protected function parseServerParameters(Buffer &$buffer)
    {

        // Init the parsed data array
        $parsed = [];

        // Read the number of parameters to parse
        $parameterSize = $buffer->readInt32Signed();

        // Iterate over the parameter size
        for ($i = 0; $i < $parameterSize; $i++) {
            // Read the type of return this is
            $dataType = $buffer->readInt8Signed();

            switch ($dataType) {
                // 32-bit int
                case 1:
                    $parsed[$i] = $buffer->readInt32Signed();
                    break;

                // 64-bit int
                case 2:
                    $parsed[$i] = $buffer->readInt64();
                    break;

                // Float
                case 3:
                    $parsed[$i] = $buffer->readFloat32();
                    break;

                // String
                case 4:
                    // The first 2 bytes are the string length
                    $strLength = $buffer->readInt16Signed();

                    // Read the above length from the buffer
                    $parsed[$i] = $buffer->read($strLength);

                    unset($strLength);
                    break;

                // Boolean
                case 5:
                    $parsed[$i] = (bool)$buffer->readInt8Signed();
                    break;

                // 8-bit int
                case 6:
                    $parsed[$i] = $buffer->readInt8Signed();
                    break;

                // 16-bit int
                case 7:
                    $parsed[$i] = $buffer->readInt16Signed();
                    break;

                // Array
                case 8:
                    // Not implemented
                    throw new Exception("StarMade array parsing is not implemented!");
            }
        }

        return $parsed;
    }
protected function parseServerParameters(Buffer &$buffer)
    {

        // Init the parsed data array
        $parsed = [];

        // Read the number of parameters to parse
        $parameterSize = $buffer->readInt32Signed();

        // Iterate over the parameter size
        for ($i = 0; $i < $parameterSize; $i++) {
            // Read the type of return this is
            $dataType = $buffer->readInt8Signed();

            switch ($dataType) {
                // 32-bit int
                case 1:
                    $parsed[$i] = $buffer->readInt32Signed();
                    break;

                // 64-bit int
                case 2:
                    $parsed[$i] = $buffer->readInt64();
                    break;

                // Float
                case 3:
                    $parsed[$i] = $buffer->readFloat32();
                    break;

                // String
                case 4:
                    // The first 2 bytes are the string length
                    $strLength = $buffer->readInt16Signed();

                    // Read the above length from the buffer
                    $parsed[$i] = $buffer->read($strLength);

                    unset($strLength);
                    break;

                // Boolean
                case 5:
                    $parsed[$i] = (bool)$buffer->readInt8Signed();
                    break;

                // 8-bit int
                case 6:
                    $parsed[$i] = $buffer->readInt8Signed();
                    break;

                // 16-bit int
                case 7:
                    $parsed[$i] = $buffer->readInt16Signed();
                    break;

                // Array
                case 8:
                    // Not implemented
                    throw new Exception("StarMade array parsing is not implemented!");
            }
        }

        return $parsed;
    }
protected function parseServerParameters ( Buffer & $ buffer ) { // Init the parsed data array $ parsed = [ ] ; // Read the number of parameters to parse $ parameterSize = $ buffer -> readInt32Signed ( ) ; // Iterate over the parameter size for ( $ i = 0 ; $ i < $ parameterSize ; $ i ++ ) { // Read the type of return this is $ dataType = $ buffer -> readInt8Signed ( ) ; switch ( $ dataType ) { // 32-bit int case 1 : $ parsed [ $ i ] = $ buffer -> readInt32Signed ( ) ; break ; // 64-bit int case 2 : $ parsed [ $ i ] = $ buffer -> readInt64 ( ) ; break ; // Float case 3 : $ parsed [ $ i ] = $ buffer -> readFloat32 ( ) ; break ; // String case 4 : // The first 2 bytes are the string length $ strLength = $ buffer -> readInt16Signed ( ) ; // Read the above length from the buffer $ parsed [ $ i ] = $ buffer -> read ( $ strLength ) ; unset ( $ strLength ) ; break ; // Boolean case 5 : $ parsed [ $ i ] = ( bool ) $ buffer -> readInt8Signed ( ) ; break ; // 8-bit int case 6 : $ parsed [ $ i ] = $ buffer -> readInt8Signed ( ) ; break ; // 16-bit int case 7 : $ parsed [ $ i ] = $ buffer -> readInt16Signed ( ) ; break ; // Array case 8 : // Not implemented throw new Exception ( "StarMade array parsing is not implemented!" ) ; } } return $ parsed ; }
Parse the server response parameters

@SuppressWarnings(PHPMD.CyclomaticComplexity)

@param \GameQ\Buffer $buffer

@return array
@throws \GameQ\Exception\Protocol
Parse the server response parameters