Skip to content

Commit 64ff99c

Browse files
committed
add playerisdefender
1 parent 20d72b4 commit 64ff99c

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Shared/LobbyClient/Protocol/Messages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ public class VoteOption
704704
public string PlanetName { get; set; }
705705
public bool CanSelectForBattle { get; set; }
706706
public bool PlayerIsAttacker { get; set; }
707+
public bool PlayerIsDefender { get; set; }
707708
}
708709
}
709710

ZkLobbyServer/SpringieInterface/PlanetWarsMatchMaker.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ public PwMatchCommand GenerateLobbyCommand(string playerName = null, string play
684684
var volunteered = DefenderVotes.ContainsKey(planetId) ? DefenderVotes[planetId].Count : 0;
685685

686686
var playerIsAttacker = playerName != null && squads.Any(s => s.Attackers.Contains(playerName));
687+
var playerIsDefender = playerName != null && DefenderVotes.ContainsKey(planetId) && DefenderVotes[planetId].Contains(playerName);
687688
var canDefend = playerFactionId != null && defFactionCache[planetId].Any(f => f.FactionID == playerFactionId);
688689

689690
options.Add(new PwMatchCommand.VoteOption
@@ -697,7 +698,8 @@ public PwMatchCommand GenerateLobbyCommand(string playerName = null, string play
697698
Count = volunteered,
698699
Needed = totalNeeded,
699700
CanSelectForBattle = canDefend && !playerIsAttacker,
700-
PlayerIsAttacker = playerIsAttacker
701+
PlayerIsAttacker = playerIsAttacker,
702+
PlayerIsDefender = playerIsDefender
701703
});
702704
}
703705

0 commit comments

Comments
 (0)