public function updateGameRoom($status)
 {
     if ($this->game_room_status == '') {
         return;
     }
     $duration = time() - $this->created_since;
     $duration_bytes = toEndian(LONG2DWORD($duration));
     $this->game_room_status[8] = $duration_bytes[0];
     $this->game_room_status[9] = $duration_bytes[1];
     $this->game_room_status[10] = $duration_bytes[2];
     $this->game_room_status[11] = $duration_bytes[3];
     switch ($status) {
         case self::GS_CLOSED:
             $this->game_room_status[4] = "";
             $this->game_room_status = '';
             $this->push("�");
             $this->push("�D\t");
             return $this->joinChannel($this->default_channel);
             break;
         case self::GS_OPEN:
             $this->game_room_status[4] = "";
             break;
         case self::GS_FULL:
             $this->game_room_status[4] = "";
             break;
         case self::GS_STARTED:
             $this->game_room_status[4] = "";
             $this->push("�");
             break;
     }
     $this->push($this->game_room_status);
 }
Example #2
0
 function getNetworkByte($long_ip, $port)
 {
     $raw_ip = LONG2DWORD($long_ip);
     $raw_port = INT2WORD($port);
     return "" . $raw_port . $raw_ip;
 }
Example #3
0
 public function getMap($index)
 {
     if ($index > -1 && $index < $this->total) {
         $data = $this->maps[$index];
         $data['filesize'] = LONG2DWORD(hexdec($data['filesize']));
         $data['signature'] = LONG2DWORD(hexdec($data['signature']));
         $data['crc32'] = LONG2DWORD(hexdec($data['crc32']));
         return $data;
     } else {
         return false;
     }
 }