Ejemplo n.º 1
0
        public static void SendMissileCreated(IMyMissileGunObject launcher, Vector3 position, Vector3 initialVelocity, Vector3 direction, float customMaxDistance, MyAmmoBase.MyAmmoBaseFlags flags, long owner)
        {
            Debug.Assert(Sync.IsServer, "Only server can shoot missiles!");
            Debug.Assert(launcher is MyEntity, "Missile launching object should be an entity!");

            if (!Sync.IsServer || !(launcher is MyEntity))
                return;

            MissileShootMsg msg = new MissileShootMsg();
            msg.Position = position;
            msg.InitialVelocity = initialVelocity;
            msg.Direction = direction;
            msg.CustomMaxDistance = customMaxDistance;
            msg.Flags = flags;
            msg.LauncherEntityId = (launcher as MyEntity).EntityId;
            msg.Owner = owner;

            Sync.Layer.SendMessageToAll(ref msg);
        }
Ejemplo n.º 2
0
        public static void SendMissileCreated(IMyMissileGunObject launcher, Vector3 position, Vector3 initialVelocity, Vector3 direction, float customMaxDistance, MyAmmoBase.MyAmmoBaseFlags flags, long owner)
        {
            Debug.Assert(Sync.IsServer, "Only server can shoot missiles!");
            Debug.Assert(launcher is MyEntity, "Missile launching object should be an entity!");

            if (!Sync.IsServer || !(launcher is MyEntity))
            {
                return;
            }

            MissileShootMsg msg = new MissileShootMsg();

            msg.Position          = position;
            msg.InitialVelocity   = initialVelocity;
            msg.Direction         = direction;
            msg.CustomMaxDistance = customMaxDistance;
            msg.Flags             = flags;
            msg.LauncherEntityId  = (launcher as MyEntity).EntityId;
            msg.Owner             = owner;

            Sync.Layer.SendMessageToAll(msg);
        }