//for server public void AddPlayer(GameObject player) { ConnectedPlayer newPeeper = PlayerList.Instance.Get(player); Peepers.Add(newPeeper); OnTabOpened.Invoke(newPeeper); }
public void RemovePlayer(GameObject player) { ConnectedPlayer newPeeper = PlayerList.Instance.Get(player); OnTabClosed.Invoke(newPeeper); Peepers.Remove(newPeeper); }
/// <summary> /// Not sending updates and closing tab for players that don't pass the validation anymore /// </summary> public void ValidatePeepers() { foreach (var peeper in Peepers.ToArray()) { bool validate = peeper.Script && !peeper.Script.canNotInteract() && peeper.Script.IsInReach(Provider, true); if (!validate) { TabUpdateMessage.Send(peeper.GameObject, Provider, Type, TabAction.Close); } } }
/// <summary> /// Not sending updates and closing tab for players that don't pass the validation anymore /// </summary> public void ValidatePeepers() { foreach (var peeper in Peepers.ToArray()) { bool validate = peeper.Script && Validations.CanApply(peeper.Script, Provider, NetworkSide.Server); if (!validate) { TabUpdateMessage.Send(peeper.GameObject, Provider, Type, TabAction.Close); } } }
/// <summary> /// Not sending updates and closing tab for players that don't pass the validation anymore /// </summary> public void ValidatePeepers() { foreach (var peeper in Peepers.ToArray()) { bool canApply = Validations.CanApply(peeper.Script, Provider, NetworkSide.Server); if (peeper.Script == false || canApply == false) { //Validate for AI if (peeper.Script.PlayerState == PlayerScript.PlayerStates.Ai) { if (Validations.CanApply(new AiActivate(peeper.GameObject, null, Provider, Intent.Help, AiActivate.ClickTypes.NormalClick), NetworkSide.Server)) { continue; } } TabUpdateMessage.Send(peeper.GameObject, Provider, Type, TabAction.Close); } } }
public void RemovePlayer(GameObject player) { Peepers.Remove(PlayerList.Instance.Get(player)); }
//for server public void AddPlayer(GameObject player) { Peepers.Add(PlayerList.Instance.Get(player)); }