mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +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:
@@ -62,11 +62,11 @@ void TClient::Disconnect(std::string_view Reason) {
|
||||
boost::system::error_code ec;
|
||||
mSocket.shutdown(socket_base::shutdown_both, ec);
|
||||
if (ec) {
|
||||
beammp_warnf("Failed to shutdown client socket: {}", ec.message());
|
||||
beammp_debugf("Failed to shutdown client socket: {}", ec.message());
|
||||
}
|
||||
mSocket.close(ec);
|
||||
if (ec) {
|
||||
beammp_warnf("Failed to close client socket: {}", ec.message());
|
||||
beammp_debugf("Failed to close client socket: {}", ec.message());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
||||
return nullptr;
|
||||
}
|
||||
} 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
|
||||
ClientKick(*Client, "Invalid key! Please restart your game.");
|
||||
return nullptr;
|
||||
@@ -425,7 +425,7 @@ std::vector<uint8_t> TNetwork::TCPRcv(TClient& c) {
|
||||
void TNetwork::ClientKick(TClient& c, const std::string& R) {
|
||||
beammp_info("Client kicked: " + 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");
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ bool TServer::IsUnicycle(TClient& c, const std::string& CarJson) {
|
||||
return true;
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user