예제 #1
0
        public void SendRotationAndElevation(float rotation, float elevation)
        {
            var msg = new UpdateRotationAndElevationMsg();

            msg.EntityId  = Entity.Entity.EntityId;
            msg.Rotation  = rotation;
            msg.Elevation = elevation;

            Sync.Layer.SendMessageToServer(ref msg);
        }
예제 #2
0
        private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            var turret = entity as MyLargeTurretBase;

            if (turret != null)
            {
                turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation);
            }
        }
예제 #3
0
        private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            var turret = entity as MyLargeTurretBase;

            if (turret != null)
            {
                turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation);
                if (Sync.IsServer)
                {
                    Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
                }
            }
        }
예제 #4
0
 private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var turret = entity as MyLargeTurretBase;
     if (turret != null)
     {
         turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation);
     }
 }
예제 #5
0
        public void SendRotationAndElevation(float rotation, float elevation)
        {
            var msg = new UpdateRotationAndElevationMsg();
            msg.EntityId = Entity.Entity.EntityId;
            msg.Rotation = rotation;
            msg.Elevation = elevation;

            Sync.Layer.SendMessageToAll(ref msg);
        }
예제 #6
0
 private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var turret = entity as MyLargeTurretBase;
     if (turret != null)
     {
         turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation);
         if (Sync.IsServer)
         {
             Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
         }
     }
 }