feat(traffic): implement autonomous City Traffic Engine and Living Urban Crowd Engine from CBT dump

This commit is contained in:
CAtlas0784 committed 2026-09-18 14:19:52 +07:00
1 parent f2a36fe188
commit 67bdbae24b
17 files changed
+18759

No files matched your search

@@ -5,6 +5,8 @@ using Ananta.Server.Configuration;
using Ananta.Server.Handlers.Game;
using Ananta.Server.Handlers.LoginGate;
using Ananta.Server.Protocol.Client4229938;
using Ananta.Server.Gameplay.Traffic;
using Ananta.Server.Gameplay.Crowd;
using Ananta.Server.Network;
namespace Ananta.Server.App;
@@ -32,6 +34,20 @@ internal sealed class PrivateServerApplication(PrivateServerConfig config)
CreateServer("game", bindHost, config.Network.GamePort, gameRouter, gameSessions),
};
// Initialize Autonomous City Traffic Engine and Living Urban Crowd Engine
var clientDataFolder = Path.GetDirectoryName(PrivateServerConfigStore.ResolveProjectPath(config.Paths.ClientConfigs))
?? PrivateServerConfigStore.ResolveProjectPath(config.Paths.ClientConfigs);
CityTrafficEngine.Instance.Initialize(
clientDataFolder,
TrafficAndCrowdDriver.Instance,
() => gameSessions.Current is not null ? [gameSessions.Current] : Array.Empty<TcpSession>());
UrbanCrowdEngine.Instance.Initialize(
clientDataFolder,
TrafficAndCrowdDriver.Instance,
() => gameSessions.Current is not null ? [gameSessions.Current] : Array.Empty<TcpSession>());
// Localhost debug API for debug-panel.py (optional, never blocks the game stack).
using var debugApi = config.Debug.Enabled ? new DebugApiServer(config, gameSessions) : null;
var webInfo = "web=off";