Ejemplo n.º 1
0
        static void TargetPositionRequest(ref TargetPositionMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(msg.EntityId, out entity);
            if (entity is MyLargeTurretBase)
            {
                Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
            }
        }
Ejemplo n.º 2
0
        static void TargetPositionSuccess(ref TargetPositionMsg msg, MyNetworkClient sender)
        {
            MyEntity entity;

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

            if (turret != null)
            {
                turret.TargetPosition(msg.TargetPos, msg.TargetVelocity, msg.UsePrediction);
            }
        }
Ejemplo n.º 3
0
        public void SendTargetPosition(Vector3D targetPos, Vector3?targetVelocity = null)
        {
            var msg = new TargetPositionMsg();

            msg.EntityId  = m_turret.EntityId;
            msg.TargetPos = targetPos;
            if (targetVelocity.HasValue)
            {
                msg.TargetVelocity = targetVelocity.Value;
                msg.UsePrediction  = true;
            }
            else
            {
                msg.UsePrediction = false;
            }

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }
Ejemplo n.º 4
0
 static void TargetPositionSuccess(ref TargetPositionMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     var turret = entity as MyLargeTurretBase;
     if (turret != null)
     {            
         turret.TargetPosition(msg.TargetPos,msg.TargetVelocity,msg.UsePrediction);
     }
 }
Ejemplo n.º 5
0
 static void TargetPositionRequest(ref TargetPositionMsg msg, MyNetworkClient sender)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(msg.EntityId, out entity);
     if (entity is MyLargeTurretBase)
     {
         Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success);
     }
 }
Ejemplo n.º 6
0
        public void SendTargetPosition(Vector3D targetPos,Vector3? targetVelocity = null)
        {
            var msg = new TargetPositionMsg();

            msg.EntityId = m_turret.EntityId;
            msg.TargetPos = targetPos;
            if (targetVelocity.HasValue)
            {
                msg.TargetVelocity = targetVelocity.Value;
                msg.UsePrediction = true;
            }
            else
            {
                msg.UsePrediction = false;
            }

            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request);
        }