Skip to content

[core] Load packet rate limits from config#10895

Open
sruon wants to merge 1 commit into
LandSandBoat:basefrom
sruon:ratelimit_config
Open

[core] Load packet rate limits from config#10895
sruon wants to merge 1 commit into
LandSandBoat:basefrom
sruon:ratelimit_config

Conversation

@sruon

@sruon sruon commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Been meaning to fix this for a while.

Tweaked settings code to support nested tables and moved the existing rate limits to network.lua

Steps to test these changes

rateLimits_[0x0F5] = 1s; // Wide Scan Track
rateLimits_[0x11B] = 2s; // Set Job Master Display
rateLimits_[0x11D] = 2s; // Jump
const auto limits = lua["xi"]["settings"]["network"]["PACKET_RATE_LIMITS"].get_or_create<sol::table>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how we call settings from core?
settings::get<data_type>("network.PACKET_RATE_WHATEVER");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

settings::get cannot deal with nested/complex tables as it's coded to only hold primitive data types, hence why we're reaching into the state directly (this is also done in xi_search for the white list).

I do intend to leverage the YAML parser for reading and loading settings in the future which will get us rid of these hacks.

Changing settings::get to support complex nesting is more hassle than it's worth right now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants