src/Analyzers/HeaderAnalyzer.php
protected function readScenarioHeader()
    {
        $nextUnitId = $this->readHeader('l', 4);
        $this->position += 4;
        // Player names
        for ($i = 0; $i < 16; $i++) {
            $this->position += 256; // rtrim(readHeaderRaw(), \0)
        }
        // Player names (string table)
        for ($i = 0; $i < 16; $i++) {
            $this->position += 4; // int
        }
        for ($i = 0; $i < 16; $i++) {
            $this->position += 4; // bool isActive
            $this->position += 4; // bool isHuman
            $this->position += 4; // int civilization
            $this->position += 4; // const 0x00000004
        }
        $this->position += 5;

        $elapsedTime = $this->readHeader('f', 4);
        $nameLen = $this->readHeader('v', 2);
        $filename = $this->readHeaderRaw($nameLen);

        // These should be string IDs for messages?
        if ($this->version->isMgl) {
            $this->position += 20;
        } else {
            $this->position += 24;
        }

        $this->analysis->scenarioFilename = $filename;
    }
protected function readScenarioHeader()
    {
        $nextUnitId = $this->readHeader('l', 4);
        $this->position += 4;
        // Player names
        for ($i = 0; $i < 16; $i++) {
            $this->position += 256; // rtrim(readHeaderRaw(), \0)
        }
        // Player names (string table)
        for ($i = 0; $i < 16; $i++) {
            $this->position += 4; // int
        }
        for ($i = 0; $i < 16; $i++) {
            $this->position += 4; // bool isActive
            $this->position += 4; // bool isHuman
            $this->position += 4; // int civilization
            $this->position += 4; // const 0x00000004
        }
        $this->position += 5;

        $elapsedTime = $this->readHeader('f', 4);
        $nameLen = $this->readHeader('v', 2);
        $filename = $this->readHeaderRaw($nameLen);

        // These should be string IDs for messages?
        if ($this->version->isMgl) {
            $this->position += 20;
        } else {
            $this->position += 24;
        }

        $this->analysis->scenarioFilename = $filename;
    }
protected function readScenarioHeader ( ) { $ nextUnitId = $ this -> readHeader ( 'l' , 4 ) ; $ this -> position += 4 ; // Player names for ( $ i = 0 ; $ i < 16 ; $ i ++ ) { $ this -> position += 256 ; // rtrim(readHeaderRaw(), \0) } // Player names (string table) for ( $ i = 0 ; $ i < 16 ; $ i ++ ) { $ this -> position += 4 ; // int } for ( $ i = 0 ; $ i < 16 ; $ i ++ ) { $ this -> position += 4 ; // bool isActive $ this -> position += 4 ; // bool isHuman $ this -> position += 4 ; // int civilization $ this -> position += 4 ; // const 0x00000004 } $ this -> position += 5 ; $ elapsedTime = $ this -> readHeader ( 'f' , 4 ) ; $ nameLen = $ this -> readHeader ( 'v' , 2 ) ; $ filename = $ this -> readHeaderRaw ( $ nameLen ) ; // These should be string IDs for messages? if ( $ this -> version -> isMgl ) { $ this -> position += 20 ; } else { $ this -> position += 24 ; } $ this -> analysis -> scenarioFilename = $ filename ; }
Read the scenario info header. Contains information about configured
players and the scenario file.

@return void
Read the scenario info header . Contains information about configured players and the scenario file .