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

Network throttle: Force ME update packets to be sent once every N ms. #110

Merged
merged 2 commits into from Apr 1, 2023

Conversation

firenoo
Copy link

@firenoo firenoo commented Mar 24, 2023

THIS REVERTS THE LAST COMMIT (#107)
Works fine on small systems.

  1. Item and fluid packets are separated to their own classes, as they are not even allowed to be mixed together in the first place. This will enforce a strict separation of the two.

  2. New network worker thread for handling ME inventory updates. Instead of creating packets directly, classes should schedule packet(s) to be sent at the next N ms boundary. The packet has a limit of 256 items to prevent killing the client, but this can be changed in the config. The packet send rate is also configurable. Packet rate is a bad name - it should really be packet period (every packetRate ms, packets are sent).

For testing, if desync lag is bad, increase packetRate. Other lag, increase packetSize.

1. Item and fluid packets are separated to their own classes, as they are
not even allowed to be mixed together in the first place. This will enforce a strict
separation of the two.

2. New network worker thread for handling ME inventory updates. Instead of
creating packets directly, classes should schedule packet(s) to be sent at the
next 50ms boundary. The packet has a limit of 256 items to prevent killing the
client, but this can be changed in the config. In fact, the packet send rate is
also configurable.

3. Upon opening a terminal GUI, ME update packets are split. Only the last received
packet will trigger a terminal sorting, so if the ME system is large, it may take
several seconds (!) to load all the items.
@Dream-Master
Copy link
Member

@firenoo i merge only approved prs. Just let me know when it is ready for a review.

@Dream-Master
Copy link
Member

@firenoo is this ready for a review? We have this code on Zeta since version 2.3.2 for testing.

@firenoo firenoo marked this pull request as ready for review March 29, 2023 15:31
@firenoo firenoo requested a review from a team March 29, 2023 15:31
@Pilzinsel64 Pilzinsel64 requested a review from a team March 29, 2023 15:37
@Pilzinsel64 Pilzinsel64 self-requested a review April 1, 2023 12:04
@Dream-Master Dream-Master merged commit e1b3f20 into master Apr 1, 2023
1 check passed
@Dream-Master Dream-Master deleted the firenoo/network_throttle2 branch April 1, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants