I have added the following lines in dll.cpp and mark out the welcome message in StartFrame()
Code:
void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
{
if (!IsDedicatedServer)
{
if ((listenserver_edict != NULL) && (welcome_sent == FALSE) &&
(welcome_time < 1.0))
{
// are they out of observer mode yet?
if (IsAlive(listenserver_edict))
welcome_time = gpGlobals->time + 5.0; // welcome in 5 seconds
}
if ((welcome_time > 0.0) && (welcome_time < gpGlobals->time))
{
char version[80];
sprintf(version,"%s Version %d.%d\n", welcome_msg, VER_MAJOR, VER_MINOR);
// let's send a welcome message to this client...
UTIL_SayText(version, listenserver_edict);
}
}
RETURN_META (MRES_IGNORED);
}
And this inside C_DLLEXPORT int GetEntityAPI2
Code:
gFunctionTable.pfnServerActivate = ServerActivate;
I am sure it never call the ServerActive() since I never saw the welcome message, am I miss something to add in dll.cpp ?
BTW if the ServerActive() really can't work than doesn't matter, because I knew the StartFrame() did call on every map change when I use welcome message to test it.
I have found out the reason why bots not delay when respawn because the bots never disconnect when map changed, I have tried not to use max_bot function but only type addbot in console to add 2 bots, but when the map changed, that 2 bots join the game again automatic, I think when the map changed, that 2 bots only respawn but not rejoin, that's why the bot_check_time not work for them again.
Hmm, any idea ?