public static void SendDamagedEvent(GameObject damagedPedGo, GameObject attackingPedGo, float damageAmount) { NetStatus.ThrowIfNotOnServer(); foreach (var p in Player.AllPlayersEnumerable) { p.GetComponent <PedSync>().TargetDamagedEvent(p.connectionToClient, damagedPedGo, attackingPedGo, damageAmount); } }
public void InitializeOnServer(uint vehicleNetId, int vehicleModelId, int[] vehicleColors, string frameName, float mass, Rigidbody rigidbody) { NetStatus.ThrowIfNotOnServer(); m_net_vehicleNetId = vehicleNetId; m_net_vehicleModelId = vehicleModelId; m_net_vehicleColors = VehicleController.SerializeColors(vehicleColors); m_net_frameName = frameName; m_net_mass = mass; this.NetworkRigidBody.Rigidbody = rigidbody; this.NetworkRigidBody.UpdateServer(); }
public static bool IsClientActive() { return ! NetStatus.IsClientDisconnected (); }
/// <summary> /// Is client connected ? /// TODO: This method should be corrected to return: is client active. /// </summary> public static bool IsClient() { return NetStatus.IsClientConnected(); }