protected function processPlayers(Buffer $buffer)
    {
        // Some games do not have a number of current players
        $playerCount = 0;

        // Set the result to a new result instance
        $result = new Result();

        // Loop until we are out of data
        while ($buffer->getLength()) {
            // Make a new buffer with this block
            $playerInfo = new Buffer($buffer->readString("\x0A"));

            // Add player info
            $result->addPlayer('frags', $playerInfo->readString("\x20"));
            $result->addPlayer('ping', $playerInfo->readString("\x20"));

            // Skip first "
            $playerInfo->skip(1);

            // Add player name, encoded
            $result->addPlayer('name', utf8_encode(trim(($playerInfo->readString('"')))));

            // Skip first "
            $playerInfo->skip(2);

            // Add address
            $result->addPlayer('address', trim($playerInfo->readString('"')));

            // Increment
            $playerCount++;

            // Clear
            unset($playerInfo);
        }

        $result->add('clients', $playerCount);

        // Clear
        unset($buffer, $playerCount);

        return $result->fetch();
    }
protected function processPlayers(Buffer $buffer)
    {
        // Some games do not have a number of current players
        $playerCount = 0;

        // Set the result to a new result instance
        $result = new Result();

        // Loop until we are out of data
        while ($buffer->getLength()) {
            // Make a new buffer with this block
            $playerInfo = new Buffer($buffer->readString("\x0A"));

            // Add player info
            $result->addPlayer('frags', $playerInfo->readString("\x20"));
            $result->addPlayer('ping', $playerInfo->readString("\x20"));

            // Skip first "
            $playerInfo->skip(1);

            // Add player name, encoded
            $result->addPlayer('name', utf8_encode(trim(($playerInfo->readString('"')))));

            // Skip first "
            $playerInfo->skip(2);

            // Add address
            $result->addPlayer('address', trim($playerInfo->readString('"')));

            // Increment
            $playerCount++;

            // Clear
            unset($playerInfo);
        }

        $result->add('clients', $playerCount);

        // Clear
        unset($buffer, $playerCount);

        return $result->fetch();
    }
protected function processPlayers ( Buffer $ buffer ) { // Some games do not have a number of current players $ playerCount = 0 ; // Set the result to a new result instance $ result = new Result ( ) ; // Loop until we are out of data while ( $ buffer -> getLength ( ) ) { // Make a new buffer with this block $ playerInfo = new Buffer ( $ buffer -> readString ( "\x0A" ) ) ; // Add player info $ result -> addPlayer ( 'frags' , $ playerInfo -> readString ( "\x20" ) ) ; $ result -> addPlayer ( 'ping' , $ playerInfo -> readString ( "\x20" ) ) ; // Skip first " $ playerInfo -> skip ( 1 ) ; // Add player name, encoded $ result -> addPlayer ( 'name' , utf8_encode ( trim ( ( $ playerInfo -> readString ( '"' ) ) ) ) ) ; // Skip first " $ playerInfo -> skip ( 2 ) ; // Add address $ result -> addPlayer ( 'address' , trim ( $ playerInfo -> readString ( '"' ) ) ) ; // Increment $ playerCount ++ ; // Clear unset ( $ playerInfo ) ; } $ result -> add ( 'clients' , $ playerCount ) ; // Clear unset ( $ buffer , $ playerCount ) ; return $ result -> fetch ( ) ; }
Handle processing of player data

@param Buffer $buffer

@return array
Handle processing of player data