tmp64 / BugfixedHL-Rebased

Bugfixed and improved Half-Life
GNU General Public License v3.0
113 stars 26 forks source link

Add support for cross-game compatibility #252

Open rtxa opened 4 weeks ago

rtxa commented 4 weeks ago

If server is using ReHLDS, one of the commits https://github.com/dreamstalker/rehlds/commit/0c5ce53666811c4243ed5aa0c755dab26d2283d4 https://github.com/dreamstalker/rehlds/issues/975 allow players to join servers from different games it client has set in his setinfo _gd with the name of the mod you're playing. This requires client-support to automatically set this. In theory, this should allow players on HL to play servers from AG or viceversa, considering that both games shares almost the same messages, and BHL already has support for AG messages.

There are some drawbacks, like not having available the server-list from AG if playing from HL, requiring to join manually using connect. Perhaps usings a custom server browser would allow to circumvent this.

Still, I haven't figure out yet how to trick the client to join the server even with setinfo _gd <MODNAME> already set, throwing "Server is running game <MODNAME>. Restart in that game to connect".

If you want to join HL servers from AG, you just need to set setinfo _gd ag. And if you want to join AG servers from HL, you just need to set setinfo _gd valve.

PD: Also I notice, it's not neccesary to remove setinfo _gd, it allows to join both HL and AG servers.

Safety1st commented 4 weeks ago

I haven't figure out yet how to trick the client to join the server even with different game

You just need to tell server what kind of gamedir it should send by means of setinfo: put setinfo _gd ag if you connect with AG mod to HL server or setinfo _gd valve when vice versa. To connect to AG servers having sv_pure 1 from HL it is also required to have a valid dlls\ag.dll in valve folder.

rtxa commented 4 weeks ago

I haven't figure out yet how to trick the client to join the server even with different game

You just need to tell server what kind of gamedir it should send by means of setinfo: put setinfo _gd ag if you connect with AG mod to HL server or setinfo _gd valve when vice versa. To connect to AG servers having sv_pure 1 from HL it is also required to have a valid dlls\ag.dll in valve folder.

Sure, already did that, but is not enough so maybe something else in the client-side needs to be modified. Server-side has already done his part (I guess). Perhaps tmp64 can figure out why.

Safety1st commented 4 weeks ago

On AIMaster servers it was enough :)

rtxa commented 4 weeks ago

On AIMaster servers it was enough :)

My bad, it does work, I was doing it the wrong way (I though you need to match setinfo _gd with the server mod name you're joining, but instead you need to match it with your current game dir), thank you. I guess what's left now it to do this automatically.