alliedmodders / metamod-source

Metamod:Source - C++ Plugin Environment and Detour Library for the Source Engine
http://www.metamodsource.net/
Other
374 stars 83 forks source link

[Contagion] Could not get IServerPluginCallbacks interface #91

Closed xerox8521 closed 2 years ago

xerox8521 commented 2 years ago

Metamod doesn't seem to load on Contagion. Error is: Could not get IServerPluginCallbacks interface from plugin "../contagion/addons/metamod/bin/server"

Tested with SM 1.10.6524 and MM 1.11.1145 on Windows 10 with a default installation. Not sure if this matters but Contagion is only available on Windows and 64 Bit only.

NGD-Skier commented 2 years ago

Same here. I tried a little troubleshooting... Not sure it will help, but here's what I found (originally posted in Contagion discussion hub on Steam, with a little additional info added here for context):

... I had MM and SM working fine for quite a while, but after recent update, I get:

Could not get IServerPluginCallbacks interface from plugin "addons/metamod/bin/server" Could not get IServerPluginCallbacks interface from plugin "addons/metamod/bin/win64/server"

when trying to load the mod...

I tried updating to the latest dev builds of both MM and SM, and even tried removing SM to isolate possible issues, but no luck...

Looking at ProcMon.exe output, filtered on contagionds.exe, it looks like it's not looking in the right places to find the mod... e.g., I ran the command:

plugin_load addons/metamod/bin/win64/server

and it looks in these locations: C:\Servers\Contagion\x32\x32\server.dll C:\Servers\Contagion\x32\server.dll C:\Servers\Contagion\bin\x32\server.dll as well as down through my path (e.g. c:\windows; c:\windows\syswow64, etc)

It looks like maybe the plugin_load functionality is broken in general...

P.S. I tried making a directory junction at c:\servers\contagion\x32 to point to the addons\metamod\bin directory, but that gave me an engine error "NUM_FOR_EDITC: bad pointer"

NGD-Skier commented 2 years ago

P.S. The last MM version I tried it with was mmsource-1.12.0-git1156-windows When I didn't have SM (SourceMod) disabled, I was trying it's latest dev build too: sourcemod-1.11.0-git6808-windows

psychonic commented 2 years ago

VSP loading in Contagion is indeed broken due to improper path handling. Loading via GameInfo method does work, but will net the same NUM_FOR_EDICT error.

I updated the SDK to fix that, but it won't take effect until the next build of MM:S (and SM). SourceMod gamedata also needs an update, some of which has already been done.

NGD-Skier commented 2 years ago

Thanks! Is the VSP loading something that the Contagion people need to fix? I wonder if my directory junction (symlink) work-around would work when the updated SDK is in the next build. I might just have to try it and find out, just for my own curiosity. Thanks for the GameInfo pointer, in case I need to use it. ... Checking dev builds.... It looks like 1157 is built, so I'll go try that and see what happens.

psychonic commented 2 years ago

Is the VSP loading something that the Contagion people need to fix?

Yes.

I wonder if my directory junction (symlink) work-around would work when the updated SDK is in the next build.

Probably, although I'd recommend GameInfo loading over that. It's what I was testing with when prepping the changes.

NGD-Skier commented 2 years ago

Just an FYI, I updated to MM build 1157 and SM build 6814, created a link in c:\servers\contagion with the following command:

C:\Servers\Contagion>mklink x32 .\contagion\addons\metamod\bin\ symbolic link created for x32 <<===>> .\contagion\addons\metamod\bin\

(Thus, there is now a "directory" at c:\Servers\Contagion\x32 which actually points to c:\Servers\Contagion\x32\contagion\addons\metamod\bin)

and then started my server back up and MetaMod loaded. I can run meta commands, e.g.:

meta list Listing 2 plugins: [01] SourceMod (1.11.0.6814) by AlliedModders LLC [02] SDK Tools (1.11.0.6814) by AlliedModders LLC

I'm not necessarily suggesting this is a better solution than using GameInfo, but I thought I'd share it, as I thought it's interesting. :-)

Now, as for SourceMod, that doesn't seem to work yet... When I run the command "sm_admin" I get a windows that pops up, has a button at the top right, that has text in front of it across the window that says "you have a menu press escape," The button doesn't work, but you can close it by clicking the X at the top right.

Progress. :-)

NGD-Skier commented 2 years ago

Just another quick side note... I'm running on 64 bit Windows and ContagionDS always tries to load both the 32bit and 64bit version of the server.dll files, as metamod.vdf and metamod_x64.vdf both exist, but there's no reason to try and load the 64bit version of dll if ContagionDS itself is only a 32 bit binary, right?

asherkin commented 2 years ago

VDF autoloading doesn't have a mechanism to gate on bitness, the way we end up with the right binary loaded is to tell the game to try both.

NGD-Skier commented 2 years ago

So if both are trying to load, only one will work (i.e. the one with the proper bitness), and the other will just show an error like this:

Could not get IServerPluginCallbacks interface from plugin "addons/metamod/bin/win64/server

Right? Given that my DS is 32 bit, assuming my understanding is correct, I'll just rename metamod_x64.vdf to metamod_x64.vdf.disabled to suppress that error message.

psychonic commented 2 years ago

So if both are trying to load, only one will work (i.e. the one with the proper bitness), and the other will just show an error like this:

Could not get IServerPluginCallbacks interface from plugin "addons/metamod/bin/win64/server

Right? Given that my DS is 32 bit, assuming my understanding is correct, I'll just rename metamod_x64.vdf to metamod_x64.vdf.disabled to suppress that error message.

That is correct.

psychonic commented 2 years ago

Now, as for SourceMod, that doesn't seem to work yet... When I run the command "sm_admin" I get a windows that pops up, has a button at the top right, that has text in front of it across the window that says "you have a menu press escape," The button doesn't work, but you can close it by clicking the X at the top right.

SourceMod in general works fine, but menus specifically aren't supported by the game - Neither the classic plugin menus, nor the newer-ish HudMenu menus.

NGD-Skier commented 2 years ago

I'm honestly not sure what you mean by "SourceMod in general works fine..." If the menu's don't work, then how would it "work fine?" I'm not trying to be a smart-ass or rude or anything, rather I just don't understand the comment. Maybe there's a way of using SourceMod that I'm not aware of, but I've only used it via the menu. Or maybe you meant "it loads fine," so "it works" (i.e. doesn't crash), but is just not useful...?

Is the fact that menu's don't work something that only the Contagion people could fix, or something that I should report to the SourceMod guys, and/or try and help fix myself. I've not really messed with the code in MM or SM, but I can code, so if it's something I could fix myself without days of effort, feel free to point me in the right direction. :-)

psychonic commented 2 years ago

SourceMod script functionality works, and console commands / chat triggers (which menus are typically a frontend for) also function.

Menus would indeed need to be fixed by the Contagion developers, as clientside changes are required. Most games/mods implement CHudMenu (part of the SDK/game) and the requisite HudLayout definition for it to display. SourceMod can work with that, or the engine-based plugin menu panel (which requires ESC to see). Neither are functional as-in in Contagion.

NGD-Skier commented 2 years ago

Ah, okay. So if the key features I normally use are mostly just changing levels and restarting rounds and for the convenience of having a menu for myself and a couple others I trust, then in its current state, I'd probably just as well use rcon for this game unless the game devs fix the things you mentioned. (Side note: SourceMod used to work until they recently updated the game, so I'll post in their Steam Hub forum and see if maybe they'd consider fixing it.). Thanks again for the additional details.

psychonic commented 2 years ago

I don't think that the menus ever worked in their game.

peace-maker commented 2 years ago

Maybe @UeberDaniel has some input since we talked a bit about game support around when the switch to 64bit was announced initially. I think the game focusses on AngelScript scripting and it sounded like they have no interest in MMS or SourceMod support iirc.

UeberDaniel commented 2 years ago

Yeah, SM is almost completely incompatible with Contagion, AngelScript is under active developement in the Game and it gets better and better. You should use this.

If you want some start you could look at: https://github.com/UeberDaniel/ContagionAngelScript

The complete API is here: http://contagion-game.com/api/

psychonic commented 2 years ago

Yeah, SM is almost completely incompatible with Contagion

Can you elaborate? The only incompatibility I'm aware of is with the menu.

UeberDaniel commented 2 years ago

Many functions are broken which didnt work or causing server crashes and so on. There are too often gameupdates and this game is too dead to get the people to update the related SM data to keep the mod up to date.

psychonic commented 2 years ago

The SourceMod gamedata is currently up to date, fixing those broken functions. Not every game update requires updates to it. Same as with any other game, the first step is someone reporting that there's an issue after an update, and then it is able to be fixed, like what was recently done.

It's great that there is a built-in scripting platform in the game (two, actually, as I believe it also supports vscript). It's good to have choice, and different platforms expose different functionality.

UeberDaniel commented 2 years ago

I have to admit that I haven't dealt with the SourceMod issue at contagion in a long time. The SM menus did not work ingame, but only in the game menu. I am no longer active in modding at AngelScript because I have no time for it. As far as I know, with the change to 64-bit, SourceMod should be completely broken (told me the current developer of the game). Therefore I would advise you to use AngelScript. :)

psychonic commented 2 years ago

As far as I know, with the change to 64-bit, SourceMod should be completely broken

Only temporarily again. SourceMod is supported on x64.

asherkin commented 2 years ago

Based on the comments it looks like everything on the MM:S side is resolved (that we can resolve), so I'm going to close the issue.

Sounds like nothing can be done for the menus, but if there are other SM gamedata-related issues best to open an issue over in the SM repo.

NGD-Skier commented 2 years ago

I have to admit that I haven't dealt with the SourceMod issue at contagion in a long time. The SM menus did not work ingame, but only in the game menu. I am no longer active in modding at AngelScript because I have no time for it. As far as I know, with the change to 64-bit, SourceMod should be completely broken (told me the current developer of the game). Therefore I would advise you to use AngelScript. :)

Regarding the change to 64bit, my contagionds.exe file executes as 32bit, and I don't see a 64bit version anywhere, even after recently SteamCmd updates.

NGD-Skier commented 2 years ago

P.S. Thanks everyone for the help/direction/info while I was troubleshooting. Much appreciated. This was my first real interaction in this community (though I've been using MM/SM for years), and it was quite impressed and the timeliness and helpfulness of replies. Thanks!