Ejemplo n.º 1
0
 /**
  * @param MemStream $s
  */
 public function serial(MemStream $s)
 {
     if (!$s->isReading()) {
         throw new \RuntimeException('Writing is not supported');
     }
     $s->serialVersion($this->Version);
     if ($this->Version >= 1) {
         $s->serialCheck(strrev(self::ICFG_HEADER));
         $this->serialUserChatsInfos($s);
     }
     $s->serialCheck('ICFG');
     // number of desktops
     $s->serial_uint32($nbMode);
     // current desktop
     $s->serial_byte($this->CurrentMode);
     if ($this->Version >= 10) {
         $s->serial_sint32($this->LastInGameScreenW);
         $s->serial_sint32($this->LastInGameScreenH);
     }
     // desktop / window configurations
     for ($i = 0; $i < $nbMode; $i++) {
         $s->serial_uint32($len);
         if ($len > 0) {
             $s->serial_buffer($buf, $len);
             if ($this->Version <= 2) {
                 $buf = chr(0) . $buf;
             }
         }
         // c++: _Modes[i].serial(ms);
     }
     $this->serialDatabase($s);
     // compatibility: load taskbar
     if ($this->Version >= 2) {
         $this->serialTaskbar($s);
     }
     // user landmarks
     $this->Landmarks = new IcfgLandmarks();
     $this->Landmarks->serial($s);
     if ($this->Version >= 5) {
         $this->serialInfoWindowSave($s);
     }
     if ($this->Version >= 7) {
         // CSphraseManager::serialMacroMemory
         $this->serialMacroMemory($s);
     }
     if ($this->Version >= 8) {
         // FIXME: serial in scene bubble info
         // CGroupInSceneBubbleManager::serialInSceneBubbleInfo
         $this->serialInSceneBubbleInfo($s);
     }
     if ($this->Version >= 11) {
         // FIXME: load user dyn chats infos
         // PeopleInterraction.loadUserDynChatsInfos
         $this->serialUserDynChatsInfos($s);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param MemStream $s
  */
 public function serial(MemStream $s)
 {
     if ($s->isReading()) {
         $s->serial_uint64($val);
         $this->setValue($val);
     } else {
         $val = $this->getValue();
         $s->serial_uint64($val);
     }
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function serial(MemStream $s)
 {
     // string with <uint32> length counter
     $s->serial_string($this->name);
     if ($s->isReading()) {
         // read all remaining bytes from buffer
         $length = $s->getSize() - $s->getPos();
     } else {
         $length = strlen($this->payload);
     }
     $s->serial_buffer($this->payload, $length);
 }