NetworkSession: Send less information to clients on error disconnects

in particular, the information from VerifyLoginTask shouldn't be sent to clients, as it could contain sensitive information.
This change only affects disconnection screens. The server log shows the same amount of information as before (though formatted differently in some cases).
This commit is contained in:
Dylan K. Taylor
2023-11-29 16:31:59 +00:00
parent d596dc571d
commit b2df405cc0
4 changed files with 28 additions and 11 deletions

View File

@ -85,8 +85,10 @@ class ResourcePacksPacketHandler extends PacketHandler{
}
private function disconnectWithError(string $error) : void{
$this->session->getLogger()->error("Error downloading resource packs: " . $error);
$this->session->disconnectWithError(KnownTranslationFactory::disconnectionScreen_resourcePack());
$this->session->disconnectWithError(
reason: "Error downloading resource packs: " . $error,
disconnectScreenMessage: KnownTranslationFactory::disconnectionScreen_resourcePack()
);
}
public function handleResourcePackClientResponse(ResourcePackClientResponsePacket $packet) : bool{