Пример #1
0
    //for server
    public void AddPlayer(GameObject player)
    {
        ConnectedPlayer newPeeper = PlayerList.Instance.Get(player);

        Peepers.Add(newPeeper);
        OnTabOpened.Invoke(newPeeper);
    }
Пример #2
0
    public void RemovePlayer(GameObject player)
    {
        ConnectedPlayer newPeeper = PlayerList.Instance.Get(player);

        OnTabClosed.Invoke(newPeeper);
        Peepers.Remove(newPeeper);
    }
Пример #3
0
 /// <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);
         }
     }
 }
Пример #4
0
 /// <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);
         }
     }
 }
Пример #5
0
    /// <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);
            }
        }
    }
Пример #6
0
 public void RemovePlayer(GameObject player)
 {
     Peepers.Remove(PlayerList.Instance.Get(player));
 }
Пример #7
0
 //for server
 public void AddPlayer(GameObject player)
 {
     Peepers.Add(PlayerList.Instance.Get(player));
 }