Skip to content

Commit d1c6cc7

Browse files
authoredMay 5, 2020
Server: Improve some log messages (#9820)
1 parent f34c62c commit d1c6cc7

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed
 

Diff for: ‎src/network/serverpackethandler.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ void Server::handleCommand_Init(NetworkPacket* pkt)
111111

112112
if (depl_serial_v == SER_FMT_VER_INVALID) {
113113
actionstream << "Server: A mismatched client tried to connect from " <<
114-
addr_s << std::endl;
115-
infostream << "Server: Cannot negotiate serialization version with " <<
116114
addr_s << " client_max=" << (int)client_max << std::endl;
117115
DenyAccess(peer_id, SERVER_ACCESSDENIED_WRONG_VERSION);
118116
return;
@@ -902,8 +900,8 @@ bool Server::checkInteractDistance(RemotePlayer *player, const f32 d, const std:
902900
actionstream << "Player " << player->getName()
903901
<< " tried to access " << what
904902
<< " from too far: "
905-
<< "d=" << d <<", max_d=" << max_d
906-
<< ". ignoring." << std::endl;
903+
<< "d=" << d << ", max_d=" << max_d
904+
<< "; ignoring." << std::endl;
907905
// Call callbacks
908906
m_script->on_cheat(player->getPlayerSAO(), "interacted_too_far");
909907
return false;
@@ -956,7 +954,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
956954
}
957955

958956
if (playersao->isDead()) {
959-
actionstream << "Server: NoCheat: " << player->getName()
957+
actionstream << "Server: " << player->getName()
960958
<< " tried to interact while dead; ignoring." << std::endl;
961959
if (pointed.type == POINTEDTHING_NODE) {
962960
// Re-send block to revert change on client-side
@@ -1145,7 +1143,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
11451143
playersao->noCheatDigEnd();
11461144
// If player didn't start digging this, ignore dig
11471145
if (nocheat_p != p_under) {
1148-
infostream << "Server: NoCheat: " << player->getName()
1146+
infostream << "Server: " << player->getName()
11491147
<< " started digging "
11501148
<< PP(nocheat_p) << " and completed digging "
11511149
<< PP(p_under) << "; not digging." << std::endl;
@@ -1169,9 +1167,9 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
11691167
}
11701168
// If can't dig, ignore dig
11711169
if (!params.diggable) {
1172-
infostream << "Server: NoCheat: " << player->getName()
1170+
infostream << "Server: " << player->getName()
11731171
<< " completed digging " << PP(p_under)
1174-
<< ", which is not diggable with tool. not digging."
1172+
<< ", which is not diggable with tool; not digging."
11751173
<< std::endl;
11761174
is_valid_dig = false;
11771175
// Call callbacks
@@ -1195,7 +1193,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
11951193
}
11961194
// Dig not possible
11971195
else {
1198-
infostream << "Server: NoCheat: " << player->getName()
1196+
infostream << "Server: " << player->getName()
11991197
<< " completed digging " << PP(p_under)
12001198
<< "too fast; not digging." << std::endl;
12011199
is_valid_dig = false;

Diff for: ‎src/server/player_sao.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,9 @@ bool PlayerSAO::checkMovementCheat()
656656
float lag_pool_max = m_env->getMaxLagEstimate() * 2.0;
657657
lag_pool_max = MYMAX(lag_pool_max, LAG_POOL_MIN);
658658
if (m_time_from_last_teleport > lag_pool_max) {
659-
actionstream << "Player " << m_player->getName()
660-
<< " moved too fast; resetting position"
661-
<< std::endl;
659+
actionstream << "Server: " << m_player->getName()
660+
<< " moved too fast: V=" << d_vert << ", H=" << d_horiz
661+
<< "; resetting position." << std::endl;
662662
cheated = true;
663663
}
664664
setBasePosition(m_last_good_position);

0 commit comments

Comments
 (0)
Please sign in to comment.