Exemplo n.º 1
0
    protected static bool GetOrigin(uLink.NetworkPlayer player, bool eyes, out Vector3 origin)
    {
        PlayerClient     playerClient;
        Transform        transforms;
        ServerManagement serverManagement = ServerManagement.Get();

        if (serverManagement && serverManagement.GetPlayerClient(player, out playerClient))
        {
            Controllable controllable = playerClient.controllable;
            if (controllable)
            {
                Character component = controllable.GetComponent <Character>();
                if (!component)
                {
                    transforms = controllable.transform;
                }
                else
                {
                    transforms = (!eyes || !component.eyesTransformReadOnly ? component.transform : component.eyesTransformReadOnly);
                }
                origin = transforms.position;
                return(true);
            }
        }
        origin = new Vector3();
        return(false);
    }
Exemplo n.º 2
0
    public virtual void RemovePlayerSpawn(GameObject spawn)
    {
        ServerManagement serverManagement = ServerManagement.Get();

        if (serverManagement)
        {
            serverManagement.RemovePlayerSpawn(spawn);
        }
    }
Exemplo n.º 3
0
    public virtual void RemovePlayerSpawn(GameObject spawn)
    {
        ServerManagement management = ServerManagement.Get();

        if (management != null)
        {
            management.RemovePlayerSpawn(spawn);
        }
    }
Exemplo n.º 4
0
    public static IEnumerable <PlayerClient> FindAllWithString(string partialNameOrIDInt)
    {
        ServerManagement management = ServerManagement.Get();

        if ((management != null) && !string.IsNullOrEmpty(partialNameOrIDInt))
        {
            return(management.FindPlayerClientsByString(partialNameOrIDInt));
        }
        return(EmptyArray <PlayerClient> .emptyEnumerable);
    }
Exemplo n.º 5
0
    public static IEnumerable <PlayerClient> FindAllWithName(string name, StringComparison comparison)
    {
        ServerManagement management;

        if (!string.IsNullOrEmpty(name) && ((management = ServerManagement.Get()) != null))
        {
            return(management.FindPlayerClientsByName(name, comparison));
        }
        return(EmptyArray <PlayerClient> .emptyEnumerable);
    }
Exemplo n.º 6
0
    private ActivationResult ActRoute(bool?on, uLink.NetworkPlayer sender, ulong timestamp)
    {
        PlayerClient     playerClient;
        ServerManagement serverManagement = ServerManagement.Get();

        if (!serverManagement)
        {
            playerClient = null;
        }
        else
        {
            serverManagement.GetPlayerClient(sender, out playerClient);
        }
        return(this.ActRoute(on, playerClient, timestamp));
    }
Exemplo n.º 7
0
    private ActivationResult ActRoute(bool?on, NetworkPlayer sender, ulong timestamp)
    {
        PlayerClient     client;
        ServerManagement management = ServerManagement.Get();

        if (management != null)
        {
            management.GetPlayerClient(sender, out client);
        }
        else
        {
            client = null;
        }
        return(this.ActRoute(on, client, timestamp));
    }
Exemplo n.º 8
0
 public virtual void AddPlayerSpawn(GameObject spawn)
 {
     ServerManagement.Get().AddPlayerSpawn(spawn);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Kicks this player from the game
 /// </summary>
 /// <param name="reason"></param>
 public void Kick(string reason)
 {
     ServerManagement.Get().networkView.RPC("KP", netUser.networkPlayer, reason);
     NetCull.CloseConnection(netUser.networkPlayer, true);
 }
Exemplo n.º 10
0
 public static new RustServerManagement Get()
 {
     return((RustServerManagement)ServerManagement.Get());
 }
Exemplo n.º 11
0
 public void RequestRespawn_InCamp()
 {
     this.OutroAnimations();
     ServerManagement.Get().networkView.RPC <bool>("RequestRespawn", uLink.RPCMode.Server, true);
 }