09-25-2004, 03:05 PM
That fix came out at a time when the server was crashing a lot becasue of problems on Holdouts end and then everyone just accepted that the server crashed at times and lived with it.
IsAlive() is just a boolean function. It returns true or false. If I remember right... IsAlive() returns false if the player has disconnected or dead as it should. IsAlive() shouldn't, in theory, make any changes to the game/player state by itself. If IsAilive() returns false, then Spawn() is called, where Spawn() checks if the player is connected or not and handles it.
But things don't always work out intuitively.
I woud try:
// the player is null and the blank name is default in this case...
// pseudo code because I don't remember the function names but something llike this...
if(!m_hCombatants[i]->null)
ThisArena->GameSate(GaveOver);
Put that in the right place and it should keep things from looping.
or:
// if the player is "dead" during the round countdown,
// then bring them back...
if(m_hCombatants[i]->m_bHasDisconnected == TRUE)
// don't execute rest of this code block...
return;
if(!m_hCombatants[i]->IsAlive())
m_hCombatants[i]->Spawn();
Put that in the right place and it should keep it from looping.
But before hacking anything, it would be better to test this theory. So download HPbot or something, edit the bot names list to be just "Player".
Download the current mp.dll and put in the appropraiate folder (there is a link to the Win32 server dll somewhere in the programming forum)..
Bind a key to "kick Player".
Create a Lan game and load a bot or two.
The bot sucks and falls, so kick him and see what happens. Try to kick the bot at various times, especially near the 2 second mark since that is when the conditions are tested, to see if the player needs to respawn or not (the code snippet below is executed).
If your computer crashes, congradulations, you found the problem.:)
Also, you may be able to fix a possible spectating bug here...I'm not sure.
// if the player is "dead" during the round countdown,
// then bring them back...
if(m_hCombatants[i]->m_bHasDisconnected == TRUE)
// don't execute rest of this code block...
return;
if(!m_hCombatants[i]->IsAlive() || m_hCombatants[i]->IsSpectating())
m_hCombatants[i]->Spawn(); // force to respawn
IsAlive() is just a boolean function. It returns true or false. If I remember right... IsAlive() returns false if the player has disconnected or dead as it should. IsAlive() shouldn't, in theory, make any changes to the game/player state by itself. If IsAilive() returns false, then Spawn() is called, where Spawn() checks if the player is connected or not and handles it.
But things don't always work out intuitively.
I woud try:
// the player is null and the blank name is default in this case...
// pseudo code because I don't remember the function names but something llike this...
if(!m_hCombatants[i]->null)
ThisArena->GameSate(GaveOver);
Put that in the right place and it should keep things from looping.
or:
// if the player is "dead" during the round countdown,
// then bring them back...
if(m_hCombatants[i]->m_bHasDisconnected == TRUE)
// don't execute rest of this code block...
return;
if(!m_hCombatants[i]->IsAlive())
m_hCombatants[i]->Spawn();
Put that in the right place and it should keep it from looping.
But before hacking anything, it would be better to test this theory. So download HPbot or something, edit the bot names list to be just "Player".
Download the current mp.dll and put in the appropraiate folder (there is a link to the Win32 server dll somewhere in the programming forum)..
Bind a key to "kick Player".
Create a Lan game and load a bot or two.
The bot sucks and falls, so kick him and see what happens. Try to kick the bot at various times, especially near the 2 second mark since that is when the conditions are tested, to see if the player needs to respawn or not (the code snippet below is executed).
If your computer crashes, congradulations, you found the problem.:)
Also, you may be able to fix a possible spectating bug here...I'm not sure.
// if the player is "dead" during the round countdown,
// then bring them back...
if(m_hCombatants[i]->m_bHasDisconnected == TRUE)
// don't execute rest of this code block...
return;
if(!m_hCombatants[i]->IsAlive() || m_hCombatants[i]->IsSpectating())
m_hCombatants[i]->Spawn(); // force to respawn