Server ignores kick votes if the client has already voted to kick the same player. Closes #615

This commit is contained in:
Joonas Rikkonen
2018-08-11 17:29:03 +03:00
parent d98de2c305
commit 091dcf35e6
2 changed files with 6 additions and 1 deletions

View File

@@ -211,6 +211,11 @@ namespace Barotrauma.Networking
{
kickVoters.Remove(voter);
}
public bool HasKickVoteFrom(Client voter)
{
return kickVoters.Contains(voter);
}
public bool HasKickVoteFromID(int id)
{

View File

@@ -122,7 +122,7 @@ namespace Barotrauma
byte kickedClientID = inc.ReadByte();
Client kicked = GameMain.Server.ConnectedClients.Find(c => c.ID == kickedClientID);
if (kicked != null)
if (kicked != null && !kicked.HasKickVoteFrom(sender))
{
kicked.AddKickVote(sender);
Client.UpdateKickVotes(GameMain.Server.ConnectedClients);