Ejemplo n.º 1
0
 public function __construct($byteString)
 {
     $this->platformID = $this->getShort($byteString, self::HEADER_START);
     $this->flightGroupCount = $this->getShort($byteString, self::HEADER_FG);
     $this->messageCount = $this->getShort($byteString, self::HEADER_MSG);
     $this->unk1 = $this->getByte($byteString, self::HEADER_UNK);
     $this->unk2 = $this->getByte($byteString, self::HEADER_UNK + 2);
     $this->unk3 = $this->getBool($byteString, self::HEADER_UNK + 5);
     $this->unk4 = $this->getByte($byteString, 40);
     $this->unk5 = $this->getByte($byteString, 80);
     $this->missionType = $this->getByte($byteString, self::HEADER_MISSION);
     $this->unk6 = $this->getBool($byteString, self::HEADER_MISSION + 1);
     $this->timeLimitMinutes = $this->getByte($byteString, self::HEADER_TIME);
     $this->timeLiimitSeconds = $this->getByte($byteString, self::HEADER_TIME + 1);
     $this->hex = \Hex::hexToStr($byteString);
 }
Ejemplo n.º 2
0
 public function __construct($byteString)
 {
     $this->platformID = getShort($byteString, self::HEADER_START);
     $this->flightGroupCount = getShort($byteString, self::HEADER_FG);
     $this->messageCount = getShort($byteString, self::HEADER_MSG);
     for ($i = 0; $i < self::IFF_COUNT; $i++) {
         $this->IFFNames[] = getString($byteString, self::HEADER_IFF + $i * self::IFF_LENGTH, self::IFF_LENGTH);
     }
     for ($r = 0; $r < self::REGION_COUNT; $r++) {
         $this->regionNames[] = getString($byteString, self::HEADER_REGION + $r * self::REGION_LENGTH, self::REGION_LENGTH);
     }
     for ($c = 0; $c < self::CARGO_COUNT; $c++) {
         $this->globalCargos[] = new GlobalCargo(substr($byteString, self::HEADER_CARGO + $c * GlobalCargo::LENGTH, GlobalCargo::LENGTH));
     }
     for ($g = 0; $g < self::GG_COUNT; $g++) {
         $this->globalGroupNames[] = getString($byteString, self::HEADER_GG + $g * self::GG_LENGTH, self::GG_LENGTH);
     }
     $this->hangar = getByte($byteString, self::HEADER_HANGAR);
     $this->timeLimitMinutes = getByte($byteString, self::HEADER_TIME);
     $this->endMissionWhenComplete = getBool($byteString, self::HEADER_END);
     $this->briefingOfficer = getByte($byteString, self::HEADER_OFFICER);
     $this->briefingLogo = getByte($byteString, self::HEADER_LOGO);
     $this->hex = \Hex::hexToStr($byteString);
 }
Ejemplo n.º 3
0
 function readHeader($path)
 {
     $ehb = file_get_contents($path . DIRECTORY_SEPARATOR . self::EHB);
     $hex = $ehb;
     $ehb = array();
     $ehb['unk1'] = ord($hex[1]);
     $ehb['title'] = substr($hex, 2, 50);
     $ehb['#'] = ord($hex[53]);
     $ehb['unk2'] = ord($hex[54]);
     $ehb['missions'] = array();
     $remaining = substr($hex, 55);
     for ($m = 0; $m < $ehb['#']; $m++) {
         $ehb['missions'][] = substr($remaining, 20 * $m, 20);
     }
     $remaining = substr($remaining, 21 * $ehb['#']);
     $ehb['rem'] = \Hex::hexToStr($remaining);
     for ($r = 0; $r < strlen($remaining); $r++) {
         $ehb['r' . $r] = ord($remaining[$r]);
     }
     $this->header = $ehb;
     $this->header['path'] = $path;
     $this->rot = ord($hex[1]);
     $this->missions = $ehb['missions'];
 }
Ejemplo n.º 4
0
echo "\n";
echo "\n";
echo $z;
?>
	/512
</pre>
</div>
<div style="float:left; width: 30%;">
<pre>
	MERGE ATTEMPT
	<?php 
echo Hex::hexToStr($ehmTIEfix);
echo "\n";
echo "\n";
echo strlen($ehmTIEfix);
?>
</pre>
</div>
<div style="float:left; width: 30%;">
<pre>
	RAW EHM
	<?php 
echo Hex::hexToStr($ehmTIE);
echo "\n";
echo "\n";
echo $e;
?>
	/512
</pre>
</div>
</body>