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); }
function getNetworkByte($long_ip, $port) { $raw_ip = LONG2DWORD($long_ip); $raw_port = INT2WORD($port); return "" . $raw_port . $raw_ip; }
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; } }