Raised This Month: $51 Target: $400
 12% 

Some questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sn4k3
Senior Member
Join Date: Nov 2005
Old 02-19-2007 , 14:31   Some questions
Reply With Quote #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?
sn4k3 is offline
Send a message via MSN to sn4k3
BAILOPAN
Join Date: Jan 2004
Old 02-20-2007 , 03:46   Re: Some questions
Reply With Quote #2

You can set convar flags using ::IsBitSet/::AddFlags. Alternatively, you can change 'private' to 'public' in your local SDK and edit m_nFlags directly.

I don't know why your plugin crashes. You should attach a debugger and find where it is crashing, or eliminate it to a single line of code. Is it just the commented line, or all of those lines?

Also, you probably don't need the Engine_CC stuff, that's just example code.
__________________
egg
BAILOPAN is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 02-20-2007 , 06:48   Re: Some questions
Reply With Quote #3

Quote:
Originally Posted by BAILOPAN View Post
You can set convar flags using ::IsBitSet/::AddFlags. Alternatively, you can change 'private' to 'public' in your local SDK and edit m_nFlags directly.

I don't know why your plugin crashes. You should attach a debugger and find where it is crashing, or eliminate it to a single line of code. Is it just the commented line, or all of those lines?

Also, you probably don't need the Engine_CC stuff, that's just example code.
not crash!!

i open server and after 3 secs he quit (rcon quit) similiar

i will sendyou my src

Last edited by sn4k3; 02-20-2007 at 06:58.
sn4k3 is offline
Send a message via MSN to sn4k3
sn4k3
Senior Member
Join Date: Nov 2005
Old 02-20-2007 , 07:01   Re: Some questions
Reply With Quote #4

i know add flags but i need delete too

what do m_nFlags ?
sn4k3 is offline
Send a message via MSN to sn4k3
BAILOPAN
Join Date: Jan 2004
Old 02-20-2007 , 12:18   Re: Some questions
Reply With Quote #5

m_nFlags is from convar.h
__________________
egg
BAILOPAN is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 02-20-2007 , 13:21   Re: Some questions
Reply With Quote #6

Quote:
Originally Posted by BAILOPAN View Post
m_nFlags is from convar.h
i know but that can remove flags?!
sn4k3 is offline
Send a message via MSN to sn4k3
sn4k3
Senior Member
Join Date: Nov 2005
Old 02-20-2007 , 14:35   Re: Some questions
Reply With Quote #7

check yours Private Message(s) i send you my mm code check and see and is bad here
sn4k3 is offline
Send a message via MSN to sn4k3
BAILOPAN
Join Date: Jan 2004
Old 02-20-2007 , 17:15   Re: Some questions
Reply With Quote #8

Quote:
Originally Posted by sn4k3 View Post
i know but that can remove flags?!
Uh... it's an integer. Use bit-wise operators, like & and ~.

Quote:
Originally Posted by sn4k3 View Post
check yours Private Message(s) i send you my mm code check and see and is bad here
Unfortunately I don't have time to personally debug everyone's code. I may take a look at it later but I suggest you attach a debugger, as it looks like your code is crashing somewhere.
__________________
egg
BAILOPAN is offline
sn4k3
Senior Member
Join Date: Nov 2005
Old 02-20-2007 , 17:30   Re: Some questions
Reply With Quote #9

Quote:
Originally Posted by BAILOPAN View Post
Uh... it's an integer. Use bit-wise operators, like & and ~.


Unfortunately I don't have time to personally debug everyone's code. I may take a look at it later but I suggest you attach a debugger, as it looks like your code is crashing somewhere.
but i know where he crash i say you in 1º post

when i include this server crash:

#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


when i remove this server load!
sn4k3 is offline
Send a message via MSN to sn4k3
BAILOPAN
Join Date: Jan 2004
Old 02-20-2007 , 18:00   Re: Some questions
Reply With Quote #10

You need to attach a debugger, this is a basic principle of C++ coding. Find which line is making it crash, and then inspect the variables on the line. It sounds like something might be NULL...

If you use Microsoft Visual Studio, you can right-click in the code margin to set a breakpoint, and then use F10/F11 to step through each line.
__________________
egg
BAILOPAN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode