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

Initial blind lobby / game support (part 1) #4175

Merged
merged 17 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use getPlayerName() in more places
  • Loading branch information
past-due committed Jan 29, 2025
commit 4d2011ba6693c79fa5b4cbf7bfc0393eaf75119f
8 changes: 4 additions & 4 deletions lib/netplay/netplay.cpp
Original file line number Diff line number Diff line change
@@ -2114,7 +2114,7 @@ bool NETmovePlayerToSpectatorOnlySlot(uint32_t playerIdx, bool hostOverride /*=
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 playerName = getPlayerName(newSpecIdx);
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(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);
}
@@ -2174,7 +2174,7 @@ SpectatorToPlayerMoveResult NETmoveSpectatorToPlayerSlot(uint32_t playerIdx, opt
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 playerName = getPlayerName(newPlayerIdx.value());
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(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);
}
@@ -4328,11 +4328,11 @@ static void NETallowJoining()

char buf[250] = {'\0'};
const char* pPlayerType = (NetPlay.players[index].isSpectator) ? "Spectator" : "Player";
snprintf(buf, sizeof(buf), "%s[%" PRIu8 "] %s has joined, IP is: %s", pPlayerType, index, NetPlay.players[index].name, NetPlay.players[index].IPtextAddress);
snprintf(buf, sizeof(buf), "%s[%" PRIu8 "] %s has joined, IP is: %s", pPlayerType, index, getPlayerName(index), NetPlay.players[index].IPtextAddress);
debug(LOG_INFO, "%s", buf);
NETlogEntry(buf, SYNC_FLAG, index);

debug(LOG_NET, "%s, %s, with index of %u has joined using socket %p", pPlayerType, NetPlay.players[index].name, (unsigned int)index, static_cast<void *>(connected_bsocket[index]));
debug(LOG_NET, "%s, %s, with index of %u has joined using socket %p", pPlayerType, getPlayerName(index), (unsigned int)index, static_cast<void *>(connected_bsocket[index]));

// Increment player count
gamestruct.desc.dwCurrentPlayers++;
2 changes: 1 addition & 1 deletion src/gamehistorylogger.cpp
Original file line number Diff line number Diff line change
@@ -333,7 +333,7 @@ void GameStoryLogger::logStartGame()
for (int i = 0; i < game.maxPlayers; i++)
{
FixedPlayerAttributes playerAttrib;
playerAttrib.name = NetPlay.players[i].name;
playerAttrib.name = (strlen(NetPlay.players[i].name) == 0) ? "" : getPlayerName(i);
playerAttrib.position = NetPlay.players[i].position;
playerAttrib.team = NetPlay.players[i].team;
playerAttrib.colour = NetPlay.players[i].colour;
4 changes: 2 additions & 2 deletions src/hci/quickchat.cpp
Original file line number Diff line number Diff line change
@@ -2447,8 +2447,8 @@ namespace INTERNAL_ADMIN_ACTION_NOTICE {
return std::string();
}

const char* responsiblePlayerName = NetPlay.players[responsiblePlayerIdx].name;
const char* targetPlayerName = NetPlay.players[targetPlayerIdx].name;
const char* responsiblePlayerName = getPlayerName(responsiblePlayerIdx);
const char* targetPlayerName = getPlayerName(targetPlayerIdx);

const char* responsiblePlayerType = _("Player");
if (responsiblePlayerIdx == NetPlay.hostPlayer)
20 changes: 10 additions & 10 deletions src/multiint.cpp
Original file line number Diff line number Diff line change
@@ -2510,7 +2510,7 @@ static void informIfAdminChangedOtherTeam(uint32_t targetPlayerIdx, uint32_t res
sendQuickChat(WzQuickChatMessage::INTERNAL_ADMIN_ACTION_NOTICE, realSelectedPlayer, WzQuickChatTargeting::targetAll(), WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::constructMessageData(WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::Context::Team, responsibleIdx, targetPlayerIdx));

std::string senderPublicKeyB64 = base64Encode(getMultiStats(responsibleIdx).identity.toBytes(EcKey::Public));
debug(LOG_INFO, "Admin %s (%s) changed team of player ([%u] %s) to: %d", NetPlay.players[responsibleIdx].name, senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].position, NetPlay.players[targetPlayerIdx].name, NetPlay.players[targetPlayerIdx].team);
debug(LOG_INFO, "Admin %s (%s) changed team of player ([%u] %s) to: %d", getPlayerName(responsibleIdx), senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].position, getPlayerName(targetPlayerIdx), NetPlay.players[targetPlayerIdx].team);
}

static bool changeTeam(UBYTE player, UBYTE team, uint32_t responsibleIdx)
@@ -2598,7 +2598,7 @@ bool recvTeamRequest(NETQUEUE queue)
{
resetReadyStatus(false);
}
debug(LOG_NET, "%s is now part of team: %d", NetPlay.players[player].name, (int) team);
debug(LOG_NET, "%s is now part of team: %d", getPlayerName(player), (int) team);
return changeTeam(player, team, queue.index); // we do this regardless, in case of sync issues
}

@@ -2612,7 +2612,7 @@ static bool SendReadyRequest(UBYTE player, bool bReady)
std::string playerPublicKeyB64 = base64Encode(getMultiStats(player).identity.toBytes(EcKey::Public));
std::string playerIdentityHash = getMultiStats(player).identity.publicHashString();
std::string playerVerifiedStatus = (ingame.VerifiedIdentity[player]) ? "V" : "?";
std::string playerName = NetPlay.players[player].name;
std::string playerName = getPlayerName(player);
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(playerName.begin(), playerName.end()));
wz_command_interface_output("WZEVENT: readyStatus=%d: %" PRIu32 " %s %s %s %s %s\n", bReady ? 1 : 0, player, playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[player].IPtextAddress);

@@ -2667,7 +2667,7 @@ bool recvReadyRequest(NETQUEUE queue)
if (stats.identity.empty() && bReady && !NetPlay.players[player].isSpectator)
{
// log this!
debug(LOG_INFO, "Player has empty identity: (player: %u, name: \"%s\", IP: %s)", (unsigned)player, NetPlay.players[player].name, NetPlay.players[player].IPtextAddress);
debug(LOG_INFO, "Player has empty identity: (player: %u, name: \"%s\", IP: %s)", (unsigned)player, getPlayerName(player), NetPlay.players[player].IPtextAddress);

// kick the player
HandleBadParam("NET_READY_REQUEST failed due to player empty identity.", player, queue.index);
@@ -2680,7 +2680,7 @@ bool recvReadyRequest(NETQUEUE queue)
std::string playerPublicKeyB64 = base64Encode(stats.identity.toBytes(EcKey::Public));
std::string playerIdentityHash = stats.identity.publicHashString();
std::string playerVerifiedStatus = (ingame.VerifiedIdentity[player]) ? "V" : "?";
std::string playerName = NetPlay.players[player].name;
std::string playerName = getPlayerName(player);
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(playerName.begin(), playerName.end()));
wz_command_interface_output("WZEVENT: readyStatus=%d: %" PRIu32 " %s %s %s %s %s\n", bReady ? 1 : 0, player, playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[player].IPtextAddress);

@@ -2712,7 +2712,7 @@ static void informIfAdminChangedOtherPosition(uint32_t targetPlayerIdx, uint32_t
sendQuickChat(WzQuickChatMessage::INTERNAL_ADMIN_ACTION_NOTICE, realSelectedPlayer, WzQuickChatTargeting::targetAll(), WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::constructMessageData(WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::Context::Position, responsibleIdx, targetPlayerIdx));

std::string senderPublicKeyB64 = base64Encode(getMultiStats(responsibleIdx).identity.toBytes(EcKey::Public));
debug(LOG_INFO, "Admin %s (%s) changed position of player (%s) to: %d", NetPlay.players[responsibleIdx].name, senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].name, NetPlay.players[targetPlayerIdx].position);
debug(LOG_INFO, "Admin %s (%s) changed position of player (%s) to: %d", getPlayerName(responsibleIdx), senderPublicKeyB64.c_str(), getPlayerName(targetPlayerIdx), NetPlay.players[targetPlayerIdx].position);
}

static bool changePosition(UBYTE player, UBYTE position, uint32_t responsibleIdx)
@@ -2765,7 +2765,7 @@ static void informIfAdminChangedOtherColor(uint32_t targetPlayerIdx, uint32_t re
sendQuickChat(WzQuickChatMessage::INTERNAL_ADMIN_ACTION_NOTICE, realSelectedPlayer, WzQuickChatTargeting::targetAll(), WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::constructMessageData(WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::Context::Color, responsibleIdx, targetPlayerIdx));

std::string senderPublicKeyB64 = base64Encode(getMultiStats(responsibleIdx).identity.toBytes(EcKey::Public));
debug(LOG_INFO, "Admin %s (%s) changed color of player ([%u] %s) to: [%d] %s", NetPlay.players[responsibleIdx].name, senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].position, NetPlay.players[targetPlayerIdx].name, NetPlay.players[targetPlayerIdx].colour, getPlayerColourName(targetPlayerIdx));
debug(LOG_INFO, "Admin %s (%s) changed color of player ([%u] %s) to: [%d] %s", getPlayerName(responsibleIdx), senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].position, getPlayerName(targetPlayerIdx), NetPlay.players[targetPlayerIdx].colour, getPlayerColourName(targetPlayerIdx));
}

bool changeColour(unsigned player, int col, uint32_t responsibleIdx)
@@ -2845,7 +2845,7 @@ static void informIfAdminChangedOtherFaction(uint32_t targetPlayerIdx, uint32_t
sendQuickChat(WzQuickChatMessage::INTERNAL_ADMIN_ACTION_NOTICE, realSelectedPlayer, WzQuickChatTargeting::targetAll(), WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::constructMessageData(WzQuickChatDataContexts::INTERNAL_ADMIN_ACTION_NOTICE::Context::Faction, responsibleIdx, targetPlayerIdx));

std::string senderPublicKeyB64 = base64Encode(getMultiStats(responsibleIdx).identity.toBytes(EcKey::Public));
debug(LOG_INFO, "Admin %s (%s) changed faction of player ([%u] %s) to: %s", NetPlay.players[responsibleIdx].name, senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].position, NetPlay.players[targetPlayerIdx].name, to_localized_string(static_cast<FactionID>(NetPlay.players[targetPlayerIdx].faction)));
debug(LOG_INFO, "Admin %s (%s) changed faction of player ([%u] %s) to: %s", getPlayerName(responsibleIdx), senderPublicKeyB64.c_str(), NetPlay.players[targetPlayerIdx].position, getPlayerName(targetPlayerIdx), to_localized_string(static_cast<FactionID>(NetPlay.players[targetPlayerIdx].faction)));
}

bool changeFaction(unsigned player, FactionID faction, uint32_t responsibleIdx)
@@ -6912,7 +6912,7 @@ class WzHostLobbyOperationsInterface : public HostLobbyOperationsInterface
std::string playerPublicKeyB64 = base64Encode(getMultiStats(player).identity.toBytes(EcKey::Public));
std::string playerIdentityHash = getMultiStats(player).identity.publicHashString();
std::string playerVerifiedStatus = (ingame.VerifiedIdentity[player]) ? "V" : "?";
std::string playerName = NetPlay.players[player].name;
std::string playerName = getPlayerName(player);
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(playerName.begin(), playerName.end()));
wz_command_interface_output("WZEVENT: hostChatPermissions=%s: %" PRIu32 " %" PRIu32 " %s %s %s %s %s\n", (freeChatEnabled) ? "Y" : "N", player, gameTime, playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[player].IPtextAddress);
}
@@ -8209,7 +8209,7 @@ void displayPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)
const PLAYERSTATS& stat = getMultiStats(j);
auto ar = stat.autorating;

std::string name = NetPlay.players[j].name;
std::string name = getPlayerName(j);

std::map<std::string, EcKey::Key> serverPlayers; // TODO Fill this with players known to the server (needs implementing on the server, too). Currently useless.

2 changes: 1 addition & 1 deletion src/multijoin.cpp
Original file line number Diff line number Diff line change
@@ -479,7 +479,7 @@ bool MultiPlayerLeave(UDWORD playerIndex)
std::string playerPublicKeyB64 = base64Encode(getMultiStats(playerIndex).identity.toBytes(EcKey::Public));
std::string playerIdentityHash = getMultiStats(playerIndex).identity.publicHashString();
std::string playerVerifiedStatus = (ingame.VerifiedIdentity[playerIndex]) ? "V" : "?";
std::string playerName = NetPlay.players[playerIndex].name;
std::string playerName = getPlayerName(playerIndex);
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(playerName.begin(), playerName.end()));
wz_command_interface_output("WZEVENT: playerLeft: %" PRIu32 " %" PRIu32 " %s %s %s %s %s\n", playerIndex, gameTime, playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[playerIndex].IPtextAddress);
}
4 changes: 2 additions & 2 deletions src/multiplay.cpp
Original file line number Diff line number Diff line change
@@ -1458,7 +1458,7 @@ bool recvMessage()
std::string playerPublicKeyB64 = base64Encode(getMultiStats(player_id).identity.toBytes(EcKey::Public));
std::string playerIdentityHash = getMultiStats(player_id).identity.publicHashString();
std::string playerVerifiedStatus = (ingame.VerifiedIdentity[player_id]) ? "V" : "?";
std::string playerName = NetPlay.players[player_id].name;
std::string playerName = getPlayerName(player_id);
std::string playerNameB64 = base64Encode(std::vector<unsigned char>(playerName.begin(), playerName.end()));
wz_command_interface_output("WZEVENT: playerResponding: %" PRIu32 " %s %s %s %s %s\n", player_id, playerPublicKeyB64.c_str(), playerIdentityHash.c_str(), playerVerifiedStatus.c_str(), playerNameB64.c_str(), NetPlay.players[player_id].IPtextAddress);

@@ -2466,7 +2466,7 @@ static bool recvBeacon(NETQUEUE queue)

debug(LOG_WZ, "Received beacon for player: %d, from: %d", receiver, sender);

sstrcat(msg, NetPlay.players[sender].name); // name
sstrcat(msg, getPlayerName(sender)); // name
sstrcpy(beaconReceiveMsg[sender], msg);

return addBeaconBlip(locX, locY, receiver, sender, beaconReceiveMsg[sender]);
16 changes: 8 additions & 8 deletions src/multistat.cpp
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ void lookupRatingAsync(uint32_t playerIndex)
req.setRequestHeader("WZ-Player-Hash", hash);
req.setRequestHeader("WZ-Player-Key", key);
req.setRequestHeader("WZ-Locale", getLanguage());
debug(LOG_INFO, "Requesting \"%s\" for player %d (%.32s) (%s)", req.url.c_str(), playerIndex, NetPlay.players[playerIndex].name, hash.c_str());
debug(LOG_INFO, "Requesting \"%s\" for player %d (%.32s) (%s)", req.url.c_str(), playerIndex, getPlayerName(playerIndex), hash.c_str());
req.onSuccess = [playerIndex, hash](std::string const &url, HTTPResponseDetails const &response, std::shared_ptr<MemoryStruct> const &data) {
long httpStatusCode = response.httpStatusCode();
std::string urlCopy = url;
@@ -225,7 +225,7 @@ bool swapPlayerMultiStatsLocal(uint32_t playerIndexA, uint32_t playerIndexB)
generateSessionKeysWithPlayer(playerIndexA);
}
catch (const std::invalid_argument& e) {
debug(LOG_INFO, "Cannot create session keys: (self: %u), (other: %u, name: \"%s\"), with error: %s", realSelectedPlayer, playerIndexA, NetPlay.players[playerIndexA].name, e.what());
debug(LOG_INFO, "Cannot create session keys: (self: %u), (other: %u, name: \"%s\"), with error: %s", realSelectedPlayer, playerIndexA, getPlayerName(playerIndexA), e.what());
}
}
if (playerIndexB != realSelectedPlayer && (playerIndexB < MAX_PLAYERS || playerIndexB == NetPlay.hostPlayer))
@@ -234,7 +234,7 @@ bool swapPlayerMultiStatsLocal(uint32_t playerIndexA, uint32_t playerIndexB)
generateSessionKeysWithPlayer(playerIndexB);
}
catch (const std::invalid_argument& e) {
debug(LOG_INFO, "Cannot create session keys: (self: %u), (other: %u, name: \"%s\"), with error: %s", realSelectedPlayer, playerIndexB, NetPlay.players[playerIndexB].name, e.what());
debug(LOG_INFO, "Cannot create session keys: (self: %u), (other: %u, name: \"%s\"), with error: %s", realSelectedPlayer, playerIndexB, getPlayerName(playerIndexB), e.what());
}
}
return true;
@@ -358,18 +358,18 @@ bool multiStatsSetIdentity(uint32_t playerIndex, const EcKey::Key &identity, boo
{
if (!playerStats[playerIndex].identity.fromBytes(identity, EcKey::Public))
{
debug(LOG_INFO, "Player sent invalid identity: (player: %u, name: \"%s\", IP: %s)", playerIndex, NetPlay.players[playerIndex].name, NetPlay.players[playerIndex].IPtextAddress);
debug(LOG_INFO, "Player sent invalid identity: (player: %u, name: \"%s\", IP: %s)", playerIndex, getPlayerName(playerIndex), NetPlay.players[playerIndex].IPtextAddress);
}
}
else
{
debug(LOG_INFO, "Player sent empty identity: (player: %u, name: \"%s\", IP: %s)", playerIndex, NetPlay.players[playerIndex].name, NetPlay.players[playerIndex].IPtextAddress);
debug(LOG_INFO, "Player sent empty identity: (player: %u, name: \"%s\", IP: %s)", playerIndex, getPlayerName(playerIndex), NetPlay.players[playerIndex].IPtextAddress);
}
if ((identity != prevIdentity) || identity.empty())
{
if (GetGameMode() == GS_NORMAL)
{
debug(LOG_INFO, "Unexpected identity change after NET_FIREUP for: (player: %u, name: \"%s\", IP: %s)", playerIndex, NetPlay.players[playerIndex].name, NetPlay.players[playerIndex].IPtextAddress);
debug(LOG_INFO, "Unexpected identity change after NET_FIREUP for: (player: %u, name: \"%s\", IP: %s)", playerIndex, getPlayerName(playerIndex), NetPlay.players[playerIndex].IPtextAddress);
}

ingame.PingTimes[playerIndex] = PING_LIMIT;
@@ -404,7 +404,7 @@ bool multiStatsSetIdentity(uint32_t playerIndex, const EcKey::Key &identity, boo
{
std::string senderPublicKeyB64 = base64Encode(playerStats[playerIndex].identity.toBytes(EcKey::Public));
std::string senderIdentityHash = playerStats[playerIndex].identity.publicHashString();
std::string sendername = NetPlay.players[playerIndex].name;
std::string sendername = getPlayerName(playerIndex);
std::string senderNameB64 = base64Encode(std::vector<unsigned char>(sendername.begin(), sendername.end()));
wz_command_interface_output("WZEVENT: player identity UNVERIFIED: %" PRIu32 " %s %s %s %s\n", playerIndex, senderPublicKeyB64.c_str(), senderIdentityHash.c_str(), senderNameB64.c_str(), NetPlay.players[playerIndex].IPtextAddress);
}
@@ -433,7 +433,7 @@ bool multiStatsSetIdentity(uint32_t playerIndex, const EcKey::Key &identity, boo
generateSessionKeysWithPlayer(playerIndex);
}
catch (const std::invalid_argument& e) {
debug(LOG_INFO, "Cannot create session keys: (self: %u), (other: %u, name: \"%s\", IP: %s), with error: %s", realSelectedPlayer, playerIndex, NetPlay.players[playerIndex].name, NetPlay.players[playerIndex].IPtextAddress, e.what());
debug(LOG_INFO, "Cannot create session keys: (self: %u), (other: %u, name: \"%s\", IP: %s), with error: %s", realSelectedPlayer, playerIndex, getPlayerName(playerIndex), NetPlay.players[playerIndex].IPtextAddress, e.what());
}
}
else
4 changes: 3 additions & 1 deletion src/multivote.cpp
Original file line number Diff line number Diff line change
@@ -158,14 +158,16 @@ uint8_t getLobbyChangeVoteTotal()

static void recvLobbyChangeVote(uint32_t player, uint8_t newVote)
{
ASSERT_OR_RETURN(, player < MAX_PLAYERS, "Invalid sender: %" PRIu32, player);

playerVotes[player] = (newVote == 1) ? 1 : 0;

debug(LOG_NET, "total votes: %d/%d", static_cast<int>(getLobbyChangeVoteTotal()), static_cast<int>(NET_numHumanPlayers()));

// there is no "votes" that disallows map change so assume they are all allowing
if(newVote == 1) {
char msg[128] = {0};
ssprintf(msg, _("%s (%d) allowed map change. Total: %d/%d"), NetPlay.players[player].name, player, static_cast<int>(getLobbyChangeVoteTotal()), static_cast<int>(NET_numHumanPlayers()));
ssprintf(msg, _("%s (%d) allowed map change. Total: %d/%d"), getPlayerName(player), player, static_cast<int>(getLobbyChangeVoteTotal()), static_cast<int>(NET_numHumanPlayers()));
sendRoomSystemMessage(msg);
}
}
Loading