feat: Upgrade server with HyNB v2.4 modular architecture, minigames, admin GM web panel, companion summons, and car radio
This commit is contained in:
1 parent
74e2963a12
commit
3e5adf1dc5
1571 files changed
+336468
-6348
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using Ananta.SDK.Logging;
|
||||
using Ananta.SDK.Network;
|
||||
using Ananta.SDK.Rpc;
|
||||
using Ananta.Server.App.Admin;
|
||||
using Ananta.Server.Configuration;
|
||||
using Ananta.Server.Handlers.Game;
|
||||
using Ananta.Server.Handlers.LoginGate;
|
||||
@@ -49,15 +50,13 @@ internal sealed class PrivateServerApplication(PrivateServerConfig config)
|
||||
TrafficAndCrowdDriver.Instance,
|
||||
() => gameSessions.Current is not null ? [gameSessions.Current] : Array.Empty<TcpSession>());
|
||||
|
||||
// Interactive gadget + scene-item grid streaming (vending machines, arcades, doors,
|
||||
// lampposts, props from the client's baked cell data) — server-side equivalent of the
|
||||
// AnantaGadgetLoader / AnantaWorldMod injects.
|
||||
// Interactive gadget + scene-item grid streaming
|
||||
GadgetStreamingEngine.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).
|
||||
// Localhost debug API for debug-panel / WebUI (port 5809)
|
||||
using var debugApi = config.Debug.Enabled ? new DebugApiServer(config, gameSessions) : null;
|
||||
var webInfo = "web=off";
|
||||
if (debugApi is not null)
|
||||
@@ -65,34 +64,42 @@ internal sealed class PrivateServerApplication(PrivateServerConfig config)
|
||||
try
|
||||
{
|
||||
debugApi.Start();
|
||||
webInfo = $"web=http://{config.Debug.Host}:{config.Debug.Port}/";
|
||||
webInfo = $"http://{config.Debug.Host}:{config.Debug.Port}/";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[DEBUG-API] disabled for this run: {ex.Message}");
|
||||
Console.WriteLine($"[DEBUG-API] disabled: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// Bootstrap diagnostics stay in console-latest/archive; runtime output becomes visible here.
|
||||
RuntimeLogs.EndBootstrapQuietMode();
|
||||
Console.WriteLine($"[READY] นี่คือเวอร์ชั่น DEV ที่ไม่ได้รับคุณภาพจากเกม Ananta GAY | client={config.Client.Version} | pid={Profile.PlayerPid} | login={config.Network.AdvertisedHost}:{loginPortA},{loginPortB} | game=:{config.Network.GamePort}");
|
||||
var savedColor = Console.ForegroundColor;
|
||||
try
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.WriteLine(webInfo == "web=off" ? "[Debug Panel] off" : $"[Debug Panel] http://{config.Debug.Host}:{config.Debug.Port}/");
|
||||
}
|
||||
finally { Console.ForegroundColor = savedColor; }
|
||||
Console.WriteLine($"[READY] Ananta Private Server (HyNB v2.4 Modular) | client={config.Client.Version} | pid={Profile.PlayerPid} | login={config.Network.AdvertisedHost}:{loginPortA},{loginPortB} | game=:{config.Network.GamePort}");
|
||||
if (config.Admin.Enabled)
|
||||
Console.WriteLine($"[READY] Admin GM panel at http://{config.Admin.Host}:{config.Admin.Port}/");
|
||||
if (webInfo != "web=off")
|
||||
Console.WriteLine($"[READY] Debug WebUI panel at {webInfo}");
|
||||
|
||||
var adminTask = config.Admin.Enabled
|
||||
? new AdminWebServer(config).RunAsync(cancellationToken)
|
||||
: Task.CompletedTask;
|
||||
|
||||
var serverTasks = servers.Select(server => server.RunAsync(cancellationToken));
|
||||
await Task.WhenAll(serverTasks);
|
||||
await Task.WhenAll(serverTasks.Prepend(adminTask));
|
||||
}
|
||||
|
||||
private static TcpServer CreateServer(string name, string host, int port, RpcRouter router, GameSessionHub? gameSessions = null)
|
||||
=> new(name, host, port, router,
|
||||
{
|
||||
var net = PrivateServerConfigStore.Current.Network;
|
||||
return new(name, host, port, router,
|
||||
async (session, frame, token) =>
|
||||
{
|
||||
gameSessions?.Touch(session);
|
||||
GameAdminBridge.Touch(session);
|
||||
await RpcFrameDispatcher.DispatchAsync(router, session, frame, token);
|
||||
});
|
||||
},
|
||||
onClosed: null,
|
||||
heartbeatMs: net.SocketHeartbeatMs,
|
||||
writeTimeoutMs: net.WriteTimeoutMs);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user