Jump to content

Bot or Bug? wtf?


Recommended Posts

It's probably related to player ID's as it seems to loop through the array with the length defined as the player count, let's say there are three players online, 1, 2 and 3, then the player with ID 2 leaves the server. When someone tries to query the list they see 2 players online but only player 1 is listed as there is no player 2. It's only a guess though.

    // Get player nicks  
     vecPlayers.clear ();  
     while ( i < nLength )  
     {  
         std::string strPlayer;  
         try  
         {  
             if ( ReadString ( strPlayer, szBuffer, i, nLength ) )  
             {  
                 // Remove color code, unless that results in an empty string  
                 SString strResult = RemoveColorCodes ( strPlayer.c_str () );  
                 if ( strResult.length () == 0 )  
                     strResult = strPlayer;  
                 if ( ( uiMasterServerSaysRestrictions & ASE_FLAG_PLAYER_LIST ) == false )  
                     vecPlayers.push_back ( strResult );  
             }  
         }  
         catch ( ... )  
         {  
             // yeah that's what I thought.  
             return false;  
         }  
     }  

Here's the code: starting at line 602.

https://github.com/multitheftauto/mtasa-blue/blob/master/MTA10/core/CServerList.cpp

Link to comment

Shouldn't expect a bit of code as simple as this to do the right thing all of the time anyway. As it only affects the largest rooms as you say, unless it is obscuring those nicks from being searched. Regardless, a night of stab-in-the-dark debugging will fix anything.

  
// Get player nicks 
vecPlayers.clear (); 
while ( i < nLength ) 
{ 
std::string strPlayer; 
try 
{ 
if ( ReadString ( strPlayer, szBuffer, i, nLength ) ) 
{ 
// Remove color code, unless that results in an empty string 
SString strResult = RemoveColorCodes ( strPlayer.c_str () ); 
if ( strResult.length () == 0 ) 
strResult = strPlayer; 
if ( ( uiMasterServerSaysRestrictions & ASE_FLAG_PLAYER_LIST ) == false ) 
vecPlayers.push_back ( strResult ); 
} 
} 
catch ( ... ) 
{ 
// yeah that's what I thought. 
return false; 
} 
} 
  
 

Never neglect the little things... they can bring us all down. Like having a game motto whose first two word are "Stop Playing.." or a white boy poster child for a largely non-european audience lacking girls.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...