Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server refactor #403

Merged
merged 29 commits into from
Nov 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c8654a6
Turn world manager into a BackgroundService
Tides Nov 16, 2023
2e6da36
Abstractions refactor pt.1
Tides Nov 16, 2023
a67ea67
Update Region.cs
Tides Nov 16, 2023
7d3b61d
Abstractions refactor pt.2
Tides Nov 16, 2023
2393b34
Move world generator registering to WorldManager
Tides Nov 16, 2023
7307ac8
abstractions pt.3
Tides Nov 16, 2023
e13bd36
Use packet broadcaster
Tides Nov 16, 2023
da4ad73
Fix event parameters
Tides Nov 16, 2023
5aaa36a
Simplify ConsoleApp.Program.cs
Tides Nov 16, 2023
922f002
Refactor Living.cs
Tides Nov 16, 2023
cafb7a6
A little cleanup
Tides Nov 16, 2023
9c699fd
WE START WOOOOO
Tides Nov 16, 2023
6fcfd3d
Update Player.cs
Tides Nov 16, 2023
737f4cd
oop
Tides Nov 16, 2023
22b2783
Merge branch 'master' into server-refactor
Tides Nov 16, 2023
aa6ede6
Fix up some NREs and wait for worlds to be ready
Tides Nov 17, 2023
0663c3a
Region loading does not need to be blocked
Tides Nov 17, 2023
93dde3d
Add a direct send method that won't get processed through the queue
Tides Nov 17, 2023
6dae353
Just use JsonNamingPolicy.SnakeCaseLower :))
Tides Nov 18, 2023
cd68c5e
world gen status
Jonpro03 Nov 18, 2023
2908dc6
Fix strange chunk unloading bug
Jonpro03 Nov 18, 2023
a8695d6
Forgot to save O_O
Jonpro03 Nov 18, 2023
c7c7013
Update OperatorList & IOperatorList
Tides Nov 20, 2023
5c112ad
Last bit refactor
Tides Nov 20, 2023
4ab15e6
Make user cache a service instead
Tides Nov 20, 2023
f26c8ce
Add sealed modifier to most classes (final commit)
Tides Nov 20, 2023
8bfc979
OKAY ACTUAL FINAL COMMIT
Tides Nov 20, 2023
6c8f026
Fix bug loading worlds from disk
Jonpro03 Nov 21, 2023
bc6599d
Document the non self explanatory properties in config
Tides Nov 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
oop
Tides committed Nov 16, 2023
commit 737f4cd5b043e19a27d753ca58c587771bbeab8f
4 changes: 2 additions & 2 deletions Obsidian/Hosting/DependencyInjection.cs
Original file line number Diff line number Diff line change
@@ -19,10 +19,10 @@ public static IServiceCollection AddObsidian(this IServiceCollection services, I
services.AddSingleton<PacketBroadcaster>();
services.AddSingleton<IServer, Server>();

services.AddHostedService(sp => sp.GetRequiredService<WorldManager>());
services.AddHostedService(sp => sp.GetRequiredService<PacketBroadcaster>());
services.AddHostedService<ObsidianHostingService>();

services.AddHostedService(sp => sp.GetRequiredService<WorldManager>());

services.AddSingleton<IWorldManager>(sp => sp.GetRequiredService<WorldManager>());
services.AddSingleton<IPacketBroadcaster>(sp => sp.GetRequiredService<PacketBroadcaster>());

4 changes: 2 additions & 2 deletions Obsidian/Server.cs
Original file line number Diff line number Diff line change
@@ -51,8 +51,8 @@ public static string VERSION
#endif
public const ProtocolVersion DefaultProtocol = ProtocolVersion.v1_20_2;

public static string PersistentDataPath { get; } = Path.Combine("persistentdata");
public static string PermissionPath { get; } = Path.Combine("permissions");
public static string PersistentDataPath { get; } = "persistentdata";
public static string PermissionPath { get; } = "permissions";

internal static readonly ConcurrentDictionary<string, DateTimeOffset> throttler = new();

2 changes: 1 addition & 1 deletion Obsidian/WorldData/WorldManager.cs
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ public WorldManager(ILoggerFactory loggerFactory, IServiceProvider serviceProvid

protected async override Task ExecuteAsync(CancellationToken stoppingToken)
{
var timer = new BalancingTimer(1000, stoppingToken);
var timer = new BalancingTimer(20, stoppingToken);

this.RegisterDefaults();
// TODO: This should defenitly accept a cancellation token.