mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 14:12:25 +00:00
change log levels of common warnings and errors to debug
this hides a lot of the "standard" errors we get behind the debug flag. for example, disconnecting a disconnected player would be such an error
This commit is contained in:
+2
-2
@@ -62,11 +62,11 @@ void TClient::Disconnect(std::string_view Reason) {
|
|||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
mSocket.shutdown(socket_base::shutdown_both, ec);
|
mSocket.shutdown(socket_base::shutdown_both, ec);
|
||||||
if (ec) {
|
if (ec) {
|
||||||
beammp_warnf("Failed to shutdown client socket: {}", ec.message());
|
beammp_debugf("Failed to shutdown client socket: {}", ec.message());
|
||||||
}
|
}
|
||||||
mSocket.close(ec);
|
mSocket.close(ec);
|
||||||
if (ec) {
|
if (ec) {
|
||||||
beammp_warnf("Failed to close client socket: {}", ec.message());
|
beammp_debugf("Failed to close client socket: {}", ec.message());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -273,7 +273,7 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
beammp_errorf("Client sent invalid key: {}", e.what());
|
beammp_errorf("Client sent invalid key. Error was: {}", e.what());
|
||||||
// TODO: we should really clarify that this was a backend response or parsing error
|
// TODO: we should really clarify that this was a backend response or parsing error
|
||||||
ClientKick(*Client, "Invalid key! Please restart your game.");
|
ClientKick(*Client, "Invalid key! Please restart your game.");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -425,7 +425,7 @@ std::vector<uint8_t> TNetwork::TCPRcv(TClient& c) {
|
|||||||
void TNetwork::ClientKick(TClient& c, const std::string& R) {
|
void TNetwork::ClientKick(TClient& c, const std::string& R) {
|
||||||
beammp_info("Client kicked: " + R);
|
beammp_info("Client kicked: " + R);
|
||||||
if (!TCPSend(c, StringToVector("K" + R))) {
|
if (!TCPSend(c, StringToVector("K" + R))) {
|
||||||
beammp_warn("tried to kick player '" + c.GetName() + "' (id " + std::to_string(c.GetID()) + "), but was already disconnected");
|
beammp_debugf("tried to kick player '{}' (id {}), but was already connected", c.GetName(), c.GetID());
|
||||||
}
|
}
|
||||||
c.Disconnect("Kicked");
|
c.Disconnect("Kicked");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -225,7 +225,7 @@ bool TServer::IsUnicycle(TClient& c, const std::string& CarJson) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
beammp_error("Failed to parse vehicle data as json for client " + std::to_string(c.GetID()) + ": '" + CarJson + "'");
|
beammp_warn("Failed to parse vehicle data as json for client " + std::to_string(c.GetID()) + ": '" + CarJson + "'.");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user