public override void OnPacket(InPacket iPacket) { try { iPacket.Decrypt(CRYPT_KEY); CenterOpcodes uOpcode = (CenterOpcodes)iPacket.ReadShort(); int uSize = iPacket.ReadInt(); bool isCompress = iPacket.ReadBool(); int cSize = 0; if (isCompress == true) { cSize = iPacket.ReadInt(); LogFactory.GetLog("Main").LogInfo("Pacote comprimido {0}({1})", (int)uOpcode, uOpcode.ToString()); } else { LogFactory.GetLog("Main").LogInfo("Packet {0}({1})", (int)uOpcode, uOpcode.ToString()); } LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); switch (uOpcode) { case CenterOpcodes.HEART_BIT_NOT: OnHeartBeatNot(); break; case CenterOpcodes.ENU_CLIENT_CONTENTS_FIRST_INIT_INFO_REQ: MyLoading.NotifyContentInfo(this); break; case CenterOpcodes.ENU_VERIFY_ACCOUNT_REQ: MyUser.OnLogin(this, iPacket); break; default: { LogFactory.GetLog("Main").LogWarning("Pacote indefinido foi recebida. Opcode: {0}({1})", (int)uOpcode, uOpcode.ToString()); LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); break; } } } catch (Exception e) { LogFactory.GetLog("Main").LogError(e.ToString()); Close(); } }
public override void OnPacket(InPacket iPacket) { try { iPacket.Decrypt(CRYPT_KEY); GameOpcodes uOpcode = (GameOpcodes)iPacket.ReadShort(); int uSize = iPacket.ReadInt(); bool isCompress = iPacket.ReadBool(); int cSize = 0; if (isCompress == true) { cSize = iPacket.ReadInt(); LogFactory.GetLog("Main").LogInfo("Pacote comprimido {0}({1})", (int)uOpcode, uOpcode.ToString()); } else { LogFactory.GetLog("Main").LogInfo("Packet {0}({1})", (int)uOpcode, uOpcode.ToString()); } LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); switch (uOpcode) { case GameOpcodes.HEART_BIT_NOT: OnHeartBeatNot(); break; case GameOpcodes.EVENT_INVITE_REQ: //31 EVENT_FRIEND_LIST_REQ MsgUser.FriendList(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_ROOM_ACK: //34 ADD_FRIEND MsgUser.Add(this, iPacket); break; default: { LogFactory.GetLog("Main").LogWarning("Pacote indefinido foi recebida. Opcode: {0}({1})", (int)uOpcode, uOpcode.ToString()); LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); break; } } } catch (Exception e) { LogFactory.GetLog("Main").LogFatal(e); Close(); } }
public override void OnPacket(InPacket inPacket) { try { //int typeId = inPacket.ReadInt(); //byte wdf = BitConverter. Log.Hex("Received Packet ", inPacket.ToArray()); //Log.Inform("String val:" + Encoding.Unicode.GetString(inPacket.ToArray())); byte typeId = inPacket.ReadByte(); byte a2 = inPacket.ReadByte(); byte a3 = inPacket.ReadByte(); byte a4 = inPacket.ReadByte(); int header = BitConverter.ToInt32(new byte[] { typeId, a2, a3, a4 }, 0); switch (typeId) { case 0xBA: using (OutPacket oPacket = new OutPacket()) { oPacket.WriteInt(header + 1); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header oPacket.WriteInt(0); // header Send(oPacket); //WALAO! } break; default: break; } } catch (SendPacketException) { Log.Error("Client was disconnected while sending packet"); Close(); } catch (Exception e) { Log.Error("Exception during packet handling from {0}: {1}", this.Label, e.ToString()); } }
public void Gacha_Action(ClientSession cs, InPacket ip) { int CharID = ip.ReadInt(); int Set = ip.ReadInt(); int Level = ip.ReadInt(); int Gema = ip.ReadInt(); int rndItems = RandomItems.Next(30); int rndUID = RandomItems.Next(873604976); if (Level == 30) { percent30(rndItems, Set); } if (Level == 40) { percent30(rndItems, Set); } if (Level == 50) { percent30(rndItems, Set); } if (Level == 60) { percent30(rndItems, Set); } if (Level == 70) { percent50(rndItems, Set); } if (Level == 80) { percent50(rndItems, Set); } using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_GACHA_ACTION_ACK)) { oPacket.WriteInt(0); oPacket.WriteInt(CharID); oPacket.WriteInt(Gema); oPacket.WriteHexString("00 00 00 01 34 12 27 47 00 00 00 03 00 00 00 03 00 00 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 0F 00 00 00 00 00 00 00 00 00 01 8E 8E 00 00 00 01 34 12 24 65 00 00 00 3A 00 00 00 3A 00 02 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 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00 01"); oPacket.WriteInt(SortedItem); //00 09 92 5A oPacket.WriteInt(1); oPacket.WriteInt(rndUID); //34 12 27 70 oPacket.WriteHexString("00 00 00 02 00 00 00 02"); oPacket.WriteInt(Level); oPacket.WriteHexString("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 FF 00 00 00 00 00 00 00 00 00"); oPacket.Assemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT); cs.Send(oPacket); LogFactory.GetLog("GACHA ACTION").LogHex("", ip.ToArray()); } }
public void Depot_Char_tab(ClientSession cs, InPacket ip) { ushort test = ip.ReadUShort(); CharIndex = ip.ReadInt(); using (OutPacket oPacket = new OutPacket(GameOpcodes.EVENT_DEPOT_CHAR_TAB_INFO_ACK)) { LogFactory.GetLog("Gacha").LogInfo("CHARACTER: " + CharIndex); oPacket.WriteInt(5); oPacket.WriteByte(0); oPacket.WriteByte((byte)CharIndex); oPacket.WriteHexString("01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); oPacket.Assemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT); cs.Send(oPacket); LogFactory.GetLog("DEPOT_CHAR").LogHex("", ip.ToArray()); } }
public void NotifySHAFile(ClientSession cs, InPacket ip) { using (OutPacket oPacket = new OutPacket(CenterOpcodes.ENU_SHAFILENAME_LIST_ACK)) { oPacket.WriteInt(0); oPacket.WriteInt(SHAFileList.Length); for (int i = 0; i <= checklist.Length - 1; i++) { oPacket.WriteInt(checklist[i].nFile.Length * 2); oPacket.WriteUnicodeString(checklist[i].nFile); oPacket.WriteInt(checklist[i].CRC.Length * 2); oPacket.WriteUnicodeString(checklist[i].CRC); } oPacket.Assemble(cs.CRYPT_KEY, cs.CRYPT_HMAC, cs.CRYPT_PREFIX, ++cs.CRYPT_COUNT); cs.Send(oPacket); LogFactory.GetLog("DATA").LogHex("PACKET: ", ip.ToArray()); } }
public override void OnPacket(InPacket iPacket) { try { iPacket.Decrypt(CRYPT_KEY); GameOpcodes uOpcode = (GameOpcodes)iPacket.ReadUShort(); int uSize = iPacket.ReadInt(); bool isCompress = iPacket.ReadBool(); int cSize = 0; if (isCompress == true) { cSize = iPacket.ReadInt(); LogFactory.GetLog("Main").LogWarning("[{0}] pacote comprimido chegada {1} ({2})", Login, (int)uOpcode, uOpcode.ToString()); } else { LogFactory.GetLog("Main").LogInfo("[{0}] de chegada de pacotes {1} ({2})", Login, (int)uOpcode, uOpcode.ToString()); } LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); switch (uOpcode) { case GameOpcodes.EVENT_HEART_BIT_NOT: // 0 OnHeartBeatNot(); break; case GameOpcodes.EVENT_CHANGE_CHARACTER_INFO_REQ: //1618 InfoChars.ChangeCharInfo(this); break; case GameOpcodes.EVENT_VERIFY_ACCOUNT_REQ: // 2 MyUser.OnLogin(this, iPacket); break; case GameOpcodes.EVENT_SET_CURRENT_CHARACTER_REQ: MyCommon.SetCurretChar(this, iPacket); break; case GameOpcodes.EVENT_GET_FULL_SP_INFO_REQ: // 423 0x1A7 MyCommon.OnGetFullSPInfo(this, iPacket); break; case GameOpcodes.EVENT_PET_COSTUM_LIST_REQ: // 517 0x205 MyCommon.OnPetCostumList(this, iPacket); break; case GameOpcodes.EVENT_INVEN_BUFF_ITEM_LIST_REQ: // 1226 0x04CA MyCommon.OnInvenBuffItemList(this, iPacket); break; case GameOpcodes.EVENT_DEPOT_INFO_REQ: // 1340 0x053C MyCommon.OnDepotInfo(this, iPacket); break; case GameOpcodes.EVENT_STAT_CLIENT_INFO: // 226 0x00E2 MyCommon.OnStatClientInfo(this, iPacket); break; case GameOpcodes.EVENT_COST_RATE_FOR_GAMBLE_BUY_REQ: // 871 0x0367 MyCommon.OnCostRateForGambleBuy(this); break; case GameOpcodes.EVENT_REGISTER_NICKNAME_REQ: // 134 0x0086 MyUser.OnRegisterNick(this, iPacket); break; case GameOpcodes.EVENT_SET_IDLE_STATE_REQ: // 835 0x0343 MyCommon.OnSetIDLE(this, iPacket); break; case GameOpcodes.EVENT_CHAR_SELECT_JOIN_REQ: // 1557 0x0613 MyUser.OnCharSelectJoin(this, iPacket); break; case GameOpcodes.EVENT_CHOICE_BOX_LIST_REQ: // 1012 0x03F4 MyCommon.OnChoiceBoxList(this); break; case GameOpcodes.EVENT_EXP_POTION_LIST_REQ: // 1338 0x053A MyCommon.OnExpPotionList(this); break; case GameOpcodes.EVENT_AGIT_STORE_CATALOG_REQ: // 1114 0x054A MyCommon.OnAgitStoreCatalog(this); break; case GameOpcodes.EVENT_AGIT_STORE_MATERIAL_REQ: // 1116 0x045C MyCommon.OnAgitStoreMaterial(this); break; case GameOpcodes.EVENT_AGIT_MAP_CATALOGUE_REQ: // 1106 0x0452 MyCommon.OnAgitMapCatalogue(this); break; case GameOpcodes.EVENT_FAIRY_TREE_LV_TABLE_REQ: // 1184 0x04A0 MyCommon.OnFaityTreeLvTable(this); break; case GameOpcodes.EVENT_INVITE_DENY_NOT: // 348 0x015C InviteDeny = iPacket.ReadBool(); break; case GameOpcodes.EVENT_GET_USER_DONATION_INFO_REQ: // 523 0x020B MyCommon.OnGetUserDonationInfo(this); break; case GameOpcodes.EVENT_RECOMMEND_FULL_INFO_REQ: // 567 0x0237 MyCommon.OnRecommentUser(this); break; case GameOpcodes.EVENT_USER_BINGO_DATA_REQ: // 654 0x28E MyCommon.OnUserBingoData(this); break; case GameOpcodes.EVENT_CHANNEL_LIST_REQ: // 14 0x0E MyCommon.OnChannelList(this); break; case GameOpcodes.EVENT_DONATION_INFO_REQ: // 525 0x020D MyCommon.OnDonationInfo(this); break; case GameOpcodes.EVENT_ENTER_CHANNEL_REQ: // 12 0x0C MyUser.OnEnterChannel(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_CHANNEL_NOT: // 26 MyUser.OnLeaveChannel(this); break; case GameOpcodes.EVENT_CREATE_ROOM_REQ: MyUser.OnCreateRoom(this, iPacket); break; case GameOpcodes.EVENT_CHANGE_ROOM_INFO_REQ: CurrentRoom.OnChangeRoomInfo(this, iPacket); break; case GameOpcodes.EVENT_CHANGE_ROOMUSER_INFO_REQ: CurrentRoom.OnChangeUserInfo(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_ROOM_REQ: CurrentRoom.OnLeaveRoom(this, iPacket); break; case GameOpcodes.EVENT_ROOM_LIST_REQ: CurrentChannel.OnRoomList(this, iPacket); break; case GameOpcodes.EVENT_JOIN_ROOM_REQ: CurrentChannel.OnJoinRoom(this, iPacket); break; case GameOpcodes.EVENT_START_GAME_REQ: CurrentRoom.StartGame(this, iPacket); break; case GameOpcodes.EVENT_RELAY_LOADING_STATE: CurrentRoom.OnLoadState(this, iPacket); break; case GameOpcodes.EVENT_LOAD_COMPLETE_NOT: //MyUser.LoadComplete(this, iPacket); CurrentRoom.OnLoadComplete(this, iPacket); break; case GameOpcodes.EVENT_STAGE_LOAD_COMPLETE_NOT: //MyUser.StageLoadComplete(this, iPacket); CurrentRoom.OnStageLoadComplete(this, iPacket); break; case GameOpcodes.EVENT_ROOM_MEMBER_PING_INFO_REQ: CurrentRoom.OnPingInfo(this, iPacket); break; case GameOpcodes.EVENT_GET_ROOMUSER_IDLE_STATE_REQ: CurrentRoom.OnIdleInfo(this, iPacket); break; case GameOpcodes.EVENT_END_GAME_REQ: CurrentRoom.OnGameEnd(this, iPacket); break; case GameOpcodes.EVENT_CHAT_REQ: CurrentChannel.OnChat(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_GAME_REQ: CurrentRoom.OnLeaveGame(this, iPacket); break; case GameOpcodes.EVENT_EQUIP_ITEM_REQ: MyCharacter.OnEquipItem(this, iPacket); break; case GameOpcodes.EVENT_CHANGE_LOOK_EQUIP_REQ: MyCharacter.OnChangeEquipInRoom(this, iPacket); break; case GameOpcodes.EVENT_SET_PRESS_STATE_REQ: CurrentRoom.OnSetPressState(this, iPacket); break; case GameOpcodes.EVENT_SKILL_TRAINING_REQ: MyCharacter.OnTrainSkill(this, iPacket); break; case GameOpcodes.EVENT_SET_SKILL_REQ: MyCharacter.OnSetSkill(this, iPacket); break; case GameOpcodes.DB_EVENT_SYSTEM_GUIDE_COMPLETE_INFO_REQ: MyCommon.SendGuideCompleteInfo(this); break; case GameOpcodes.EVENT_CASHBACK_EXTRA_RATIO_INFO_REQ: MyShop.CashRatio(this); break; case GameOpcodes.EVENT_PACKAGE_INFO_REQ: MyShop.packageInfo(this); break; case GameOpcodes.EVENT_PACKAGE_INFO_DETAIL_REQ: MyShop.packageInfoDetail(this, iPacket); break; default: { LogFactory.GetLog("Main").LogWarning("pacote indefinido foi recebido. Opcode: {0}({1})", (int)uOpcode, uOpcode.ToString()); LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); break; } } } catch (Exception e) { LogFactory.GetLog("Main").LogFatal(e); Close(); } }
/*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); } }
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); } }
public override void OnPacket(InPacket iPacket) { try { iPacket.Decrypt(CRYPT_KEY); CenterOpcodes uOpcode = (CenterOpcodes)iPacket.ReadShort(); int uSize = iPacket.ReadInt(); bool isCompress = iPacket.ReadBool(); int cSize = 0; if (isCompress == true) { cSize = iPacket.ReadInt(); LogFactory.GetLog("Main").LogWarning("Recebido Pacote Compress {0}({1})", (int)uOpcode, uOpcode.ToString()); } else { LogFactory.GetLog("Main").LogInfo("Pacote Recebido {0}({1})", (int)uOpcode, uOpcode.ToString()); } LogFactory.GetLog("Main").LogHex(uOpcode + ": ", iPacket.ToArray()); switch (uOpcode) { case CenterOpcodes.HEART_BIT_NOT: OnHeartBeatNot(); break; case CenterOpcodes.ENU_CLIENT_CONTENTS_FIRST_INIT_INFO_REQ: MyLoading.NotifyContentInfo(this, iPacket); break; case CenterOpcodes.ENU_SHAFILENAME_LIST_REQ: MyLoading.NotifySHAFile(this, iPacket); break; case CenterOpcodes.ENU_VERIFY_ACCOUNT_REQ: MyUser.OnLogin(this, iPacket); break; case CenterOpcodes.ENU_CLIENT_PING_CONFIG_REQ: OnClientPingConfig(); break; case CenterOpcodes.ENU_GUIDE_BOOK_LIST_REQ: MyUser.OnGuideBookList(this); break; default: { LogFactory.GetLog("Main").LogWarning("Pacote Desconhecido Recebido. Opcode: {0}({1})", (int)uOpcode, uOpcode.ToString()); LogFactory.GetLog("Main").LogHex("Pacote", iPacket.ToArray()); break; } } } catch (Exception e) { LogFactory.GetLog("Main").LogError(e.ToString()); Close(); } }
public override void OnPacket(InPacket iPacket) { try { iPacket.Decrypt(CRYPT_KEY); GameOpcodes uOpcode = (GameOpcodes)iPacket.ReadUShort(); int uSize = iPacket.ReadInt(); bool isCompress = iPacket.ReadBool(); int cSize = 0; if (isCompress == true) { cSize = iPacket.ReadInt(); LogFactory.GetLog("Main").LogWarning("[{0}] Pacote comprimido {1}({2})", Login, (int)uOpcode, uOpcode.ToString()); } else { LogFactory.GetLog("Main").LogInfo("[{0}] Packet {1}({2})", Login, (int)uOpcode, uOpcode.ToString()); } LogFactory.GetLog("Main").LogHex("Pacote: ", iPacket.ToArray()); switch (uOpcode) { case GameOpcodes.HEART_BIT_NOT: // 0 OnHeartBeatNot(); break; case GameOpcodes.EVENT_VERIFY_ACCOUNT_REQ: // 2 MyUser.OnLogin(this, iPacket); break; case GameOpcodes.EVENT_GET_FULL_SP_INFO_REQ: // 423 0x1A7 MyCommon.OnGetFullSPInfo(this, iPacket); break; case GameOpcodes.EVENT_PET_COSTUM_LIST_REQ: // 517 0x205 MyCommon.OnPetCostumList(this, iPacket); break; case GameOpcodes.EVENT_INVEN_BUFF_ITEM_LIST_REQ: // 1226 0x04CA MyCommon.OnInvenBuffItemList(this, iPacket); break; case GameOpcodes.EVENT_DEPOT_INFO_REQ: // 1340 0x053C MyCommon.OnDepotInfo(this, iPacket); break; case GameOpcodes.EVENT_STAT_CLIENT_INFO: // 226 0x00E2 MyCommon.OnStatClientInfo(this, iPacket); break; case GameOpcodes.EVENT_COST_RATE_FOR_GAMBLE_BUY_REQ: // 871 0x0367 MyCommon.OnCostRateForGambleBuy(this); break; case GameOpcodes.EVENT_ENTER_AGIT_REQ: //AGITT MyAgit.EnterAgit(this); break; case GameOpcodes.EVENT_AGIT_LOADING_COMPLETE_REQ: //AGITT MyAgit.AgitLoadComplete(this); break; case GameOpcodes.EVENT_REGISTER_NICKNAME_REQ: // 134 0x0086 MyUser.OnRegisterNick(this, iPacket); break; case GameOpcodes.EVENT_SET_IDLE_STATE_REQ: // 835 0x0343 MyCommon.OnSetIDLE(this, iPacket); break; case GameOpcodes.EVENT_CHAR_SELECT_JOIN_REQ: // 1555 0x0613 MyUser.OnCharSelectJoin(this, iPacket); break; case GameOpcodes.EVENT_CHOICE_BOX_LIST_REQ: // 1012 0x03F4 MyCommon.OnChoiceBoxList(this); break; case GameOpcodes.EVENT_EXP_POTION_LIST_REQ: // 1338 0x053A MyCommon.OnExpPotionList(this); break; case GameOpcodes.EVENT_AGIT_STORE_CATALOG_REQ: // 1114 0x054A MyCommon.OnAgitStoreCatalog(this); break; case GameOpcodes.EVENT_AGIT_STORE_MATERIAL_REQ: // 1116 0x045C MyCommon.OnAgitStoreMaterial(this); break; case GameOpcodes.EVENT_AGIT_MAP_CATALOGUE_REQ: // 1106 0x0452 MyCommon.OnAgitMapCatalogue(this); break; case GameOpcodes.EVENT_FAIRY_TREE_LV_TABLE_REQ: // 1184 0x04A0 MyCommon.OnFaityTreeLvTable(this); break; case GameOpcodes.EVENT_INVITE_DENY_NOT: // 348 0x015C InviteDeny = iPacket.ReadBool(); break; case GameOpcodes.EVENT_GET_USER_DONATION_INFO_REQ: // 523 0x020B MyCommon.OnGetUserDonationInfo(this); break; case GameOpcodes.EVENT_RECOMMEND_FULL_INFO_REQ: // 567 0x0237 MyCommon.OnRecommentUser(this); break; case GameOpcodes.EVENT_USER_BINGO_DATA_REQ: // 654 0x28E MyCommon.OnUserBingoData(this); break; case GameOpcodes.EVENT_CHANNEL_LIST_REQ: // 14 0x0E MyCommon.OnChannelList(this, iPacket); break; case GameOpcodes.EVENT_DONATION_INFO_REQ: // 525 0x020D MyCommon.OnDonationInfo(this); break; case GameOpcodes.EVENT_ENTER_CHANNEL_REQ: // 12 0x0C MyUser.OnEnterChannel(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_CHANNEL_NOT: // 26 MyUser.OnLeaveChannel(this); break; case GameOpcodes.EVENT_CREATE_ROOM_REQ: // 24 방 만들기 MyUser.OnCreateRoom(this, iPacket); break; case GameOpcodes.EVENT_CHANGE_ROOM_INFO_REQ: // 28 0x1C 방의 게임모드 정보 바뀜 CurrentRoom.OnChangeRoomInfo(this, iPacket); break; case GameOpcodes.EVENT_CHANGE_ROOMUSER_INFO_REQ: // 40 0x28 방의 유저 정보 바뀜 CurrentRoom.OnChangeUserInfo(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_ROOM_REQ: // 33 0x21 방에서 나가기 요청 CurrentRoom.OnLeaveRoom(this, iPacket); break; case GameOpcodes.EVENT_ROOM_LIST_REQ: // 16 0x10 방 목록 요청 CurrentChannel.OnRoomList(this, iPacket); break; case GameOpcodes.EVENT_JOIN_ROOM_REQ: // 20 방 입장 요청 CurrentChannel.OnJoinRoom(this, iPacket); break; case GameOpcodes.EVENT_START_GAME_REQ: // 36 게임 시작 요청 CurrentRoom.OnGameStart(this, iPacket); break; case GameOpcodes.EVENT_RELAY_LOADING_STATE: // 842 게임로딩중 로딩진행도 CurrentRoom.OnLoadState(this, iPacket); break; case GameOpcodes.EVENT_LOAD_COMPLETE_NOT: // 39 로딩 끝났다는거 전송 (게임으로 들여보내짐) CurrentRoom.OnLoadComplete(this, iPacket); break; case GameOpcodes.EVENT_STAGE_LOAD_COMPLETE_NOT: // 927 스테이지 로딩이 끝났다 CurrentRoom.OnStageLoadComplete(this, iPacket); break; case GameOpcodes.EVENT_ROOM_MEMBER_PING_INFO_REQ: // 837 게임 멤버 핑 정보 요청 (게임시작 할때 쓰나봄) CurrentRoom.OnPingInfo(this, iPacket); break; case GameOpcodes.EVENT_GET_ROOMUSER_IDLE_STATE_REQ: // 833 자리비움 상태 요청 CurrentRoom.OnIdleInfo(this, iPacket); break; case GameOpcodes.EVENT_END_GAME_REQ: // 게임 종료 CurrentRoom.OnGameEnd(this, iPacket); break; case GameOpcodes.EVENT_CHAT_REQ: // 6 채팅! CurrentChannel.OnChat(this, iPacket); break; case GameOpcodes.EVENT_LEAVE_GAME_REQ: // 44 게임중 나가기 CurrentRoom.OnLeaveGame(this, iPacket); break; case GameOpcodes.EVENT_EQUIP_ITEM_REQ: // 62 장비 변경 요청 MyCharacter.OnEquipItem(this, iPacket); break; case GameOpcodes.EVENT_CHANGE_LOOK_EQUIP_REQ: // 860 방에서 장비변경 요청 (이게 선처리 된 후 EVENT_EQUIP_ITEM_REQ) MyCharacter.OnChangeEquipInRoom(this, iPacket); break; case GameOpcodes.EVENT_SET_PRESS_STATE_REQ: // 방에서 다른 용무중 CurrentRoom.OnSetPressState(this, iPacket); break; case GameOpcodes.EVENT_SKILL_TRAINING_REQ: // 스킬 배우기 MyCharacter.OnTrainSkill(this, iPacket); break; case GameOpcodes.EVENT_SET_SKILL_REQ: // 스킬 장착 요청 MyCharacter.OnSetSkill(this, iPacket); break; case GameOpcodes.EVENT_SERVER_LIST_REQ: MyUser.SendServerList(this); break; case GameOpcodes.EVENT_SQUARE_LIST_REQ: square.SquareList(this); break; case GameOpcodes.EVENT_ENTER_SQUARE_REQ: square.enterSquare(this); break; case GameOpcodes.EVENT_LEAVE_SQUARE_REQ: square.LeaveSquare(this); break; case GameOpcodes.EVENT_CASHBACK_EXTRA_RATIO_INFO_REQ: MyShop.CashRatio(this); break; case GameOpcodes.EVENT_PACKAGE_INFO_REQ: MyShop.packageInfo(this); break; case GameOpcodes.EVENT_PACKAGE_INFO_DETAIL_REQ: MyShop.packageInfoDetail(this, iPacket); break; case GameOpcodes.EVENT_ITEM_BUY_CHECK_REQ: MyShop.CheckItem(this, iPacket); break; case GameOpcodes.EVENT_BUY_VIRTUAL_CASH_REQ: MyShop.BuyVP(this, iPacket); break; case GameOpcodes.EVENT_BUY_FOR_GP_REQ: MyShop.BuyGP(this, iPacket); break; case GameOpcodes.EVENT_CHARISMAS_EVENT_INFO_REQ: MyCommon.Event_Gifts(this); break; case GameOpcodes.EVENT_CHECK_ROOM_USERLIST_NOT: CurrentRoom.checkRoomUser(this); break; case GameOpcodes.EVENT_STAT_LOADING_TIME_NOT: CurrentRoom.statLoadingTime(this, iPacket); break; case GameOpcodes.EVENT_SPECIAL_REWARD_REQ: CurrentRoom.RewardItem(this, iPacket); break; case GameOpcodes.EVENT_DEPOT_CHAR_TAB_INFO_REQ: GachaList.Depot_Char_tab(this, iPacket); break; case GameOpcodes.EVENT_GACHA_REWARD_LIST_REQ: GachaList.Gacha_Reward_List(this, iPacket); break; case GameOpcodes.EVENT_GACHA_SET_REWARD_LIST_REQ: GachaList.Gacha_SET_Reward_List(this, iPacket); break; case GameOpcodes.EVENT_GACHA_LEVEL_ACTION_REQ: GachaList.Gacha_Action(this, iPacket); break; case GameOpcodes.EVENT_REMOVE_MISSION_REQ: MyQuests.RemoveMission(this, iPacket); break; case GameOpcodes.EVENT_REGIST_MISSION_REQ: MyQuests.RegisterMission(this, iPacket); break; case GameOpcodes.EVENT_COMPLETE_MISSION_REQ: MyQuests.CompleteMission(this, iPacket); break; case GameOpcodes.EVENT_CREATE_PET_REQ: MyPet.create_pet(this, iPacket); break; case GameOpcodes.EVENT_HERO_ITEM_CATALOG_REQ: heroico.Hero_Item_Catalog(this); break; case GameOpcodes.EVENT_HERO_ITEM_MATERIAL_REQ: heroico.Hero_Item_Material(this); break; case GameOpcodes.EVENT_MANUFACTURES3_CATALOG_REQ: manufacture.Manufacture_Catalog(this); break; case GameOpcodes.EVENT_SPECIFIC_ITEM_BREAKUP_INFO_REQ: manufacture.SpecificItemBreakup(this); break; case GameOpcodes.EVENT_MANUFACTURES3_MATERIAL_REQ: manufacture.ManuFactureMaterial(this); break; case GameOpcodes.EVENT_DUNGEON_REWARD_EXP_REQ: CurrentRoom.RewardEXP(this, iPacket); break; case GameOpcodes.EVENT_USER_LIST_REQ: MyUser.ListUsers(this); break; default: { LogFactory.GetLog("Main").LogWarning("pacote indefinido foi recebida. Opcode: {0}({1})", (int)uOpcode, uOpcode.ToString()); LogFactory.GetLog("Main").LogHex("Pacote: ", iPacket.ToArray()); break; } } } catch (Exception e) { LogFactory.GetLog("Main").LogError(e.ToString()); Close(); } }