protected void OnUserSearchResult(InterceptArgs e) { try { if (SetResult(UserSearchResults.Parse(e.Packet))) { e.Block(); } } catch (Exception ex) { SetException(ex); } }
protected void OnAchievementList(InterceptArgs e) { try { if (SetResult(Achievements.Parse(e.Packet))) { e.Block(); } } catch (Exception ex) { SetException(ex); } }
protected void HandleUserData(InterceptArgs e) { try { if (SetResult(UserData.Parse(e.Packet))) { e.Block(); } } catch (Exception ex) { SetException(ex); } }
private void HandleWalletBalance(InterceptArgs e) { if (_isLoadingCredits) { _isLoadingCredits = false; e.Block(); } Credits = (int)e.Packet.ReadFloatAsString(); OnCreditsUpdated(); }
private void OnInterceptMove(InterceptArgs e) { if (EnablePacketBlocking) { // Flags the packet to be blocked, this cannot be reversed. e.Block(); int x = e.Packet.ReadInt(), y = e.Packet.ReadInt(); Log($"Blocked move packet to ({x}, {y})."); } }
private void OnIntercept(InterceptArgs e) { try { if (SetResult(e.Packet.Copy())) { if (_block) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected override Task OnExecuteAsync() => throw new NotImplementedException(); // @Update SendAsync(Out.RequestPetInfo); // @Update [InterceptIn(nameof(Incoming.PetInfo))] protected void OnPetInfo(InterceptArgs e) { try { var petInfo = PetInfo.Parse(e.Packet); if (petInfo.Id == petId) { if (SetResult(petInfo)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnPostItData(InterceptArgs e) { try { var sticky = Sticky.Parse(e.Packet); if (sticky.Id == _stickyId) { if (SetResult(sticky)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnHabboGroupDetails(InterceptArgs e) { try { var groupData = GroupData.Parse(e.Packet); if (groupData.Id == groupId) { if (SetResult(groupData)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void HandleCatalogIndex(InterceptArgs e) { try { var catalog = Catalog.Parse(e.Packet); if (catalog.Mode == mode) { if (SetResult(catalog)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnRoomData(InterceptArgs e) { try { var roomData = RoomData.Parse(e.Packet); if (roomData.Id == _roomId) { if (SetResult(roomData)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnUserProfile(InterceptArgs e) { try { var userProfile = UserProfile.Parse(e.Packet); if (userProfile.Id == _userId) { if (SetResult(userProfile)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnNavigatorSearchResults(InterceptArgs e) { try { var results = NavigatorSearchResults.Parse(e.Packet); if (results.Category == category && results.Filter == filter) { if (SetResult(results)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void HandleCatalogPage(InterceptArgs e) { try { var catalogPage = CatalogPage.Parse(e.Packet); if (catalogPage.Id == _pageId && catalogPage.Mode == _mode) { if (SetResult(catalogPage)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnGuildMembers(InterceptArgs e) { try { var groupMembers = GroupMembers.Parse(e.Packet); if (groupMembers.GroupId == _groupId && groupMembers.CurrentPage == _page && groupMembers.Filter == _filter && groupMembers.SearchType == _searchType) { if (SetResult(groupMembers)) { e.Block(); } } } catch (Exception ex) { SetException(ex); } }
protected void OnInventoryItems(InterceptArgs e) { try { var packet = e.Packet; int total = packet.ReadInt(); int current = packet.ReadInt(); if (current != currentIndex) { return; } if (totalExpected == -1) { totalExpected = total; } else if (total != totalExpected) { return; } currentIndex++; if (_block) { e.Block(); } foreach (var item in Inventory.ParseItems(packet)) { inventory.Add(item); } if (currentIndex == totalExpected) { SetResult(inventory); } } catch (Exception ex) { SetException(ex); } }
protected override Task OnExecuteAsync() => throw new NotImplementedException(); // @Update SendAsync(Out.RequestInventoryBadges); // @Update [InterceptIn(nameof(Incoming.InventoryBadges))] protected void OnInventoryBadges(InterceptArgs e) { try { var packet = e.Packet; int total = packet.ReadInt(); int index = packet.ReadInt(); if (index != currentIndex) { return; } if (totalExpected == -1) { totalExpected = total; } else if (total != totalExpected) { return; } currentIndex++; e.Block(); int n = packet.ReadInt(); for (int i = 0; i < n; i++) { badges.Add(Badge.Parse(packet)); } if (currentIndex == totalExpected) { SetResult(badges); } } catch (Exception ex) { SetException(ex); } }
// @Update [InterceptIn(nameof(Incoming.Friends))] protected void OnFriends(InterceptArgs e) { try { int total = e.Packet.ReadInt(); int current = e.Packet.ReadInt(); if (current != currentIndex) { return; } if (totalExpected == -1) { totalExpected = total; } else if (totalExpected != total) { return; } currentIndex++; e.Block(); int n = e.Packet.ReadInt(); for (int i = 0; i < n; i++) { friends.Add(Friend.Parse(e.Packet)); } if (currentIndex == total) { SetResult(friends); } } catch (Exception ex) { SetException(ex); } }
protected override Task OnExecuteAsync() => throw new NotImplementedException(); // @Update SendAsync(Out.RequestInitFriends); // @Update [InterceptIn(nameof(Incoming.InitFriends))] protected void OnInitFriends(InterceptArgs e) => e.Block();