Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
server crash bug
#1
This is what makes the server reset "randomly"

Player A plays Player B, Player B falls during a round and leaves before the next round commences (newbs do this a lot when they get frustrated). Server keeps playing the round thinking a player is still there, it shows Player A vs. (blank). Server crashes.

Fix this if possible.
Reply
#2
Is that with the fixes from this community or with the files that came with rico ?
Well, I'm INVISIBLE AGAIN ... I might as well pay a visit to the LADIES ROOM ...
Without ice cream life and fame are meaningless.
[Image: stoned.jpg]
Reply
#3
Don't know, don't care. It happens on 24/7 GRITS' Arena, the only server I play on.
Reply
#4
wow, after all this time. gwars, is this for real? a possible fix , when I thought it was just the server .
Reply
#5
It does make sense, but it don't happen all the time. Maybe its a build up of these. I have seen where the server has crashed 2 or 3 times in a row with in 5 to 10 minutes, first time could be because of this, but the other times I'm not sure.

It does give a good clue into what to look at. I never really thought a player leaving early could have an effect like that. I've had many players leave the game after just 1 or 2 kills and I just drop back to spec.


So Miagi and Evil, think this could be a cause of the crashing?
Reply
#6
Not sure. From looking at the mp source, it checks if the player has disconnected during spawn

Code:
pPlayer->m_bHasDisconnected != TRUE


But I was looking at this. Wouldn't this need to check if the player disconnected or is that in the IsAlive function?

Code:
//.ASM : white disc haxxx...
// if the player is "dead" during the round countdown,
// then bring the back...
   if(!m_hCombatants[i]->IsAlive())
       m_hCombatants[i]->Spawn();
// end .ASM
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!

Reply
#7
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
Reply
#8
Well here's the entire function I was looking at.
Code:
void CDiscArena::CountDownThink( void )
{
    // Freeze everyone until there's 3 seconds to go
    if ( m_iSecondsTillStart == 3 )
    {
 for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
 {
 &nbsp;&nbsp;&nbsp;&nbsp;//.ASM : white disc haxxx...
 &nbsp;&nbsp;&nbsp;&nbsp;// if the player is "dead" during the round countdown,
 &nbsp;&nbsp;&nbsp;&nbsp;// then bring the bastard back...
 &nbsp;&nbsp;&nbsp;&nbsp;if(!m_hCombatants[i]->IsAlive())
   m_hCombatants[i]->Spawn();
 &nbsp;&nbsp;&nbsp;&nbsp;// end .ASM

 &nbsp;&nbsp;&nbsp;&nbsp;if (m_hCombatants[i])
   ((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
 }
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;m_iSecondsTillStart--;

&nbsp;&nbsp;&nbsp;&nbsp;// Play countdown VOX
&nbsp;&nbsp;&nbsp;&nbsp;if (m_iSecondsTillStart < 5)
&nbsp;&nbsp;&nbsp;&nbsp;{
 // Speech
 for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
 {
 &nbsp;&nbsp;&nbsp;&nbsp;if (m_hCombatants[i])
   ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i])->ClientHearVox( g_szCountDownVox[ m_iSecondsTillStart ] );
 }
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;// Send the message to the clients in the arena
&nbsp;&nbsp;&nbsp;&nbsp;for ( int i = 1; i <= gpGlobals->maxClients; i++ )
&nbsp;&nbsp;&nbsp;&nbsp;{
 CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );

 if (pPlayer &amp;&amp; (pPlayer->pev->groupinfo &amp; pev->groupinfo) &amp;&amp; pPlayer->m_bHasDisconnected != TRUE)
 {
 &nbsp;&nbsp;&nbsp;&nbsp;MESSAGE_BEGIN( MSG_ONE, gmsgStartRnd, NULL, pPlayer->edict() );
   WRITE_BYTE( m_iCurrRound );
   WRITE_BYTE( m_iSecondsTillStart );
   WRITE_BYTE( 0 );
 &nbsp;&nbsp;&nbsp;&nbsp;MESSAGE_END();
 }
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;if (m_iSecondsTillStart)
&nbsp;&nbsp;&nbsp;&nbsp;{
 pev->nextthink = gpGlobals->time + 1.0;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;{
 m_iArenaState = ARENA_BATTLE_IN_PROGRESS;

 // Enable powerups
 CBaseEntity *pFunc = NULL;
 while ((pFunc = UTIL_FindEntityByClassname( pFunc, "item_powerup" )) != NULL)
 {
 &nbsp;&nbsp;&nbsp;&nbsp;((CDiscwarPowerup*)pFunc)->Enable();
 }

 pev->nextthink = gpGlobals->time + 1.0;
 SetThink( BattleThink );
&nbsp;&nbsp;&nbsp;&nbsp;}
}



Could just add the disconnect check to the one? Its been awhile since my C++ class but.

Code:
if(!m_hCombatants[i]->IsAlive() &amp;&amp; m_bHasDisconnected != TRUE)
m_hCombatants[i]->Spawn();
// end .ASM


That should work? Think they both would work :P


EDIT*
Code:
// Freeze everyone until there's 3 seconds to go
&nbsp;&nbsp;&nbsp;&nbsp;if ( m_iSecondsTillStart == 3 )
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
&nbsp;{

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CBasePlayer *pPlayer = ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i]);

&nbsp;//.ASM : white disc haxxx...
&nbsp;// if the player is "dead" during the round countdown,
&nbsp;// then bring the bastard back...
&nbsp;if(!m_hCombatants[i]->IsAlive() &amp;&amp; pPlayer->m_bHasDisconnected != TRUE)

&nbsp; m_hCombatants[i]->Spawn();
&nbsp;// end .ASM
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (m_hCombatants[i])
&nbsp; &nbsp;((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}


Edited again. Had the wrong For statement :P
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply
#9
Theory, I like that word. I haven't been able to reproduce a crash yet, didn't change anything. When the player falls I wait 2 seconds and hit the kick key and I just go to spectate like I should. I tried with 3 players. I go into spectate also.

Metamod or adminmod look guilty to me right now.
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply
#10
Actually, I didn't see the for loop ( I don't have the SDK, source or compiler). Everyone playing needs those conditions tested on them so I wouldn't 'return' and exit the loop prematurely. Otherwise white disc could return for some players, so I would do it your way now that I can see the whole function.
Code:
if (m_hCombatants[i])
&nbsp; ((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
This gets executed if spawn() doesn't but I don't know much about what that does. Does maxspeed get used for spectators' camera speeds and player movement? I wouldn''t want it executed on players who don't need attributes. This is looking like a candadite for a spectate exploit fix.

Anyways, hopefully someone will fix the problem. Nothing gets done if all anybody does is talk about it.:P
Reply
#11
Thanks for trying that Miagi...maybe now Acid will stfu:lol:

/Just kidding Acid, we all love your crackpot theories;)
Reply
#12
Try this scenario? The loser falls, and just as he falls the winner of the match leaves. The game starts a theoretical 6th round (or whatever the round # after the win) and says that &quot;&quot; won 0 to -1. Then it crashes.
Reply
#13
Um, I know for sure the arena server always crashes when this happens, this didn't happen on earlier arena servers (bigger ones too) like KAH. I'm guessing this could have something to do with the fix that respawns a player before the round timer runs out.

There are other times when the server crashes when this doesn't even happen, but every time this DOES happen, it crashes.
Reply
#14
acid maybe you can catch miagi or asm in game and demo it for them
Reply
#15
When you freeze (meaning server just crashed), just look at the players list and look for a match with only one person. Nine out of 10 times you'll see it, the other cause for crashes is beyond me.
Reply
#16
The code above in the last edit above would probably be the fix if its the one fix that respawns a player who died before the match start thats causing the crashing.

I think thats a run on sentence...

Rushjet, right after opponent 2 falls and winning opponent leaves, opponent 2 is respawned into a match with himself and the countdown starts?

If so, that might be from the white disc fix. Thats if I'm looking at it right. :blink:

Random crashes can be from plugins for adminmod, adminmod, or metamod.
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply
#17
personally i dont think so acid...ive seen that thousands of times and the server never crashed for me.


edit...of course that was on WON...never know with steam.

and ASM about that *possible* spectate glitch?...it is a glitch


Quote:Also, you may be able to fix a possible spectating bug here...I'm not sure.

// if the player is &quot;dead&quot; during the round countdown,
// then bring them back...
if(m_hCombatants[i]-&gt;m_bHasDisconnected == TRUE)
// don't execute rest of this code block...
return;
if(!m_hCombatants[i]-&gt;IsAlive() || m_hCombatants[i]-&gt;IsSpectating())
m_hCombatants[i]-&gt;Spawn(); // force to respawn
Reply
#18
and PIQUE, I wasn't doubting it's existance but I still am not all that familiar with the problem. If it looks like that snippet of code could fix such a thing then, by all means, feel free to implement it. I can not be sure if it would work (may depend on IsAlive()), but it may be worth a go. You'd know better than I would.
Reply
#19
I PERSONALLY THINK SO, PIQUE!

I don't remember this happening on WON but it sure is happening on STEAM.
Reply
#20
I remember it happening on WON too.
Reply
#21
lol in 1.5 on won and on steam the server crashed like 3 times in a row a few times when i play on arena. i hate that. like your about to kill someone and it just freezes than you gotta count 36 seconds for it to come back up. I mean the damn server crashes so much i even know how many seconds it takes for the server to be back up lol.
Reply
#22
I just wait until I get the &quot;connection problem&quot; message and type in retry in console, it always reconnects on the third automatic try.
Reply
#23
The crash seems happen when &quot;player b&quot; disconnect IN THE LAST ROUND (score 2-2)
Reply
#24
To rule out it being an adminmod problem or plugin I put up a 4 person arena server on my recently installed linux machine(its fun with non-graphical interface). Right now nothing extra is installed.

Tomorrow or tuesday I'll ask grits for the .so and put that on. If no crashes then I'll put metamod and so forth.
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply
#25
Alright, I ran a dedicated server on my pc with the fixes installed and a few hours later it crashed with mp.dll causing it.

I went and added a disconnect check on the white disc fix.
Code:
void CDiscArena::CountDownThink( void )
{
&nbsp;&nbsp;&nbsp;&nbsp;// Freeze everyone until there's 3 seconds to go
&nbsp;&nbsp;&nbsp;&nbsp;if ( m_iSecondsTillStart == 3 )
&nbsp;&nbsp;&nbsp;&nbsp;{
 for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
 {

 &nbsp;&nbsp;&nbsp;&nbsp;CBasePlayer *pPlayer = ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i]);

 //.ASM : white disc haxxx...
 // if the player is "dead" during the round countdown,
 // then bring them back.

 //Miagi - check if they are disconnected also, if they aren't spawn.
 if(!m_hCombatants[i]->IsAlive() &amp;&amp; pPlayer->m_bHasDisconnected != TRUE)

  m_hCombatants[i]->Spawn();
 // end .ASM
 &nbsp;&nbsp;&nbsp;&nbsp;if (m_hCombatants[i])
   ((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
 }
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;m_iSecondsTillStart--;

&nbsp;&nbsp;&nbsp;&nbsp;// Play countdown VOX

So far, 20 hours, the server hasn't crashed and people were playing. Before(without my fix) it crashed when 3 people were playing and one disconnected.

Anyway, once I installed the new compiled dll that had my small fix in it, server didn't crash yet, but this happened... I'm not sure when it happened, but there were a bunch of discs floating around on the bottom. Fixed with a reload of the map.

[Image: post-12-1099776500.jpg]
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply
#26
Ricochet is too friggen messed up for the Half-life engine to run right.

Good job on the fix...no clue about discs on the bottom.
Reply
#27
Don't know if its fixed. Evil said his server was still crashing when he put mine in :(. Mine is still up though.
&lt;@Miagi&gt; !8 Am I spamming?
&lt;@ChanServ&gt; Miagi: Yes.
&lt;@Miagi&gt; !8 Should I stop?
&lt;@ChanServ&gt; Miagi: Oh, please, PLEASE, make it stop!

Reply
#28
Are all those discs red? That is weird. If it's a constant problem, adding some sort of entity cleanup routine would be easy enough.

Good luck. It would mean a lot to Grits and regulars to have a stable server I'm sure.

Also, if you finish with it, can you post the linux and Win32 builds here, so that others can benefit? I would like to see other servers have the chance to use the community-build once it's stable.
Reply
#29
Make the stable builds a sticky thread so it'll be easy to find:)nice work.... weird with the floating discs.... hmmm i remember it happening some times in a DM map... and if you jumped into it you would die.....
funny to see the new ones jump into it because you told them you'll get a mp5:)
Well, I'm INVISIBLE AGAIN ... I might as well pay a visit to the LADIES ROOM ...
Without ice cream life and fame are meaningless.
[Image: stoned.jpg]
Reply
#30
ok ok i found the fix...

The problem is..











THATS ITS UNFIXABLE.:)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)