dreamstalker / rehlds

Reverse-engineered HLDS
GNU General Public License v3.0
652 stars 167 forks source link

"client_disconnected" not working in bugfixed ReHLDS #221

Closed souvikdas95 closed 6 years ago

souvikdas95 commented 8 years ago

There is a small bug I noticed. Forward "client_disconnected" is not working on bugfixed ReHLDS. It is working in pure ReHLDS and original engine swds.dll as well. The depricated version aka "client_disconnect" is working. I believe it's due to a nested dependency "DropClientDetour" that's not met.

+           // deprecated
            executeForwards(FF_ClientDisconnect, static_cast<cell>(pPlayer->index));

 +          if (DropClientDetour && !pPlayer->disconnecting)
 +          {
 +              executeForwards(FF_ClientDisconnected, static_cast<cell>(pPlayer->index), FALSE, prepareCharArray(const_cast<char*>(""), 0), 0);
 +          }

"DropClientDetour" requires engine function "SV_DropClient" address to function properly. By amxmodx way of implementation, it does so in the following way:

+   void *address = nullptr;
 +
 +  if (CommonConfig && CommonConfig->GetMemSig("SV_DropClient", &address))
 +  {
 +      DropClientDetour = DETOUR_CREATE_STATIC_FIXED(SV_DropClient, address);
 +      DropClientDetour->EnableDetour();
 +  }
 +  else
 +  {
 +      AMXXLOG_Log("client_disconnected forward has been disabled - check your gamedata files.");
 +  }

The function "*GetMemSig(const char _key, void _addr)" belongs to Class "CGameConfig**" which has something to do with managing engine+gamedll function addresses and forwarding.

In other words, unless AmxModX fixes their implementation of "CGameConfig" according to definitions from bugfixed ReHLDS, we might end up making either of them depricated i.e. either ReHLDS or AmxModx. So tell me guys, how are we going to fix this issue? As far as I can see, "amxmodx" in no way is interested in changing their code structure for this new development. So does that mean, we would require "ReAmxModX" now?!?

Source: [url]https://github.com/alliedmodders/amxmodx/commit/ed4faf7c114495db7426023c2b47914523fcdfd1[/url]

Arkshine commented 8 years ago

There is no bug. You need to update the associated signatures/symbols (amxmodx/data/gamedata) which are not the same in reHLDS. Here some help.. Ideally AMXX should use the reHLDS API, but until this day comes, you just need to update the gamedata.

forid786 commented 8 years ago

@Arkshine Allied Modders / AMXX still refuses to support anything that isn't officially from Valve though. :/

IgnacioFDM commented 8 years ago

@forid786 It doesn't really matter what "Allied Modders" refuses to support, it matters what dvander and arkshine choose to do.

In-line commented 6 years ago

Closing as non active. AMX Mod X already has a native ReHLDS support