Skip to content

Commit

Permalink
fix/improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsupermanhd committed Oct 6, 2024
1 parent cd1557e commit 5cbf4a0
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions src/multiint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2526,13 +2526,17 @@ bool recvTeamRequest(NETQUEUE queue)

if (senderHasLobbyCommandAdminPrivs(queue.index) && (queue.index != player || locked.teams))
{
const char* msg = astringf("Admin %s changed team of player [%d] %s to %d",
sendRoomSystemMessage(astringf("Admin %s changed team of player [%d] %s to %d",
NetPlay.players[queue.index].name,
NetPlay.players[player].position,
NetPlay.players[player].name,
team).c_str();
sendRoomSystemMessage(msg);
debug(LOG_INFO, "%s", msg);
team).c_str());
debug(LOG_INFO, "Admin %s (%s) changed team of player [%d] %s to %d",
NetPlay.players[queue.index].name,
getMultiStats(queue.index).identity.publicKeyHexString().c_str(),
NetPlay.players[player].position,
NetPlay.players[player].name,
team);
}

if (!alliancesSetTeamsBeforeGame(game.alliance))
Expand Down Expand Up @@ -2793,13 +2797,17 @@ bool recvFactionRequest(NETQUEUE queue)

if (senderHasLobbyCommandAdminPrivs(queue.index) && queue.index != player)
{
const char* msg = astringf("Admin %s changed faction of player [%d] %s to %d",
sendRoomSystemMessage(astringf("Admin %s changed faction of player [%d] %s to %d",
NetPlay.players[queue.index].name,
NetPlay.players[player].position,
NetPlay.players[player].name,
faction).c_str());
debug(LOG_INFO, "Admin %s (%s) changed faction of player [%d] %s to %d",
NetPlay.players[queue.index].name,
getMultiStats(queue.index).identity.publicKeyHexString().c_str(),
NetPlay.players[player].position,
NetPlay.players[player].name,
faction).c_str();
sendRoomSystemMessage(msg);
debug(LOG_INFO, "%s", msg);
faction);
}

resetReadyStatus(false, true);
Expand Down Expand Up @@ -2835,13 +2843,17 @@ bool recvColourRequest(NETQUEUE queue)

if (senderHasLobbyCommandAdminPrivs(queue.index) && (queue.index != player))
{
const char* msg = astringf("Admin %s changed color of player [%d] %s to %d",
sendRoomSystemMessage(astringf("Admin %s changed color of player [%d] %s to %d",
NetPlay.players[queue.index].name,
NetPlay.players[player].position,
NetPlay.players[player].name,
col).c_str();
sendRoomSystemMessage(msg);
debug(LOG_INFO, "%s", msg);
col).c_str());
debug(LOG_INFO, "Admin %s (%s) changed color of player [%d] %s to %d",
NetPlay.players[queue.index].name,
getMultiStats(queue.index).identity.publicKeyHexString().c_str(),
NetPlay.players[player].position,
NetPlay.players[player].name,
col);
}

resetReadyStatus(false, true);
Expand Down Expand Up @@ -2881,13 +2893,17 @@ bool recvPositionRequest(NETQUEUE queue)

if (senderHasLobbyCommandAdminPrivs(queue.index) && (queue.index != player || (locked.position)))
{
const char* msg = astringf("Admin %s changed position of player [%d] %s to %d",
sendRoomSystemMessage(astringf("Admin %s changed position of player [%d] %s to %d",
NetPlay.players[queue.index].name,
NetPlay.players[player].position,
NetPlay.players[player].name,
position).c_str());
debug(LOG_INFO, "Admin %s (%s) changed position of player [%d] %s to %d",
NetPlay.players[queue.index].name,
getMultiStats(queue.index).identity.publicKeyHexString().c_str(),
NetPlay.players[player].position,
NetPlay.players[player].name,
position).c_str();
sendRoomSystemMessage(msg);
debug(LOG_INFO, "%s", msg);
position);
}

resetReadyStatus(false);
Expand Down

0 comments on commit 5cbf4a0

Please sign in to comment.