06-03-2003, 02:31 AM
i am pleased to anounce that i have taken care of the reconnecting problem in ricochet. the solution was very simple, so painfully obvious that i'm ashamed i didn't take care of it a helluva lot sooner.
you can replace the AddClientToArena function in your DiscArena.cpp file w/ this one below and recompile...or pm me and i will e-mail you my modified DiscArena.cpp file. remeber that this function is
a global and not part of the Arena class.
i didn't really write any new code...i just swaped some things around (man, i feel dumb...lol). now about that white-disc...hmm...
// MODIFIED FUNCTION //////////////////////////////////////////////////////////////////////////////
void AddClientToArena( CBasePlayer *pPlayer )
{
// This is the HAX!!!
// remember ...we don't have any arena objects yet...so when do we
// initialize?
// here's the plan...we need to tell the
// computer to try and place the client in a full arena first...that will make him/her spectate...
for (int i = 0; i < MAX_ARENAS; i++)
{
if ( g_pArenaList[i]->IsFull() == FALSE )
{
int iArenaNumber = i;
g_pArenaList[iArenaNumber]->AddClient( pPlayer, TRUE );
bool bFoundOne = TRUE;
/*
// Now, if this arena's not full, try to find one more player to join her
while ( (g_pArenaList[iArenaNumber]->IsFull() == FALSE) && bFoundOne )
{
bFoundOne = FALSE;
// Cycle through all the arenas and find a spare player
for (int j = 0; j < MAX_ARENAS; j++)
{
CBasePlayer *pSparePlayer = g_pArenaList[j]->GetFirstSparePlayer();
if (pSparePlayer && pSparePlayer != pPlayer)
{
g_pArenaList[j]->RemoveClient( pSparePlayer );
g_pArenaList[iArenaNumber]->AddClient( pSparePlayer, TRUE );
bFoundOne = TRUE;
break;
}
}
} */
// If we couldn't find another player for this arena, just add them to an existing arena
if ( g_pArenaList[iArenaNumber]->IsFull() == FALSE )
{
// Add to the first full arena
for (int j = 0; j < MAX_ARENAS; j++)
{
if ( g_pArenaList[j]->IsFull() )
{
// Remove from current
g_pArenaList[iArenaNumber]->RemoveClient( pPlayer );
// Add to full one
iArenaNumber = j;
g_pArenaList[iArenaNumber]->AddClient( pPlayer, TRUE );
break;
}
}
}
//while ( (g_pArenaList[iArenaNumber]->IsFull() == FALSE) && bFoundOne )
else
{
bFoundOne = FALSE;
// Cycle through all the arenas and find a spare player
for (int j = 0; j < MAX_ARENAS; j++)
{
CBasePlayer *pSparePlayer = g_pArenaList[j]->GetFirstSparePlayer();
if (pSparePlayer && pSparePlayer != pPlayer)
{
g_pArenaList[j]->RemoveClient( pSparePlayer );
g_pArenaList[iArenaNumber]->AddClient( pSparePlayer, TRUE );
bFoundOne = TRUE;
break;
}
}
} // */
//ALERT( at_console, "ADDED %s to Arena %d\n", STRING(pPlayer->pev->netname), iArenaNumber );
return;
}
}
}
// END ///////////////////////////////////////////////////////////////////////////////////////////
you can replace the AddClientToArena function in your DiscArena.cpp file w/ this one below and recompile...or pm me and i will e-mail you my modified DiscArena.cpp file. remeber that this function is
a global and not part of the Arena class.
i didn't really write any new code...i just swaped some things around (man, i feel dumb...lol). now about that white-disc...hmm...
// MODIFIED FUNCTION //////////////////////////////////////////////////////////////////////////////
void AddClientToArena( CBasePlayer *pPlayer )
{
// This is the HAX!!!
// remember ...we don't have any arena objects yet...so when do we
// initialize?
// here's the plan...we need to tell the
// computer to try and place the client in a full arena first...that will make him/her spectate...
for (int i = 0; i < MAX_ARENAS; i++)
{
if ( g_pArenaList[i]->IsFull() == FALSE )
{
int iArenaNumber = i;
g_pArenaList[iArenaNumber]->AddClient( pPlayer, TRUE );
bool bFoundOne = TRUE;
/*
// Now, if this arena's not full, try to find one more player to join her
while ( (g_pArenaList[iArenaNumber]->IsFull() == FALSE) && bFoundOne )
{
bFoundOne = FALSE;
// Cycle through all the arenas and find a spare player
for (int j = 0; j < MAX_ARENAS; j++)
{
CBasePlayer *pSparePlayer = g_pArenaList[j]->GetFirstSparePlayer();
if (pSparePlayer && pSparePlayer != pPlayer)
{
g_pArenaList[j]->RemoveClient( pSparePlayer );
g_pArenaList[iArenaNumber]->AddClient( pSparePlayer, TRUE );
bFoundOne = TRUE;
break;
}
}
} */
// If we couldn't find another player for this arena, just add them to an existing arena
if ( g_pArenaList[iArenaNumber]->IsFull() == FALSE )
{
// Add to the first full arena
for (int j = 0; j < MAX_ARENAS; j++)
{
if ( g_pArenaList[j]->IsFull() )
{
// Remove from current
g_pArenaList[iArenaNumber]->RemoveClient( pPlayer );
// Add to full one
iArenaNumber = j;
g_pArenaList[iArenaNumber]->AddClient( pPlayer, TRUE );
break;
}
}
}
//while ( (g_pArenaList[iArenaNumber]->IsFull() == FALSE) && bFoundOne )
else
{
bFoundOne = FALSE;
// Cycle through all the arenas and find a spare player
for (int j = 0; j < MAX_ARENAS; j++)
{
CBasePlayer *pSparePlayer = g_pArenaList[j]->GetFirstSparePlayer();
if (pSparePlayer && pSparePlayer != pPlayer)
{
g_pArenaList[j]->RemoveClient( pSparePlayer );
g_pArenaList[iArenaNumber]->AddClient( pSparePlayer, TRUE );
bFoundOne = TRUE;
break;
}
}
} // */
//ALERT( at_console, "ADDED %s to Arena %d\n", STRING(pPlayer->pev->netname), iArenaNumber );
return;
}
}
}
// END ///////////////////////////////////////////////////////////////////////////////////////////