Skip to content

Commit

Permalink
pls gimme blue tick
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaileke committed Sep 20, 2024
1 parent 41ac282 commit 7d1586f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/UnconnectedMessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ private function handle(OfflineMessage $packet, InternetAddress $address) : bool
$this->server->getLogger()->debug("Not creating session for $address due to session already opened");
return true;
}
$cookieCache = $this->server->getCookieCache();
if ($cookieCache instanceof CookieCache) { // womp womp
if (!$cookieCache->check($address, $packet->cookie)) {
if ($this->server->getCookieCache() instanceof CookieCache) { // womp womp
if ($packet->cookie === null || !$this->server->getCookieCache()->check($address, $packet->cookie)) {
// Disconnect if OpenConnectionReply1 and the cookie in the OpenConnectionRequest2 packet do not match
$this->server->getLogger()->debug("Not creating session for $address due to session mismatched cookies");
return true;
}

}
$mtuSize = min($packet->mtuSize, $this->server->getMaxMtuSize()); //Max size, do not allow creating large buffers to fill server memory
$this->server->sendPacket(OpenConnectionReply2::create($this->server->getID(), $address, $mtuSize, false), $address);
Expand Down

0 comments on commit 7d1586f

Please sign in to comment.