Loaded chunks sending is now splitted in 500 chunks packets to prevent overloading the 250.

A "clear array" is sent prior to the data and data is cumulativly added to the array.
This commit is contained in:
ProfMobius committed 2014-03-31 11:12:35 +02:00
1 parent 7f5491ece1
commit a732947920
12 files changed
+52 -17

No files matched your search

@@ -38,6 +38,7 @@ import mcp.mobius.opis.data.server.WorldTickProfiler;
import mcp.mobius.opis.events.PlayerTracker;
import mcp.mobius.opis.gui.overlay.OverlayStatus;
import mcp.mobius.opis.network.enums.Message;
import mcp.mobius.opis.network.packets.server.NetDataCommand;
import mcp.mobius.opis.network.packets.server.NetDataList;
import mcp.mobius.opis.network.packets.server.Packet_DataOverlayChunkEntities;
import mcp.mobius.opis.network.packets.server.NetDataValue;
@@ -77,7 +78,8 @@ public class ServerMessageHandler {
else if (maintype == Message.LIST_CHUNK_LOADED){
PlayerTracker.instance().playerOverlayStatus.put(player, OverlayStatus.CHUNKSTATUS);
PlayerTracker.instance().playerDimension.put(player, ((SerialInt)param1).value);
OpisPacketHandler.validateAndSend(NetDataList.create(Message.LIST_CHUNK_LOADED, ChunkManager.instance().getLoadedChunks(((SerialInt)param1).value)), player);
OpisPacketHandler.validateAndSend(NetDataCommand.create(Message.LIST_CHUNK_LOADED_CLEAR), player);
OpisPacketHandler.splitAndSend(Message.LIST_CHUNK_LOADED, ChunkManager.instance().getLoadedChunks(((SerialInt)param1).value), player);
}
else if (maintype == Message.LIST_CHUNK_TICKETS){