예제 #1
0
 protected void OnUserSearchResult(InterceptArgs e)
 {
     try
     {
         if (SetResult(UserSearchResults.Parse(e.Packet)))
         {
             e.Block();
         }
     }
     catch (Exception ex) { SetException(ex); }
 }
예제 #2
0
 protected void OnAchievementList(InterceptArgs e)
 {
     try
     {
         if (SetResult(Achievements.Parse(e.Packet)))
         {
             e.Block();
         }
     }
     catch (Exception ex) { SetException(ex); }
 }
예제 #3
0
 protected void HandleUserData(InterceptArgs e)
 {
     try
     {
         if (SetResult(UserData.Parse(e.Packet)))
         {
             e.Block();
         }
     }
     catch (Exception ex) { SetException(ex); }
 }
예제 #4
0
        private void HandleWalletBalance(InterceptArgs e)
        {
            if (_isLoadingCredits)
            {
                _isLoadingCredits = false;
                e.Block();
            }

            Credits = (int)e.Packet.ReadFloatAsString();

            OnCreditsUpdated();
        }
예제 #5
0
        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}).");
            }
        }
예제 #6
0
 private void OnIntercept(InterceptArgs e)
 {
     try
     {
         if (SetResult(e.Packet.Copy()))
         {
             if (_block)
             {
                 e.Block();
             }
         }
     }
     catch (Exception ex) { SetException(ex); }
 }
예제 #7
0
        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); }
        }
예제 #8
0
 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); }
 }
예제 #9
0
 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); }
 }
예제 #10
0
 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); }
 }
예제 #11
0
 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); }
 }
예제 #12
0
 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); }
 }
예제 #13
0
 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); }
 }
예제 #14
0
 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); }
 }
예제 #15
0
 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); }
 }
예제 #16
0
        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); }
        }
예제 #17
0
        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); }
        }
예제 #18
0
        // @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); }
        }
예제 #19
0
        protected override Task OnExecuteAsync() => throw new NotImplementedException(); // @Update SendAsync(Out.RequestInitFriends);

        // @Update [InterceptIn(nameof(Incoming.InitFriends))]
        protected void OnInitFriends(InterceptArgs e) => e.Block();