Senior Member
|
02-19-2007
, 14:31
Some questions
|
#1
|
1º ===
how i remove FCVAR_*** in created vars?
i search all things in plugin_convar-> but i dont found
eg. remove 'FCVAR_NOTIFY' from sv_cheats
------------------------------------------------------------
2º ===
i compile dll for mm and 3 secs after server load he quit
my code:
Code:
#ifdef SU_SOURCEMM
bool CSourceUtils::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
{
CreateInterfaceFn interfaceFactory = ismm->engineFactory(), gameServerFactory = ismm->serverFactory();
PLUGIN_SAVEVARS();
#else
bool CSourceUtils::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory )
{
#endif
playerinfomanager = (IPlayerInfoManager *)gameServerFactory(INTERFACEVERSION_PLAYERINFOMANAGER,NULL);
if ( !playerinfomanager )
{
Warning( "Unable to load playerinfomanager, ignoring\n" ); // this isn't fatal, we just won't be able to access specific player data
}
botmanager = (IBotManager *)gameServerFactory(INTERFACEVERSION_PLAYERBOTMANAGER, NULL);
if ( !botmanager )
{
Warning( "Unable to load botcontroller, ignoring\n" ); // this isn't fatal, we just won't be able to access specific bot functions
}
// get the interfaces we want to use
if( !(engine = (IVEngineServer*)interfaceFactory(INTERFACEVERSION_VENGINESERVER, NULL)) ||
!(gameeventmanager2 = (IGameEventManager2 *)interfaceFactory(INTERFACEVERSION_GAMEEVENTSMANAGER2,NULL)) ||
!(filesystem = (IFileSystem*)interfaceFactory(FILESYSTEM_INTERFACE_VERSION, NULL)) ||
!(helpers = (IServerPluginHelpers*)interfaceFactory(INTERFACEVERSION_ISERVERPLUGINHELPERS, NULL)) ||
!(enginetrace = (IEngineTrace *)interfaceFactory(INTERFACEVERSION_ENGINETRACE_SERVER,NULL)) ||
!(networkstringtable = (INetworkStringTableContainer*)interfaceFactory(INTERFACENAME_NETWORKSTRINGTABLESERVER, NULL)) ||
!(gamedll = (IServerGameDLL*)gameServerFactory(INTERFACEVERSION_SERVERGAMEDLL, NULL)) ||
!(effects = (IEffects*)gameServerFactory(IEFFECTS_INTERFACE_VERSION, NULL)) ||
!(cvar = (ICvar*)interfaceFactory(VENGINE_CVAR_INTERFACE_VERSION, NULL)) ||
!(esounds = (IEngineSound*)interfaceFactory(IENGINESOUND_SERVER_INTERFACE_VERSION, NULL)) ||
!(playerinfomanager = (IPlayerInfoManager*)gameServerFactory(INTERFACEVERSION_PLAYERINFOMANAGER, NULL)) ||
!(randomStr = (IUniformRandomStream *)interfaceFactory(VENGINE_SERVER_RANDOM_INTERFACE_VERSION, NULL))
)
{
return false; // we require all these interface to function
}
#ifdef SU_SOURCEMM
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, &g_SourceUtils, &CSourceUtils::LevelInit, true);
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, gamedll, &g_SourceUtils, &CSourceUtils::ServerActivate, true);
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, gamedll, &g_SourceUtils, &CSourceUtils::GameFrame, true);
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, gamedll, &g_SourceUtils, &CSourceUtils::LevelShutdown, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientActive, serverclients, &g_SourceUtils, &CSourceUtils::ClientActive, false); //false so this can get called /after/ FireGameEvent
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, serverclients, &g_SourceUtils, &CSourceUtils::ClientDisconnect, true);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, serverclients, &g_SourceUtils, &CSourceUtils::ClientPutInServer, true);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, serverclients, &g_SourceUtils, &CSourceUtils::SetCommandClient, true);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, serverclients, &g_SourceUtils, &CSourceUtils::ClientSettingsChanged, true);
/* The following functions are pre handled, because that's how they are in IServerPluginCallbacks */
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, serverclients, &g_SourceUtils, &CSourceUtils::ClientConnect, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, serverclients, &g_SourceUtils, &CSourceUtils::ClientCommand, false);
// SH_ADD_HOOK_MEMFUNC(IGameEventManager2, FireEvent, gameeventmanager, &g_SourceUtils, &CSourceUtils::FireGameEvent, false);
/* Get the call class for IVServerEngine so we can safely call functions
without invoking their hooks (when needed). */
Engine_CC = SH_GET_CALLCLASS(engine);
gpGlobals = g_SMAPI->pGlobals();
#else
if ( playerinfomanager )
{
gpGlobals = playerinfomanager->GetGlobalVars();
}
#endif
When i remove
Code:
#ifdef SU_SOURCEMM
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, &g_SourceUtils, &CSourceUtils::LevelInit, true);
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, gamedll, &g_SourceUtils, &CSourceUtils::ServerActivate, true);
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, gamedll, &g_SourceUtils, &CSourceUtils::GameFrame, true);
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, gamedll, &g_SourceUtils, &CSourceUtils::LevelShutdown, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientActive, serverclients, &g_SourceUtils, &CSourceUtils::ClientActive, false); //false so this can get called /after/ FireGameEvent
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, serverclients, &g_SourceUtils, &CSourceUtils::ClientDisconnect, true);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, serverclients, &g_SourceUtils, &CSourceUtils::ClientPutInServer, true);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, serverclients, &g_SourceUtils, &CSourceUtils::SetCommandClient, true);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, serverclients, &g_SourceUtils, &CSourceUtils::ClientSettingsChanged, true);
/* The following functions are pre handled, because that's how they are in IServerPluginCallbacks */
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, serverclients, &g_SourceUtils, &CSourceUtils::ClientConnect, false);
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, serverclients, &g_SourceUtils, &CSourceUtils::ClientCommand, false);
// SH_ADD_HOOK_MEMFUNC(IGameEventManager2, FireEvent, gameeventmanager, &g_SourceUtils, &CSourceUtils::FireGameEvent, false);
/* Get the call class for IVServerEngine so we can safely call functions
without invoking their hooks (when needed). */
Engine_CC = SH_GET_CALLCLASS(engine);
gpGlobals = g_SMAPI->pGlobals();
#else
Server load plugin but hooks dont work
what is bad?
|
|