Network throttle: Force ME update packets to be sent once every N ms. #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
THIS REVERTS THE LAST COMMIT (#107)
Works fine on small systems.
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.
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, increasepacketSize
.