コード例 #1
0
        public static void ShowWindowTest(Character chr)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(5);
            pw.WriteByte((byte)MiniRoomTypes.Omok);
            pw.WriteByte(2);
            pw.WriteBool(true);

            pw.WriteByte(0);
            PacketHelper.AddAvatar(pw, chr);
            pw.WriteString(chr.Name);

            pw.WriteByte(0xFF);
            pw.WriteByte(0);

            pw.WriteInt(1);
            pw.WriteInt(1);
            pw.WriteInt(1);
            pw.WriteInt(1);
            pw.WriteInt(2000);

            pw.WriteString("lolo");
            pw.WriteByte(4); //Pieces type

            //Continue, no idea what this part is.
            pw.WriteByte(0);

            chr.SendPacket(pw);
        }
コード例 #2
0
        public static void ShowWindow(MiniRoomBase pRoom, Character pTo)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(5);
            pw.WriteByte((byte)pRoom.Type);
            pw.WriteByte(pRoom.MaxUsers);
            pw.WriteByte(pTo.RoomSlotId);

            for (int i = 0; i < pRoom.Users.Length; i++)
            {
                Character character = pRoom.Users[i];

                if (character == null)
                {
                    continue;
                }

                pw.WriteByte(character.RoomSlotId);
                PacketHelper.AddAvatar(pw, character);
                pw.WriteString(character.Name);
            }

            pw.WriteByte(0xFF);
            pRoom.EncodeEnter(pTo, pw);
            pTo.SendPacket(pw);
        }
コード例 #3
0
        public static void ShowWindow(Character pOwner, MiniRoomBase mrb, byte OmokType)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(5);
            pw.WriteByte((byte)MiniRoomTypes.Omok);
            pw.WriteByte(mrb.MaxUsers);
            pw.WriteBool(mrb.Users[0] == pOwner ? false : true);
            for (byte i = 0; i < 2; i++)
            {
                Character pUser = pOwner.Room.Users[i];
                if (pUser != null)
                {
                    pw.WriteByte(i);
                    PacketHelper.AddAvatar(pw, pUser);
                    pw.WriteString(pUser.Name);
                }
            }
            pw.WriteByte(0xFF);
            //End of Regular Enter base
            //Start of Omok Enter Base

            pw.WriteByte(0); //slot id

            //GW_Minigamerecord_Decode (20 bytes)
            pw.WriteInt(1);
            //pw.WriteInt(0);
            //pw.WriteInt(0);
            //pw.WriteInt(0);
            pw.WriteInt(mrb.Users[0].GameStats.OmokWins);
            pw.WriteInt(mrb.Users[0].GameStats.OmokTies);
            pw.WriteInt(mrb.Users[0].GameStats.OmokLosses);
            pw.WriteInt(2000);

            if (mrb.EnteredUsers > 1)
            {
                pw.WriteByte(1); //slot id

                pw.WriteInt(1);
                //pw.WriteInt(0);
                //pw.WriteInt(0);
                //pw.WriteInt(0);
                pw.WriteInt(pOwner.GameStats.OmokWins);
                pw.WriteInt(pOwner.GameStats.OmokTies);
                pw.WriteInt(pOwner.GameStats.OmokLosses);
                pw.WriteInt(2000);
            }
            pw.WriteByte(0xFF);
            //Rest of packet
            pw.WriteString(mrb.Title);
            pw.WriteByte(OmokType); //Pieces type

            //Continue, no idea what this part is.
            pw.WriteByte(0);
            pw.WriteByte(0);
            pw.WriteLong(0);
            pOwner.SendPacket(pw);
        }
コード例 #4
0
        public void MessengerAvatar(Character chr)
        {
            Packet packet = new Packet(ISClientMessages.MessengerAvatar);

            packet.WriteInt(chr.ID);
            packet.WriteString(chr.Name);
            PacketHelper.AddAvatar(packet, chr);
            SendPacket(packet);
        }
コード例 #5
0
        public static void AddPlayer(Character pCharacter, Character pTo)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(4);
            pw.WriteByte(pCharacter.RoomSlotId);
            PacketHelper.AddAvatar(pw, pCharacter);
            pw.WriteString(pCharacter.Name);
            pTo.SendPacket(pw);
        }
コード例 #6
0
        public static void ShowJoin(MiniRoomBase pRoom, Character pWho)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(4);
            pw.WriteByte(pWho.RoomSlotId);
            PacketHelper.AddAvatar(pw, pWho);
            pw.WriteString(pWho.Name);
            pRoom.EncodeEnterResult(pWho, pw);
            pRoom.BroadcastPacket(pw, pWho);
        }
コード例 #7
0
        public static void Test(Character chr)
        {
            Packet pw = new Packet();

            pw.WriteByte(0xAF);
            pw.WriteByte(4);
            pw.WriteByte(0);
            PacketHelper.AddAvatar(pw, chr);
            pw.WriteString(chr.Name);
            chr.SendPacket(pw);
        }
コード例 #8
0
ファイル: MapPacket.cs プロジェクト: zhuomingliang/WvsGlobal
        public static void SendCharacterEnterPacket(Character player, Character victim)
        {
            Packet pw = new Packet(ServerMessages.USER_ENTER_FIELD);

            pw.WriteInt(player.ID);

            pw.WriteString(player.Name);

            BuffPacket.AddMapBuffValues(player, pw);

            PacketHelper.AddAvatar(pw, player);

            pw.WriteInt(player.GetSpawnedPet()?.ItemID ?? 0);
            pw.WriteInt(player.Inventory.ActiveItemID);
            pw.WriteInt(player.Inventory.ChocoCount);
            pw.WriteShort(player.Position.X);
            pw.WriteShort(player.Position.Y);
            pw.WriteByte(player.Stance);
            pw.WriteShort(player.Foothold);
            pw.WriteBool(player.IsGM && !player.Undercover);

            var petItem = player.GetSpawnedPet();

            pw.WriteBool(petItem != null);
            if (petItem != null)
            {
                pw.WriteInt(petItem.ItemID);
                pw.WriteString(petItem.Name);
                pw.WriteLong(petItem.CashId);
                var ml = petItem.MovableLife;
                pw.WriteShort(ml.Position.X);
                pw.WriteShort(ml.Position.Y);
                pw.WriteByte(ml.Stance);
                pw.WriteShort(ml.Foothold);
            }

            // Mini Game & Player Shops
            pw.WriteByte(0); // Hardcoded end of minigame & player shops until implemented

            //Rings
            pw.WriteByte(0); // Number of Rings, hardcoded 0 until implemented.

            //Ring packet structure

            /**
             * for (Ring ring in player.Rings()) {
             *  pw.WriteLong(ring.getRingId()); // R
             *  pw.WriteLong(ring.getPartnerRingId());
             *  pw.WriteInt(ring.getItemId());
             * }
             */
            victim.SendPacket(pw);
        }
コード例 #9
0
        public static void AddVisitor(Character chr, Character to)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x04);
            pw.WriteByte(0x01);
            PacketHelper.AddAvatar(pw, chr);
            pw.WriteString("lolwat123");
            pw.WriteInt(1);
            pw.WriteInt(0);
            pw.WriteInt(0);
            pw.WriteInt(0);
            pw.WriteInt(2000); //total score: should be 0
            to.SendPacket(pw);
        }
コード例 #10
0
        public static void AddShop(Character chr)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(5);
            pw.WriteByte((byte)MiniRoomTypes.Shop);
            pw.WriteByte(4);
            pw.WriteBool(false);
            pw.WriteByte(0);
            PacketHelper.AddAvatar(pw, chr);
            pw.WriteString("loltest123");
            pw.WriteByte(0xFF);
            pw.WriteString("lolwattest");
            pw.WriteByte(0x10);
            pw.WriteByte(0);
            chr.SendPacket(pw);
        }
コード例 #11
0
        public static void AddVisitor(Character chr, MiniRoomBase mrb)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(4);
            pw.WriteByte(chr.RoomSlotId);
            PacketHelper.AddAvatar(pw, chr);
            pw.WriteString(chr.Name);

            //GW_Minigamerecord_Decode
            pw.WriteInt(1);
            //pw.WriteInt(0);
            //pw.WriteInt(0);
            //pw.WriteInt(0);
            pw.WriteInt(chr.GameStats.OmokWins);
            pw.WriteInt(chr.GameStats.OmokTies);
            pw.WriteInt(chr.GameStats.OmokLosses);
            pw.WriteInt(2000);
            mrb.BroadcastPacket(pw, chr);
        }
コード例 #12
0
        public static void OpenPlayerShop(Character pOwner, MiniRoomBase mrb)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(5);
            pw.WriteByte((byte)mrb.Type);
            pw.WriteByte(mrb.MaxUsers);
            pw.WriteBool(mrb.Users[0] == pOwner ? false : true); //owner
            for (byte i = 0; i < 4; i++)
            {
                Character pUser = mrb.Users[i];
                if (pUser != null)
                {
                    pw.WriteByte(i);
                    PacketHelper.AddAvatar(pw, pUser);
                    pw.WriteString(pUser.Name);
                }
            }
            pw.WriteByte(0xFF);
            pw.WriteString(mrb.Title);
            pw.WriteByte(0x10);
            pw.WriteByte(0);
            pOwner.SendPacket(pw);
        }