Exemplo n.º 1
0
        public void SendBeginShootMessage()
        {
            m_block.SyncRotationAndOrientation();
            m_block.BeginShoot();
            var msg = new BeginShootMessage();

            msg.EntityId = m_block.EntityId;
            Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Success);
        }
        static void BeginShootSuccess(ref BeginShootMessage msg, MyNetworkClient sender)
        {
            MyUserControllableGun block = null;

            MyEntities.TryGetEntityById(msg.EntityId, out block);
            if (block != null)
            {
                block.BeginShoot();
            }
        }
Exemplo n.º 3
0
        static void BeginShootSuccess(ref BeginShootMessage msg, MyNetworkClient sender)
        {
            MyUserControllableGun block = null;

            MyEntities.TryGetEntityById(msg.EntityId, out block);
            if (block != null)
            {
                block.BeginShoot();
                if (Sync.IsServer)
                {
                    Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId, MyTransportMessageEnum.Success);
                }
            }
        }