示例#1
0
        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);
            }
        }
示例#2
0
        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();
        }
示例#3
0
 public static bool IsClientActive()
 {
     return ! NetStatus.IsClientDisconnected ();
 }
示例#4
0
 /// <summary>
 /// Is client connected ?
 /// TODO: This method should be corrected to return: is client active.
 /// </summary>
 public static bool IsClient()
 {
     return NetStatus.IsClientConnected();
 }