Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server lags when switching menus #154

Open
qHollow opened this issue Dec 11, 2022 · 1 comment
Open

Server lags when switching menus #154

qHollow opened this issue Dec 11, 2022 · 1 comment

Comments

@qHollow
Copy link

qHollow commented Dec 11, 2022

Describe the bug
Using modules that contain a large number of items causes server latency. This problem does not occur in the original version (FrozDark version)

To Reproduce
Steps to reproduce the behavior:

  1. Load any module. For example auras
  2. Add a large number of items, like this config with a lot of items
  3. Toggle on net_graph 1 in the console
  4. Go to the server and open shop menu
  5. Select the "Buy" category
  6. Observe the increasing server var as you switch the category list
  7. Select any category and go back
  8. Observe a similar thing as in item 6

Expected behavior
Switching menus does not cause performance degradation

Server:

  • OS: Linux
  • Sourcemod version: 1.11.0.6913
  • Version: 3.0E7

Additional context

  • Game: CS:GO
@IL0co
Copy link
Collaborator

IL0co commented Dec 12, 2022

🤔 Presumably the occurrence of server lags when opening any of the categories in the menu causes a one-time addition of all existing items in this menu. In addition, each item undergoes a series of checks before being added.

There is a category, it has 100 items, when a player opens this category, he is shown the entire menu with all the items in it, and not a specific number of items on this page (up to 6 pieces).

Ways to solve the problem from the side of the core rights:

  1. Complicated. Rewriting the menu for displaying category items to Panel will give more control to the developer, since he creates the menu completely from scratch (element layout, markup and button styles). Each page will be drawn as needed, and category items will be added to this page. All the complexity lies in the management of pages, nothing more.
  2. Average. When entering a category, only show the player the first 8 items. Why not as much as fits on the page? - because the Next button is shown only if the number of buttons exceeds the maximum number of buttons on the page. The difficulty lies in keeping track of the current page in the Menu, as I know - this is impossible with the standard approach (meaning without crutches).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants