Server ignores kick votes if the client has already voted to kick the same player. Closes #615
This commit is contained in:
@@ -211,6 +211,11 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
kickVoters.Remove(voter);
|
||||
}
|
||||
|
||||
public bool HasKickVoteFrom(Client voter)
|
||||
{
|
||||
return kickVoters.Contains(voter);
|
||||
}
|
||||
|
||||
public bool HasKickVoteFromID(int id)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user