Posts: 1,306
Threads: 86
Joined: Mar 2003
Reputation:
0
09-25-2004, 12:11 AM
(This post was last modified: 09-25-2004, 12:11 AM by _Acid_Head_.)
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.
Posts: 612
Threads: 86
Joined: Apr 2004
Reputation:
0
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.
Posts: 1,306
Threads: 86
Joined: Mar 2003
Reputation:
0
Don't know, don't care. It happens on 24/7 GRITS' Arena, the only server I play on.
Posts: 1,411
Threads: 85
Joined: Feb 2003
Reputation:
0
wow, after all this time. gwars, is this for real? a possible fix , when I thought it was just the server .
Posts: 2,453
Threads: 614
Joined: Jan 2003
Reputation:
0
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?
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
09-25-2004, 10:38 AM
(This post was last modified: 09-25-2004, 10:44 AM by Miagi.)
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!
Posts: 758
Threads: 46
Joined: Feb 2003
Reputation:
0
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
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
09-25-2004, 03:31 PM
(This post was last modified: 09-25-2004, 10:49 PM by Miagi.)
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++ )
 {
 //.ASM : white disc haxxx...
 // if the player is "dead" during the round countdown,
 // then bring the bastard back...
 if(!m_hCombatants[i]->IsAlive())
  m_hCombatants[i]->Spawn();
 // end .ASM
 if (m_hCombatants[i])
  ((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
 }
}
m_iSecondsTillStart--;
// Play countdown VOX
if (m_iSecondsTillStart < 5)
{
 // Speech
 for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
 {
 if (m_hCombatants[i])
  ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i])->ClientHearVox( g_szCountDownVox[ m_iSecondsTillStart ] );
 }
}
// Send the message to the clients in the arena
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
 CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
 if (pPlayer && (pPlayer->pev->groupinfo & pev->groupinfo) && pPlayer->m_bHasDisconnected != TRUE)
 {
 MESSAGE_BEGIN( MSG_ONE, gmsgStartRnd, NULL, pPlayer->edict() );
  WRITE_BYTE( m_iCurrRound );
  WRITE_BYTE( m_iSecondsTillStart );
  WRITE_BYTE( 0 );
 MESSAGE_END();
 }
}
if (m_iSecondsTillStart)
{
 pev->nextthink = gpGlobals->time + 1.0;
}
else
{
 m_iArenaState = ARENA_BATTLE_IN_PROGRESS;
 // Enable powerups
 CBaseEntity *pFunc = NULL;
 while ((pFunc = UTIL_FindEntityByClassname( pFunc, "item_powerup" )) != NULL)
 {
 ((CDiscwarPowerup*)pFunc)->Enable();
 }
 pev->nextthink = gpGlobals->time + 1.0;
 SetThink( BattleThink );
}
}
Could just add the disconnect check to the one? Its been awhile since my C++ class but.
Code: if(!m_hCombatants[i]->IsAlive() && 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
if ( m_iSecondsTillStart == 3 )
{
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
CBasePlayer *pPlayer = ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i]);
//.ASM : white disc haxxx...
// if the player is "dead" during the round countdown,
// then bring the bastard back...
if(!m_hCombatants[i]->IsAlive() && pPlayer->m_bHasDisconnected != TRUE)
m_hCombatants[i]->Spawn();
// end .ASM
if (m_hCombatants[i])
((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
}
}
Edited again. Had the wrong For statement :P
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
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.
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
Posts: 758
Threads: 46
Joined: Feb 2003
Reputation:
0
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])
((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
Posts: 758
Threads: 46
Joined: Feb 2003
Reputation:
0
Thanks for trying that Miagi...maybe now Acid will stfu:lol:
/Just kidding Acid, we all love your crackpot theories;)
Posts: 274
Threads: 18
Joined: May 2003
Reputation:
0
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 "" won 0 to -1. Then it crashes.
Posts: 1,306
Threads: 86
Joined: Mar 2003
Reputation:
0
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.
Posts: 4,208
Threads: 795
Joined: Jan 2003
Reputation:
0
acid maybe you can catch miagi or asm in game and demo it for them
Posts: 1,306
Threads: 86
Joined: Mar 2003
Reputation:
0
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.
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
09-25-2004, 10:34 PM
(This post was last modified: 09-25-2004, 10:56 PM by Miagi.)
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.
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
Posts: 458
Threads: 53
Joined: Feb 2003
Reputation:
0
09-27-2004, 02:34 PM
(This post was last modified: 09-27-2004, 02:34 PM by Pique.)
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 "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
Posts: 758
Threads: 46
Joined: Feb 2003
Reputation:
0
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.
Posts: 1,306
Threads: 86
Joined: Mar 2003
Reputation:
0
I PERSONALLY THINK SO, PIQUE!
I don't remember this happening on WON but it sure is happening on STEAM.
Posts: 274
Threads: 18
Joined: May 2003
Reputation:
0
I remember it happening on WON too.
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.
Posts: 1,306
Threads: 86
Joined: Mar 2003
Reputation:
0
I just wait until I get the "connection problem" message and type in retry in console, it always reconnects on the third automatic try.
Posts: 92
Threads: 4
Joined: Feb 2003
Reputation:
0
The crash seems happen when "player b" disconnect IN THE LAST ROUND (score 2-2)
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
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.
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
11-06-2004, 06:37 PM
(This post was last modified: 11-06-2004, 06:40 PM by Miagi.)
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 )
{
// Freeze everyone until there's 3 seconds to go
if ( m_iSecondsTillStart == 3 )
{
 for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
 {
 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() && pPlayer->m_bHasDisconnected != TRUE)
 m_hCombatants[i]->Spawn();
 // end .ASM
 if (m_hCombatants[i])
  ((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
 }
}
m_iSecondsTillStart--;
// 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.
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
Posts: 458
Threads: 53
Joined: Feb 2003
Reputation:
0
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.
Posts: 1,329
Threads: 294
Joined: Dec 2003
Reputation:
0
Don't know if its fixed. Evil said his server was still crashing when he put mine in :(. Mine is still up though.
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
Posts: 758
Threads: 46
Joined: Feb 2003
Reputation:
0
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.
Posts: 612
Threads: 86
Joined: Apr 2004
Reputation:
0
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.
ok ok i found the fix...
The problem is..
THATS ITS UNFIXABLE.:)
|