


public class SmartUpdate
{
public UpdatePacket Upd;
public Queue<UpdatePacket> Update = new Queue<UpdatePacket>();
public SmartUpdate()
{
Upd = Empty();
}
public void Merge(UpdatePacket basePacket)
{
short[] classes = { 768, 775, 782, 784, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806 };
var Current_Obj = Upd.NewObjs.ToList();
var Current_Tiles = Upd.Tiles.ToList();
Current_Obj.AddRange(basePacket.NewObjs.Where(newObj => !Current_Obj.Contains(newObj) && !classes.Contains(newObj.ObjectType)));
Current_Tiles.AddRange(basePacket.Tiles.Where(tile => !Current_Tiles.Contains(tile)));
Upd.NewObjs = Current_Obj.ToArray();
Upd.Tiles = Current_Tiles.ToArray();
if (Upd.NewObjs.Length + Upd.Tiles.Length >= 5000)
{
Update.Enqueue(Upd);
Upd = Empty();
}
}
private UpdatePacket Empty()
{
return new UpdatePacket
{
NewObjs = new Entity[0],
Tiles = new Tile[0],
Drops = new int[0]
};
}
}
push new updates to existing one.
Updates[client._mapInfo.Fp] = new SmartUpdate();
client.SendToClient(PluginUtils.CreateOryxNotification("Reload", "New seed " + client._mapInfo.Fp + " added!"));
Updates[client._mapInfo.Fp].Merge(update);
Loop from Queue<UpdatePacket> Update = new Queue<UpdatePacket>(); until you dont have any more chunks
block acks for each manual chunk
???
you reloaded your existing saved map.