v1.6.17.0 (Unto the Breach update)

This commit is contained in:
Regalis11
2024-10-22 17:29:04 +03:00
parent e74b3cdb17
commit 6e6c17e100
417 changed files with 17166 additions and 5870 deletions
@@ -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)