Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional autoload extensions #1718

Merged
merged 2 commits into from Apr 21, 2022
Merged

Optional autoload extensions #1718

merged 2 commits into from Apr 21, 2022

Conversation

Kxnrl
Copy link
Contributor

@Kxnrl Kxnrl commented Feb 19, 2022

sometimes, we don't need auto load that extension.

@peace-maker
Copy link
Member

What is your use case where those extensions cause you trouble? Some extensions provide passive game fixes like fixing precaching issues in OnMapStart in CS:GO, so not loading them could do more harm than good.

@asherkin
Copy link
Member

Some extensions provide passive game fixes like fixing precaching issues in OnMapStart in CS:GO, so not loading them could do more harm than good.

The game support extensions are actually autoloaded by core explicitly:

/* Load any game extension */
const char *game_ext;
if ((game_ext = g_pGameConf->GetKeyValue("GameExtension")) != NULL)
{
char path[PLATFORM_MAX_PATH];
ke::SafeSprintf(path, sizeof(path), "%s.ext." PLATFORM_LIB_EXT, game_ext);
extsys->LoadAutoExtension(path);
}

@Kxnrl
Copy link
Contributor Author

Kxnrl commented Feb 23, 2022

What is your use case where those extensions cause you trouble? Some extensions provide passive game fixes like fixing precaching issues in OnMapStart in CS:GO, so not loading them could do more harm than good.

Just make them as optinal.
I reach extension load limit.
I don't know why I can not load more then 40 extensions (windows 2016/2019).
for multi mod server, the extension list is changeable.
examples:
https://github.com/Kxnrl/Store/blob/master/store.sp#L35
https://github.com/Kxnrl/MiniGames/blob/master/MiniGames.sp#L47

Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not being able to load more than X extensions seems to be a bug, could you file a bug with as much info about that as you can please?

Adding the AUTOLOAD_EXTENSIONS guard for clientprefs seems fine, eventhough the clientprefs plugin strongly depends on the extension, so if you have that plugin loaded the extension will be loaded anyways. Since the game extensions are autoloaded automatically as asherkin pointed out, adding the guard to the cstrike and tf2 includes does nothing. Could you switch this up to only change the clientprefs include file, please?

@Kxnrl
Copy link
Contributor Author

Kxnrl commented Feb 26, 2022

Not being able to load more than X extensions seems to be a bug, could you file a bug with as much info about that as you can please?

Adding the AUTOLOAD_EXTENSIONS guard for clientprefs seems fine, eventhough the clientprefs plugin strongly depends on the extension, so if you have that plugin loaded the extension will be loaded anyways. Since the game extensions are autoloaded automatically as asherkin pointed out, adding the guard to the cstrike and tf2 includes does nothing. Could you switch this up to only change the clientprefs include file, please?

Z${1SI1NB}1VVD0 A5_DV$T

The problem has nothing to do with the extension itself, but the 40th cannot be loaded.
Edit: OS (win2016/win2019)

@peace-maker peace-maker merged commit ab8bbbd into alliedmodders:master Apr 21, 2022
StarterX4 pushed a commit to StarterX4/sourcemod that referenced this pull request Aug 1, 2023
* Optional autoload extensions

* revert autoload for cstrike/tf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants