public function processResponse()
    {
        // Merge the response packets
        $xmlString = implode('', $this->packets_response);

        // Check to make sure this is will decode into a valid XML Document
        if (($xmlDoc = @simplexml_load_string($xmlString)) === false) {
            throw new Exception(__METHOD__ . " Unable to load XML string.");
        }

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

        // All servers are dedicated as far as I can tell
        $result->add('dedicated', 1);

        // Iterate over the info
        foreach (['serverinfo', 'owner', 'map', 'npcs', 'monsters', 'players'] as $property) {
            foreach ($xmlDoc->{$property}->attributes() as $key => $value) {
                if (!in_array($property, ['serverinfo'])) {
                    $key = $property . '_' . $key;
                }

                // Add the result
                $result->add($key, (string)$value);
            }
        }

        $result->add("motd", (string)$xmlDoc->motd);

        unset($xmlDoc, $xmlDoc);

        return $result->fetch();
    }
public function processResponse()
    {
        // Merge the response packets
        $xmlString = implode('', $this->packets_response);

        // Check to make sure this is will decode into a valid XML Document
        if (($xmlDoc = @simplexml_load_string($xmlString)) === false) {
            throw new Exception(__METHOD__ . " Unable to load XML string.");
        }

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

        // All servers are dedicated as far as I can tell
        $result->add('dedicated', 1);

        // Iterate over the info
        foreach (['serverinfo', 'owner', 'map', 'npcs', 'monsters', 'players'] as $property) {
            foreach ($xmlDoc->{$property}->attributes() as $key => $value) {
                if (!in_array($property, ['serverinfo'])) {
                    $key = $property . '_' . $key;
                }

                // Add the result
                $result->add($key, (string)$value);
            }
        }

        $result->add("motd", (string)$xmlDoc->motd);

        unset($xmlDoc, $xmlDoc);

        return $result->fetch();
    }
public function processResponse ( ) { // Merge the response packets $ xmlString = implode ( '' , $ this -> packets_response ) ; // Check to make sure this is will decode into a valid XML Document if ( ( $ xmlDoc = @ simplexml_load_string ( $ xmlString ) ) === false ) { throw new Exception ( __METHOD__ . " Unable to load XML string." ) ; } // Set the result to a new result instance $ result = new Result ( ) ; // All servers are dedicated as far as I can tell $ result -> add ( 'dedicated' , 1 ) ; // Iterate over the info foreach ( [ 'serverinfo' , 'owner' , 'map' , 'npcs' , 'monsters' , 'players' ] as $ property ) { foreach ( $ xmlDoc -> { $ property } -> attributes ( ) as $ key => $ value ) { if ( ! in_array ( $ property , [ 'serverinfo' ] ) ) { $ key = $ property . '_' . $ key ; } // Add the result $ result -> add ( $ key , ( string ) $ value ) ; } } $ result -> add ( "motd" , ( string ) $ xmlDoc -> motd ) ; unset ( $ xmlDoc , $ xmlDoc ) ; return $ result -> fetch ( ) ; }
Process the response for the Tibia server

@return array
@throws \GameQ\Exception\Protocol
Process the response for the Tibia server