public static void KUserInfo(Session right, PacketRead rs) { string m_strLogin = rs.String(); int m_dwID = rs.Int(); string m_strNickName = rs.String(); rs.Int(); byte m_cStatus = rs.Byte(); rs.Jump(22); int m_iGamePoint = rs.Int(); rs.Short(); right.PInfo.m_ucCharType = m_cStatus; }
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); } }
public static void KEquipItemInfo(Session right, PacketRead rs, int m_vecCharInfo) { for (int i = 0; i < m_vecCharInfo; i += 1) { byte m_cCharIndex = rs.Byte(); int m_vecEquipInfo = rs.Int(); int m_dwCharPosition = right.PCharacters.PositionCharacter(m_cCharIndex, right); for (int x = 0; x < m_vecEquipInfo; x += 1) { int m_dwID = rs.Int(); int m_dwUnk = rs.Int(); int m_dwUID = rs.Int(); byte m_cUpgrade = rs.Byte(); byte m_cGrade = rs.Byte(); int m_dwLevel = rs.Int(); byte[] test = rs.Buffer_Array_Bytes(9); int m_dwAtrribs = rs.Int(); for (int x2 = 0; x2 < m_dwAtrribs; x2++) { rs.Jump(7); } right.PCharacters.AddEquipment(m_dwID, m_dwUID, m_dwCharPosition, right); //Log.Write("Character:{0} Equips: {1} Current Item:{2} Atribbs:{3}", m_cCharIndex, m_vecEquipInfo, m_dwID, m_dwAtrribs); } int m_vecDelInfo = rs.Int(); for (int x = 0; x < m_vecDelInfo; x += 1) { int m_dwID = rs.Int(); int m_dwUnk = rs.Int(); int m_dwUID = rs.Int(); byte m_cUpgrade = rs.Byte(); byte m_cGrade = rs.Byte(); int m_dwLevel = rs.Int(); byte[] test = rs.Buffer_Array_Bytes(9); int m_dwAtrribs = rs.Int(); for (int x2 = 0; x2 < m_dwAtrribs; x2++) { rs.Jump(7); } right.PCharacters.RemoveEquipment(m_dwID, m_dwCharPosition, right); } int m_dwPetIsNew = rs.Int(); int m_dwPetUID = rs.Int(); int m_dwPetID = rs.Int(); string m_strPetName = rs.String(); int m_mapInitExp = rs.Int(); for (int x = 0; x < m_mapInitExp; x++) { rs.Byte(); rs.Int(); } uint m_dwExp = rs.UInt(); int m_iLevel = rs.Int(); byte m_cPromotion = rs.Byte(); int m_nHatchingID = rs.Int(); int m_iInitSatiation = rs.Int(); int m_iSatiation = rs.Int(); uint m_vecEquipItem = rs.UInt(); right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].Slot1.Clear(); for (uint x = 0; x < m_vecEquipItem; x++) { uint m_dwPetAtkId = rs.UInt(); rs.Jump(4); uint m_dwPetAtkUID = rs.UInt(); rs.Byte(); right.PCharacters.AddAtkPetSlot1((int)m_dwPetAtkId, m_dwPetAtkUID, m_dwCharPosition, right); } uint m_vecEquipItem2 = rs.UInt(); right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].Slot2.Clear(); for (uint x = 0; x < m_vecEquipItem2; x++) { uint m_dwPetAtkId = rs.UInt(); rs.Jump(4); uint m_dwPetAtkUID = rs.UInt(); rs.Byte(); right.PCharacters.AddAtkPetSlot2((int)m_dwPetAtkId, m_dwPetAtkUID, m_dwCharPosition, right); } byte[] restantPet = rs.Buffer_Array_Bytes(14); right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_dwUID = m_dwPetUID; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_dwID = m_dwPetID; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_strName = m_strPetName; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_cPromotion = m_cPromotion; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_dwEXP = m_dwExp; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_iInitSatiation = m_iInitSatiation; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_iLevel = m_iLevel; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_iSatiation = m_iSatiation; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_mapInitExp = m_mapInitExp; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_nHatchingID = m_nHatchingID; //Log.Write("Character:{0} PetID: {1} PetName:{2} Equips:{3}", m_cCharIndex, m_dwPetID, m_strPetName, m_vecEquipItem); rs.Jump(41); } }