Code:
bool MetaProtect::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late)
{
ConMsg("SDK_OnMetamodLoad\n");
gpGlobals = ismm->GetCGlobals();
GET_V_IFACE_CURRENT(GetEngineFactory, helpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS);
GET_V_IFACE_CURRENT(GetEngineFactory, icvar, ICvar, CVAR_INTERFACE_VERSION);
GET_V_IFACE_ANY(GetServerFactory, gameclients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS);
GET_V_IFACE_ANY(GetServerFactory, playerinfomanager, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER);
ConMsg("[!!!!!!!!!!!!!!!!!]gameclients:%p\n",gameclients);
ConMsg("[!!!!!!!!!!!!!!!!!]playerinfomanager:%p\n",playerinfomanager);
ConMsg("[!!!!!!!!!!!!!!!!!]helpers:%p\n",helpers);
g_pCVar = icvar;
ConVar_Register(0, &s_BaseAccessor);
SH_ADD_HOOK(IServerGameClients, ClientConnect, gameclients, SH_MEMBER(this, &MetaProtect::OnClientConnect), false);
SH_ADD_HOOK(IServerGameClients, ClientConnect, gameclients, SH_MEMBER(this, &MetaProtect::OnClientConnect_Post), true);
SH_ADD_HOOK(IServerGameClients, ClientCommand, gameclients, SH_MEMBER(this, &MetaProtect::OnClientCommand), false);
SH_ADD_HOOK(IServerGameClients, ClientPutInServer, gameclients, SH_MEMBER(this, &MetaProtect::OnClientPutInServer), true);
SH_ADD_HOOK(IServerGameClients, ClientDisconnect, gameclients, SH_MEMBER(this, &MetaProtect::OnClientDisconnect), false);
SH_ADD_HOOK(IServerGameClients, ClientDisconnect, gameclients, SH_MEMBER(this, &MetaProtect::OnClientDisconnect_Post), true);
return true;
}
When I installed these hooks on the csgo server, he didn't get the correct call? I don't know why. Do you need to add additional processing?
It was I who modified the interface function of mmsource that caused the interface error. I restored it and worked it out.