public static bool CanStartMatchmakingPrep(SquadController squadController, BuildingLookupController blc) { SquadRole role = squadController.StateManager.Role; bool flag = role == SquadRole.Owner || role == SquadRole.Officer; int highestLevelHQ = blc.GetHighestLevelHQ(); bool flag2 = highestLevelHQ >= GameConstants.WAR_PARTICIPANT_MIN_LEVEL; SquadWarStatusType currentStatus = squadController.WarManager.GetCurrentStatus(); bool flag3 = currentStatus == SquadWarStatusType.PhaseCooldown || currentStatus == SquadWarStatusType.PhaseOpen; SquadWarData currentSquadWar = squadController.WarManager.CurrentSquadWar; bool flag4 = currentSquadWar == null || currentSquadWar.RewardsProcessed; return(flag2 & flag & flag3 & flag4); }
private void OnNextButtonClicked(UXButton button) { this.Close(null); SquadController squadController = Service.SquadController; bool flag = squadController.StateManager.GetCurrentSquad() != null; BuildingLookupController buildingLookupController = Service.BuildingLookupController; int highestLevelHQ = buildingLookupController.GetHighestLevelHQ(); bool flag2 = SquadUtils.CanStartMatchmakingPrep(squadController, buildingLookupController); if (!flag) { Service.BILoggingController.TrackGameAction(highestLevelHQ.ToString(), "UI_squadwar_joinsquad", ServerTime.Time.ToString(), null); Service.ScreenController.AddScreen(new SquadJoinScreen()); } else if (flag2) { squadController.WarManager.StartMatchMakingPreparation(); } }
private void LogMemberAttemptingWarStart() { SquadController squadController = Service.SquadController; Squad currentSquad = squadController.StateManager.GetCurrentSquad(); string squadID = currentSquad.SquadID; int memberCount = currentSquad.MemberCount; int activeMemberCount = currentSquad.ActiveMemberCount; BuildingLookupController buildingLookupController = Service.BuildingLookupController; int highestLevelHQ = buildingLookupController.GetHighestLevelHQ(); Service.BILoggingController.TrackGameAction(highestLevelHQ.ToString(), "UI_squadwar_askforwar", string.Concat(new object[] { squadID, "|", memberCount, "|", activeMemberCount }), null); }