Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player muteChat state handling tweaks #3490

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/netplay/netplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ void NET_InitPlayers(bool initTeams, bool initSpectator)
for (unsigned i = 0; i < MAX_CONNECTED_PLAYERS; ++i)
{
NET_InitPlayer(i, true, initTeams, initSpectator);
ingame.muteChat[i] = false;
clearPlayerName(i);
NETinitQueue(NETnetQueue(i));
}
Expand Down
1 change: 1 addition & 0 deletions src/multiint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3240,6 +3240,7 @@ static SwapPlayerIndexesResult recvSwapPlayerIndexes(NETQUEUE queue, const std::
}
}
swapPlayerMultiStatsLocal(playerIndexA, playerIndexB);
std::swap(ingame.muteChat[playerIndexA], ingame.muteChat[playerIndexB]);
multiSyncPlayerSwap(playerIndexA, playerIndexB);

if (playerIndexA == selectedPlayer || playerIndexB == selectedPlayer)
Expand Down
2 changes: 2 additions & 0 deletions src/multijoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ bool MultiPlayerLeave(UDWORD playerIndex)
NETlogEntry("Player leaving game", SYNC_FLAG, playerIndex);
debug(LOG_NET, "** Player %u [%s], has left the game at game time %u.", playerIndex, getPlayerName(playerIndex), gameTime);

ingame.muteChat[playerIndex] = false;

if (wz_command_interface_enabled())
{
std::string playerPublicKeyB64 = base64Encode(getMultiStats(playerIndex).identity.toBytes(EcKey::Public));
Expand Down
Loading