This commit is contained in:
dingo
2025-11-29 15:44:45 -05:00
parent 9c75aaafc9
commit bc8cbab8ce
23 changed files with 3333 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using SystemRevivalServer.Networking.Messages;
namespace Server.Services.World;
public interface IWorldService
{
/// Spawn the selected character into the world (owner-only).
/// Returns the player's own spawn data and a list of already-present neighbors to display.
Task<(bool ok, string? error, WorldSpawn self, IEnumerable<WorldSpawn> neighbors)>
SpawnAsync(ulong accountId, ulong characterId, CancellationToken ct);
/// Queue a client input for the zone owner to process.
void EnqueueInput(ulong zoneId, ulong characterId, float dx, float dy, float facingRad, uint clientSeq);
/// Owner tick: integrate movement, update presence/grid.
Task TickOwnerAsync(ulong zoneId, float dt, CancellationToken ct);
/// Build a snapshot (naive: full-zone). Call at 10Hz and broadcast.
WorldState BuildSnapshot(ulong zoneId, long tick);
}