RefreshHand() public method

public RefreshHand ( int player, int flag = 0x181fff, Player observer = null ) : void
player int
flag int
observer Player
return void
Exemplo n.º 1
0
        private void OnTagSwap(CoreMessage msg)
        {
            GamePacketWriter packet = GamePacketFactory.Create(GameMessage.TagSwap);

            int player = msg.Reader.ReadByte();

            packet.Write((byte)player);

            packet.Write(msg.Reader.ReadByte()); // mcount
            int ecount = msg.Reader.ReadByte();

            packet.Write((byte)ecount);
            packet.Write(msg.Reader.ReadByte()); // pcount
            int hcount = msg.Reader.ReadByte();

            packet.Write((byte)hcount);

            packet.Write(msg.Reader.ReadBytes(4)); // topcode

            for (int i = 0; i < hcount + ecount; i++)
            {
                uint code = msg.Reader.ReadUInt32();
                if ((code & 0x80000000) != 0)
                {
                    packet.Write(code);
                }
                else
                {
                    packet.Write(0);
                }
            }

            SendToPlayer(msg, player);
            Game.SendToAllBut(packet, player);

            Game.RefreshExtra(player);
            Game.RefreshMonsters(0, 0x81fff);
            Game.RefreshMonsters(1, 0x81fff);
            Game.RefreshSpells(0, 0x681fff);
            Game.RefreshSpells(1, 0x681fff);
            Game.RefreshHand(0, 0x181fff);
            Game.RefreshHand(1, 0x181fff);
        }
Exemplo n.º 2
0
        private void OnShuffleHand(CoreMessage msg)
        {
            GamePacketWriter packet = GamePacketFactory.Create(msg.Message);
            int player = msg.Reader.ReadByte();
            int count  = msg.Reader.ReadByte();

            packet.Write((byte)player);
            packet.Write((byte)count);

            msg.Reader.ReadBytes(count * 4);
            for (int i = 0; i < count; i++)
            {
                packet.Write(0);
            }

            SendToPlayer(msg, player);
            Game.SendToAllBut(packet, player);
            Game.RefreshHand(player, 0x181fff);
        }
Exemplo n.º 3
0
        private void OnShuffleHand(CoreMessage msg)
        {
            GameServerPacket packet = new GameServerPacket(msg.Message);
            int player = msg.Reader.ReadByte();
            int count  = msg.Reader.ReadByte();

            packet.Write((byte)player);
            packet.Write((byte)count);

            msg.Reader.ReadBytes(count * 4);
            for (int i = 0; i < count; i++)
            {
                packet.Write(0);
            }

            SendToPlayer(msg, player);
            Game.SendToAllBut(packet, player);
            Game.RefreshHand(player, 0x181fff, false);
        }
Exemplo n.º 4
0
        private void OnTagSwap(CoreMessage msg)
        {
            GameServerPacket packet = new GameServerPacket(GameMessage.TagSwap);

            int player = msg.Reader.ReadByte();

            packet.Write((byte)player);
            packet.Write(msg.Reader.ReadBytes(2));
            int count = msg.Reader.ReadByte();

            packet.Write((byte)count);
            packet.Write(msg.Reader.ReadBytes(4));

            for (int i = 0; i < count; i++)
            {
                uint code = msg.Reader.ReadUInt32();
                if ((code & 0x80000000) != 0)
                {
                    packet.Write(code);
                }
                else
                {
                    packet.Write(0);
                }
            }

            SendToPlayer(msg, player);
            Game.SendToAllBut(packet, player);

            Game.RefreshExtra(player);
            Game.RefreshMonsters(0, 0x81fff, false);
            Game.RefreshMonsters(1, 0x81fff, false);
            Game.RefreshSpells(0, 0x681fff, false);
            Game.RefreshSpells(1, 0x681fff, false);
            Game.RefreshHand(0, 0x181fff, false);
            Game.RefreshHand(1, 0x181fff, false);
        }