Esempio n. 1
0
        private GameServerPacket InternalReceive()
        {
            m_lastAction = DateTime.Now;
            int len = m_reader.ReadInt16();
            GameServerPacket packet = new GameServerPacket(m_reader.ReadBytes(len));

            return(packet);
        }
Esempio n. 2
0
 private void InternalTick()
 {
     lock (m_sendQueue)
     {
         while (m_sendQueue.Count > 0)
         {
             InternalSend(m_sendQueue.Dequeue());
         }
     }
     while (m_client.Available > 1)
     {
         GameServerPacket packet = InternalReceive();
         lock (m_receiveQueue)
         {
             m_receiveQueue.Enqueue(packet);
         }
     }
 }
Esempio n. 3
0
 public void Update(GameServerPacket packet, Duel duel)
 {
     int flag = packet.ReadInt32();
     if ((flag & (int)Query.Code) != 0)
         SetId(packet.ReadInt32());
     if ((flag & (int) Query.Position) != 0)
     {
         Controller = duel.GetLocalPlayer(packet.ReadByte());
         packet.ReadByte();
         packet.ReadByte();
         Position = packet.ReadByte();
     }
     if ((flag & (int)Query.Alias) != 0)
         Alias = packet.ReadInt32();
     if ((flag & (int)Query.Type) != 0)
         Type = packet.ReadInt32();
     if ((flag & (int)Query.Level) != 0)
         Level = packet.ReadInt32();
     if ((flag & (int)Query.Rank) != 0)
         Rank = packet.ReadInt32();
     if ((flag & (int)Query.Attribute) != 0)
         Attribute = packet.ReadInt32();
     if ((flag & (int)Query.Race) != 0)
         Race = packet.ReadInt32();
     if ((flag & (int)Query.Attack) != 0)
         Attack = packet.ReadInt32();
     if ((flag & (int)Query.Defence) != 0)
         Defense = packet.ReadInt32();
     if ((flag & (int)Query.BaseAttack) != 0)
         BaseAttack = packet.ReadInt32();
     if ((flag & (int)Query.BaseDefence) != 0)
         BaseDefence = packet.ReadInt32();
     if ((flag & (int)Query.Reason) != 0)
         packet.ReadInt32();
     if ((flag & (int)Query.ReasonCard) != 0)
         packet.ReadInt32(); // Int8 * 4
     if ((flag & (int)Query.EquipCard) != 0)
         packet.ReadInt32(); // Int8 * 4
     if ((flag & (int)Query.TargetCard) != 0)
     {
         int count = packet.ReadInt32();
         for (int i = 0; i < count; ++i)
             packet.ReadInt32(); // Int8 * 4
     }
     if ((flag & (int)Query.OverlayCard) != 0)
     {
         int count = packet.ReadInt32();
         for (int i = 0; i < count; ++i)
             packet.ReadInt32();
     }
     if ((flag & (int)Query.Counters) != 0)
     {
         int count = packet.ReadInt32();
         for (int i = 0; i < count; ++i)
             packet.ReadInt32(); // Int16 * 2
     }
     if ((flag & (int)Query.Owner) != 0)
         Owner = duel.GetLocalPlayer(packet.ReadInt32());
     if ((flag & (int)Query.IsDisabled) != 0)
         packet.ReadInt32();
     if ((flag & (int)Query.IsPublic) != 0)
         packet.ReadInt32();
     if ((flag & (int)Query.LScale) != 0)
         packet.ReadInt32();
     if ((flag & (int)Query.RScale) != 0)
         packet.ReadInt32();
 }
Esempio n. 4
0
 private GameServerPacket InternalReceive()
 {
     m_lastAction = DateTime.Now;
     int len = m_reader.ReadInt16();
     GameServerPacket packet = new GameServerPacket(m_reader.ReadBytes(len));
     return packet;
 }