コード例 #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);
    }
コード例 #2
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));
    }
コード例 #3
0
ファイル: Activatable.cs プロジェクト: salvadj1/RustSource
    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));
    }