When I do this it compiles ok but when I join the server, the server crashes with some memory location error.
It crashes on this line
const char *address = netinfo->GetAddress();
WHY?
EDIT1:
I think I don't pass valid edict.
OK SO I have main loop which checks for number of players and then takes one by one and checks his IP. I am doing it like this.
Quote:
edict_t* pEntity = engine->PEntityOfEntIndex(i);
INetChannelInfo *netinfo = engine->GetPlayerNetInfo(engine->IndexOfEdict(pEntity));
const char *address = netinfo->GetAddress();
|
"i" is used in the "for" loop.
Am I doing something wrong?
on load I have this plugins
Quote:
if( !(engine = (IVEngineServer*)interfaceFactory(INTERFACEVE RSION_VENGINESERVER, NULL)) ||
!(gameeventmanager = (IGameEventManager *)interfaceFactory(INTERFACEVERSION_GAMEEVENT SMANAGER,NULL)) ||
!(filesystem = (IFileSystem*)interfaceFactory(FILESYSTEM_INT ERFACE_VERSION, NULL)) ||
!(helpers = (IServerPluginHelpers*)interfaceFactory(INTER FACEVERSION_ISERVERPLUGINHELPERS, NULL)) ||
!(enginetrace = (IEngineTrace *)interfaceFactory(INTERFACEVERSION_ENGINETRA CE_SERVER,NULL)) ||
!(randomStr = (IUniformRandomStream *)interfaceFactory(VENGINE_SERVER_RANDOM_INTE RFACE_VERSION, NULL))
)
|
Should I write new line for INetChannelInfo ?