diff options
author | sfan5 <sfan5@live.de> | 2022-04-27 19:55:13 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-04-28 20:05:26 +0200 |
commit | a65f6f07f3a5601207b790edcc8cc945133112f7 (patch) | |
tree | 976d7cfa2b8c9a693bdd3f6b0e579b84590d41d8 /src/network/clientpackethandler.cpp | |
parent | 00f71c3b9d35e1cdd5aa62491a46068358aa8b2a (diff) | |
download | hax-minetest-server-a65f6f07f3a5601207b790edcc8cc945133112f7.tar.gz hax-minetest-server-a65f6f07f3a5601207b790edcc8cc945133112f7.zip |
Clean up some auth packet handling related code
Diffstat (limited to '')
-rw-r--r-- | src/network/clientpackethandler.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 15b576640..55d20d673 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -183,7 +183,7 @@ void Client::handleCommand_AccessDenied(NetworkPacket* pkt) m_access_denied_reason = "Unknown"; if (pkt->getCommand() != TOCLIENT_ACCESS_DENIED) { - // 13/03/15 Legacy code from 0.4.12 and lesser but is still used + // Legacy code from 0.4.12 and older but is still used // in some places of the server code if (pkt->getSize() >= 2) { std::wstring wide_reason; @@ -196,14 +196,14 @@ void Client::handleCommand_AccessDenied(NetworkPacket* pkt) if (pkt->getSize() < 1) return; - u8 denyCode = SERVER_ACCESSDENIED_UNEXPECTED_DATA; + u8 denyCode; *pkt >> denyCode; + if (denyCode == SERVER_ACCESSDENIED_SHUTDOWN || denyCode == SERVER_ACCESSDENIED_CRASH) { *pkt >> m_access_denied_reason; - if (m_access_denied_reason.empty()) { + if (m_access_denied_reason.empty()) m_access_denied_reason = accessDeniedStrings[denyCode]; - } u8 reconnect; *pkt >> reconnect; m_access_denied_reconnect = reconnect & 1; @@ -220,9 +220,8 @@ void Client::handleCommand_AccessDenied(NetworkPacket* pkt) // Until then (which may be never), this is outside // of the defined protocol. *pkt >> m_access_denied_reason; - if (m_access_denied_reason.empty()) { + if (m_access_denied_reason.empty()) m_access_denied_reason = "Unknown"; - } } } |