src/Analyzers/PlayerMetaAnalyzer.php
private function seek()
    {
        $version = $this->get(VersionAnalyzer::class);

        $constant2 = pack('c*', 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0xF9, 0x3F);
        $separator = pack('c*', 0x9D, 0xFF, 0xFF, 0xFF);

        $playersByIndex = [];

        $size = strlen($this->header);
        $this->position = 0;

        $triggerInfoPos = strrpos($this->header, $constant2, $this->position) + strlen($constant2);
        $gameSettingsPos = strrpos($this->header, $separator, -($size - $triggerInfoPos)) + strlen($separator);

        $this->position = $gameSettingsPos + 8;
        if (!$version->isAoK) {
            // Skip Map ID.
            $this->position += 4;
        }
        // Skip difficulty & diplomacy lock.
        $this->position += 8;

        // TODO Is 12.3 the correct cutoff point?
        if ($version->subVersion >= 12.3) {
            // TODO what are theeeese?
            $this->position += 16;
        }
    }
private function seek()
    {
        $version = $this->get(VersionAnalyzer::class);

        $constant2 = pack('c*', 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0xF9, 0x3F);
        $separator = pack('c*', 0x9D, 0xFF, 0xFF, 0xFF);

        $playersByIndex = [];

        $size = strlen($this->header);
        $this->position = 0;

        $triggerInfoPos = strrpos($this->header, $constant2, $this->position) + strlen($constant2);
        $gameSettingsPos = strrpos($this->header, $separator, -($size - $triggerInfoPos)) + strlen($separator);

        $this->position = $gameSettingsPos + 8;
        if (!$version->isAoK) {
            // Skip Map ID.
            $this->position += 4;
        }
        // Skip difficulty & diplomacy lock.
        $this->position += 8;

        // TODO Is 12.3 the correct cutoff point?
        if ($version->subVersion >= 12.3) {
            // TODO what are theeeese?
            $this->position += 16;
        }
    }
private function seek ( ) { $ version = $ this -> get ( VersionAnalyzer :: class ) ; $ constant2 = pack ( 'c*' , 0x9A , 0x99 , 0x99 , 0x99 , 0x99 , 0x99 , 0xF9 , 0x3F ) ; $ separator = pack ( 'c*' , 0x9D , 0xFF , 0xFF , 0xFF ) ; $ playersByIndex = [ ] ; $ size = strlen ( $ this -> header ) ; $ this -> position = 0 ; $ triggerInfoPos = strrpos ( $ this -> header , $ constant2 , $ this -> position ) + strlen ( $ constant2 ) ; $ gameSettingsPos = strrpos ( $ this -> header , $ separator , - ( $ size - $ triggerInfoPos ) ) + strlen ( $ separator ) ; $ this -> position = $ gameSettingsPos + 8 ; if ( ! $ version -> isAoK ) { // Skip Map ID. $ this -> position += 4 ; } // Skip difficulty & diplomacy lock. $ this -> position += 8 ; // TODO Is 12.3 the correct cutoff point? if ( $ version -> subVersion >= 12.3 ) { // TODO what are theeeese? $ this -> position += 16 ; } }
Find the position of the small player metadata block.
Find the position of the small player metadata block .