Ejemplo n.º 1
0
        public static void m_roomCharacterInfo(Session right, PacketWrite ks)
        {
            ks.Int(right.PCharacters.CharInfo.Length);
            for (int x = 0; x < right.PCharacters.CharInfo.Length; x++)
            {
                ks.Byte(right.PCharacters.CharInfo[x].CharType);
                ks.Int(0);
                ks.Byte(right.PCharacters.CharInfo[x].Promotion);
                ks.Byte(right.PCharacters.CharInfo[x].Promotion);
                ks.Long(right.PCharacters.CharInfo[x].Exp);
                ks.Int(right.PCharacters.CharInfo[x].Level);
                ks.Int(right.PCharacters.CharInfo[x].Win);
                ks.Int(right.PCharacters.CharInfo[x].Lose);
                ks.Int(right.PCharacters.CharInfo[x].Equipements.Count);
                for (int y = 0; y < right.PCharacters.CharInfo[x].Equipements.Count; y++)
                {
                    ks.Int(right.PCharacters.CharInfo[x].Equipements[y].ItemID);
                    ks.Int(1);
                    ks.Int(right.PCharacters.CharInfo[x].Equipements[y].ItemUID);
                    ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
                }

                ks.Int(0);
                ks.Int(right.PCharacters.CharInfo[x].LookItens.Count);
                for (int y = 0; y < right.PCharacters.CharInfo[x].LookItens.Count; y++)
                {
                    ks.UInt(right.PCharacters.CharInfo[x].LookItens[y].ItemID);
                    ks.Int(1);
                    ks.UInt(right.PCharacters.CharInfo[x].LookItens[y].ItemUID);
                    ks.HexArray("00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
                }
                KPetInfo(right, ks, x);
                ks.HexArray("00 00 00 00 00 00 00 00 04 00 00 00 00 00 01 00 00 00 00 02 00 00 00 00 03");
                ks.Int(0);
                ks.HexArray("00 00 00 8C 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");
                ks.Int(right.PCharacters.CharInfo[x].Promotion + 2);
                ks.Byte(right.PCharacters.CharInfo[x].CharType);
                ks.Byte(255);
                ks.Int(0);
                for (byte y = 0; y < right.PCharacters.CharInfo[x].Promotion + 1; y++)
                {
                    ks.Byte(right.PCharacters.CharInfo[x].CharType);
                    ks.Byte(y);
                    ks.Int(0);
                }
                ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
                ks.HexArray("00 00 04 E2 00 00 04 E2 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");
                ks.Int(x);
                ks.Int(right.PInfo.m_iGamePoint);
                ks.Int(right.PInfo.m_iLifePoint);
                ks.HexArray("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");
            }
        }
Ejemplo n.º 2
0
 public static void m_mapCharacterInfo(Session right, PacketWrite ks)
 {
     ks.Int(right.PCharacters.CharInfo.Length);
     for (int x = 0; x < right.PCharacters.CharInfo.Length; x++)
     {
         ks.Byte(right.PCharacters.CharInfo[x].CharType);
         ks.Byte(right.PCharacters.CharInfo[x].CharType);
         ks.Int(0);
         ks.Byte(right.PCharacters.CharInfo[x].Promotion);
         ks.Byte(right.PCharacters.CharInfo[x].Promotion);
         ks.Long(right.PCharacters.CharInfo[x].Exp);
         ks.Int(right.PCharacters.CharInfo[x].Win);
         ks.Int(right.PCharacters.CharInfo[x].Lose);
         ks.Int(right.PCharacters.CharInfo[x].Win);
         ks.Int(right.PCharacters.CharInfo[x].Lose);
         ks.Long(right.PCharacters.CharInfo[x].Exp);
         ks.Int(right.PCharacters.CharInfo[x].Level);
         ks.Int(right.PCharacters.CharInfo[x].Equipements.Count);
         for (int y = 0; y < right.PCharacters.CharInfo[x].Equipements.Count; y++)
         {
             ks.Int(right.PCharacters.CharInfo[x].Equipements[y].ItemID);
             ks.Int(1);
             ks.Int(right.PCharacters.CharInfo[x].Equipements[y].ItemUID);
             ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
         }
         ks.Int(255);
         ks.HexArray("00 00 00 A0 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 0B 18 00 00 00 00 00 00 0B 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
         ks.Int(7);
         ks.Int(7);
         ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
         ks.Int(500);
         ks.Int(x);
         ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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");
         ks.Int(right.PInfo.m_iGamePoint);
         ks.Int(right.PInfo.m_iGamePoint);
         ks.Int(right.PInfo.m_iLifePoint);
         ks.Int(0);
         ks.Int(260);
         ks.Int(260);
         ks.Int(right.PCharacters.CharInfo[x].LookItens.Count);
         for (int y = 0; y < right.PCharacters.CharInfo[x].LookItens.Count; y++)
         {
             ks.UInt(right.PCharacters.CharInfo[x].LookItens[y].ItemID);
             ks.Int(1);
             ks.UInt(right.PCharacters.CharInfo[x].LookItens[y].ItemUID);
             ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
         }
         ks.Int(0);
         ks.Int(0);
     }
 }
Ejemplo n.º 3
0
        public void BundleSellItens(Session p, PacketRead r)
        {
            PacketWrite pw = new PacketWrite();

            r.Int();
            int m_dwDeleteCount = r.Int();

            pw.Int(m_dwDeleteCount);
            for (int i = 0; i < m_dwDeleteCount; i += 1)
            {
                int unk = r.Int();
                pw.Int(unk);
                uint m_dwUID = r.UInt();
                pw.UInt(m_dwUID);
                p.PInfo.m_iGamePoint += SelectPrice(m_dwUID);
                RemoveItem(p.PInfo.m_strLogin, m_dwUID);
            }
            int unk2 = r.Int();

            pw.Int(unk2);

            PacketWrite ks = new PacketWrite();

            ks.Int(0);//dwOK
            ks.Int(p.PInfo.m_iGamePoint);
            ks.Long(0);
            ks.ArrayBytes(pw.Get_Packet());
            p.SendPacket(ks, 867);
        }
Ejemplo n.º 4
0
 public void BuyVC(Session p, PacketRead r)
 {
     try
     {
         r.Jump(13);
         uint itemid = r.UInt();
         r.Jump(8);
         int  quantity   = r.Int();
         uint itemuid    = 0;
         int  valuePrice = SelectPrice(itemid);
         if (CheckItemExists(itemid, p) && quantity != -1)
         {
             sItem currentItem = ItemExists(itemid, p);
             itemuid   = currentItem.ItemUID;
             quantity += currentItem.Quantity;
             p.PInventory.UpdateItem(p.PInfo.m_strLogin, itemid, quantity, itemuid);
             p.PInventory.InventoryList.Remove(currentItem);
         }
         else
         {
             itemuid = GetUID();
             p.PInventory.AddItem(p.PInfo.m_strLogin, itemid, quantity, itemuid);
         }
         PacketWrite pw = new PacketWrite();
         pw.Int(BuyException(valuePrice, p));
         pw.Int(1);
         pw.UInt(itemid);
         pw.Int(1);
         pw.UInt(itemuid);
         pw.Int(quantity);
         pw.Int(quantity);
         pw.Short(0);//Epic
         pw.HexArray("00 00 00 00 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00");
         pw.Byte(LoadItemType(itemid));
         pw.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 04 FC F7 70 04 FC FF 78 00 00 0D 00 00 00 00 00 00 00 00 00 FF FF FF 9D");
         pw.Int(p.PInfo.m_iVirtualPoint);
         pw.HexArray("00 00 00 00 00 00 01 5E 1C 00 40 47 00 00 00 00");
         p.SendPacket(pw, 396);
     }
     catch
     {
         PacketWrite pw = new PacketWrite();
         pw.Int(1);
         pw.Int(0);
         p.SendPacket(pw, 396);
     }
 }
Ejemplo n.º 5
0
 public void BuyGP(Session p, PacketRead r)
 {
     try
     {
         uint itemid     = r.UInt();
         int  quantity   = r.Int();
         uint itemuid    = 0;
         int  valuePrice = SelectPrice(itemid);
         if (CheckItemExists(itemid, p) && quantity != -1)
         {
             sItem currentItem = ItemExists(itemid, p);
             itemuid   = currentItem.ItemUID;
             quantity += currentItem.Quantity;
             p.PInventory.UpdateItem(p.PInfo.m_strLogin, itemid, quantity, itemuid);
             p.PInventory.InventoryList.Remove(currentItem);
         }
         else
         {
             itemuid = GetUID();
             p.PInventory.AddItem(p.PInfo.m_strLogin, itemid, quantity, itemuid);
         }
         PacketWrite pw = new PacketWrite();
         pw.Int(BuyExceptionGP(valuePrice, p));
         pw.Int(p.PInfo.m_iGamePoint);
         pw.Int(1);
         pw.UInt(itemid);
         pw.Int(1);
         pw.UInt(itemuid);
         pw.Int(quantity);
         pw.Int(quantity);
         pw.Short(0);
         pw.HexArray("00 00 00 00 FF FF 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 0C 0C 53 6C A5 B9 73 A2 00 40 37 CC 00 00 0B 00 00 00 00 00 00 00 00 00");
         p.SendPacket(pw, 85);
     }
     catch (Exception ex)
     {
         Log.Write("\n{0}\n{1}\n", ex.Message, ex.StackTrace);
         PacketWrite pw = new PacketWrite();
         pw.Int(1);
         pw.Int(0);
         p.SendPacket(pw, 85);
     }
 }
Ejemplo n.º 6
0
        public void AddSlotNewChar(Session p, uint slotid)
        {
            int         price = 500;
            int         exce  = BuyException(price, p);
            PacketWrite pw    = new PacketWrite();

            pw.Int(exce);
            pw.Int(1);
            pw.Int(1);
            pw.UInt(slotid);
            pw.Int(1);
            pw.UInt(slotid);
            pw.HexArray("00 00 00 00 00 00 00 01 00 02 FF FF 00 00 FF FF 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 00 00 04 FA 6E 90 04 FA 72 98 00 00 0B 00 00 00 00 00 00 00 00 00");
            p.SendPacket(pw, 1618);
            if (exce == 0)
            {
                p.PInfo.m_dwSlots += 1;
                Querys.Execute_UpdateSLOTS(p.PInfo.m_dwUserUID, p.PInfo.m_dwSlots);
            }
        }
Ejemplo n.º 7
0
 internal static void KItemInfo(PacketWrite ks, uint itemid, uint itemuid, byte level)
 {
     ks.UInt(itemid);
     ks.Int(1);
     ks.UInt(itemuid);
     ks.Int(-1);
     ks.Int(-1);
     ks.Byte(0);
     ks.Byte(0);
     ks.Byte(0);
     ks.Byte(level);
     ks.HexArray("00 00");
     ks.Int(-1);
     ks.HexArray("00 00 00 00 59 6E 2C DB");
     ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00");//Atribs
     ks.Byte(0);
     ks.Int(0);
     ks.Int(0);
     ks.HexArray("00 07 D8 47 DC 07 D8 47 EC 00 4E 6D A5 00 00 06 00 00 00 00 00 00 00 00 00");
 }
Ejemplo n.º 8
0
        public static void KPetInfo(Session right, PacketWrite ks, int obj)
        {
            ks.Int(0);//Pet is New

            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_dwUID);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_dwID);
            ks.Str(right.PCharacters.CharInfo[obj].Pets[0].m_strName);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_mapInitExp);
            for (byte y = 0; y < right.PCharacters.CharInfo[obj].Pets[0].m_mapInitExp; y += 1)
            {
                ks.Byte(y);
                ks.Int(100);
            }
            ks.UInt(right.PCharacters.CharInfo[obj].Pets[0].m_dwEXP);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_iLevel);
            ks.Byte(right.PCharacters.CharInfo[obj].Pets[0].m_cPromotion);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_nHatchingID);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_iInitSatiation);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].m_iSatiation);
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].Slot1.Count);//00 00 00 01
            for (int y = 0; y < right.PCharacters.CharInfo[obj].Pets[0].Slot1.Count; y += 1)
            {
                ks.Int(right.PCharacters.CharInfo[obj].Pets[0].Slot1[y].AtkID);
                ks.Int(1);
                ks.UInt(right.PCharacters.CharInfo[obj].Pets[0].Slot1[y].AtkUID);
                ks.Byte(0);
            }
            ks.Int(right.PCharacters.CharInfo[obj].Pets[0].Slot2.Count);//00 00 00 01
            for (int y = 0; y < right.PCharacters.CharInfo[obj].Pets[0].Slot2.Count; y += 1)
            {
                ks.Int(right.PCharacters.CharInfo[obj].Pets[0].Slot2[y].AtkID);
                ks.Int(1);
                ks.UInt(right.PCharacters.CharInfo[obj].Pets[0].Slot2[y].AtkUID);
                ks.Byte(0);
            }
            ks.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 FF");
            ks.Byte(right.PCharacters.CharInfo[obj].CharType);
        }
Ejemplo n.º 9
0
        public void InventoryItens(Session p)
        {
            LoadItens(p);
            PacketWrite pw = new PacketWrite();

            pw.Int(1);
            pw.Int(1);
            pw.Int(InventoryList.Count);
            for (int x = 0; x < InventoryList.Count; x++)
            {
                pw.UInt(InventoryList[x].ItemID);
                pw.Int(1);
                pw.UInt(InventoryList[x].ItemUID);
                pw.Int(InventoryList[x].Quantity);
                pw.Int(InventoryList[x].Quantity);
                pw.HexArray("00 00 FF FF 00 00");
                pw.Int(InventoryList[x].Period);
                pw.HexArray("00 00 00 00 59 22 21 B4 06 00 00 00 00 00 00 00 00 00 00 00");
                pw.Byte(InventoryList[x].ItemType);
                pw.HexArray("00 00 00 00 00 00 00 00 00 FF FF FF FF 7F DE 81 10 D0 FF 24 E3 00 00 FF 00 00 00 00 00 00 00 00 00");
            }
            p.SendPacket(pw, 232);
        }
Ejemplo n.º 10
0
        public void Login(Session p, PacketRead r)
        {
            //33 = +1
            //1249 - normal
            try
            {
                byte[] Crc32  = new byte[] { 0x43, 0x7D, 0x7A, 0x7A };
                int    m_dwOK = 0;
                p.PInfo.m_strLogin  = r.String();
                p.PInfo.m_strPasswd = r.String();
                p.PInfo.m_bMale     = r.Bool();
                p.PInfo.m_iVersion  = r.Int();
                r.Int();
                byte[] checksum = r.Buffer_Array_Bytes(4);
                //Log.WriteHex("Checksum:",checksum);

                PacketWrite pw = new PacketWrite();

                Log.Write("clog : KTRUser::KSkTRUser::CheckLogin::User {0} and Passwd {1}", p.PInfo.m_strLogin, p.PInfo.m_strPasswd);
                int Login_Acess = Querys.Execute_VerifyAccount(p, p.PInfo.m_strLogin, p.PInfo.m_strPasswd);
                if (Login_Acess == 0)
                {
                    p.Req.ExpTable(p);
                    p.Req.ServerTime(p);
                    p.Req.NewCharChoice(p);
                    p.PCharacters.LoadCharacters(p.PInfo.m_strLogin, p.PInfo.m_dwUserUID);
                    p.PStages.LoadStages(p);
                    p.PInventory.InventoryItens(p);
                    p.PLetter.LoadLetter(p.PInfo.m_dwUserUID);
                    Log.Write("clog : KTRUser::KSkTRUser::OnClientLoginOK(), {0}-{1}-{2}.", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                }
                else if (Login_Acess == 14)
                {
                    m_dwOK = 7;
                }
                if (checksum != Crc32)
                {
                    m_dwOK = 10;
                }
                pw.UnicodeStr(p.PInfo.m_strLogin);
                pw.UnicodeStr(p.PInfo.m_strNickName);
                pw.Int(0);
                pw.Str(p.PInfo.m_strPasswd);
                pw.HexArray("00 2E 00 37 00 32 00 31 00 00 C8 72 D1 BF 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");
                pw.Byte(0);     //m_cAuthLevel
                pw.Int(100);    //m_iAge
                pw.Bool(false); //m_bAgreePrivateInfo
                pw.Byte(0);     //m_cPCBangType
                Serializables.m_mapCharacterInfo(p, pw);
                pw.UShort(GameServer.m_usUdpPort);
                pw.Int(p.PInfo.m_dwUserUID);
                pw.UnicodeStr(GameServer.m_strServerName);
                pw.Int(GameServer.m_iSessionInfo);
                pw.HexArray("00 00 00 00");
                Serializables.SerializeStages(p, pw);
                pw.UInt(3222798336);//C0 18 00 00 //m_nConnectType
                Serializables.m_vecMissionSlot(p, pw);
                pw.Int(0);
                pw.HexArray("29 E1 85 22 02 00 74 85 00 00 00 01 00 00 00 00 00 00 00 00");
                pw.UnicodeStr("MsgServer_02");
                pw.Str(GameServer.m_dwIP);
                pw.UShort(GameServer.m_usMsgPort);
                pw.HexArray("00 00 02 9D 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF");
                pw.Str(GameServer.m_dwIP);
                pw.HexArray("00 00 00 00 00 00 00 00 03 5A 35 55 C0 5A 35 55 C0 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 01 61 D0 5E 60 00 D0 FF F9 3D AC 0C F9 74 00 5A 35 55 00 00 00 00 00 73 E6 5F 5A 33 2C A0 00 00 00 00");
                //Chars
                pw.HexArray("00 00 00 15 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 00 00 00 00 00 00 00 00 00 00 02 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 0B 00 00 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 0D 00 00 00 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 0E 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 0F 00 00 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 14 00 00 00 00 00 00 00 00 00 00");
                pw.HexArray("00 00 00 03 00 00 00 C6 00 0C 22 CC 00 00 00 00 00 00 00 C7 00 0C F1 FC 00 00 00 00 00 00 00 C9 00 15 6D 0A 00 00 00 01");
                pw.Int(p.PInfo.m_dwSlots);
                pw.Byte(255);
                pw.Byte(0);
                pw.Byte(0);
                p.SendPacket(pw, 34);
                p.Shop.SendMyVirtualCash(p);
                p.HeroDugeons.HeroDungeonInfo(p);
                UdpPort(p);
                sends(p);
            }
            catch (Exception Ex)
            {
                Log.Write("{0} \n\n {1}", Ex.Message, Ex.StackTrace);
            }
        }