Exemple #1
0
 private static void AddPlayer(AutoTurret turret, PlayerNameID playerNameId)
 {
     RemovePlayer(turret, playerNameId.userid);
     turret.authorizedPlayers.Add(playerNameId);
     turret.target = null;
     turret.SendNetworkUpdate();
 }
Exemple #2
0
 private static IEnumerator AddPlayer(PlayerNameID playerNameId)
 {
     foreach (AutoTurret turret in turrets)
     {
         AddPlayer(turret, playerNameId);
         yield return(new WaitForFixedUpdate());
     }
 }
 // constructor
 public PlayerUI(BasePlayer player)
 {
     _player = player;
     nameId  = new PlayerNameID()
     {
         userid   = player.userID,
         username = player.displayName
     };
 }
Exemple #4
0
        private static PlayerNameID GetPlayerNameId(BasePlayer player)
        {
            var playerNameId = new PlayerNameID()
            {
                userid   = player.userID,
                username = player.displayName
            };

            return(playerNameId);
        }
Exemple #5
0
 public void AddPlayer(BasePlayer player)
 {
     if (!AtMaxAuthCapacity())
     {
         authorizedPlayers.RemoveAll((PlayerNameID x) => x.userid == player.userID);
         PlayerNameID playerNameID = new PlayerNameID();
         playerNameID.userid   = player.userID;
         playerNameID.username = player.displayName;
         authorizedPlayers.Add(playerNameID);
         UpdateMaxAuthCapacity();
     }
 }
Exemple #6
0
        private PlayerNameID GrabPlayer(BasePlayer player)
        {
            if (player == null)
            {
                return(null);
            }

            PlayerNameID playerNameID = new PlayerNameID()
            {
                userid   = player.userID,
                username = player.displayName
            };

            return(playerNameID);
        }
Exemple #7
0
    private void AddSelfAuthorize(RPCMessage rpc)
    {
        RPCMessage rpc2 = rpc;

        if (!IsOnline() && rpc2.player.CanBuild() && !AtMaxAuthCapacity() && Interface.CallHook("OnTurretAuthorize", this, rpc.player) == null)
        {
            authorizedPlayers.RemoveAll((PlayerNameID x) => x.userid == rpc2.player.userID);
            PlayerNameID playerNameID = new PlayerNameID();
            playerNameID.userid   = rpc2.player.userID;
            playerNameID.username = rpc2.player.displayName;
            authorizedPlayers.Add(playerNameID);
            UpdateMaxAuthCapacity();
            SendNetworkUpdate();
        }
    }
    private void AddSelfAuthorize(BaseEntity.RPCMessage rpc)
    {
        if (this.IsOnline())
        {
            return;
        }
        if (Interface.CallHook("OnTurretAuthorize", this, rpc.player) != null)
        {
            return;
        }
        this.authorizedPlayers.RemoveAll((PlayerNameID x) => x.userid == rpc.player.userID);
        PlayerNameID playerNameID = new PlayerNameID()
        {
            userid   = rpc.player.userID,
            username = rpc.player.displayName
        };

        this.authorizedPlayers.Add(playerNameID);
        base.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
    }
    public void AddSelfAuthorize(BaseEntity.RPCMessage rpc)
    {
        if (!rpc.player.CanInteract())
        {
            return;
        }
        if (!this.CanAdministrate(rpc.player))
        {
            return;
        }
        if (Interface.CallHook("OnCupboardAuthorize", this, rpc.player) != null)
        {
            return;
        }
        this.authorizedPlayers.RemoveAll((PlayerNameID x) => x.userid == rpc.player.userID);
        PlayerNameID playerNameID = new PlayerNameID()
        {
            userid   = rpc.player.userID,
            username = rpc.player.displayName
        };

        this.authorizedPlayers.Add(playerNameID);
        base.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
    }
Exemple #10
0
 private static void Auth(AutoTurret turret, PlayerNameID playerNameId)
 {
     turret.authorizedPlayers.Add(playerNameId);
     turret.SendNetworkUpdate();
 }