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.
TrueCraft/TrueCraft.API/Server/IEventScheduler.cs
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

21 lines
811 B
C#

using System;
using System.Collections.Generic;
namespace TrueCraft.API.Server
{
public interface IEventScheduler
{
HashSet<string> DisabledEvents { get; }
/// <summary>
/// Schedules an event to occur some time in the future.
/// </summary>
/// <param name="subject">The subject of the event. If the subject is disposed, the event is cancelled.</param>
/// <param name="when">When to trigger the event.</param>
/// <param name="action">The event to trigger.</param>
void ScheduleEvent(string name, IEventSubject subject, TimeSpan when, Action<IMultiplayerServer> action);
/// <summary>
/// Triggers all pending scheduled events whose scheduled time has transpired.
/// </summary>
void Update();
}
}