public static bool CanLeaveSquad() { bool result = true; SquadController squadController = Service.Get <SquadController>(); CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>(); Squad currentSquad = squadController.StateManager.GetCurrentSquad(); if (currentSquad == null) { return(result); } SquadWarStatusType currentStatus = squadController.WarManager.GetCurrentStatus(); if (currentStatus == SquadWarStatusType.PhaseCooldown) { return(result); } SquadMember squadMemberById = SquadUtils.GetSquadMemberById(currentSquad, currentPlayer.PlayerId); if (squadController.WarManager.IsMemberInWarParty(squadMemberById.MemberID) || squadController.WarManager.IsSquadMemberInWarOrMatchmaking(squadMemberById)) { result = false; } return(result); }
public static void SetSquadMemberRole(Squad squad, string memberId, SquadRole role) { SquadMember squadMemberById = SquadUtils.GetSquadMemberById(squad, memberId); if (squadMemberById != null) { squadMemberById.Role = role; } }
public static void RemoveSquadMember(Squad squad, string memberId) { SquadMember squadMemberById = SquadUtils.GetSquadMemberById(squad, memberId); if (squadMemberById != null && squad != null) { squad.MemberList.Remove(squadMemberById); squad.BattleScore -= squadMemberById.Score; squad.MemberCount--; } }
public unsafe static long $Invoke15(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(SquadUtils.GetSquadMemberById((Squad)GCHandledObjects.GCHandleToObject(*args), Marshal.PtrToStringUni(*(IntPtr *)(args + 1))))); }