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); }
public virtual void RemovePlayerSpawn(GameObject spawn) { ServerManagement serverManagement = ServerManagement.Get(); if (serverManagement) { serverManagement.RemovePlayerSpawn(spawn); } }
public virtual void RemovePlayerSpawn(GameObject spawn) { ServerManagement management = ServerManagement.Get(); if (management != null) { management.RemovePlayerSpawn(spawn); } }
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); }
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); }
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)); }
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)); }
public virtual void AddPlayerSpawn(GameObject spawn) { ServerManagement.Get().AddPlayerSpawn(spawn); }
/// <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); }
public static new RustServerManagement Get() { return((RustServerManagement)ServerManagement.Get()); }
public void RequestRespawn_InCamp() { this.OutroAnimations(); ServerManagement.Get().networkView.RPC <bool>("RequestRespawn", uLink.RPCMode.Server, true); }