diff --git a/lib/netplay/netplay.cpp b/lib/netplay/netplay.cpp index 6a4eaa07895..79412560090 100644 --- a/lib/netplay/netplay.cpp +++ b/lib/netplay/netplay.cpp @@ -2086,6 +2086,17 @@ bool NETmovePlayerToSpectatorOnlySlot(uint32_t playerIdx, bool hostOverride /*= playerManagementRecord.movedPlayerToSpectators(NetPlay.players[availableSpectatorIndex.value()], playerPublicKeyIdentity, hostOverride); + if (wz_command_interface_enabled()) + { + uint32_t newSpecIdx = availableSpectatorIndex.value(); + std::string playerPublicKeyB64 = base64Encode(getMultiStats(newSpecIdx).identity.toBytes(EcKey::Public)); + std::string playerIdentityHash = getMultiStats(newSpecIdx).identity.publicHashString(); + std::string playerVerifiedStatus = (ingame.VerifiedIdentity[newSpecIdx]) ? "V" : "?"; + std::string playerName = NetPlay.players[newSpecIdx].name; + std::string playerNameB64 = base64Encode(std::vector(playerName.begin(), playerName.end())); + wz_command_interface_output("WZEVENT: movedPlayerToSpec: %" PRIu32 " -> %" PRIu32 " %s %s %s %s %s\n", playerIdx, newSpecIdx, playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[newSpecIdx].IPtextAddress); + } + // Broadcast the swapped player info NETBroadcastTwoPlayerInfo(playerIdx, availableSpectatorIndex.value()); @@ -2136,6 +2147,16 @@ SpectatorToPlayerMoveResult NETmoveSpectatorToPlayerSlot(uint32_t playerIdx, opt playerManagementRecord.movedSpectatorToPlayers(NetPlay.players[newPlayerIdx.value()], spectatorPublicKeyIdentity, hostOverride); + if (wz_command_interface_enabled()) + { + std::string playerPublicKeyB64 = base64Encode(getMultiStats(newPlayerIdx.value()).identity.toBytes(EcKey::Public)); + std::string playerIdentityHash = getMultiStats(newPlayerIdx.value()).identity.publicHashString(); + std::string playerVerifiedStatus = (ingame.VerifiedIdentity[newPlayerIdx.value()]) ? "V" : "?"; + std::string playerName = NetPlay.players[newPlayerIdx.value()].name; + std::string playerNameB64 = base64Encode(std::vector(playerName.begin(), playerName.end())); + wz_command_interface_output("WZEVENT: movedSpecToPlayer: %" PRIu32 " -> %" PRIu32 " %s %s %s %s %s\n", playerIdx, newPlayerIdx.value(), playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[newPlayerIdx.value()].IPtextAddress); + } + // Broadcast the swapped player info NETBroadcastTwoPlayerInfo(playerIdx, newPlayerIdx.value());