sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

Add support for other engine binaries in game configs (#1414).

Open psychonic opened this issue 3 years ago • 4 comments

psychonic avatar Nov 02 '21 01:11 psychonic

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.

psychonic avatar Nov 04 '21 01:11 psychonic

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.

psychonic avatar Nov 04 '21 03:11 psychonic

What's missing for linux support here? We could have used this for the optional game update #1766

peace-maker avatar May 10 '22 06:05 peace-maker

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.

psychonic avatar May 10 '22 12:05 psychonic

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

psychonic avatar Dec 28 '22 20:12 psychonic

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.

psychonic avatar Dec 28 '22 22:12 psychonic

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!

Alienmario avatar Oct 30 '23 00:10 Alienmario

Yes. To clarify, any platform-specific prefixes and/or suffixes are handled automatically. File system case sensitivity can still apply.

psychonic avatar Oct 30 '23 16:10 psychonic