
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
19 lines
547 B
C#
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);
|
|
}
|
|
} |