コード例 #1
0
        public void OnChangeEquipInRoom(ClientSession cs, InPacket ip)
        {
            if (cs.CurrentRoom == null)
            {
                return;
            }


            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_CHANGE_LOOK_EQUIP_NOT))
            {
                oPacket.WriteInt(cs.LoginUID);
                oPacket.WriteInt(cs.MyCharacter.MyChar.Length);

                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(0); // 00 00 00 00
                }


                for (int i = 0; i < 6; i++)
                {
                    if (cs.CurrentRoom.Slot[i].Active == true)
                    {
                        oPacket.CompressAndAssemble(cs.CurrentRoom.Slot[i].cs.CRYPT_KEY, cs.CurrentRoom.Slot[i].cs.CRYPT_HMAC, cs.CurrentRoom.Slot[i].cs.CRYPT_PREFIX, cs.CurrentRoom.Slot[i].cs.CRYPT_COUNT);
                        cs.CurrentRoom.Slot[i].cs.Send(oPacket);
                        oPacket.CancelAssemble();
                    }
                }
            }
        }
コード例 #2
0
 // 가이드북 리스트라고 써있는데 뭔지 모름
 public void OnGuideBookList(ClientSession cs)
 {
     using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_GUIDE_BOOK_LIST_ACK))
     {
         oPacket.WriteHexString("00 00 00 01 00 00 00 00");
         oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(oPacket);
     }
 }
コード例 #3
0
ファイル: Ep2.cs プロジェクト: Raymonf/GCV
 public void EnuClientPing(ClientSession cs)
 {
     using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_SHAFILENAME_LIST_ACK))
     {
         oPacket.WriteInt(0);
         oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(oPacket);
     }
 }
コード例 #4
0
 public void Add(ClientSession msg, InPacket ip)
 {
     using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_LEAVE_ROOM_BROAD))
     {
         oPacket.WriteHexString("00 00 00 64 00 00 00 22 4C 00 65 00 74 00 27 00 73 00 20 00 62 00 65 00 20 00 66 00 72 00 69 00 65 00 6E 00 64 00 73 00 7E 00 00 01 60 D9 00 00 00 08 74 00 65 00 73 00 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 6F 00 66 00 66 00 00 00 00 01 00 FF FF FF FF");
         oPacket.CompressAndAssemble(msg.CRYPT_KEY, msg.CRYPT_HMAC, msg.CRYPT_PREFIX, ++msg.CRYPT_COUNT);
         msg.Send(oPacket);
     }
 }
コード例 #5
0
ファイル: Ep2.cs プロジェクト: Raymonf/GCV
 public void ClientsContent(ClientSession cs)
 {
     using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_CLIENT_PING_CONFIG_ACK))
     {
         oPacket.WriteHexString("00 00 03 E8 00 00 0F A0 00 00 03 E8 00 00 00 01 01 FF FF FF FF");
         oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(oPacket);
     }
 }
コード例 #6
0
        public void SendCashbackRatio(ClientSession cs)
        {
            using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_CASHBACK_RATIO_INFO_NOT))
            {
                oPacket.WriteHexString("00 00 00 00 00 00 00 00");

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }
        }
コード例 #7
0
        public void SendSocketTableInfo(ClientSession cs)
        {
            using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_SOCKET_TABLE_INFO_NOT))
            {
                oPacket.WriteHexString("00 00 00 65 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 01 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 02 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 03 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 04 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 05 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 08 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 09 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 0A 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 0B 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 0C 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 0D 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 0E 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 0F 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 10 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 11 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 12 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 13 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 14 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 15 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 16 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 17 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 18 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 19 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 1A 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 1B 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 1C 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 1D 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 1E 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 1F 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 20 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 21 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 22 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 23 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 24 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 25 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 26 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 27 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 28 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 29 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 2A 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 2B 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 2C 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 2D 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 2E 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 2F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 30 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 31 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 32 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 33 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 34 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 35 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 36 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 37 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 38 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 39 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 3A 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 3B 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 3C 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 3D 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 3E 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 3F 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 40 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 41 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 42 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 43 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 44 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 45 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 46 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 47 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 48 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 49 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 4A 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 4B 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 4C 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 4D 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 4E 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 4F 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 50 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 51 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 52 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 53 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 54 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 55 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 56 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 57 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 58 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 59 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 5A 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 5B 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 5C 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 5D 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 5E 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 5F 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 60 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 61 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 62 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 63 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 25 00 00 00 64 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 25 00 00 00 65 00 00 00 00 00 00 00 BE 00 00 00 FA 00 00 01 4A 00 00 01 D6 00 00 00 01 00 00 00 BE 00 00 00 FA 00 00 01 4A 00 00 01 D6 00 00 00 02 00 00 00 BE 00 00 00 FA 00 00 01 4A 00 00 01 D6 00 00 00 03 00 00 00 FA 00 00 01 4A 00 00 01 D6 00 00 03 52 00 00 00 04 00 00 00 FA 00 00 01 4A 00 00 01 D6 00 00 03 52 00 00 00 05 00 00 00 FA 00 00 01 4A 00 00 01 D6 00 00 03 52 00 00 00 06 00 00 01 4A 00 00 01 D6 00 00 03 52 00 00 08 98 00 00 00 07 00 00 01 4A 00 00 01 D6 00 00 03 52 00 00 08 98 00 00 00 08 00 00 01 4A 00 00 01 D6 00 00 03 52 00 00 08 98 00 00 00 09 00 00 01 D6 00 00 03 52 00 00 08 98 00 00 0E 74 00 00 00 0A 00 00 01 D6 00 00 03 52 00 00 08 98 00 00 0E 74 00 00 00 0B 00 00 01 D6 00 00 03 52 00 00 08 98 00 00 0E 74 00 00 00 0C 00 00 03 52 00 00 08 98 00 00 0E 74 00 00 17 0C 00 00 00 0D 00 00 03 52 00 00 08 98 00 00 0E 74 00 00 17 0C 00 00 00 0E 00 00 03 52 00 00 08 98 00 00 0E 74 00 00 17 0C 00 00 00 0F 00 00 08 98 00 00 0E 74 00 00 17 0C 00 00 22 C4 00 00 00 10 00 00 08 98 00 00 0E 74 00 00 17 0C 00 00 22 C4 00 00 00 11 00 00 08 98 00 00 0E 74 00 00 17 0C 00 00 22 C4 00 00 00 12 00 00 0E 74 00 00 17 0C 00 00 22 C4 00 00 31 9C 00 00 00 13 00 00 0E 74 00 00 17 0C 00 00 22 C4 00 00 31 9C 00 00 00 14 00 00 0E 74 00 00 17 0C 00 00 22 C4 00 00 31 9C 00 00 00 15 00 00 17 0C 00 00 22 C4 00 00 31 9C 00 00 55 F0 00 00 00 16 00 00 17 0C 00 00 22 C4 00 00 31 9C 00 00 55 F0 00 00 00 17 00 00 17 0C 00 00 22 C4 00 00 31 9C 00 00 55 F0 00 00 00 18 00 00 22 C4 00 00 31 9C 00 00 55 F0 00 00 6C 98 00 00 00 19 00 00 22 C4 00 00 31 9C 00 00 55 F0 00 00 6C 98 00 00 00 1A 00 00 22 C4 00 00 31 9C 00 00 55 F0 00 00 6C 98 00 00 00 1B 00 00 31 9C 00 00 55 F0 00 00 6C 98 00 00 84 08 00 00 00 1C 00 00 31 9C 00 00 55 F0 00 00 6C 98 00 00 84 08 00 00 00 1D 00 00 31 9C 00 00 55 F0 00 00 6C 98 00 00 84 08 00 00 00 1E 00 00 55 F0 00 00 6C 98 00 00 84 08 00 00 9C 40 00 00 00 1F 00 00 55 F0 00 00 6C 98 00 00 84 08 00 00 9C 40 00 00 00 20 00 00 55 F0 00 00 6C 98 00 00 84 08 00 00 9C 40 00 00 00 21 00 00 6C 98 00 00 84 08 00 00 9C 40 00 00 B9 28 00 00 00 22 00 00 6C 98 00 00 84 08 00 00 9C 40 00 00 B9 28 00 00 00 23 00 00 6C 98 00 00 84 08 00 00 9C 40 00 00 B9 28 00 00 00 24 00 00 84 08 00 00 9C 40 00 00 B9 28 00 00 D8 CC 00 00 00 25 00 00 84 08 00 00 9C 40 00 00 B9 28 00 00 D8 CC 00 00 00 26 00 00 84 08 00 00 9C 40 00 00 B9 28 00 00 D8 CC 00 00 00 27 00 00 9C 40 00 00 B9 28 00 00 D8 CC 00 00 F8 70 00 00 00 28 00 00 9C 40 00 00 B9 28 00 00 D8 CC 00 00 F8 70 00 00 00 29 00 00 9C 40 00 00 B9 28 00 00 D8 CC 00 00 F8 70 00 00 00 2A 00 00 B9 28 00 00 D8 CC 00 00 F8 70 00 01 1D 28 00 00 00 2B 00 00 B9 28 00 00 D8 CC 00 00 F8 70 00 01 1D 28 00 00 00 2C 00 00 B9 28 00 00 D8 CC 00 00 F8 70 00 01 1D 28 00 00 00 2D 00 00 D8 CC 00 00 F8 70 00 01 1D 28 00 01 47 58 00 00 00 2E 00 00 D8 CC 00 00 F8 70 00 01 1D 28 00 01 47 58 00 00 00 2F 00 00 D8 CC 00 00 F8 70 00 01 1D 28 00 01 47 58 00 00 00 30 00 00 F8 70 00 01 1D 28 00 01 47 58 00 01 7D 40 00 00 00 31 00 00 F8 70 00 01 1D 28 00 01 47 58 00 01 7D 40 00 00 00 32 00 00 F8 70 00 01 1D 28 00 01 47 58 00 01 7D 40 00 00 00 33 00 01 1D 28 00 01 47 58 00 01 7D 40 00 01 B7 74 00 00 00 34 00 01 1D 28 00 01 47 58 00 01 7D 40 00 01 B7 74 00 00 00 35 00 01 1D 28 00 01 47 58 00 01 7D 40 00 01 B7 74 00 00 00 36 00 01 47 58 00 01 7D 40 00 01 B7 74 00 02 00 E4 00 00 00 37 00 01 47 58 00 01 7D 40 00 01 B7 74 00 02 00 E4 00 00 00 38 00 01 47 58 00 01 7D 40 00 01 B7 74 00 02 00 E4 00 00 00 39 00 01 7D 40 00 01 B7 74 00 02 00 E4 00 02 50 F8 00 00 00 3A 00 01 7D 40 00 01 B7 74 00 02 00 E4 00 02 50 F8 00 00 00 3B 00 01 7D 40 00 01 B7 74 00 02 00 E4 00 02 50 F8 00 00 00 3C 00 01 B7 74 00 02 00 E4 00 02 50 F8 00 02 AC C4 00 00 00 3D 00 01 B7 74 00 02 00 E4 00 02 50 F8 00 02 AC C4 00 00 00 3E 00 01 B7 74 00 02 00 E4 00 02 50 F8 00 02 AC C4 00 00 00 3F 00 02 00 E4 00 02 50 F8 00 02 AC C4 00 03 15 10 00 00 00 40 00 02 00 E4 00 02 50 F8 00 02 AC C4 00 03 15 10 00 00 00 41 00 02 00 E4 00 02 50 F8 00 02 AC C4 00 03 15 10 00 00 00 42 00 02 50 F8 00 02 AC C4 00 03 15 10 00 03 BB 78 00 00 00 43 00 02 50 F8 00 02 AC C4 00 03 15 10 00 03 BB 78 00 00 00 44 00 02 50 F8 00 02 AC C4 00 03 15 10 00 03 BB 78 00 00 00 45 00 02 AC C4 00 03 15 10 00 03 BB 78 00 04 27 48 00 00 00 46 00 02 AC C4 00 03 15 10 00 03 BB 78 00 04 27 48 00 00 00 47 00 02 AC C4 00 03 15 10 00 03 BB 78 00 04 27 48 00 00 00 48 00 03 15 10 00 03 BB 78 00 04 27 48 00 04 AC E0 00 00 00 49 00 03 15 10 00 03 BB 78 00 04 27 48 00 04 AC E0 00 00 00 4A 00 03 15 10 00 03 BB 78 00 04 27 48 00 04 AC E0 00 00 00 4B 00 03 BB 78 00 04 27 48 00 04 AC E0 00 05 32 78 00 00 00 4C 00 03 BB 78 00 04 27 48 00 04 AC E0 00 05 32 78 00 00 00 4D 00 03 BB 78 00 04 27 48 00 04 AC E0 00 05 32 78 00 00 00 4E 00 04 27 48 00 04 AC E0 00 05 32 78 00 05 B8 10 00 00 00 4F 00 04 27 48 00 04 AC E0 00 05 32 78 00 05 B8 10 00 00 00 50 00 04 27 48 00 04 AC E0 00 05 32 78 00 05 B8 10 00 00 00 51 00 04 AC E0 00 05 32 78 00 05 B8 10 00 06 3D A8 00 00 00 52 00 04 AC E0 00 05 32 78 00 05 B8 10 00 06 3D A8 00 00 00 53 00 04 AC E0 00 05 32 78 00 05 B8 10 00 06 3D A8 00 00 00 54 00 05 32 78 00 05 B8 10 00 06 3D A8 00 06 C3 40 00 00 00 55 00 05 32 78 00 05 B8 10 00 06 3D A8 00 06 C3 40 00 00 00 56 00 05 32 78 00 05 B8 10 00 06 3D A8 00 06 C3 40 00 00 00 57 00 05 B8 10 00 06 3D A8 00 06 C3 40 00 07 48 74 00 00 00 58 00 05 B8 10 00 06 3D A8 00 06 C3 40 00 07 48 74 00 00 00 59 00 05 B8 10 00 06 3D A8 00 06 C3 40 00 07 48 74 00 00 00 5A 00 06 3D A8 00 06 C3 40 00 07 48 74 00 07 CE 0C 00 00 00 5B 00 06 3D A8 00 06 C3 40 00 07 48 74 00 07 CE 0C 00 00 00 5C 00 06 3D A8 00 06 C3 40 00 07 48 74 00 07 CE 0C 00 00 00 5D 00 06 C3 40 00 07 48 74 00 07 CE 0C 00 08 53 A4 00 00 00 5E 00 06 C3 40 00 07 48 74 00 07 CE 0C 00 08 53 A4 00 00 00 5F 00 06 C3 40 00 07 48 74 00 07 CE 0C 00 08 53 A4 00 00 00 60 00 07 48 74 00 07 CE 0C 00 08 53 A4 00 08 D9 3C 00 00 00 61 00 07 48 74 00 07 CE 0C 00 08 53 A4 00 08 D9 3C 00 00 00 62 00 07 48 74 00 07 CE 0C 00 08 53 A4 00 08 D9 3C 00 00 00 63 00 07 CE 0C 00 08 53 A4 00 08 D9 3C 00 09 5E D4 00 00 00 64 00 07 CE 0C 00 08 53 A4 00 08 D9 3C 00 09 5E D4 00 04 61 54");

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }
        }
コード例 #8
0
        public void SendClientContentOpen(ClientSession cs)
        {
            using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_NEW_CLIENT_CONTENTS_OPEN_NOT))
            {
                LoadContents();
                LoadCharacters();
                //oPacket.WriteHexString("00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 09 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 09 00 00 00 01 00 00 00 01 00 00 00 0A 00 00 00 01 00 00 00 01 00 00 00 0E 00 00 00 01 00 00 00 01 00 00 00 12 00 00 00 01 00 00 00 01 00 00 00 14 00 00 00 01 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 03 00 00 00 03 00 00 00 01 00 00 00 00 00 00 00 15 00 00 00 01 00 00 00 0D 00 00 00 08 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 00 00 05 00 00 00 03 00 00 00 01 00 00 00 06 00 00 00 04 00 00 00 01 00 00 00 00 00 00 00 05 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 02 00 00 00 42 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1E 00 00 00 24 00 00 00 27 00 00 00 28 00 00 00 29 00 00 00 2A 00 00 00 2B 00 00 00 2C 00 00 00 2D 00 00 00 2E 00 00 00 2F 00 00 00 30 00 00 00 31 00 00 00 32 00 00 00 37 00 00 00 38 00 00 00 39 00 00 00 3A 00 00 00 3B 00 00 00 3C 00 00 00 3D 00 00 00 3E 00 00 00 3F 00 00 00 40 00 00 00 46 00 00 00 49 00 00 00 4A 00 00 00 4C 00 00 00 4E 00 00 00 4F 00 00 00 50 00 00 00 51 00 00 00 53 00 00 00 54 00 00 00 55 00 00 00 56 00 00 00 57 00 00 00 58 00 00 00 59 00 00 00 5A 00 00 00 5B 00 00 00 5C 00 00 00 5D 00 00 00 5E 00 00 00 5F 00 00 00 0B 00 00 00 01 00 00 00 26 00 00 00 0D 00 00 00 01 00 00 00 42 00 00 00 06 00 00 00 04 00 00 00 00 01 00 00 00 63 00 00 00 00 01 00 00 00 10 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 2B 00 00 00 2F 00 00 00 01 01 00 00 00 0E 00 00 00 0A 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 09 00 00 00 04 00 00 00 06 00 00 00 05 00 00 00 08 00 00 00 07 00 00 00 0B 00 00 00 05 01 00 00 00 10 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 2B 00 00 00 2F 00 00 00 03 01 00 00 00 09 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 09 00 00 00 0B 00 00 00 02 00 00 00 0A 00 00 00 04 00 00 00 0B 00 00 00 00 10 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 2B 00 00 00 2F 00 00 00 06 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 55 00 00 00 14 00 00 00 00 00 00 00 04 00 01 02 03 00 00 00 01 00 00 00 04 00 01 02 03 00 00 00 02 00 00 00 04 00 01 02 03 00 00 00 03 00 00 00 04 00 01 02 03 00 00 00 04 00 00 00 04 00 01 02 03 00 00 00 05 00 00 00 04 00 01 02 03 00 00 00 06 00 00 00 04 00 01 02 03 00 00 00 07 00 00 00 04 00 01 02 03 00 00 00 08 00 00 00 04 00 01 02 03 00 00 00 09 00 00 00 04 00 01 02 03 00 00 00 0A 00 00 00 04 00 01 02 03 00 00 00 0B 00 00 00 04 00 01 02 03 00 00 00 0C 00 00 00 04 00 01 02 03 00 00 00 0D 00 00 00 04 00 01 02 03 00 00 00 0E 00 00 00 04 00 01 02 03 00 00 00 0F 00 00 00 02 00 01 00 00 00 10 00 00 00 02 00 01 00 00 00 11 00 00 00 02 00 01 00 00 00 12 00 00 00 02 00 01 00 00 00 13 00 00 00 01 00 00 00 00 13 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 02 00 00 00 02 00 00 00 02 00 00 00 03 00 00 00 01 00 00 00 04 00 00 00 01 00 00 00 05 00 00 00 01 00 00 00 06 00 00 00 01 00 00 00 07 00 00 00 01 00 00 00 08 00 00 00 01 00 00 00 09 00 00 00 01 00 00 00 0A 00 00 00 01 00 00 00 0B 00 00 00 01 00 00 00 0C 00 00 00 01 00 00 00 0D 00 00 00 01 00 00 00 0E 00 00 00 00 00 00 00 0F 00 00 00 01 00 00 00 10 00 00 00 01 00 00 00 11 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 12 00 00 00 00 00 01 83 3F 00 00 00 01 00 01 83 40 00 00 00 02 00 01 83 41 00 00 00 03 00 01 83 42 00 00 00 04 00 01 83 43 00 00 00 05 00 01 83 44 00 00 00 06 00 01 83 45 00 00 00 07 00 01 83 46 00 00 00 08 00 01 83 47 00 00 00 09 00 01 83 48 00 00 00 0A 00 01 83 49 00 00 00 0B 00 01 83 4A 00 00 00 0C 00 01 83 4B 00 00 00 0D 00 01 83 4C 00 00 00 0E 00 01 83 4D 00 00 00 0F 00 01 83 4E 00 00 00 10 00 01 83 4F 00 00 00 11 00 01 E3 32 00 00 00 43 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 26 00 00 00 27 00 00 00 28 00 00 00 29 00 00 00 2A 00 00 00 2B 00 00 00 2C 00 00 00 2D 00 00 00 2E 00 00 00 2F 00 00 00 30 00 00 00 31 00 00 00 32 00 00 00 33 00 00 00 34 00 00 00 39 00 00 00 3A 00 00 00 3B 00 00 00 3C 00 00 00 3D 00 00 00 3E 00 00 00 3F 00 00 00 40 00 00 00 41 00 00 00 42 00 00 00 43 00 00 00 44 00 00 00 45 00 00 00 46 00 00 00 47 00 00 00 02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 13 00 00 00 18 00 00 00 03 00 00 22 56 00 00 00 8E 00 00 00 3C 74 00 65 00 78 00 5F 00 67 00 63 00 5F 00 6D 00 62 00 6F 00 78 00 5F 00 67 00 61 00 77 00 69 00 62 00 61 00 77 00 69 00 62 00 6F 00 5F 00 64 00 6C 00 67 00 2E 00 64 00 64 00 73 00 00 00 00 01 00 06 4E F6 00 00 25 40 00 00 00 B3 00 00 00 36 74 00 65 00 78 00 5F 00 67 00 63 00 5F 00 6D 00 62 00 6F 00 78 00 5F 00 66 00 72 00 69 00 65 00 6E 00 64 00 5F 00 67 00 69 00 66 00 74 00 2E 00 64 00 64 00 73 00 00 00 00 01 00 0C C5 D8 00 00 27 D2 00 00 00 BF 00 00 00 38 74 00 65 00 78 00 5F 00 67 00 63 00 5F 00 6D 00 62 00 6F 00 78 00 5F 00 73 00 6F 00 6E 00 67 00 6B 00 72 00 61 00 6E 00 5F 00 64 00 6C 00 67 00 2E 00 64 00 64 00 73 00 00 00 00 01 00 0D 5E 44");
                oPacket.WriteInt(0); //00 00 00 00

                oPacket.WriteInt(3); //00 00 00 03 00 00 00 00 00 00 00 01 00 00 00 02
                for (int c = 0; c < 3; c++)
                {
                    oPacket.WriteInt(c);
                }
                oPacket.WriteHexString("00 00 00 09 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 09 00 00 00 01 00 00 00 01 00 00 00 0A 00 00 00 01 00 00 00 01 00 00 00 0E 00 00 00 01 00 00 00 01 00 00 00 12 00 00 00 01 00 00 00 01 00 00 00 14 00 00 00 01 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 03 00 00 00 03 00 00 00 01 00 00 00 00 00 00 00 15 00 00 00 01 00 00 00 0D 00 00 00 08 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 00 00 05 00 00 00 03 00 00 00 01 00 00 00 06 00 00 00 04 00 00 00 01 00 00 00 00 00 00 00 05 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 02 00 00 00 42 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1E 00 00 00 24 00 00 00 27 00 00 00 28 00 00 00 29 00 00 00 2A 00 00 00 2B 00 00 00 2C 00 00 00 2D 00 00 00 2E 00 00 00 2F 00 00 00 30 00 00 00 31 00 00 00 32 00 00 00 37 00 00 00 38 00 00 00 39 00 00 00 3A 00 00 00 3B 00 00 00 3C 00 00 00 3D 00 00 00 3E 00 00 00 3F 00 00 00 40 00 00 00 46 00 00 00 49 00 00 00 4A 00 00 00 4C 00 00 00 4E 00 00 00 4F 00 00 00 50 00 00 00 51 00 00 00 53 00 00 00 54 00 00 00 55 00 00 00 56 00 00 00 57 00 00 00 58 00 00 00 59 00 00 00 5A 00 00 00 5B 00 00 00 5C 00 00 00 5D 00 00 00 5E 00 00 00 5F 00 00 00 0B 00 00 00 01 00 00 00 26 00 00 00 0D 00 00 00 01 00 00 00 42 00 00 00 06 00 00 00 04 00 00 00 00 01 00 00 00 63 00 00 00 00 01 00 00 00 10 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 2B 00 00 00 2F 00 00 00 01 01 00 00 00 0E 00 00 00 0A 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 09 00 00 00 04 00 00 00 06 00 00 00 05 00 00 00 08 00 00 00 07 00 00 00 0B 00 00 00 05 01 00 00 00 10 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 2B 00 00 00 2F 00 00 00 03 01 00 00 00 09 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 09 00 00 00 0B 00 00 00 02 00 00 00 0A 00 00 00 04 00 00 00 0B 00 00 00 00 10 00 00 00 63 00 00 00 64 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 2B 00 00 00 2F");

                oPacket.WriteInt(6);//00 00 00 06 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05
                for (int c = 0; c < 6; c++)
                {
                    oPacket.WriteInt(c);
                }

                oPacket.WriteInt(SetMaxLevel());       //00 00 00 55
                oPacket.WriteInt(CCPCharacter.Length); //13
                for (int a = 0; a < CCPCharacter.Length; a++)
                {
                    oPacket.WriteInt(CCPCharacter[a].CharID);
                    oPacket.WriteInt(CCPCharacter[a].CCPPromotion.Length);
                    for (int b = 0; b < CCPCharacter[a].CCPPromotion.Length; b++)
                    {
                        oPacket.WriteByte((byte)CCPCharacter[a].CCPPromotion[b].Promotion);
                    }
                }
                oPacket.WriteHexString("00 00 00 13 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13");
                oPacket.WriteHexString("00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 02 00 00 00 02 00 00 00 02 00 00 00 03 00 00 00 01 00 00 00 04 00 00 00 01 00 00 00 05 00 00 00 01 00 00 00 06 00 00 00 01 00 00 00 07 00 00 00 01 00 00 00 08 00 00 00 01 00 00 00 09 00 00 00 01 00 00 00 0A 00 00 00 01 00 00 00 0B 00 00 00 01 00 00 00 0C 00 00 00 01 00 00 00 0D 00 00 00 01 00 00 00 0E 00 00 00 00 00 00 00 0F 00 00 00 01 00 00 00 10 00 00 00 01 00 00 00 11 00 00 00 00 00 00 00 12 00 00 00 00");
                oPacket.WriteHexString("00 00 00 12 00 00 00 00 00 01 83 3F 00 00 00 01 00 01 83 40 00 00 00 02 00 01 83 41 00 00 00 03 00 01 83 42 00 00 00 04 00 01 83 43 00 00 00 05 00 01 83 44 00 00 00 06 00 01 83 45 00 00 00 07 00 01 83 46 00 00 00 08 00 01 83 47 00 00 00 09 00 01 83 48 00 00 00 0A 00 01 83 49 00 00 00 0B 00 01 83 4A 00 00 00 0C 00 01 83 4B 00 00 00 0D 00 01 83 4C 00 00 00 0E 00 01 83 4D 00 00 00 0F 00 01 83 4E 00 00 00 10 00 01 83 4F 00 00 00 11 00 01 E3 32");
                oPacket.WriteHexString("00 00 00 43 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 0A 00 00 00 0B 00 00 00 0C 00 00 00 0D 00 00 00 0E 00 00 00 0F 00 00 00 10 00 00 00 11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 1A 00 00 00 1B 00 00 00 1C 00 00 00 1D 00 00 00 1E 00 00 00 1F 00 00 00 20 00 00 00 21 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00 26 00 00 00 27 00 00 00 28 00 00 00 29 00 00 00 2A 00 00 00 2B 00 00 00 2C 00 00 00 2D 00 00 00 2E 00 00 00 2F 00 00 00 30 00 00 00 31 00 00 00 32 00 00 00 33 00 00 00 34 00 00 00 39 00 00 00 3A 00 00 00 3B 00 00 00 3C 00 00 00 3D 00 00 00 3E 00 00 00 3F 00 00 00 40 00 00 00 41 00 00 00 42 00 00 00 43 00 00 00 44 00 00 00 45 00 00 00 46 00 00 00 47");
                oPacket.WriteHexString("00 00 00 02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 13");
                oPacket.WriteInt(Enum.GetNames(typeof(MenuItems.list)).Length);//00 00 00 18
                oPacket.WriteInt(eventsinfo.Length);
                LogFactory.GetLog("MAIN").LogInfo("Events Infos: " + eventsinfo.Length);
                for (int a = 0; a < eventsinfo.Length; a++)
                {
                    oPacket.WriteInt(eventsinfo[a].EventID);
                    oPacket.WriteInt(eventsinfo[a].EventMBoxID);
                    oPacket.WriteInt(eventsinfo[a].EventTextureFileName.Length * 2);
                    oPacket.WriteUnicodeString(eventsinfo[a].EventTextureFileName);
                    oPacket.WriteInt(eventsinfo[a].EventItem1);
                    oPacket.WriteInt(eventsinfo[a].EventItem2);
                }
                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }
        }
コード例 #9
0
ファイル: Loading.cs プロジェクト: rocverde/GrandChaseIV
        public void NotifyContentInfo(ClientSession cs, InPacket ip)
        {
            using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_CLIENT_CONTENTS_FIRST_INIT_INFO_ACK))
            {
                oPacket.WriteHexString("00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 01 00 00 00");
                oPacket.WriteHexString("02 00 00 00 03 00 00 00 04 00 00 00 01 00 00 00 00");

                oPacket.WriteInt(InitLoading.Length);
                oPacket.WriteInt(InitLoading[0].Length * 2);
                oPacket.WriteUnicodeString(InitLoading[0]);
                oPacket.WriteInt(InitLoading[1].Length * 2);
                oPacket.WriteUnicodeString(InitLoading[1]);
                oPacket.WriteInt(InitLoading[2].Length * 2);
                oPacket.WriteUnicodeString(InitLoading[2]);
                oPacket.WriteInt(InitLoading[3].Length * 2);
                oPacket.WriteUnicodeString(InitLoading[3]);
                oPacket.WriteHexString("00 00 00 02 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00");

                oPacket.WriteInt(MatchLoading.Length);
                oPacket.WriteInt(MatchLoading[0].Length * 2);
                oPacket.WriteUnicodeString(MatchLoading[0]);
                oPacket.WriteInt(MatchLoading[1].Length * 2);
                oPacket.WriteUnicodeString(MatchLoading[1]);
                oPacket.WriteInt(MatchLoading[2].Length * 2);
                oPacket.WriteUnicodeString(MatchLoading[2]);
                oPacket.WriteInt(0);

                oPacket.WriteInt(SquareLoading.Length);
                oPacket.WriteInt(0);
                oPacket.WriteInt(SquareLoading[0].Length * 2);
                oPacket.WriteUnicodeString(SquareLoading[0]);
                oPacket.WriteInt(1);
                oPacket.WriteInt(SquareLoading[1].Length * 2);
                oPacket.WriteUnicodeString(SquareLoading[1]);
                oPacket.WriteInt(2);
                oPacket.WriteInt(SquareLoading[2].Length * 2);
                oPacket.WriteUnicodeString(SquareLoading[2]);
                oPacket.WriteHexString("00 00 00 03 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 00");

                oPacket.WriteInt(HackList.Length);
                for (int i = 0; i <= HackList.Length - 1; i++)
                {
                    oPacket.WriteInt(HackList[i].Length * 2);
                    oPacket.WriteUnicodeString(HackList[i]);
                }

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);

                cs.Send(oPacket);
                LogFactory.GetLog("GET").LogHex("DATA: ", oPacket.getBuffer());
            }
        }
コード例 #10
0
ファイル: Quests.cs プロジェクト: rocverde/GrandChaseIV
        public void CompleteMission(ClientSession cs, InPacket ip)
        {
            int missionID = ip.ReadInt();

            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_COMPLETE_MISSION_ACK))
            {
                oPacket.WriteInt(0);
                oPacket.WriteInt(missionID);
                oPacket.WriteHexString("00 00 01 F8 00 00 00 11 00 00 00 01 00 00 22 B0 00 00 00 01 30 B2 5C A2 00 00 00 09 00 00 00 09 00 00 00 00 00 00 FF FF FF FF 00 00 00 00 57 AD 34 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 0D 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 07 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 08 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 09 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0A 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0B 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0C 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0D 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0E 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 0F 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 10 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 11 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 12 00 00 00 01 01 01 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 28 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 29 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 01 01 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 A0");
                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
                DataSet ds = new DataSet();
                Database.Query(ref ds, "DELETE FROM  `gc`.`missions` WHERE `LoginUID` = '{0}'   AND `MissionID` = '{1}'", cs.LoginUID, missionID);
            }
        }
コード例 #11
0
ファイル: Quests.cs プロジェクト: rocverde/GrandChaseIV
        public void RemoveMission(ClientSession cs, InPacket ip)
        {
            int missionUID = ip.ReadInt();
            int missionID  = ip.ReadInt();

            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_REMOVE_MISSION_ACK))
            {
                oPacket.WriteInt(0);
                oPacket.WriteInt(missionID);
                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
                DataSet ds = new DataSet();
                Database.Query(ref ds, "DELETE FROM  `gc`.`missions` WHERE `LoginUID` = '{0}'   AND `MissionID` = '{1}'", cs.LoginUID, missionID);
            }
        }
コード例 #12
0
 public void EnterAgit(ClientSession cs)
 {
     using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_ENTER_AGIT_ACK))
     {
         oPacket.WriteInt(0);
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 06 00 00 00 15 00 00 00 15 00 00 00 15 1D 00 00 00 00 00 00 00 09 00 09 3C 60 00 00 00 01 30 A5 3E C4 FF FF FF FF FF FF FF FF 00 09 3C 60 00 00 00 01 30 A5 3E C5 FF FF FF FF FF FF FF FF 00 09 3D 82 00 00 00 01 30 A5 3E CB FF FF FF FF FF FF FF FF 00 09 3C 56 00 00 00 01 30 A5 3E CC FF FF FF FF FF FF FF FF 00 09 3C 7E 00 00 00 01 30 A5 3E CD FF FF FF FF FF FF FF FF 00 09 3D BE 00 00 00 01 30 A5 3E CE FF FF FF FF FF FF FF FF 00 09 3D D2 00 00 00 01 30 A5 3E CF FF FF FF FF FF FF FF FF 00 0A 05 DC 00 00 00 01 30 A5 3E D0 FF FF FF FF FF FF FF FF 00 0A 05 E6 00 00 00 01 30 A5 3E D1 FF FF FF FF FF FF FF FF 00 00 00 00 57 A6 DC 70 00 00 00 00");
         oPacket.WriteIPFromString(Server.UDPRelayIP, true);
         oPacket.WriteShort(Server.TCPRelayPort);//2D 50 0C C6 25 E4
         oPacket.WriteIPFromString(Server.UDPRelayIP, true);
         oPacket.WriteShort(Server.UDPRelayPort);
         oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 58 29 FB DC 59 21 3A F0 00 59 21 9F DB 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 1C BD");
         oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(oPacket);
     }
 }
コード例 #13
0
ファイル: Commands.cs プロジェクト: rocverde/GrandChaseIV
 public void GMCommands(ClientSession cs, String Chat, InPacket ip)
 {
     if (cs.AuthLevel == 1)
     {
         //Commands!
         if (Chat == "/loginout")
         {
             using (OutPacket op = new OutPacket(GameOpcodes.EVENT_STAT_LOGINOUT_COUNT))
             {
                 op.WriteInt(0);
                 op.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                 cs.Send(op);
             }
         }
         if (Chat == "/Char" + Chat.Substring(5))
         {
             cs.CurrentChar = Convert.ToInt32(Chat.Substring(5));
         }
         if (Chat == "/addgp" + (string)Chat.Substring(6))
         {
             DataSet ds = new DataSet();
             Database.Query(ref ds, "UPDATE   `gc`.`account` SET   `Gamepoint` = '{1}' WHERE `LoginUID` = '{0}'", cs.LoginUID, cs.GamePoint + Convert.ToInt32(Chat.Substring(6)));
         }
         if (Chat == "!!!!!" + Chat.Substring(5))
         {
             using (OutPacket op = new OutPacket(GameOpcodes.EVENT_SIGN_BOARD_NOT))
             {
                 //LogFactory.GetLog("SIGNBOARD").LogInfo("TEXT: " + Chat.Substring(5));
                 op.WriteHexString("00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
                 op.WriteInt((cs.Nick + " : " + Chat.Substring(5)).Length * 2);
                 op.WriteUnicodeString((cs.Nick + " : " + Chat.Substring(5)));
                 foreach (ClientSession u in cs.CurrentChannel.UsersList)
                 {
                     if (u.CurrentRoom == cs.CurrentRoom)
                     {
                         op.Assemble(u.CRYPT_KEY, u.CRYPT_HMAC, u.CRYPT_PREFIX, u.CRYPT_COUNT);
                         u.Send(op);
                         op.CancelAssemble();
                     }
                 }
             }
         }
     }
 }
コード例 #14
0
ファイル: Commands.cs プロジェクト: rocverde/GrandChaseIV
 public void DigitOnChat(ClientSession cs, string msg)
 {
     using (OutPacket op = new OutPacket(GameOpcodes.EVENT_CHAT_NOT))
     {
         op.WriteByte(1);
         op.WriteInt(cs.LoginUID);
         op.WriteInt(cs.Nick.Length * 2);
         op.WriteUnicodeString(cs.Nick);
         op.WriteInt(0);
         op.WriteInt(0);
         op.WriteInt(-1);
         op.WriteInt(msg.Length);
         op.WriteUnicodeString(msg);
         op.WriteInt(0);
         op.WriteInt(0);
         op.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(op);
     }
 }
コード例 #15
0
 public void AgitLoadComplete(ClientSession cs)
 {
     using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_AGIT_VISITER_COUNT_BROAD))
     {
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteInt(22);
         oPacket.WriteInt(22);
         oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(oPacket);
     }
     using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_AGIT_LOADING_COMPLETE_ACK))
     {
         oPacket.WriteInt(0);
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteInt(1);//Users in Agit //Length Visiter Count
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteInt(4);
         oPacket.WriteInt(cs.LoginUID);
         oPacket.WriteInt(cs.Nick.Length * 2);
         oPacket.WriteUnicodeString(cs.Nick);
         oPacket.WriteByte((byte)cs.CurrentChar);
         int MyCharPos = -1;
         for (int t = 0; t < cs.MyCharacter.MyChar.Length; t++)
         {
             if (cs.MyCharacter.MyChar[t].CharType == cs.CurrentChar)
             {
                 MyCharPos = t;
             }
         }
         oPacket.WriteByte((byte)cs.MyCharacter.MyChar[MyCharPos].Promotion);
         oPacket.WriteInt(cs.MyCharacter.MyChar[MyCharPos].Level);
         oPacket.WriteInt(0);
         oPacket.WriteHexString("00 00 00 01 00 0A 9A 2E 00 00 00 01 33 F5 2A 7B 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 E4 82 00 00 00 1A 53 00 71 00 75 00 69 00 72 00 65 00 20 00 47 00 61 00 69 00 6B 00 6F 00 7A 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 FF DB 30 31 C8 67 2D 00 00 00 01 00 00 00 00 06 00 00 00 00 00 00 00 01 00 00 03 4F 00 00 00 00 00 00 00 02 00 00 03 51 00 00 00 00 00 00 00 05 00 00 03 4A 00 00 00 00 00 00 00 06 00 00 03 50 00 00 00 00 00 00 00 07 00 00 03 4D 00 00 00 00 00 00 00 0B 00 00 03 4E 00 00 00 00 00 00 00 00");
         oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
         cs.Send(oPacket);
     }
 }
コード例 #16
0
ファイル: Quests.cs プロジェクト: rocverde/GrandChaseIV
        public void RegisterMission(ClientSession cs, InPacket ip)
        {
            int missionID  = ip.ReadInt();
            int progress   = ip.ReadInt();
            int missionUID = ip.ReadInt();

            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_REGIST_MISSION_ACK))
            {
                oPacket.WriteInt(0);
                oPacket.WriteInt(missionID);
                oPacket.WriteInt(progress);
                oPacket.WriteInt(missionUID);
                oPacket.WriteInt(missionID);
                oPacket.WriteHexString("00 00 00 00 59 21 9E A1 59 20 4D 21 00 00 00 00");
                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
                DataSet ds = new DataSet();
                Database.Query(ref ds, "INSERT INTO `gc`.`missions` (  `LoginUID`,  `MissionID`,  `MissionUID`,  `Progress`) VALUES  (    '{0}',    '{1}',    '{2}',    '{3}'  )", cs.LoginUID, missionID, missionUID, progress);

                DataSet ds2 = new DataSet();
                Database.Query(ref ds2, "DELETE FROM  `gc`.`inventory` WHERE `LoginUID` = '{0}'   AND `ItemID` = '{1}'", cs.LoginUID, missionID);
            }
        }
コード例 #17
0
        public void FriendList(ClientSession msg, InPacket ip)
        {
            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_INVITE_NOT))
            {
                msg.LoginUID = ip.ReadInt();
                int LenLogin = ip.ReadInt();
                msg.Login = ip.ReadUnicodeString(LenLogin);

                LogFactory.GetLog("MSG INFOS").LogInfo("LoginUID: " + msg.LoginUID);
                LogFactory.GetLog("MSG INFOS").LogInfo("Length Lgn: " + LenLogin);
                LogFactory.GetLog("MSG INFOS").LogInfo("Login: "******"00 00 00 00 00 00 00 01 00 00 00 0A 00 00 00 0A 00 00 00 0C 46 00 72 00 69 00 65 00 6E 00 64 00");
                oPacket.WriteInt(listfriends.Length);
                LogFactory.GetLog("FriendsList").LogInfo("List Length: " + listfriends.Length);
                for (int z = 0; z < listfriends.Length; z++)
                {
                    LogFactory.GetLog("FriendsList").LogInfo("FriendName: " + listfriends[z].FriendName);
                    oPacket.WriteInt(listfriends[z].FriendID);
                    oPacket.WriteInt(listfriends[z].FriendID);
                    oPacket.WriteInt(listfriends[z].FriendName.Length * 2);
                    oPacket.WriteUnicodeString(listfriends[z].FriendName);
                    oPacket.WriteHexString("00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 FF FF FF FF");//00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 FF FF FF FF
                }
                oPacket.WriteHexString("00 00 00 01 00 00 00 18 42 00 6C 00 6F 00 63 00 6B 00 20 00 46 00 72 00 69 00 65 00 6E 00 64 00 00 00 00 00 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 01");
                oPacket.Assemble(msg.CRYPT_KEY, msg.CRYPT_HMAC, msg.CRYPT_PREFIX, ++msg.CRYPT_COUNT);
                msg.Send(oPacket);
            }
            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_CHANGE_ROOMUSER_INFO_REQ))
            {
                oPacket.WriteHexString("00 00 00 01 00 00 00 0A 00 00 00 00");
                oPacket.CompressAndAssemble(msg.CRYPT_KEY, msg.CRYPT_HMAC, msg.CRYPT_PREFIX, ++msg.CRYPT_COUNT);
                msg.Send(oPacket);
            }
        }
コード例 #18
0
        public void OnJoinRoom(ClientSession cs, InPacket ip)
        {
            ip.ReadByte(); // 0
            ip.ReadByte(); // 0
            ip.ReadByte(); // 0
            ushort RoomID  = ip.ReadUShort();
            int    PassLen = ip.ReadInt();
            string Pass    = "";

            if (PassLen > 0)
            {
                Pass = ip.ReadUnicodeString(PassLen);
            }


            Room room = GetRoom(RoomID);


            if (room == null)
            {
                goto cantjoin;
            }


            if (room.GetFreeSlot() == 0 || room.Playing == true || cs.CurrentRoom != null)
            {
                goto cantjoin;
            }


            if (room.RoomPass != Pass)
            {
                goto cantjoin;
            }


            byte Team1 = 0, Team2 = 0;
            int  EmptyPos1 = -1, EmptyPos2 = -1;

            for (int i = 0; i < 3; i++)
            {
                if (room.Slot[i].Active == true)
                {
                    Team1++;
                }
                if (EmptyPos1 == -1 && room.Slot[i].Open == true)
                {
                    EmptyPos1 = i;
                }
            }
            for (int i = 3; i < 6; i++)
            {
                if (room.Slot[i].Active == true)
                {
                    Team2++;
                }
                if (EmptyPos2 == -1 && room.Slot[i].Open == true)
                {
                    EmptyPos2 = i;
                }
            }


            int pos = EmptyPos1;

            if (Team1 >= Team2)
            {
                pos = EmptyPos2;
            }

            room.Slot[pos].Active = true;
            room.Slot[pos].cs     = cs;
            room.Slot[pos].Open   = false;
            room.Slot[pos].Spree  = 0;
            room.Slot[pos].Leader = false;
            room.Slot[pos].AFK    = false;


            cs.CurrentRoom = room;


            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_JOIN_ROOM_BROAD))
            {
                oPacket.WriteInt(cs.Login.Length * 2);
                oPacket.WriteUnicodeString(cs.Login);
                oPacket.WriteInt(cs.LoginUID);
                oPacket.WriteInt(cs.Nick.Length * 2);
                oPacket.WriteUnicodeString(cs.Nick);
                oPacket.WriteInt(pos);
                oPacket.WriteByte((byte)cs.CurrentChar);
                oPacket.WriteHexString("00 FF 00 FF 00 FF 00 00 00 00");
                oPacket.WriteByte((byte)(pos / 3));
                oPacket.WriteHexString("01 00 00 00 0D 00 00 00 00 10 F4 00 00 00 00 00 4E 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00");
                if (room.GetRoomLeaderCS() == cs)
                {
                    oPacket.WriteByte(1);
                }
                else
                {
                    oPacket.WriteByte(0);
                }
                oPacket.WriteHexString("01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");

                oPacket.WriteByte((byte)cs.MyCharacter.MyChar.Length);
                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(0);
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].Promotion);
                    oPacket.WriteInt(0);
                    oPacket.WriteByte(0);
                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Exp);
                    oPacket.WriteByte(0);
                    oPacket.WriteByte(0);
                    oPacket.WriteByte(0);
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].Level);
                    oPacket.WriteInt(0);
                    oPacket.WriteInt(0);

                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip.Length);
                    for (int j = 0; j < cs.MyCharacter.MyChar[i].Equip.Length; j++)
                    {
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemID);
                        oPacket.WriteInt(1);
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemUID);
                        oPacket.WriteInt(0);
                        oPacket.WriteInt(0);
                        oPacket.WriteInt(0);
                        oPacket.WriteInt(0);
                        oPacket.WriteByte(0);
                        oPacket.WriteByte(0);
                        oPacket.WriteByte(0);
                    }

                    //oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 01 00 00 00 00 00 00 00 00 02 00 00 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 01 FF 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07");

                    oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 01 00");


                    /*
                     * oPacket.WriteInt(cs.MyCharacter.MyChar[i].EquipSkill.Length);
                     * for (int j = 0; j < cs.MyCharacter.MyChar[i].EquipSkill.Length; j++)
                     * {
                     *  oPacket.WriteInt(0);
                     *  oPacket.WriteInt(cs.MyCharacter.MyChar[i].EquipSkill[j].SkillGroup);
                     *  oPacket.WriteInt(cs.MyCharacter.MyChar[i].EquipSkill[j].SkillID);
                     * }*/
                    oPacket.WriteInt(0);


                    oPacket.WriteHexString("00 00 00 FF 00 00 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 FF 00 00 00 00 00 00");


                    /*oPacket.WriteInt(cs.MyCharacter.MyChar[i].MySkill.Length);
                     * for (int j = 0; j < cs.MyCharacter.MyChar[i].MySkill.Length; j++)
                     * {
                     *  oPacket.WriteInt(cs.MyCharacter.MyChar[i].MySkill[j].SkillID);
                     * }*/
                    oPacket.WriteInt(0);

                    oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07");
                }
                oPacket.WriteHexString("00 00 00 04 13 00 A8 C0 01 EC A8 C0 9B BA FE A9");
                oPacket.WriteIPFromString(cs.GetIP(), false);
                oPacket.WriteHexString("00 00 00 01 7E F6 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 E5 6A 00 00 00 01 2C BD 52 5A 00 00 00 00 01 00 00 E5 88 00 00 00 01 2C BD 52 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 56 86 32 00 56 87 6E D4 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");


                for (int i = 0; i < 6; i++)
                {
                    if (room.Slot[i].Active == true && room.Slot[i].cs != cs)
                    {
                        oPacket.Assemble(room.Slot[i].cs.CRYPT_KEY, room.Slot[i].cs.CRYPT_HMAC, room.Slot[i].cs.CRYPT_PREFIX, room.Slot[i].cs.CRYPT_COUNT);
                        room.Slot[i].cs.Send(oPacket);
                        oPacket.CancelAssemble();
                    }
                }
            }


            using (OutPacket op = new OutPacket(GameOpcodes.EVENT_JOIN_ROOM_INFO_ACK))
            {
                op.WriteUShort(RoomID);
                op.WriteInt(room.RoomName.Length * 2);
                op.WriteUnicodeString(room.RoomName);
                op.WriteByte(0);
                if (room.RoomPass.Length > 0)
                {
                    op.WriteByte(1);
                }
                else
                {
                    op.WriteByte(0);
                }
                op.WriteInt(room.RoomPass.Length * 2);
                op.WriteUnicodeString(room.RoomPass);
                op.WriteShort((short)room.GetPlayerCount());
                op.WriteShort((short)room.GetFreeSlot());
                op.WriteHexString("00 0B");
                op.WriteByte((byte)room.GameCategory);
                op.WriteInt(room.GameMode);
                op.WriteInt(room.ItemMode);
                op.WriteBool(room.RandomMap);
                op.WriteInt(room.GameMap);
                op.WriteHexString("00 00 00 0C");
                for (int i = 0; i < 6; i++)
                {
                    op.WriteBool(room.Slot[i].Open);
                }
                op.WriteHexString("FF FF FF FF 00 00 00 00 00 00 00 00 01");
                op.WriteIPFromString(Server.UDPRelayIP, true);
                op.WriteShort(Server.UDPRelayPort);
                op.WriteIPFromString(Server.TCPRelayIP, true);
                op.WriteShort(Server.TCPRelayPort);

                op.WriteHexString("01 00 01 00 00 01 2C 00 00 00 14 00 02 4B 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 01 00 00 00 00");

                op.Assemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, cs.CRYPT_COUNT);
                cs.Send(op);
            }

            room.SendJoinRoomInfoDivide(cs);
            return;


cantjoin:
            using (OutPacket op = new OutPacket(GameOpcodes.EVENT_JOIN_ROOM_INFO_DIVIDE_ACK))
            {
                op.WriteInt(6);
                op.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 01 30 00 00 00 F9 00 00 09 0D 00 00 00 00 00 00 00 00 F2 04 00 00 00 00 00 00 13 49 F4 FC 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 09 13 F2 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");

                op.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, cs.CRYPT_COUNT);
                cs.Send(op);
            }
            return;
        }
コード例 #19
0
ファイル: Channel.cs プロジェクト: Raymonf/GCV
        public void OnJoinRoom(ClientSession cs, InPacket ip)
        {
            ip.ReadByte(); // 0
            ip.ReadByte(); // 0
            ip.ReadByte(); // 0
            ip.ReadByte(); // 0
            ushort RoomID  = ip.ReadUShort();
            int    PassLen = ip.ReadInt();
            string Pass    = "";

            if (PassLen > 0)
            {
                Pass = ip.ReadUnicodeString(PassLen);
            }
            //LogFactory.GetLog("ROOM INFO:").LogInfo("ROOM ID: "+RoomID);
            //LogFactory.GetLog("ROOM INFO:").LogInfo("ROOM Length Password: "******"ROOM INFO:").LogInfo("ROOM Password: "******"Main").LogInfo(" Sergio Dean {0} metade Kana {1} {2} uma determinada ranhura ({3}, {4})", Team1, Team2, pos, EmptyPos1, EmptyPos2);

            // 방 슬롯에 정보 입력
            room.Slot[pos].Active = true;
            room.Slot[pos].cs     = cs;
            room.Slot[pos].Open   = false;
            room.Slot[pos].Spree  = 0;
            room.Slot[pos].Leader = false;
            room.Slot[pos].AFK    = false;

            // 유저한테 방 입력
            cs.CurrentRoom = room;

            // 방에 있는 사람들한테 입장했다고 알려준다. (입장하는놈은 제외)
            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_JOIN_ROOM_BROAD))
            {
                oPacket.WriteInt(cs.Login.Length * 2);
                oPacket.WriteUnicodeString(cs.Login);
                oPacket.WriteInt(cs.LoginUID);
                oPacket.WriteInt(cs.Nick.Length * 2);
                oPacket.WriteUnicodeString(cs.Nick);
                oPacket.WriteInt(pos);
                oPacket.WriteByte((byte)cs.CurrentChar);
                oPacket.WriteHexString("00 FF 00 FF 00 FF 00 00 00 00");
                oPacket.WriteByte((byte)(pos / 3)); // 팀을 구하면 됨. 빠르게 처리하기 위해서
                oPacket.WriteHexString("01 00 00 00 0D 00 00 00 00 10 F4 00 00 00 00 00 4E 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35 00 00 00 00 00 00 00 00 00 00 00 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 00 00 00 00 00 00 00 00 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5F 00 00 00 00 00 00 00 00 00 00 00");
                if (room.GetRoomLeaderCS() == cs)
                {
                    oPacket.WriteByte(1);
                }
                else
                {
                    oPacket.WriteByte(0);
                }
                oPacket.WriteHexString("01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");

                oPacket.WriteByte((byte)cs.MyCharacter.MyChar.Length);
                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    //LogFactory.GetLog("ROOM INFO:").LogInfo("ROOM Chartype: " + cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(0);
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].Promotion);
                    //LogFactory.GetLog("ROOM INFO:").LogInfo("ROOM Chartype: " + cs.MyCharacter.MyChar[i].Promotion);
                    oPacket.WriteInt(0);
                    oPacket.WriteByte(0);
                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Exp);
                    //LogFactory.GetLog("ROOM INFO:").LogInfo("ROOM Chartype: " + cs.MyCharacter.MyChar[i].Exp);
                    oPacket.WriteByte(0);
                    oPacket.WriteByte(0);
                    oPacket.WriteByte(0);
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].Level);
                    //LogFactory.GetLog("ROOM INFO:").LogInfo("ROOM Chartype: " + cs.MyCharacter.MyChar[i].Level);
                    oPacket.WriteInt(0);
                    oPacket.WriteInt(0);

                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip.Length);
                    for (int j = 0; j < cs.MyCharacter.MyChar[i].Equip.Length; j++)
                    {
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemID);
                        oPacket.WriteInt(1);
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemUID);
                        oPacket.WriteInt(0);
                        oPacket.WriteInt(0);
                        oPacket.WriteInt(0);
                        oPacket.WriteInt(0);
                        oPacket.WriteByte(0);
                        oPacket.WriteByte(0);
                        oPacket.WriteByte(0);
                    }

                    //oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 01 00 00 00 00 00 00 00 00 02 00 00 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 01 FF 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07");
                    // 이 패킷이 아래 끝까지 분리됐음. ▼▼
                    oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 01 00");

                    // 장착한 스킬

                    /*
                     * oPacket.WriteInt(cs.MyCharacter.MyChar[i].EquipSkill.Length);
                     * for (int j = 0; j < cs.MyCharacter.MyChar[i].EquipSkill.Length; j++)
                     * {
                     *  oPacket.WriteInt(0);
                     *  oPacket.WriteInt(cs.MyCharacter.MyChar[i].EquipSkill[j].SkillGroup);
                     *  oPacket.WriteInt(cs.MyCharacter.MyChar[i].EquipSkill[j].SkillID);
                     * }*/
                    oPacket.WriteInt(0);

                    // FF가 스킬포인트일지도
                    oPacket.WriteHexString("00 00 00 FF 00 00 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 FF 00 00 00 00 00 00");

                    // 배운 스킬

                    /*oPacket.WriteInt(cs.MyCharacter.MyChar[i].MySkill.Length);
                     * for (int j = 0; j < cs.MyCharacter.MyChar[i].MySkill.Length; j++)
                     * {
                     *  oPacket.WriteInt(cs.MyCharacter.MyChar[i].MySkill[j].SkillID);
                     * }*/
                    oPacket.WriteInt(0);

                    oPacket.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 2C 00 00 01 2C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07");
                    // ▲▲
                }
                oPacket.WriteHexString("00 00 00 04 13 00 A8 C0 01 EC A8 C0 9B BA FE A9");
                oPacket.WriteIPFromString(cs.GetIP(), false);
                oPacket.WriteHexString("00 00 00 01 7E F6 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 E5 6A 00 00 00 01 2C BD 52 5A 00 00 00 00 01 00 00 E5 88 00 00 00 01 2C BD 52 5B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 56 86 32 00 56 87 6E D4 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");

                // 방에 있는 모든 유저에게 전송해야함.
                for (int i = 0; i < 6; i++)
                {
                    // 나 자신은 제외한 나머지한테 전송
                    if (room.Slot[i].Active == true && room.Slot[i].cs != cs)
                    {
                        oPacket.Assemble(room.Slot[i].cs.CRYPT_KEY, room.Slot[i].cs.CRYPT_HMAC, room.Slot[i].cs.CRYPT_PREFIX, room.Slot[i].cs.CRYPT_COUNT);
                        room.Slot[i].cs.Send(oPacket); // 패킷 보내고
                        oPacket.CancelAssemble();      // 다시 패킷 복구
                    }
                }
            }

            // 방에 접속했다고 알려준다.
            using (OutPacket op = new OutPacket(GameOpcodes.EVENT_JOIN_ROOM_INFO_ACK))
            {
                op.WriteUShort(RoomID);
                op.WriteInt(room.RoomName.Length * 2);
                op.WriteUnicodeString(room.RoomName);
                op.WriteByte(0);
                if (room.RoomPass.Length > 0)
                {
                    op.WriteByte(1); // 비밀방
                }
                else
                {
                    op.WriteByte(0); // 공개방
                }
                op.WriteInt(room.RoomPass.Length * 2);
                op.WriteUnicodeString(room.RoomPass);
                op.WriteShort((short)room.GetPlayerCount());
                op.WriteShort((short)room.GetFreeSlot());
                op.WriteHexString("00 0B");
                op.WriteByte((byte)room.GameCategory);
                op.WriteInt(room.GameMode);
                op.WriteInt(room.ItemMode);
                op.WriteBool(room.RandomMap);
                op.WriteInt(room.GameMap);
                op.WriteHexString("00 00 00 0C");
                for (int i = 0; i < 6; i++)
                {
                    op.WriteBool(room.Slot[i].Open);
                }
                op.WriteHexString("FF FF FF FF 00 00 00 00 00 00 00 00 01");
                op.WriteIPFromString(Server.UDPRelayIP, true);
                op.WriteShort(Server.UDPRelayPort);
                op.WriteIPFromString(Server.TCPRelayIP, true);
                op.WriteShort(Server.TCPRelayPort);

                op.WriteHexString("01 00 01 00 00 01 2C 00 00 00 14 00 02 4B 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 01 00 00 00 00");

                op.Assemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, cs.CRYPT_COUNT);
                cs.Send(op);
            }

            room.SendJoinRoomInfoDivide(cs);
            //return;

            // 방에 입장할 수 없다.
cantjoin:
            using (OutPacket op = new OutPacket(GameOpcodes.EVENT_JOIN_ROOM_INFO_DIVIDE_ACK))
            {
                op.WriteInt(6);
                op.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 01 30 00 00 00 F9 00 00 09 0D 00 00 00 00 00 00 00 00 F2 04 00 00 00 00 00 00 13 49 F4 FC 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 09 13 F2 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");

                op.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, cs.CRYPT_COUNT);
                cs.Send(op);
            }
            //return;
        }
コード例 #20
0
        public void OnLogin(ClientSession cs, InPacket ip)
        {
            int    IDLength = ip.ReadInt();
            string ID       = ip.ReadString(IDLength);
            int    PWLength = ip.ReadInt();
            string PW       = ip.ReadString(PWLength);

            ip.Skip(21);
            int    crc32len = ip.ReadInt();
            string crc32    = ip.ReadString(crc32len);

            LogFactory.GetLog("CRC").LogInfo("LENGTH: " + crc32len + " CRC: " + crc32);

            DataSet ds = new DataSet();

            Database.Query(ref ds, "SELECT * FROM account WHERE Login = '******' AND Passwd = '{1}'", ID, PW);


            if (ds.Tables[0].Rows.Count == 0)
            {
                // 로그인 실패
                LogFactory.GetLog("MAIN").LogInfo("{0}의 로그인이 실패하였습니다.", ID);

                using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_VERIFY_ACCOUNT_ACK))
                {
                    oPacket.WriteHexString("00 00 00 14");
                    oPacket.WriteInt(IDLength * 2);
                    oPacket.WriteUnicodeString(ID);
                    oPacket.WriteHexString("00 00 00 00 00");

                    oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                    cs.Send(oPacket);
                }
            }
            else
            {
                SendServerList(cs);
                SendChannelNews(cs);
                //SendShop(cs);
                SendClientContentOpen(cs);
                SendSocketTableInfo(cs);
                SendCashbackRatio(cs);

                using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_VERIFY_ACCOUNT_ACK))
                {
                    oPacket.WriteHexString("00 00 00 00");
                    oPacket.WriteInt(IDLength * 2);
                    oPacket.WriteUnicodeString(ID);
                    oPacket.WriteInt(PWLength);
                    oPacket.WriteString(PW);

                    oPacket.WriteHexString("00 00 00 00 14 00 8E A7 C5 01 00 00 00 00 00 00 02 4B 52 00 05 A3 BD 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00");

                    oPacket.WriteInt(cs.MyLoading.GuildMarkURL.Length * 2);
                    oPacket.WriteUnicodeString(cs.MyLoading.GuildMarkURL);
                    oPacket.WriteHexString("00 00 00 00 00 00 00 00");

                    //checklist
                    int SHAi = cs.MyLoading.checklist.Length;
                    oPacket.WriteInt(SHAi);
                    for (int i = 0; i <= cs.MyLoading.checklist.Length - 1; i++)
                    {
                        oPacket.WriteInt(cs.MyLoading.checklist[i].nFile.Length * 2);
                        oPacket.WriteUnicodeString(cs.MyLoading.checklist[i].nFile);
                        oPacket.WriteBool(true);
                    }
                    oPacket.WriteHexString("00 00 00 01 00 00 00 03 00 00 00 00 00 00 00 00 64 01 00 00 00 00 00 00 00 64 02 00 00 00 00 00 00 00 64 01 BF 80 00 00 FC 04 97 FF 00 00 00 00 00 00 00 00 00 00 00 00");

                    oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                    cs.Send(oPacket);
                }
            }
        }
コード例 #21
0
        /*public void LoadSkilltree(ClientSession cs)
         * {
         *  DataSet ds3 = new DataSet();
         *  Database.Query(ref ds3, "SELECT * FROM `skilltree` WHERE `LoginUI` = '{0}'", cs.LoginUID);
         *  Array.Resize(ref skillinfo, ds3.Tables[0].Rows.Count);
         *  for (int i = 0; i < skillinfo.Length; i++)
         *  {
         *      skillinfo[i].charindex =Convert.ToByte(ds3.Tables[0].Rows[i]["charindex"].ToString());
         *      LogFactory.GetLog("SKILL").LogInfo("CHARID: " + skillinfo[i].charindex);
         *      skillinfo[i].ui1 = Convert.ToByte(ds3.Tables[0].Rows[i]["ui1"].ToString());
         *      LogFactory.GetLog("SKILL").LogInfo("CHARID: " + skillinfo[i].ui1);
         *      skillinfo[i].ui2 = Convert.ToInt32(ds3.Tables[0].Rows[i]["ui2"].ToString());
         *      LogFactory.GetLog("SKILL").LogInfo("CHARID: " + skillinfo[i].ui2);
         *  }
         * }*/

        public void OnSetSkill(ClientSession cs, InPacket ip)
        {
            int unknown1       = ip.ReadInt();
            int LoginUID       = ip.ReadInt();
            int UnknownCharNum = ip.ReadInt();

            /*
             * for(int i = 0; i < UnknownCharNum; i++)
             * {
             *  int c = ip.ReadByte();
             *  byte u1= ip.ReadByte(); // ???
             *  int u2 = ip.ReadInt(); // ???
             *
             *  LogFactory.GetLog("MAIN").LogInfo("    {0} / {1} / {2}", c, u1, u2);
             * }
             */
            int CharNum = ip.ReadInt();

            for (int i = 0; i < CharNum; i++)
            {
                int CharType = ip.ReadByte();
                ip.ReadByte(); // ?
                ip.ReadInt();  // ? 00 00 00 02
                ip.ReadInt();  // ? 00 00 00 00

                int SkillCount = ip.ReadInt();

                LogFactory.GetLog("MAIN").LogInfo("    CHARID :{0} / SKILLID: {1}", CharType, SkillCount);

                int CharPos = findCharIndex(CharType);

                if (CharPos != -1)
                {
                    Array.Resize(ref MyChar[CharPos].EquipSkill, SkillCount);


                    for (int j = 0; j < SkillCount; j++)
                    {
                        ip.ReadInt(); // ? 00 00 00 00
                        int SkillGruop = ip.ReadInt();
                        int SkillID    = ip.ReadInt();

                        MyChar[CharPos].EquipSkill[j].SkillGroup = SkillGruop;
                        MyChar[CharPos].EquipSkill[j].SkillID    = SkillID;
                    }
                }

                ip.ReadInt(); // 00 00 00 01
                ip.ReadInt(); // 00 00 00 00
            }


            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_SET_SKILL_BROAD))
            {
                oPacket.WriteInt(0);

                byte[] data = ip.ToArray();
                data = BytesUtil.ReadBytes(data, 4, data.Length - 4);

                oPacket.WriteBytes(data);

                /*
                 * oPacket.WriteInt(0);
                 * oPacket.WriteInt(cs.LoginUID);
                 * oPacket.WriteHexString("00 00 00 0B 00 00 00 00 00 00 01 00 00 00 00 00 02 00 00 00 00 00 05 00 00 00 00 00 0A FF 00 00 00 00 0A 00 00 00 00 00 0D 00 00 00 00 00 0E 00 00 00 00 00 0F 00 00 00 00 00 11 00 00 00 00 00 12 00 00 00 00 00");
                 * oPacket.WriteInt(MyChar.Length);
                 * for (int i = 0; i < MyChar.Length; i++)
                 * {
                 *  oPacket.WriteByte((byte)MyChar[i].CharType);
                 *  oPacket.WriteByte(0);
                 *  oPacket.WriteInt(2);
                 *  oPacket.WriteInt(0);
                 *
                 *  oPacket.WriteInt(MyChar[i].skillinfo.Length);
                 *  for (int j = 0; j < MyChar[i].skillinfo.Length; j++)
                 *  {
                 *      oPacket.WriteInt(0);
                 *      oPacket.WriteInt(MyChar[i].skillinfo[j].SkillGroup);
                 *      oPacket.WriteInt(MyChar[i].skillinfo[j].SkilliD);
                 *  }
                 *
                 *  oPacket.WriteInt(1);
                 *  oPacket.WriteInt(0);
                 * }
                 *  /*
                 *  oPacket.WriteInt(0); // ??
                 *  oPacket.WriteInt(LoginUID);
                 *
                 *  oPacket.WriteInt(MyChar.Length);
                 *  for (int i = 0; i < MyChar.Length; i++)
                 *  {
                 *      oPacket.WriteByte((byte)i); // 캐릭터 번호
                 *      oPacket.WriteByte(0); // ???
                 *      oPacket.WriteInt(); // ???
                 *  }
                 *
                 *  oPacket.WriteInt(MyChar.Length);
                 *  for (int i = 0; i < MyChar.Length; i++)
                 *  {
                 *      oPacket.WriteByte((byte)MyChar[i].CharType);
                 *      oPacket.WriteByte(0);
                 *      oPacket.WriteInt(2);
                 *      oPacket.WriteInt(0);
                 *
                 *      oPacket.WriteInt(MyChar[i].EquipSkill.Length);
                 *      for (int j = 0; j < MyChar[i].EquipSkill.Length; j++)
                 *      {
                 *          oPacket.WriteInt(0);
                 *          oPacket.WriteInt(MyChar[i].EquipSkill[j].SkillGroup);
                 *          oPacket.WriteInt(MyChar[i].EquipSkill[j].SkillID);
                 *      }
                 *
                 *      oPacket.WriteInt(1);
                 *      oPacket.WriteInt(0);
                 *  }
                 */

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }
        }
コード例 #22
0
        public void OnEquipItem(ClientSession cs, InPacket ip)
        {
            int    LoginIDLen = ip.ReadInt();
            string LoginID    = ip.ReadUnicodeString(LoginIDLen);

            ip.ReadInt(); // 00 00 00 00
            byte CharNum = ip.ReadByte();

            for (byte i = 0; i < CharNum; i++)
            {
                byte TargetChar = ip.ReadByte();
                int  EquipCount = ip.ReadInt();

                int MyCharPos = -1;
                for (int t = 0; t < cs.MyCharacter.MyChar.Length; t++)
                {
                    if (cs.MyCharacter.MyChar[t].CharType == TargetChar)
                    {
                        MyCharPos = t;
                    }
                }

                // 내가 가진 캐릭터 목록에 없다
                if (MyCharPos == -1)
                {
                    continue;
                }

                //Array.Resize(ref cs.MyCharacter.MyChar[MyCharPos].Equip, EquipCount);
                int len = cs.MyCharacter.MyChar[MyCharPos].Equip.Length;
                for (int j = 0; j < EquipCount; j++)
                {
                    int kind   = 0;
                    int ItemID = ip.ReadInt();
                    ip.ReadInt();  // 00 00 00 01
                    int ItemUID = ip.ReadInt();
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadByte(); // 00 00 00
                    ip.ReadByte(); //
                    ip.ReadByte(); //

                    /*
                     * helm 0
                     * upper 1
                     * lower 2
                     * Weapon 3
                     * gloves 8
                     * shoes 9
                     * Circlet 10
                     * Wings 12
                     * Mask 11
                     * cloak 13
                     * Stompers 14
                     * Shields 15
                     */
                    DataSet ds3 = new DataSet();
                    Database.Query(ref ds3, "SELECT   `Kind` FROM  `gc`.`goodsinfolist` WHERE `GoodsID` = '{0}'", ItemID);
                    if (ds3.Tables[0].Rows.Count == 0)
                    {
                        LogFactory.GetLog("EQUIPS").LogWarning("ITEM NAO EXISTE!");
                        kind = 0;
                    }
                    else
                    {
                        kind = Convert.ToInt32(ds3.Tables[0].Rows[0]["Kind"].ToString());
                    }
                    int type = 0;
                    if (kind == 0)
                    {
                        type = 0;
                    }
                    if (kind == 1)
                    {
                        type = 1;
                    }
                    if (kind == 2)
                    {
                        type = 2;
                    }
                    if (kind == 3)
                    {
                        type = 3;
                    }
                    if (kind == 8)
                    {
                        type = 4;
                    }
                    if (kind == 9)
                    {
                        type = 5;
                    }
                    if (kind == 13)
                    {
                        type = 6;
                    }
                    //cs.MyCharacter.MyChar[MyCharPos].Equip[j].ItemID = ItemID;
                    DataSet ds2 = new DataSet();
                    Database.Query(ref ds2, "SELECT itemID FROM gc.equipment WHERE LoginUID = '{0}' AND CharType = '{1}' AND ItemUID = '{2}'", cs.LoginUID, MyChar[MyCharPos].CharType, ItemUID);
                    if (ds2.Tables[0].Rows.Count == 0)
                    {
                        DataSet ds = new DataSet();
                        Database.Query(ref ds, "INSERT INTO gc.equipment ( LoginUID, CharType, ItemType, ItemID,ItemUID) VALUES ( '{0}', '{1}', '{2}', '{3}' ,'{4}')", cs.LoginUID, MyChar[MyCharPos].CharType, type, ItemID, ItemUID);
                    }
                    else
                    {
                        DataSet ds = new DataSet();
                        Database.Query(ref ds, "UPDATE   `gc`.`equipment` SET  `ItemID` = '{0}' WHERE `LoginUID` = '{1}'   AND `CharType` = '{2}'   AND `ItemType` = '{3}'", ItemID, cs.LoginUID, MyChar[MyCharPos].CharType, type);
                    }
                    if (EquipCount > len)
                    {
                        for (int k = 0; k < EquipCount; k++)
                        {
                            len++;
                        }
                    }
                    LogFactory.GetLog("EQUIPAMENTOS").LogInfo("ATUAL TYPE: " + type);
                    if (type > len)
                    {
                        for (int h = 0; h < type; h++)
                        {
                            type--;
                            LogFactory.GetLog("EQUIPAMENTOS").LogInfo("ATUAL TYPE: " + type);
                        }
                    }
                    Array.Resize(ref cs.MyCharacter.MyChar[MyCharPos].Equip, len);
                    cs.MyCharacter.MyChar[MyCharPos].TotalEquips++;
                    LogFactory.GetLog("EQUIPS").LogInfo("TOTAL: " + cs.MyCharacter.MyChar[MyCharPos].TotalEquips);
                    cs.MyCharacter.MyChar[MyCharPos].Equip[type].ItemID  = ItemID;
                    cs.MyCharacter.MyChar[MyCharPos].Equip[type].ItemUID = ItemUID;

                    //Array.Resize(ref cs.MyCharacter.MyChar[MyCharPos].Equip, EquipCount++);

                    /*cs.MyCharacter.MyChar[MyCharPos].Equip[type].ItemID = ItemID;
                     * cs.MyCharacter.MyChar[MyCharPos].Equip[type].ItemUID = ItemUID;*/
                }

                // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                ip.Skip(99);
            }

            // 패킷 구조 똑같이 보내면 된다.
            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_EQUIP_ITEM_BROAD))
            {
                oPacket.WriteInt(cs.Login.Length * 2);
                oPacket.WriteUnicodeString(cs.Login);
                oPacket.WriteInt(0);
                oPacket.WriteByte((byte)cs.MyCharacter.MyChar.Length);

                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip.Length);
                    for (int j = 0; j < cs.MyCharacter.MyChar[i].Equip.Length; j++)
                    {
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemID);
                        oPacket.WriteInt(1);
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemUID);
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteByte(); // 00 00 00
                        oPacket.WriteByte(); //
                        oPacket.WriteByte(); //
                    }

                    // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                    oPacket.Skip(99);
                }

                oPacket.WriteInt(0); // 그냥

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }

            if (cs.CurrentRoom == null)
            {
                return;
            }

            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_EQUIP_ITEM_BROAD))
            {
                oPacket.WriteInt(cs.Login.Length);
                oPacket.WriteUnicodeString(cs.Login);

                oPacket.WriteByte(2); // ???

                oPacket.WriteInt(cs.MyCharacter.MyChar.Length);
                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(0); // 00 00 00 00
                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip.Length);
                    for (int j = 0; j < cs.MyCharacter.MyChar[i].Equip.Length; j++)
                    {
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemID);
                        oPacket.WriteInt(1);
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemUID);
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteByte(); // 00 00 00
                        oPacket.WriteByte(); //
                        oPacket.WriteByte(); //
                    }

                    oPacket.Skip(61);
                    oPacket.WriteHexString("FF FF");
                    oPacket.Skip(32);
                    oPacket.WriteInt(cs.LoginUID);
                }

                for (int i = 0; i < 6; i++)
                {
                    if (cs.CurrentRoom.Slot[i].Active == true)
                    {
                        oPacket.CompressAndAssemble(cs.CurrentRoom.Slot[i].cs.CRYPT_KEY, cs.CurrentRoom.Slot[i].cs.CRYPT_HMAC, cs.CurrentRoom.Slot[i].cs.CRYPT_PREFIX, cs.CurrentRoom.Slot[i].cs.CRYPT_COUNT);
                        cs.CurrentRoom.Slot[i].cs.Send(oPacket);
                        oPacket.CancelAssemble();
                    }
                }
            }
        }
コード例 #23
0
        public void OnSetSkill(ClientSession cs, InPacket ip)
        {
            //Log.Hex("패킷", ip.ToArray());

            int unknown1       = ip.ReadInt();
            int LoginUID       = ip.ReadInt();
            int UnknownCharNum = ip.ReadInt();

            for (int i = 0; i < UnknownCharNum; i++)
            {
                int  c  = ip.ReadByte(); // 캐릭터 번호
                byte u1 = ip.ReadByte(); // ???
                int  u2 = ip.ReadInt();  // ???
                LogFactory.GetLog("Main").LogInfo("    {0} / {1} / {2}", c, u1, u2);
            }

            int CharNum = ip.ReadInt();

            for (int i = 0; i < CharNum; i++)
            {
                int CharType = ip.ReadByte(); // 캐릭터 번호
                ip.ReadByte();                // ?
                ip.ReadInt();                 // ? 00 00 00 02
                ip.ReadInt();                 // ? 00 00 00 00

                int SkillCount = ip.ReadInt();

                LogFactory.GetLog("Main").LogInfo("Caracteres {0} / {1} habilidades do número", CharType, SkillCount);

                int CharPos = findCharIndex(CharType); // 캐릭터가 있는 배열 위치
                // 캐릭터가 있으면 동작
                if (CharPos != -1)
                {
                    Array.Resize(ref MyChar[CharPos].EquipSkill, SkillCount);

                    // 스킬 개수만큼 배열에 담는다
                    for (int j = 0; j < SkillCount; j++)
                    {
                        ip.ReadInt();                  // ? 00 00 00 00
                        int SkillGruop = ip.ReadInt(); // 아마도 스킬 그룹일 가능성 높음.
                        int SkillID    = ip.ReadInt();

                        MyChar[CharPos].EquipSkill[j].SkillGroup = SkillGruop;
                        MyChar[CharPos].EquipSkill[j].SkillID    = SkillID;
                    }
                }

                ip.ReadInt(); // 00 00 00 01
                ip.ReadInt(); // 00 00 00 00
            }

            // 패킷은 똑같이 보내면 된다.
            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_SET_SKILL_BROAD))
            {
                oPacket.WriteInt(0);

                byte[] data = ip.ToArray();
                data = BytesUtil.ReadBytes(data, 4, data.Length - 4);

                oPacket.WriteBytes(data);

                /*
                 * oPacket.WriteInt(0); // ??
                 * oPacket.WriteInt(LoginUID);
                 *
                 * oPacket.WriteInt(MyChar.Length);
                 * for (int i = 0; i < MyChar.Length; i++)
                 * {
                 *  oPacket.WriteByte((byte)i); // 캐릭터 번호
                 *  oPacket.WriteByte(0); // ???
                 *  oPacket.WriteInt(); // ???
                 * }
                 *
                 * oPacket.WriteInt(MyChar.Length);
                 * for (int i = 0; i < MyChar.Length; i++)
                 * {
                 *  oPacket.WriteByte((byte)MyChar[i].CharType);
                 *  oPacket.WriteByte(0);
                 *  oPacket.WriteInt(2);
                 *  oPacket.WriteInt(0);
                 *
                 *  oPacket.WriteInt(MyChar[i].EquipSkill.Length);
                 *  for (int j = 0; j < MyChar[i].EquipSkill.Length; j++)
                 *  {
                 *      oPacket.WriteInt(0);
                 *      oPacket.WriteInt(MyChar[i].EquipSkill[j].SkillGroup);
                 *      oPacket.WriteInt(MyChar[i].EquipSkill[j].SkillID);
                 *  }
                 *
                 *  oPacket.WriteInt(1);
                 *  oPacket.WriteInt(0);
                 * }
                 */

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }
        }
コード例 #24
0
        public void OnEquipItem(ClientSession cs, InPacket ip)
        {
            int    LoginIDLen = ip.ReadInt();
            string LoginID    = ip.ReadUnicodeString(LoginIDLen);

            ip.ReadInt(); // 00 00 00 00
            byte CharNum = ip.ReadByte();

            for (byte i = 0; i < CharNum; i++)
            {
                byte TargetChar = ip.ReadByte();
                int  EquipCount = ip.ReadInt();

                int MyCharPos = -1;
                for (int t = 0; t < cs.MyCharacter.MyChar.Length; t++)
                {
                    if (cs.MyCharacter.MyChar[t].CharType == TargetChar)
                    {
                        MyCharPos = t;
                    }
                }

                // 내가 가진 캐릭터 목록에 없다
                if (MyCharPos == -1)
                {
                    continue;
                }

                Array.Resize(ref cs.MyCharacter.MyChar[MyCharPos].Equip, EquipCount);

                for (int j = 0; j < EquipCount; j++)
                {
                    int ItemID = ip.ReadInt();
                    ip.ReadInt();  // 00 00 00 01
                    int ItemUID = ip.ReadInt();
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadInt();  // 00 00 00 00
                    ip.ReadByte(); // 00 00 00
                    ip.ReadByte(); //
                    ip.ReadByte(); //

                    cs.MyCharacter.MyChar[MyCharPos].Equip[j].ItemID  = ItemID;
                    cs.MyCharacter.MyChar[MyCharPos].Equip[j].ItemUID = ItemUID;
                }

                // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                ip.Skip(99);
            }

            // 패킷 구조 똑같이 보내면 된다.
            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_EQUIP_ITEM_BROAD))
            {
                oPacket.WriteInt(cs.Login.Length * 2);
                oPacket.WriteUnicodeString(cs.Login);
                oPacket.WriteInt(0);
                oPacket.WriteByte((byte)cs.MyCharacter.MyChar.Length);

                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip.Length);
                    for (int j = 0; j < cs.MyCharacter.MyChar[i].Equip.Length; j++)
                    {
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemID);
                        oPacket.WriteInt(1);
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemUID);
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteByte(); // 00 00 00
                        oPacket.WriteByte(); //
                        oPacket.WriteByte(); //
                    }

                    // 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                    oPacket.Skip(99);
                }

                oPacket.WriteInt(0); // 그냥

                oPacket.CompressAndAssemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT);
                cs.Send(oPacket);
            }

            // 내가 지금 방에 입장하고 있으면 방 인원한테 장비가 바뀌었다고 알려준다.
            if (cs.CurrentRoom == null)
            {
                return;
            }

            using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_EQUIP_ITEM_BROAD))
            {
                oPacket.WriteInt(cs.Login.Length);
                oPacket.WriteUnicodeString(cs.Login);

                oPacket.WriteByte(2); // ???

                oPacket.WriteInt(cs.MyCharacter.MyChar.Length);
                for (int i = 0; i < cs.MyCharacter.MyChar.Length; i++)
                {
                    oPacket.WriteByte((byte)cs.MyCharacter.MyChar[i].CharType);
                    oPacket.WriteInt(0); // 00 00 00 00
                    oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip.Length);
                    for (int j = 0; j < cs.MyCharacter.MyChar[i].Equip.Length; j++)
                    {
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemID);
                        oPacket.WriteInt(1);
                        oPacket.WriteInt(cs.MyCharacter.MyChar[i].Equip[j].ItemUID);
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteInt();  // 00 00 00 00
                        oPacket.WriteByte(); // 00 00 00
                        oPacket.WriteByte(); //
                        oPacket.WriteByte(); //
                    }

                    oPacket.Skip(61);
                    oPacket.WriteHexString("FF FF");
                    oPacket.Skip(32);
                    oPacket.WriteInt(cs.LoginUID);
                }

                // 방에 있는 모든 유저에게 전송해야함.
                for (int i = 0; i < 6; i++)
                {
                    if (cs.CurrentRoom.Slot[i].Active == true)
                    {
                        oPacket.CompressAndAssemble(cs.CurrentRoom.Slot[i].cs.CRYPT_KEY, cs.CurrentRoom.Slot[i].cs.CRYPT_HMAC, cs.CurrentRoom.Slot[i].cs.CRYPT_PREFIX, cs.CurrentRoom.Slot[i].cs.CRYPT_COUNT);
                        cs.CurrentRoom.Slot[i].cs.Send(oPacket); // 패킷 보내고
                        oPacket.CancelAssemble();                // 다시 패킷 복구
                    }
                }
            }
        }