sourcemod
sourcemod copied to clipboard
Add support for other engine binaries in game configs (#1414).
Some other issues with this current method of using Valve's filesystem layer is that if MM:S is loaded via the gameinfo method, it's loader will be picked up instead of the game's server.dll.
I updated with a different approach. The aforementioned issues appear to be solved now on Windows. It's currently completely broken on Linux, but it shouldn't be too bad to fix.
What's missing for linux support here? We could have used this for the optional game update #1766
What's missing for linux support here?
I don't remember. I vaguely recall there being an issue around the dlopen
usage. It would need to be tested again at minimum.
What's missing for linux support here? We could have used this for the optional game update #1766
I've now found and fixed the remaining issue on Linux with https://github.com/alliedmodders/sourcemod/pull/1626/commits/67aea1796615b91f2b2f681b58a9419c65c36042
Could use the same
link
cast as in #576, but limiting the allowed binaries to engine ones seems reasonable given those are the libraries targeted.
Cool. That's good info.
I had a small back-and-forth about this in my head. I'm not a fan of just casting the handle since that does not seem to be an API guarantee. However, it looks like dlinfo
can be safely used to the same end. I then wondered if we shouldn't be relying on the Windows HMODULE to be a pointer in the library either. Rather than then looking up an equivalent method there, I landed on this being fine as-is for now. We can revisit if/when there is a use case.
Is this supposed to automatically recognize the _srv filename suffix in some linux binaries?
e.g. "library" "MaterialSystem"
should work?
Edit: turns out it will, but only if you use lowercase!
Yes. To clarify, any platform-specific prefixes and/or suffixes are handled automatically. File system case sensitivity can still apply.