Exemplo n.º 1
0
        static void ShootBeginCallback(MySyncControllableEntity sync, ref ShootBeginMsg msg, MyNetworkClient sender)
        {
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
            }

            bool wouldCallStartTwice = Sync.IsServer && sender.IsGameServer();

            if (!wouldCallStartTwice)
            {
                sync.StartShooting(msg.Action, msg.Direction);
            }
        }
Exemplo n.º 2
0
        public void BeginShoot(Vector3 direction, MyShootActionEnum action = MyShootActionEnum.PrimaryAction)
        {
            ShootBeginMsg msg = new ShootBeginMsg();

            msg.EntityId  = SyncedEntityId;
            msg.Direction = direction;
            msg.Action    = action;

            MySession.Static.SyncLayer.SendMessageToServer(ref msg);

            StartShooting(action, direction);
            m_lastShootDirectionUpdate = MySandboxGame.TotalGamePlayTimeInMilliseconds;

            if (MyFakes.SIMULATE_QUICK_TRIGGER)
            {
                EndShootInternal(action);
            }
        }
        static void ShootBeginCallback(MySyncControllableEntity sync, ref ShootBeginMsg msg, MyNetworkClient sender)
        {
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
            }

            bool wouldCallStartTwice = Sync.IsServer && sender.IsGameServer();
            if (!wouldCallStartTwice)
                sync.StartShooting(msg.Action, msg.Direction);
        }
        public void BeginShoot(Vector3 direction, MyShootActionEnum action = MyShootActionEnum.PrimaryAction)
        {
            ShootBeginMsg msg = new ShootBeginMsg();
            msg.EntityId = SyncedEntityId;
            msg.Direction = direction;
            msg.Action = action;

            MySession.Static.SyncLayer.SendMessageToServer(ref msg);

            StartShooting(action, direction);
            m_lastShootDirectionUpdate = MySandboxGame.TotalGamePlayTimeInMilliseconds;

            if (MyFakes.SIMULATE_QUICK_TRIGGER)
                EndShootInternal(action);
        }