This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
Drew DeVault 6fb8ee7ba5 Many more optimizations and bugfixes
Again, sorry for the huge commit. Just taking on performance issues as I
see them. Changes in this:

- Deadlocks in region code finally fixed
- Chunk packet preparation optimized (saves ~10-20ms per packet, since
  we're sending these like 30 at a time that's pretty important) by
  storing chunks pre-encoded in memory (basically just using a single
  big array for IDs, metadata, and light)
- Move chunk generation and compression to the thread pool
- Move client chunk updates to the scheduler
- Improve profiler coverage
- Add knob to disable scheduling chunk events on chunk load
- Make it possible to disable specific scheduled events in config.yml
2017-05-23 18:17:44 -04:00

19 lines
547 B
C#

using System;
using System.Collections.Generic;
namespace TrueCraft.API.World
{
public interface IRegion : IDisposable
{
IDictionary<Coordinates2D, IChunk> Chunks { get; }
Coordinates2D Position { get; }
IChunk GetChunk(Coordinates2D position, bool generate = true);
/// <summary>
/// Marks the chunk for saving in the next Save().
/// </summary>
void DamageChunk(Coordinates2D position);
void UnloadChunk(Coordinates2D position);
void Save(string path);
}
}