Enhance school management and protocol handling by introducing a new worker failure mechanism, ensuring proper cleanup of schools when a worker thread encounters an error. Update the map snapshot protocol to allow larger school data sizes, improving the handling of extensive map layouts. Revise documentation to reflect changes in save intervals and introduce a minimum save interval for better performance. Update tests to validate the new functionalities and ensure robustness in handling large data scenarios.
This commit is contained in:
@@ -38,15 +38,23 @@ public sealed class SimulationOptions
|
||||
public string ModsDirectory { get; set; } = "mods";
|
||||
|
||||
/// <summary>
|
||||
/// How often a running school writes its clock to disk. Create, pause, speed and shutdown
|
||||
/// write immediately; the tick itself never does.
|
||||
/// How often a running school writes its clock to disk. Create and shutdown write
|
||||
/// immediately; the tick itself never does.
|
||||
/// </summary>
|
||||
public int SaveIntervalSeconds { get; set; } = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Shortest gap between two saves caused by pause or speed. A client can send those as fast
|
||||
/// as the socket allows, and each one used to be a file write on the school's own thread.
|
||||
/// </summary>
|
||||
public int MinSaveIntervalMilliseconds { get; set; } = 1000;
|
||||
|
||||
/// <summary>Length of one fixed step.</summary>
|
||||
public double FixedDeltaTime => 1d / TickRate;
|
||||
|
||||
public TimeSpan TickInterval => TimeSpan.FromSeconds(1d / TickRate);
|
||||
|
||||
public TimeSpan SaveInterval => TimeSpan.FromSeconds(SaveIntervalSeconds);
|
||||
|
||||
public TimeSpan MinSaveInterval => TimeSpan.FromMilliseconds(MinSaveIntervalMilliseconds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user