using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Text; using SimpleJSON; using UnityEngine; using proto; namespace MoleMole { public class NetworkManager { private const float DISPATCH_CONNECT_TIMEOUT_SECOND = 3f; private const int QUEUE_CAPACITY = 20; public readonly ConfigChannel channelConfig; private List _globalDispatchUrlList; private MiClient _client; private MonoClientPacketConsumer _clientPacketConsumer; private Dictionary _lastRequestTimeDict; private Dictionary _requestMinIntervalDict; public readonly ProtobufSerializer serializer; public bool alreadyLogin; public uint loginRandomNum; private string _uuid; private Queue _packetSendQueue; private Dictionary _CMD_SHOULD_ENQUEUE_MAP; public GlobalDispatchDataItem GlobalDispatchData { get; private set; } public DispatchServerDataItem DispatchSeverData { get; set; } public NetworkManager() { _client = new MiClient(); Singleton.Create(); _packetSendQueue = new Queue(); InitClientPacketConsumer(); serializer = new ProtobufSerializer(); alreadyLogin = false; channelConfig = ConfigUtil.LoadJSONConfig("DataPersistent/BuildChannel/ChannelConfig"); _globalDispatchUrlList = channelConfig.DispatchUrls; GlobalVars.DataUseAssetBundle = channelConfig.DataUseAssetBundle; GlobalVars.ResourceUseAssetBundle = channelConfig.EventUseAssetBundle; _lastRequestTimeDict = new Dictionary(); SetupRequestMinIntervalDict(); } public void SendPacketsOnLoginSuccess(bool forceAll = false, uint serverProcessedPacketId = 0) { if (forceAll || !alreadyLogin) { RequestConfigData(); RequestGetAllEquipmentData(); RequestGetAllAvatarData(); RequestGetAvatarTeamData(); RequestRecommandFriendList(); RequestHasGotItemIdList(); RequestGetBulletin(); RequestIslandVenture(); RequestGetIsland(); RequestGetCollectCabin(); RequestGetFinishGuideData(); RequestGetAllLevelData(); RequestGetVipRewardData(); RequestGetShopList(); RequestGachaDisplayInfo(); RequestGetMailData(); } RequestGetAllMainData(); RequestGetAllWeekDayActivityData(); RequestGetAssistantFrozenList(); RequestEnterWorldChatroom(); RequestFriendList(); RequestAskAddFriendList(); RequestRecommandFriendList(); RequestGetMissionData(); RequestGetInviteeFriend(); RequestGetInviteFriend(); if (alreadyLogin && serverProcessedPacketId != 0) { SendQueuePacketWhenReconnected(serverProcessedPacketId); } } public void RequestPlayerToken() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected I4, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } AccountType accountType = Singleton.Instance.manager.AccountType; string accountUid = Singleton.Instance.manager.AccountUid; string accountToken = Singleton.Instance.manager.AccountToken; string accountExt = Singleton.Instance.manager.AccountExt; GetPlayerTokenReq val2; if (!string.IsNullOrEmpty(accountUid)) { GetPlayerTokenReq val = new GetPlayerTokenReq(); val.account_type = (uint)(int)accountType; val.account_uid = accountUid; val.account_token = accountToken; val.account_ext = accountExt; val.token = string.Empty; val2 = val; } else { val2 = GetTestPlayerTokenReq(); } val2.version = GetGameVersion(); val2.device = SystemInfo.deviceModel; val2.system_info = SystemInfo.operatingSystem; SendPacket(val2); } public void RequestBindAccount() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected I4, but got Unknown AccountType accountType = Singleton.Instance.manager.AccountType; string accountUid = Singleton.Instance.manager.AccountUid; string accountToken = Singleton.Instance.manager.AccountToken; string accountExt = Singleton.Instance.manager.AccountExt; if (!string.IsNullOrEmpty(accountUid) && !string.IsNullOrEmpty(accountToken)) { BindAccountReq val = new BindAccountReq(); val.account_type = (uint)(int)accountType; val.account_uid = accountUid; val.account_token = accountToken; val.account_ext = accountExt; BindAccountReq data = val; SendPacket(data); } } public void RequestPlayerLogin() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } loginRandomNum = Singleton.Instance.LocalData.LoginRandomNum; if (loginRandomNum == 0) { loginRandomNum = GeneralLoginRandomNum(); Singleton.Instance.LocalData.LoginRandomNum = loginRandomNum; Singleton.Instance.Save(); } PlayerLoginReq val = new PlayerLoginReq(); val.login_random_num = loginRandomNum; val.last_server_packet_id = _clientPacketConsumer.lastServerPacketId; if (Singleton.Instance.apkCommentInfo != null) { string cps = Singleton.Instance.apkCommentInfo.cps; if (!string.IsNullOrEmpty(cps)) { val.cps = cps; } string checksum = Singleton.Instance.apkCommentInfo.checksum; if (!string.IsNullOrEmpty(checksum)) { val.check_sum = checksum; } } if (string.IsNullOrEmpty(_uuid)) { _uuid = GetPersistentUUID(); } val.device_uuid = _uuid; val.android_signatures = Singleton.Instance.apkSignature; SendPacket(val); } public void RequestConfigData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetConfigReq data = new GetConfigReq(); SendPacket(data); } public void RequestGetAllMainData() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } GetMainDataReq val = new GetMainDataReq(); val.type_list.Add((GetMainDataReq.DataType)0); SendPacket(val); } public void RequestGetStaminaRecoverLeftTime() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } GetMainDataReq val = new GetMainDataReq(); val.type_list.Add((GetMainDataReq.DataType)7); SendPacket(val); } public void RequestGetSkillPointRecoverLeftTime() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } GetMainDataReq val = new GetMainDataReq(); val.type_list.Add((GetMainDataReq.DataType)10); SendPacket(val); } public void RequestGetAllAvatarData() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeAvatarDataRsp()); return; } GetAvatarDataReq val = new GetAvatarDataReq(); val.avatar_id_list.Add(0u); SendPacket(val); } public void RequestGetAllLevelData() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeStageDataRsp()); return; } GetStageDataReq val = new GetStageDataReq(); val.stage_id_list.Add(0u); SendPacket(val); } public void RequestGetAllWeekDayActivityData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetWeekDayActivityDataReq data = new GetWeekDayActivityDataReq(); SendPacket(data); } public void RequestGetAvatarTeamData() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeGetAvatarTeamDataRsp()); } else { SendPacket(new GetAvatarTeamDataReq()); } } public void RequestGetScoinExchangeInfo() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); } else { SendPacket(new GetScoinExchangeInfoReq()); } } public void RequestScoinExchange() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); } else { SendPacket(new ScoinExchangeReq()); } } public void RequestGetStaminaExchangeInfo() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); } else { SendPacket(new GetStaminaExchangeInfoReq()); } } public void RequestStaminaExchange() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); } else { SendPacket(new StaminaExchangeReq()); } } public void RequestGetSkillPointExchangeInfo() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); } else { SendPacket(new GetSkillPointExchangeInfoReq()); } } public void RequestSkillPointExchange() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); } else { SendPacket(new SkillPointExchangeReq()); } } public void RequestNicknameChange(string newName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown NicknameModifyReq val = new NicknameModifyReq(); val.nickname = newName; SendPacket(val); } public void RequestSelfDescChange(string desc) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown SetSelfDescReq val = new SetSelfDescReq(); val.self_desc = desc; SendPacket(val); } public void RequestEquipmentPowerUp(StorageDataItemBase mainItem, List consumeItemList) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } EquipmentPowerUpReq val = new EquipmentPowerUpReq(); EquipmentItem val2 = new EquipmentItem(); SetEquipmentItemByStorageDataItem(val2, mainItem); val.main_item = val2; EquipmentItemList val3 = new EquipmentItemList(); foreach (StorageDataItemBase consumeItem in consumeItemList) { EquipmentItem val4 = new EquipmentItem(); SetEquipmentItemByStorageDataItem(val4, consumeItem); val3.item_list.Add(val4); } val.consume_item_list = val3; SendPacket(val); } private void SetEquipmentItemByStorageDataItem(EquipmentItem equipmentItem, StorageDataItemBase storageDataItem) { if (storageDataItem.GetType() == typeof(WeaponDataItem)) { equipmentItem.type = (EquipmentType)3; equipmentItem.id_or_unique_id = (uint)storageDataItem.uid; } if (storageDataItem.GetType() == typeof(StigmataDataItem)) { equipmentItem.type = (EquipmentType)4; equipmentItem.id_or_unique_id = (uint)storageDataItem.uid; } if (storageDataItem.GetType() == typeof(MaterialDataItem)) { equipmentItem.type = (EquipmentType)1; equipmentItem.id_or_unique_id = (uint)storageDataItem.ID; equipmentItem.num = (uint)storageDataItem.number; } } public void RequestEquipmentSell(List storageItemList) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown EquipmentItemList val = new EquipmentItemList(); List list = new List(); foreach (StorageDataItemBase storageItem in storageItemList) { if (storageItem is AvatarFragmentDataItem) { AvatarFragment val2 = new AvatarFragment(); val2.fragment_id = (uint)storageItem.ID; val2.num = (uint)storageItem.number; list.Add(val2); } else { EquipmentItem val3 = new EquipmentItem(); SetEquipmentItemByStorageDataItem(val3, storageItem); val.item_list.Add(val3); } } if (val.item_list.Count > 0) { EquipmentSellReq val4 = new EquipmentSellReq(); val4.sell_item_list = val; SendPacket(val4); } if (list.Count > 0) { SellAvatarFragmentReq val5 = new SellAvatarFragmentReq(); val5.fragment_list.AddRange(list); SendPacket(val5); } } public void RequestGetAllEquipmentData() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeEquipmentDataRsp()); return; } GetEquipmentDataReq val = new GetEquipmentDataReq(); val.weapon_unique_id_list.Add(0u); val.stigmata_unique_id_list.Add(0u); val.material_id_list.Add(0u); SendPacket(val); } public void RequestGetSpecifiedEquipmentData(List weaponUIDList, List stigmataUIDList, List materialIDList) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetEquipmentDataReq val = new GetEquipmentDataReq(); foreach (uint weaponUID in weaponUIDList) { val.weapon_unique_id_list.Add(weaponUID); } foreach (uint stigmataUID in stigmataUIDList) { val.stigmata_unique_id_list.Add(stigmataUID); } foreach (uint materialID in materialIDList) { val.material_id_list.Add(materialID); } SendPacket(val); } public void RequestAvatarStarUp(int m_avatarId) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); SendFakePacket(); } else { AvatarStarUpReq val = new AvatarStarUpReq(); val.avatar_id = (uint)m_avatarId; SendPacket(val); } } public void RequestEquipmentEvo(List resourceList, StorageDataItemBase mainItem) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown EquipmentEvoReq val = new EquipmentEvoReq(); EquipmentItem val2 = new EquipmentItem(); SetEquipmentItemByStorageDataItem(val2, mainItem); val.main_item = val2; EquipmentItemList val3 = new EquipmentItemList(); foreach (StorageDataItemBase resource in resourceList) { EquipmentItem val4 = new EquipmentItem(); SetEquipmentItemByStorageDataItem(val4, resource); val3.item_list.Add(val4); } val.consume_item_list = val3; SendPacket(val); } public void RequestDressEquipmentReq(int avatarID, StorageDataItemBase dataItem, EquipmentSlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) DressEquipmentReq val = new DressEquipmentReq(); val.avatar_id = (uint)avatarID; val.slot = slot; val.unique_id = ((dataItem != null) ? ((uint)dataItem.uid) : 0u); SendPacket(val); } public void RequestAddAvatarExpByMaterial(int avatarID, int materialID, int num) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AddAvatarExpByMaterialReq val = new AddAvatarExpByMaterialReq(); val.avatar_id = (uint)avatarID; val.material_id = (uint)materialID; val.material_num = (uint)num; SendPacket(val); } public void RequestLevelBeginReq(LevelDataItem level, int helperUid = 0) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } StageBeginReq val = new StageBeginReq(); val.stage_id = (uint)level.levelId; List memberList = Singleton.Instance.playerData.GetMemberList(level.LevelType); foreach (int item in memberList) { val.avatar_id_list.Add((uint)item); } if (helperUid != 0) { val.assistant_uid = (uint)helperUid; } SendPacket(val); } public void RequestEndlessLevelBeginReq() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown EndlessStageBeginReq val = new EndlessStageBeginReq(); List memberList = Singleton.Instance.playerData.GetMemberList((StageType)4); foreach (int item in memberList) { val.avatar_id_list.Add((uint)item); } SendPacket(val); } public void RequestLevelEndReq(int levelId, StageEndStatus status, int scoinReward, int avatarExpReward, List challengeIndexList, List drops, List cheatDataList, bool hashChanged, string signKey) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeStageEndRsp()); return; } StageEndReqBody val = new StageEndReqBody(); val.stage_id = (uint)levelId; val.end_status = status; val.scoin_reward = (uint)scoinReward; val.avatar_exp_reward = (uint)avatarExpReward; foreach (int challengeIndex in challengeIndexList) { val.challenge_index_list.Add((uint)challengeIndex); } val.drop_item_list.AddRange(drops); if (cheatDataList != null) { val.cheat_data_list.AddRange(cheatDataList); } val.is_hash_changed = hashChanged; MemoryStream memoryStream = new MemoryStream(); memoryStream.SetLength(0L); memoryStream.Position = 0L; Singleton.Instance.serializer.Serialize(memoryStream, val); byte[] body = memoryStream.ToArray(); byte[] bytes = Encoding.Default.GetBytes(signKey); memoryStream.Write(bytes, 0, bytes.Length); byte[] bytes2 = memoryStream.ToArray(); StageEndReq val2 = new StageEndReq(); val2.body = body; val2.sign = SecurityUtil.SHA256(bytes2); SendPacket(val2); Singleton.Instance.SaveLevelEndReqInfo(val2); } public void RequestEndlessFloorEndReq(StageEndStatus status, List drops, List avatarHPList, bool hashChanged) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) EndlessStageEndReq val = new EndlessStageEndReq(); val.end_status = status; val.drop_item_list.AddRange(drops); val.avatar_hp_list.AddRange(avatarHPList); val.is_hash_changed = hashChanged; SendPacket(val); } public void NotifyUpdateAvatarTeam(StageType levelType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected I4, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) UpdateAvatarTeamNotify val = new UpdateAvatarTeamNotify(); val.team = new AvatarTeam(); val.team.stage_type = (uint)(int)levelType; foreach (int member in Singleton.Instance.playerData.GetMemberList(levelType)) { val.team.avatar_id_list.Add((uint)member); } SendPacket(val); } public void RequestAvatarSubSkillLevelUp(int avatarID, int skillID, int subSkillID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AvatarSubSkillLevelUpReq val = new AvatarSubSkillLevelUpReq(); val.avatar_id = (uint)avatarID; val.skill_id = (uint)skillID; val.sub_skill_id = (uint)subSkillID; SendPacket(val); } public void RequestGachaDisplayInfo() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeGetGachaDisplayRsp()); return; } GetGachaDisplayReq data = new GetGachaDisplayReq(); SendPacket(data); } public void RequestGacha(GachaType type, int num) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(); return; } GachaReq val = new GachaReq(); val.type = type; val.num = (uint)num; SendPacket(val); } public void RequestChapterDropList(ChapterDataItem chapter) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetStageDropDisplayReq val = new GetStageDropDisplayReq(); foreach (LevelDataItem allLevel in chapter.GetAllLevelList()) { val.stage_id_list.Add((uint)allLevel.levelId); } SendPacket(val); } public void RequestLevelDropList(List levelIDList) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetStageDropDisplayReq val = new GetStageDropDisplayReq(); val.stage_id_list.AddRange(levelIDList); SendPacket(val); } public void RequestChangeEquipmentProtectdStatus(StorageDataItemBase storageDataItem) { if (!(storageDataItem is MaterialDataItem)) { List list = new List(); List list2 = new List(); if (storageDataItem is WeaponDataItem) { list.Add(storageDataItem as WeaponDataItem); } else { list2.Add(storageDataItem as StigmataDataItem); } RequestUpdateEquipmentProtectdStatus(list, list2, !storageDataItem.isProtected); } } public void RequestIdentifyStigmataAffix(StorageDataItemBase storageItem) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown IdentifyStigmataAffixReq val = new IdentifyStigmataAffixReq(); val.unique_id = (uint)storageItem.uid; SendPacket(val); } public void RequestUpdateEquipmentProtectdStatus(List weaponList, List stigmataList, bool isProtected) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown UpdateEquipmentProtectedStatusReq val = new UpdateEquipmentProtectedStatusReq(); if (weaponList != null) { foreach (WeaponDataItem weapon in weaponList) { val.weapon_unique_id_list.Add((uint)weapon.uid); } } if (stigmataList != null) { foreach (StigmataDataItem stigmata in stigmataList) { val.stigmata_unique_id_list.Add((uint)stigmata.uid); } } val.is_protected = isProtected; SendPacket(val); } public void RequestFriendDetailInfo(int uid) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakePlayerDetailDataRsp((uint)uid)); return; } GetPlayerDetailDataReq val = new GetPlayerDetailDataReq(); val.target_uid = (uint)uid; SendPacket(val); } public void RequestAddFriend(int targetUid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AddFriendReq val = new AddFriendReq(); val.action = (AddFriendAction)1; val.target_uid = (uint)targetUid; SendPacket(val); } public void RequestAgreeFriend(int targetUid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AddFriendReq val = new AddFriendReq(); val.action = (AddFriendAction)2; val.target_uid = (uint)targetUid; SendPacket(val); } public void RequestRejectFriend(int targetUid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AddFriendReq val = new AddFriendReq(); val.action = (AddFriendAction)3; val.target_uid = (uint)targetUid; SendPacket(val); } public void RequestDelFriend(int targetUid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown DelFriendReq val = new DelFriendReq(); val.target_uid = (uint)targetUid; SendPacket(val); } public void RequestAskAddFriendList() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeAskAddFriendListRsp()); return; } GetAskAddFriendListReq data = new GetAskAddFriendListReq(); SendPacket(data); } public void RequestFriendList() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeFriendListRsp()); return; } GetFriendListReq data = new GetFriendListReq(); SendPacket(data); } public void RequestRecommandFriendList() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeRecommendFriendListRsp()); return; } GetRecommendFriendListReq data = new GetRecommendFriendListReq(); SendPacket(data); } public void RequestSetFriendDesc(string desc) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown SetSelfDescReq val = new SetSelfDescReq(); val.self_desc = desc; SendPacket(val); } public void RequestGetMailData() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeMailDataRsp()); return; } GetMailDataReq data = new GetMailDataReq(); SendPacket(data); } public void RequestGetAllMailAttachment() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetMailAttachmentReq data = new GetMailAttachmentReq(); SendPacket(data); } public void RequestGetOneMailAttachment(MailDataItem mailData) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown MailKey val = new MailKey(); val.id = (uint)mailData.ID; val.type = mailData.type; GetMailAttachmentReq val2 = new GetMailAttachmentReq(); val2.mail_key_list.Add(val); SendPacket(val2); } public void RequestEnterWorldChatroom(int chatRoomId = 0) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown EnterWorldChatroomReq val = new EnterWorldChatroomReq(); val.chatroom_id = (uint)chatRoomId; SendPacket(val); } public void NotifySendWorldChatMsg(string message) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown SendWorldChatMsgNotify val = new SendWorldChatMsgNotify(); val.msg = message; SendPacket(val); } public void NotifySendGuildChatMsg(string message) { } public void NotifySendFriendChatMsg(int targetUid, string message) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown SendFriendChatMsgNotify val = new SendFriendChatMsgNotify(); val.msg = message; val.target_uid = (uint)targetUid; SendPacket(val); } public void RequestGetAssistantFrozenList() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetAssistantFrozenListReq data = new GetAssistantFrozenListReq(); SendPacket(data); } public void RequestHasGotItemIdList() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetHasGotItemIdListReq data = new GetHasGotItemIdListReq(); SendPacket(data); } public void RequestAvatarRevive(bool is_retry = false) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetAvatarReviveRsp()); return; } AvatarReviveReq val = new AvatarReviveReq(); val.is_retry = is_retry; SendPacket(val); } public void RequestStageEnterTimes(uint _stageId) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown ResetStageEnterTimesReq val = new ResetStageEnterTimesReq(); val.stage_id = _stageId; SendPacket(val); } public void RequestGetMissionData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetMissionDataReq data = new GetMissionDataReq(); SendPacket(data); } public void RequestGetMissionReward(uint missionId) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetMissionRewardReq val = new GetMissionRewardReq(); val.mission_id = missionId; SendPacket(val); } public void RequestUpdateMissionProgress(MissionFinishWay finishWay, uint finishParaInt, string finishParaStr, uint progressAdd) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) UpdateMissionProgressReq val = new UpdateMissionProgressReq(); val.finish_way = finishWay; val.finish_para = finishParaInt; val.finish_para_str = finishParaStr; val.progress_add = progressAdd; SendPacket(val); } public void RequestGetFinishGuideData() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (GlobalVars.DISABLE_NETWORK_DEBUG) { SendFakePacket(FakePacketHelper.GetFakeFinishGuideDataRsp()); return; } GetFinishGuideDataReq data = new GetFinishGuideDataReq(); SendPacket(data); } public void RequestFinishGuideReport(uint guideID, bool isForceFinish) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown FinishGuideReportReq val = new FinishGuideReportReq(); List list = new List(); list.Add(guideID); val.guide_id_list.Clear(); val.guide_id_list.AddRange(list); val.is_force_finish = isForceFinish; SendPacket(val); } public void RequestFinishGuideReport(List guideIDList, bool isForceFinish) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown FinishGuideReportReq val = new FinishGuideReportReq(); List list = new List(); foreach (int guideID in guideIDList) { list.Add((uint)guideID); } val.guide_id_list.Clear(); val.guide_id_list.AddRange(list); val.is_force_finish = isForceFinish; SendPacket(val); } public void RequestStageInnerDataReport(List avatarInfoList, List monsterInfoList, PlayerStastics playerData) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Expected O, but got Unknown StageInnerDataReportReq val = new StageInnerDataReportReq(); foreach (AvatarStastics avatarInfo in avatarInfoList) { StageInnerAvatarData val2 = new StageInnerAvatarData(); val2.avatar_id = (uint)avatarInfo.avatarID; val2.stage_id = (uint)avatarInfo.stageID; val2.avatar_level = (uint)avatarInfo.avatarLevel; val2.avatar_star = (uint)avatarInfo.avatarStar; val2.total_output = (uint)Mathf.FloorToInt(avatarInfo.avatarDamage); val2.no_restrict_output = (uint)Mathf.FloorToInt(avatarInfo.normalDamage); val2.do_restrict_output = (uint)Mathf.FloorToInt(avatarInfo.restrictionDamage); val2.be_restrict_output = (uint)Mathf.FloorToInt(avatarInfo.beRestrictedDamage); val2.total_input = (uint)Mathf.FloorToInt(avatarInfo.avatarBeDamaged); val2.battle_time = (uint)Mathf.FloorToInt(avatarInfo.battleTime); val2.total_time = (uint)Mathf.FloorToInt(avatarInfo.onStageTime); val2.enter_times = (uint)avatarInfo.swapInTimes; val2.leave_times = (uint)avatarInfo.swapOutTimes; val2.do_break_times = (uint)avatarInfo.avatarBreakTimes; val2.be_break_times = (uint)avatarInfo.avatarBeingBreakTimes; val2.do_hit_times = (uint)avatarInfo.avatarHitTimes; val2.be_hit_times = (uint)avatarInfo.avatarBeingHitTimes; val2.exskill_times = (uint)avatarInfo.avatarSkill02Times; val2.evade_times = (uint)avatarInfo.avatarEvadeTimes; val2.evade_success_times = (uint)avatarInfo.avatarEvadeSuccessTimes; val2.evade_effect_times = (uint)avatarInfo.avatarEvadeEffectTimes; val2.attack_sp_recover = (uint)Mathf.FloorToInt(avatarInfo.selfSPRecover); val2.total_sp_recover = (uint)Mathf.FloorToInt(avatarInfo.SpRecover); val2.dps = (uint)Mathf.FloorToInt(avatarInfo.dps); val2.special_attack_times = (uint)Mathf.FloorToInt((int)avatarInfo.avatarSpecialAttackTimes); val2.weapon_active_skill = (uint)Mathf.FloorToInt(avatarInfo.avatarActiveWeaponSkillDamage); val.avatar_list.Add(val2); } foreach (MonsterStastics monsterInfo in monsterInfoList) { StageInnerMonsterData val3 = new StageInnerMonsterData(); val3.monster_name = monsterInfo.key.monsterName; val3.monster_type = monsterInfo.key.configType; val3.monster_level = (uint)monsterInfo.key.level; val3.monster_num = (uint)monsterInfo.monsterCount; val3.avg_output = (uint)Mathf.FloorToInt(monsterInfo.damage); val3.avg_live_time = (uint)Mathf.FloorToInt(monsterInfo.aliveTime); val3.dps = (uint)Mathf.FloorToInt(monsterInfo.dps); val3.hit_avatar_times = (uint)monsterInfo.hitAvatarTimes; val3.break_avatar_times = (uint)monsterInfo.breakAvatarTimes; val.monster_list.Add(val3); } val.rotate_camera_times = (uint)playerData.screenRotateTimes; val.stage_time = (uint)UIUtil.FloorToIntCustom(playerData.stageTime); val.max_combo_num = (uint)Singleton.Instance.maxComboNum; SendPacket(val); } public void RequestExchangeAvatarWeapon(int avatarID1, int avatarID2) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown ExchangeAvatarWeaponReq val = new ExchangeAvatarWeaponReq(); val.avatar_id_1 = (uint)avatarID1; val.avatar_id_2 = (uint)avatarID2; SendPacket(val); } public void RequestGetBulletin() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown SendPacket(new GetBulletinReq()); Singleton.Instance.LastCheckBulletinTime = TimeUtil.Now; } public void RequestGetSignInRewardStatus() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetSignInRewardStatusReq data = new GetSignInRewardStatusReq(); SendPacket(data); } public void RequestGetSignInReward() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetSignInRewardReq data = new GetSignInRewardReq(); SendPacket(data); } public void RequestEndlessData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetEndlessDataReq data = new GetEndlessDataReq(); SendPacket(data); } public void RequestEndlessAvatarHp() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetEndlessAvatarHpReq data = new GetEndlessAvatarHpReq(); SendPacket(data); } public void RequestUseEndlessItem(uint itemId, int targetUid = -1) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown UseEndlessItemReq val = new UseEndlessItemReq(); val.item_id = itemId; if (targetUid > 0) { val.target_uid = (uint)targetUid; } SendPacket(val); } public void RequestGalAddGoodFeel(int avatarId, int amount, uint type) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AddGoodfeelReq val = new AddGoodfeelReq(); val.avatar_id = (uint)avatarId; val.add_goodfeel = amount; val.add_goodfeel_type = type; SendPacket(val); } public void RequestGetIsland() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetIslandReq data = new GetIslandReq(); SendPacket(data); } public void RequestCabinLevelUp(CabinType cabinType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown LevelUpCabinReq val = new LevelUpCabinReq(); val.cabin_type = (uint)(int)cabinType; SendPacket(val); } public void RequestExtendCabin(CabinType cabinType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown ExtendCabinReq val = new ExtendCabinReq(); val.cabin_type = (uint)(int)cabinType; SendPacket(val); } public void RequestFinishCabinLevelUp(CabinType cabinType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown FinishCabinLevelUpReq val = new FinishCabinLevelUpReq(); val.cabin_type = (uint)(int)cabinType; SendPacket(val); } public void RequestFeedStigmataAffix(int mainUID, int consumeUID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown FeedStigmataAffixReq val = new FeedStigmataAffixReq(); val.main_unique_id = (uint)mainUID; val.consume_unique_id = (uint)consumeUID; SendPacket(val); } public void RequestSelectNewStigmataAffix() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown SelectNewStigmataAffixReq data = new SelectNewStigmataAffixReq(); SendPacket(data); } public void RequestProductList() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetProductListReq data = new GetProductListReq(); SendPacket(data); } public void RequestAddCabinTech(CabinType cabinType, int x, int y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown AddCabinTechReq val = new AddCabinTechReq(); val.cabin_type = (uint)(int)cabinType; val.pos_x = x; val.pos_y = y; SendPacket(val); } public void RequestCheckAppleReceipt(string receipt) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown VerifyItunesOrderNotify val = new VerifyItunesOrderNotify(); val.receipt_data = receipt; SendPacket(val); } public void RequestResetCabinTech(CabinType cabinType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected I4, but got Unknown ResetCabinTechReq val = new ResetCabinTechReq(); val.cabin_type = (uint)(int)cabinType; SendPacket(val); } public void RequestGetVipRewardData() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetVipRewardDataReq data = new GetVipRewardDataReq(); SendPacket(data); } public void RequestIslandVenture() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetIslandVentureReq data = new GetIslandVentureReq(); SendPacket(data); } public void RequestGetVipReward(int VipLevel) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetVipRewardReq val = new GetVipRewardReq(); val.vip_level = (uint)VipLevel; SendPacket(val); } public void RequestRefreshIslandVenture() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown RefreshIslandVentureReq data = new RefreshIslandVentureReq(); SendPacket(data); } public void RequestDispatchIslandVenture(int ventureId, List avatarIdList) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown DispatchIslandVentureReq val = new DispatchIslandVentureReq(); val.venture_id = (uint)ventureId; foreach (int avatarId in avatarIdList) { val.avatar_id_list.Add((uint)avatarId); } SendPacket(val); } public void RequestGetIslandVentureReward(int ventureId) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetIslandVentureRewardReq val = new GetIslandVentureRewardReq(); val.venture_id = (uint)ventureId; SendPacket(val); } public void RequestCancelDispatchIslandVenture(int ventureId) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown CancelDispatchIslandVentureReq val = new CancelDispatchIslandVentureReq(); val.venture_id = (uint)ventureId; SendPacket(val); } public void RequestGetShopList() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetShopListReq data = new GetShopListReq(); SendPacket(data); } public void RequestBuyGoods(int shopID, int goodsID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown BuyGoodsReq val = new BuyGoodsReq(); val.shop_id = (uint)shopID; val.goods_id = (uint)goodsID; SendPacket(val); } public void RequestManualRefreshShop(int shopID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown ManualRefreshShopReq val = new ManualRefreshShopReq(); val.shop_id = (uint)shopID; SendPacket(val); } public void RequestIslandDisjoinEquipment(EquipmentType type, uint id) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) IslandDisjoinEquipmentReq val = new IslandDisjoinEquipmentReq(); val.type = type; val.unique_id = id; SendPacket(val); } public void RequestIslandCollect() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown IslandCollectReq data = new IslandCollectReq(); SendPacket(data); } public void RequestGetCollectCabin() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetCollectCabinReq data = new GetCollectCabinReq(); SendPacket(data); } public void RequestCreateWeiXinOrder(string productID, string productName, float productPrice) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown CreateWeiXinOrderReq val = new CreateWeiXinOrderReq(); val.body = productName; val.attach = Singleton.Instance.playerData.userId + "|" + productID; val.total_fee = ((int)(productPrice * 100f)).ToString(); val.notify_url = Singleton.Instance.DispatchSeverData.oaServerUrl + "/callback/weixin"; SendPacket(val); } public void RequestSpeedUpIslandVenture(int ventureID, int materialID, int num) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown SpeedUpIslandVentureReq val = new SpeedUpIslandVentureReq(); val.venture_id = (uint)ventureID; val.material_id = (uint)materialID; val.num = (uint)num; SendPacket(val); } public void RequestGuideReward(int rewardID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetGuideRewardReq val = new GetGuideRewardReq(); val.guide_id = (uint)rewardID; SendPacket(val); } public void RequestGetRedeemCodeInfo(string redeemCode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetRedeemCodeInfoReq val = new GetRedeemCodeInfoReq(); val.redeem_code = redeemCode; SendPacket(val); } public void RequestExchangeRedeemCode(string redeemCode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown ExchangeRedeemCodeReq val = new ExchangeRedeemCodeReq(); val.redeem_code = redeemCode; SendPacket(val); } public void RequestBuyGachaTicket(int ticketID, int num) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown BuyGachaTicketReq val = new BuyGachaTicketReq(); val.material_id = (uint)ticketID; val.num = (uint)num; SendPacket(val); } public void RequestAntiCheatSDKReport() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AntiCheatSDKReportReq data = new AntiCheatSDKReportReq(); SendPacket(data); } public void RequestGetEndlessTopGroup() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetEndlessTopGroupReq data = new GetEndlessTopGroupReq(); SendPacket(data); } public void RequestGetRefreshIslandVentureInfo() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetRefreshIslandVentureInfoReq data = new GetRefreshIslandVentureInfoReq(); SendPacket(data); } public void RequestCommentReport(CommentType comment, uint times) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) CommentReportReq val = new CommentReportReq(); val.comment = comment; val.times = times; SendPacket(val); } public void RequestGetInviteFriend() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetInviteFriendReq data = new GetInviteFriendReq(); SendPacket(data); } public void RequestGetInviteeFriend() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GetInviteeFriendReq data = new GetInviteeFriendReq(); SendPacket(data); } public void RequestGetAcceptFriendInvite(string inviteCode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown AcceptFriendInviteReq val = new AcceptFriendInviteReq(); val.invite_code = inviteCode; SendPacket(val); } private void InitClientPacketConsumer() { if (_clientPacketConsumer == null) { GameObject gameObject = new GameObject(); gameObject.name = "NetPacketConsumer"; _clientPacketConsumer = gameObject.AddComponent(); } _clientPacketConsumer.Init(_client); _clientPacketConsumer.gameObject.SetActive(false); } private bool ConnectGameServer(string host, ushort port, int timeout_ms = 3000) { if (_client.isConnected()) { if (_client.Host == host && _client.Port == port) { return true; } _client.disconnect(); } bool flag = _client.connect(host, port, timeout_ms); if (flag) { NetPacketV1 netPacketV = new NetPacketV1(); netPacketV.setCmdId(1); _client.setKeepalive(10000, netPacketV); _client.setDisconnectCallback(UnexceptedDisconnectCallback); _clientPacketConsumer.gameObject.SetActive(true); } return flag; } public void DisConnect() { _client.disconnect(); } public void SendFakePacket() { T fakeRsp = FakePacketHelper.GetFakeRsp(); SendFakePacket(fakeRsp); } public void SendFakePacket(T data) { Singleton.Instance.StartCoroutine(DoSendFakePacket(data)); } private IEnumerator DoSendFakePacket(T data) { yield return null; ushort cmdID = Singleton.Instance.GetCmdIDByType(typeof(T)); NetPacketV1 req_pack = new NetPacketV1(); req_pack.setUserId((uint)Singleton.Instance.playerData.userId); req_pack.setCmdId(cmdID); req_pack.setData(data); Type cmdType = Singleton.Instance.GetTypeByCmdID(cmdID); Singleton.Instance.FireNotify(new Notify(NotifyTypes.NetwrokPacket, req_pack)); } public void SendPacket(T data) { if (GlobalVars.DISABLE_NETWORK_DEBUG) { return; } ushort cmdIDByType = Singleton.Instance.GetCmdIDByType(typeof(T)); if (CheckRequestTimeValid(cmdIDByType)) { NetPacketV1 netPacketV = new NetPacketV1(); netPacketV.setUserId((uint)Singleton.Instance.playerData.userId); netPacketV.setCmdId(cmdIDByType); netPacketV.setData(data); if (cmdIDByType != 4 && cmdIDByType != 6) { netPacketV.setTime(++_clientPacketConsumer.clientPacketId); } Type typeByCmdID = Singleton.Instance.GetTypeByCmdID(cmdIDByType); TryCacheSendPacket(netPacketV); _client.send(netPacketV); } } public void UnexceptedDisconnectCallback() { } public void QuickLogin() { if (GlobalVars.DISABLE_NETWORK_DEBUG) { RequestPlayerToken(); return; } Singleton.Instance.StartCoroutine(ConnectDispatchServer(delegate { if (ConnectGameServer(DispatchSeverData.host, DispatchSeverData.port)) { RequestPlayerToken(); } })); } public void LoginGameServer() { if (GlobalVars.DISABLE_NETWORK_DEBUG) { RequestPlayerToken(); } else if (ConnectGameServer(DispatchSeverData.host, DispatchSeverData.port)) { RequestPlayerToken(); } } public void ProcessWaitStopAnotherLogin() { float num = 2f; if (alreadyLogin) { Singleton.Instance.Invoke(num, RequestPlayerLogin); return; } LoadingWheelWidgetContext loadingWheelWidgetContext = new LoadingWheelWidgetContext(); loadingWheelWidgetContext.SetMaxWaitTime(num); loadingWheelWidgetContext.timeOutCallBack = RequestPlayerLogin; Singleton.Instance.ShowWidget(loadingWheelWidgetContext); } public IEnumerator ConnectGlobalDispatchServer(Action successCallback = null) { string retJsonString = string.Empty; for (int count = 0; count < _globalDispatchUrlList.Count; count++) { float timer = 0f; string globalDispatchUrl = _globalDispatchUrlList[count] + "?version=" + GetGameVersion(); bool timeout = false; WWW www = new WWW(globalDispatchUrl); while (!www.isDone) { if (timer > 3f) { timeout = true; break; } timer += Time.deltaTime; yield return null; } if (!string.IsNullOrEmpty(www.error) || timeout) { www.Dispose(); continue; } retJsonString = www.text; break; } OnConnectGlobalDispatch(retJsonString, successCallback); } private bool OnConnectGlobalDispatch(string retJsonString, Action successCallback = null) { bool flag = false; bool flag2 = false; string errorMsg = string.Empty; int retCode = 0; JSONNode retJson = null; string desc = LocalizationGeneralLogic.GetText("Menu_Desc_ConnectGlobalDispatchErr"); flag2 = TryGetRetCodeFromJsonString(retJsonString, out retJson, out errorMsg, out retCode); flag = flag2; if (flag2) { if (retCode == 0) { GlobalDispatchData = new GlobalDispatchDataItem(retJson); if (GlobalDispatchData.regionList.Count <= 0) { flag = false; errorMsg = "Error: GlobalDispatchData.regionList.Count <= 0"; } else { flag = true; } } else { flag = false; errorMsg = (string)retJson["msg"] + " retcode=" + retCode; desc = errorMsg; } } if (flag) { if (successCallback != null) { successCallback(); } } else { Singleton.Instance.ShowDialog(new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Tittle_GlobalDispatchUnknownErr"), desc = desc, notDestroyAfterTouchBG = true, hideCloseBtn = true, buttonCallBack = delegate { TryReconnectGlobalDispatch(); } }); if (!string.IsNullOrEmpty(retJsonString)) { SuperDebug.VeryImportantError("Connect Global Dispatch Error msg=" + errorMsg + " retJsonString=" + retJsonString); } } return flag; } private bool TryGetRetCodeFromJsonString(string jsonString, out JSONNode retJson, out string errorMsg, out int retCode) { bool flag = false; errorMsg = string.Empty; retCode = 0; retJson = null; if (string.IsNullOrEmpty(jsonString)) { flag = false; errorMsg = "Error: retJsonString IsNullOrEmpty!"; } else { retJson = JSON.Parse(jsonString); if (retJson == null || string.IsNullOrEmpty(retJson["retcode"])) { flag = false; errorMsg = "Error: JSON.Parse null!"; } else if (!int.TryParse(retJson["retcode"].Value, out retCode)) { flag = false; errorMsg = "Error: retcode is not integer!"; } else { flag = true; } } return flag; } public IEnumerator ConnectDispatchServer(Action successCallback = null) { int lastLoginUserId = Singleton.Instance.GeneralLocalData.LastLoginUserId; string dispatchUrl = GlobalDispatchData.regionList[0].dispatchUrl + "?version=" + GetGameVersion() + "&uid=" + lastLoginUserId; WWW www = new WWW(dispatchUrl); yield return www; string retString = string.Empty; if (string.IsNullOrEmpty(www.error)) { retString = www.text; } OnConnectDispatchServer(retString, successCallback); www.Dispose(); } private bool OnConnectDispatchServer(string retJsonString, Action successCallback = null) { bool flag = false; string errorMsg = string.Empty; int retCode = 0; JSONNode retJson = null; if (!TryGetRetCodeFromJsonString(retJsonString, out retJson, out errorMsg, out retCode)) { if (!alreadyLogin) { Singleton.Instance.ShowDialog(new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_NetError"), desc = LocalizationGeneralLogic.GetText("Menu_Desc_ConnectDispatchErr"), notDestroyAfterTouchBG = true, hideCloseBtn = true, buttonCallBack = delegate { TryReconnectDispatch(); } }); } if (!string.IsNullOrEmpty(retJsonString)) { SuperDebug.VeryImportantError("Connect Dispatch Error msg=" + errorMsg + " retJsonString=" + retJsonString); } return false; } retCode = retJson["retcode"].AsInt; switch (retCode) { case 0: DispatchSeverData = new DispatchServerDataItem(retJson); Singleton.Instance.remoteAssetBundleUrl = DispatchSeverData.assetBundleUrl; if (DispatchSeverData.dataUseAssetBundleUseSever) { GlobalVars.DataUseAssetBundle = DispatchSeverData.dataUseAssetBundle; } if (DispatchSeverData.resUseAssetBundleUseSever) { GlobalVars.ResourceUseAssetBundle = DispatchSeverData.resUseAssetBundle; } if (successCallback != null) { successCallback(); } return true; case 4: { string forceUupdateUrl = OpeUtil.ConvertEventUrl(retJson["force_update_url"]); Singleton.Instance.ShowDialog(new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Title_NewVersion"), desc = retJson["msg"], notDestroyAfterTouchBG = true, hideCloseBtn = true, buttonCallBack = delegate { Application.OpenURL(forceUupdateUrl); } }); break; } case 2: { DateTime dateTimeFromTimeStamp = Miscs.GetDateTimeFromTimeStamp((uint)retJson["stop_begin_time"].AsInt); DateTime dateTimeFromTimeStamp2 = Miscs.GetDateTimeFromTimeStamp((uint)retJson["stop_end_time"].AsInt); string desc = string.Concat(retJson["msg"], Environment.NewLine, LocalizationGeneralLogic.GetText("Menu_ServerStopTime", dateTimeFromTimeStamp.ToString("MM-dd HH:mm"), dateTimeFromTimeStamp2.ToString("MM-dd HH:mm"))); Singleton.Instance.ShowDialog(new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Title_ServerStop"), desc = desc, notDestroyAfterTouchBG = true, hideCloseBtn = true, buttonCallBack = delegate { TryReconnectDispatch(); } }); break; } default: Singleton.Instance.ShowDialog(new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Tittle_DispatchUnknownErr"), desc = (string)retJson["msg"] + " retcode=" + retCode, notDestroyAfterTouchBG = true, hideCloseBtn = true, buttonCallBack = delegate { TryReconnectDispatch(); } }); break; } return false; } private void TryReconnectDispatch() { if (alreadyLogin) { QuickLogin(); return; } MonoGameEntry monoGameEntry = Singleton.Instance.SceneCanvas as MonoGameEntry; if (monoGameEntry != null) { monoGameEntry.ConnectDispatch(); } } private void TryReconnectGlobalDispatch() { if (!alreadyLogin) { MonoGameEntry monoGameEntry = Singleton.Instance.SceneCanvas as MonoGameEntry; if (monoGameEntry != null) { monoGameEntry.ConnentGlobalDispatch(); } } } private GetPlayerTokenReq GetTestPlayerTokenReq() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown string persistentUUID = GetPersistentUUID(); GetPlayerTokenReq val = new GetPlayerTokenReq(); val.account_type = 0u; val.account_uid = string.Empty; val.account_token = string.Empty; val.account_ext = string.Empty; val.token = persistentUUID; return val; } private static string GetPersistentUUID() { return SystemInfo.deviceUniqueIdentifier; } private static bool CheckDeviceUniqueIdentifier() { string deviceUniqueIdentifier = SystemInfo.deviceUniqueIdentifier; return !string.IsNullOrEmpty(deviceUniqueIdentifier) && deviceUniqueIdentifier != "00000000-0000-0000-0000-000000000000"; } public string GetGameVersion() { return "0.9.9_" + channelConfig.ChannelName; } private uint GeneralLoginRandomNum() { return (uint)(DateTime.Now.Ticks >> 13); } private bool CheckRequestTimeValid(int cmdId) { if (!_requestMinIntervalDict.ContainsKey(cmdId)) { return true; } bool flag = false; if (_lastRequestTimeDict.ContainsKey(cmdId)) { if (_lastRequestTimeDict[cmdId].AddSeconds(_requestMinIntervalDict[cmdId]) < TimeUtil.Now) { flag = true; } } else { flag = true; } if (flag) { _lastRequestTimeDict[cmdId] = TimeUtil.Now; } return flag; } private void SetupRequestMinIntervalDict() { _requestMinIntervalDict = new Dictionary { { 14, 1f }, { 18, 1f }, { 54, 1f }, { 31, 3f }, { 33, 3f }, { 102, 3f }, { 29, 3f }, { 37, 3f }, { 35, 3f }, { 50, 1f }, { 86, 1f }, { 106, 1f }, { 135, 1f }, { 147, 1f }, { 158, 3f }, { 160, 3f }, { 162, 1f }, { 193, 3f }, { 195, 3f }, { 173, 3f }, { 171, 3f }, { 175, 1f }, { 203, 1f }, { 205, 3f }, { 179, 3f } }; } private void BuildCmdShouldEnqueueMap() { _CMD_SHOULD_ENQUEUE_MAP = new Dictionary { { 201u, true }, { 58u, true }, { 43u, true }, { 72u, true }, { 45u, true }, { 131u, true }, { 141u, true }, { 143u, true }, { 106u, true }, { 98u, true }, { 100u, true }, { 112u, true }, { 117u, true }, { 129u, true }, { 31u, true } }; } private void TryCacheSendPacket(NetPacketV1 reqPack) { if (_CMD_SHOULD_ENQUEUE_MAP == null) { BuildCmdShouldEnqueueMap(); } if (_CMD_SHOULD_ENQUEUE_MAP.ContainsKey(reqPack.getCmdId())) { if (_packetSendQueue.Count >= 20) { _packetSendQueue.Dequeue(); } _packetSendQueue.Enqueue(reqPack); } } private void SendQueuePacketWhenReconnected(uint serverProcessedPacketId) { foreach (NetPacketV1 item in _packetSendQueue) { if (item.getTime() > serverProcessedPacketId) { Type typeByCmdID = Singleton.Instance.GetTypeByCmdID(item.getCmdId()); _client.send(item); } } } public void Destroy() { DisConnect(); Singleton.Destroy(); UnityEngine.Object.Destroy(_clientPacketConsumer.gameObject); } public void SetRepeatLogin() { _clientPacketConsumer.SetRepeatLogin(); } } }