Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ricochet HLTV Support
#4
Alright, forgetting what I've said above, here is the complete fix with the changes in bold. All of these functions are in disc_arena.cpp.

Quote:void CDiscArena::Reset( void )
{
// Remove all clients in the queue
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );

if (pPlayer && (pPlayer->m_pCurrentArena == this) && pPlayer->m_bHasDisconnected != TRUE && (stricmp(GETPLAYERAUTHID(pPlayer->edict()), "HLTV") != 0))
{
RemoveClient( pPlayer );

// Move her into spectator mode
//MoveToSpectator( pPlayer );
}
}

m_pPlayerQueue = NULL;
m_iPlayers = 0;
m_flTimeLimitOver = 0;
m_bShownTimeWarning = FALSE;
m_iArenaState = ARENA_WAITING_FOR_PLAYERS;
memset( m_hCombatants, 0, sizeof( m_hCombatants ) );

SetThink( NULL );
pev->nextthink = 0;
}
<!--/sizec-->

Quote:void AddClientToArena( CBasePlayer *pPlayer )
{

if (stricmp(GETPLAYERAUTHID(pPlayer-&gt;edict()), &quot;HLTV&quot;) == 0)
{
return;
}


// First, find an arena for this player to be put into
for (int i = 0; i &lt; MAX_ARENAS; i++)
{
if ( g_pArenaList[i]-&gt;IsFull() == FALSE )
{
int iArenaNumber = i;

g_pArenaList[iArenaNumber]-&gt;AddClient( pPlayer, TRUE );

bool bFoundOne = TRUE;
// Now, if this arena's not full, try to find more player to join her
//Commented out - .asm 06/03/03
/* while ( (g_pArenaList[iArenaNumber]-&gt;IsFull() == FALSE) &amp;&amp; bFoundOne )
{
bFoundOne = FALSE;

// Cycle through all the arenas and find a spare player
for (int j = 0; j &lt; MAX_ARENAS; j++)
{
CBasePlayer *pSparePlayer = g_pArenaList[j]-&gt;GetFirstSparePlayer();
if (pSparePlayer &amp;&amp; pSparePlayer != pPlayer)
{
g_pArenaList[j]-&gt;RemoveClient( pSparePlayer );
g_pArenaList[iArenaNumber]-&gt;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]-&gt;IsFull() == FALSE )
{
// Add to the first full arena
for (int j = 0; j &lt; MAX_ARENAS; j++)
{
if ( g_pArenaList[j]-&gt;IsFull() )
{
// Remove from current
g_pArenaList[iArenaNumber]-&gt;RemoveClient( pPlayer );

// Add to full one
iArenaNumber = j;
g_pArenaList[iArenaNumber]-&gt;AddClient( pPlayer, TRUE );
break;
}
}
}
//Beginning of added code to prevent reconnectors - .asm 06/03/03
else
{
bFoundOne = FALSE;

// Cycle through all the arenas and find a spare player
for (int j = 0; j &lt; MAX_ARENAS; j++)
{
CBasePlayer *pSparePlayer = g_pArenaList[j]-&gt;GetFirstSparePlayer();
if (pSparePlayer &amp;&amp; pSparePlayer != pPlayer)
{
g_pArenaList[j]-&gt;RemoveClient( pSparePlayer );
g_pArenaList[iArenaNumber]-&gt;AddClient( pSparePlayer, TRUE );
bFoundOne = TRUE;
break;
}
}
}

//End of added code to prevent reconnectors - .asm 06/03/03


//ALERT( at_console, &quot;ADDED %s to Arena %d\n&quot;, STRING(pPlayer-&gt;pev-&gt;netname), iArenaNumber );
return;
}
}
}
<!--/sizec-->

Quote:int AddPlayers( int iPlayers, int iArenaNum )
{
for ( int i = 1; i &lt;= gpGlobals-&gt;maxClients; i++ )
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );

if (pPlayer &amp;&amp; (pPlayer-&gt;m_pCurrentArena == NULL) &amp;&amp; (pPlayer-&gt;m_bHasDisconnected != TRUE) &amp;&amp; (stricmp(GETPLAYERAUTHID(pPlayer-&gt;edict()), &quot;HLTV&quot;) != 0))
{
if ( pPlayer-&gt;m_iLastGameResult != iPlayers )
continue;

g_pArenaList[iArenaNum]-&gt;AddClient( pPlayer, FALSE );
if ( g_pArenaList[iArenaNum]-&gt;IsFull() )
iArenaNum++;
}
}

return iArenaNum;
}<!--sizec-->
<!--/sizec-->
Reply


Messages In This Thread
Ricochet HLTV Support - by GoD-Tony - 09-16-2007, 06:18 PM
Ricochet HLTV Support - by GoD-Tony - 09-16-2007, 07:19 PM
Ricochet HLTV Support - by PZ: Tribute - 09-16-2007, 08:55 PM
Ricochet HLTV Support - by GoD-Tony - 09-17-2007, 11:12 PM
Ricochet HLTV Support - by Miagi - 09-18-2007, 06:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)