Author Topic: findClientByName.  (Read 1933 times)

Well, I believe setPlayerName has syntax to it. Like, is phrases the name given to clean it up. Not that it can be accessed in Blockland Retail, but getPlayerName must have it's own type of code in it.

Bet in basics, setPlayerName just did %client.name = Blah; but with fixes. So think of getPlayerName in the same way.

Code: [Select]
function GameConnection::setPlayerName(%client,%name)
{
   %client.sendGuid = 0;

   // Minimum length requirements
   %name = stripTrailingSpaces( strToPlayerName( %name ) );
   if ( strlen( %name ) < 3 )
      %name = "Poser";

   // Make sure the alias is unique, we'll hit something eventually
   if (!isNameUnique(%name))
   {
      %isUnique = false;
      for (%suffix = 1; !%isUnique; %suffix++)  {
         %nameTry = %name @ "." @ %suffix;
         %isUnique = isNameUnique(%nameTry);
      }
      %name = %nameTry;
   }

   // Tag the name with the "smurf" color:
   %client.nameBase = %name;
   %client.playerName = addTaggedString("\cp\c8" @ %name @ "\co");
}