Skip to content

Commit

Permalink
uhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaileke committed Aug 9, 2024
1 parent ff2a37e commit 8e6c677
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/UnconnectedMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ private function handle(OfflineMessage $packet, InternetAddress $address) : bool
$this->server->sendPacket(IncompatibleProtocolVersion::create($this->protocolAcceptor->getPrimaryVersion(), $this->server->getID()), $address);
$this->server->getLogger()->notice("Refused connection from $address due to incompatible RakNet protocol version (version $packet->protocol)");
}else{
$cookie = null;
if ($this->server->getCookie() instanceof Cookie) {
$this->server->getCookie()->add($address);
$cookie = $this->server->getCookie()->get($address);
}
//IP header size (20 bytes) + UDP header size (8 bytes)
$this->server->sendPacket(OpenConnectionReply1::create($this->server->getID(), $this->server->getCookie()->get($address), $packet->mtuSize + 28), $address);
$this->server->sendPacket(OpenConnectionReply1::create($this->server->getID(), $cookie, $packet->mtuSize + 28), $address);
}
}elseif($packet instanceof OpenConnectionRequest2){
// The client may not send such data even though serverSecurity is enabled, and if we try to decode this, we may encounter an error
Expand Down

0 comments on commit 8e6c677

Please sign in to comment.