mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 01:54:59 +00:00
Network throttle: Force ME update packets to be sent once every N ms. (#110)
* Network throttle: Force ME update packets to be sent once every 50ms. 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. * Update SPacketMEFluidInvUpdate.java --------- Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
1 parent
54781c290e
commit
e1b3f20078
10 files changed
+200
-90
No files matched your search
@@ -14,6 +14,7 @@ import com.glodblock.github.loader.ChannelLoader;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.loader.RecipeLoader;
|
||||
import com.glodblock.github.loader.filter.FluidFilter;
|
||||
import com.glodblock.github.network.SPacketMEUpdateBuffer;
|
||||
import com.glodblock.github.proxy.CommonProxy;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
@@ -82,6 +83,16 @@ public class FluidCraft {
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onServerStart(FMLServerStartingEvent event) {
|
||||
SPacketMEUpdateBuffer.init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onServerStop(FMLServerStoppedEvent event) {
|
||||
SPacketMEUpdateBuffer.disable();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onLoadComplete(FMLLoadCompleteEvent event) {}
|
||||
|
||||
|
||||
Reference in new issue
Block a user