v1.6.17.0 (Unto the Breach update)
This commit is contained in:
@@ -374,13 +374,32 @@ namespace Barotrauma
|
||||
msg.WriteBoolean(GameMain.Server.ServerSettings.AllowSubVoting);
|
||||
if (GameMain.Server.ServerSettings.AllowSubVoting)
|
||||
{
|
||||
IReadOnlyDictionary<SubmarineInfo, int> voteList = GetVoteCounts<SubmarineInfo>(VoteType.Sub, GameMain.Server.ConnectedClients);
|
||||
bool isMultiSub = GameMain.NetLobbyScreen.SelectedMode == GameModePreset.PvP;
|
||||
msg.WriteBoolean(isMultiSub);
|
||||
|
||||
var subVoters = isMultiSub ?
|
||||
GameMain.Server.ConnectedClients.Where(static c => c.PreferredTeam is CharacterTeamType.Team1) :
|
||||
GameMain.Server.ConnectedClients;
|
||||
|
||||
IReadOnlyDictionary<SubmarineInfo, int> voteList = GetVoteCounts<SubmarineInfo>(VoteType.Sub, subVoters);
|
||||
msg.WriteByte((byte)voteList.Count);
|
||||
foreach (KeyValuePair<SubmarineInfo, int> vote in voteList)
|
||||
{
|
||||
msg.WriteByte((byte)vote.Value);
|
||||
msg.WriteString(vote.Key.Name);
|
||||
}
|
||||
|
||||
if (isMultiSub)
|
||||
{
|
||||
var separatistsVotes = GetVoteCounts<SubmarineInfo>(VoteType.Sub, GameMain.Server.ConnectedClients.Where(static c => c.PreferredTeam is CharacterTeamType.Team2));
|
||||
msg.WriteByte((byte)separatistsVotes.Count);
|
||||
|
||||
foreach (var (info, amount) in separatistsVotes)
|
||||
{
|
||||
msg.WriteByte((byte)amount);
|
||||
msg.WriteString(info.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
msg.WriteBoolean(GameMain.Server.ServerSettings.AllowModeVoting);
|
||||
if (GameMain.Server.ServerSettings.AllowModeVoting)
|
||||
|
||||
Reference in New Issue
Block a user