mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +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 <dream-master@gmx.net>
This commit is contained in:
1 parent
54781c290e
commit
e1b3f20078
10 files changed
+200
-90
No files matched your search
@@ -18,6 +18,7 @@ public class Config {
|
||||
public static boolean blacklistEssentiaGas;
|
||||
public static double portableCellBattery;
|
||||
public static int packetSize;
|
||||
public static int packetRate;
|
||||
|
||||
public static void run() {
|
||||
loadCategory();
|
||||
@@ -55,6 +56,10 @@ public class Config {
|
||||
packetSize = Config.get("Fluid Craft for AE2", "packetSize", 256, "Number of items to be sent per packet")
|
||||
.getInt();
|
||||
if (packetSize <= 0) packetSize = 256;
|
||||
packetRate = Config
|
||||
.get("Fluid Craft for AE2", "packetRate", 50, "Period at which packets are dispatched, in ms.")
|
||||
.getInt();
|
||||
if (packetRate <= 0) packetRate = 50;
|
||||
if (Config.hasChanged()) Config.save();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user