fix: improve minigame reconnect flow
This commit is contained in:
@@ -14,6 +14,9 @@ namespace XWorld.Server.Gateway.Runner
|
||||
Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "Server.Host.Tests", "TestGames"));
|
||||
int port = int.TryParse(GetArg(args, "--port"), out int p) ? p : 5005;
|
||||
int tickMs = int.TryParse(GetArg(args, "--tickMs"), out int t) ? t : 100;
|
||||
long reconnectWindowTicks = long.TryParse(GetArg(args, "--reconnectWindowTicks"), out long rw)
|
||||
? rw
|
||||
: ServerLoop.DefaultReconnectWindowTicks;
|
||||
long matchTimeoutTicks = long.TryParse(GetArg(args, "--matchTimeoutTicks"), out long mt) ? mt : 150;
|
||||
string devToken = GetArg(args, "--devToken");
|
||||
string advertiseWs = GetArg(args, "--advertiseWs");
|
||||
@@ -49,13 +52,15 @@ namespace XWorld.Server.Gateway.Runner
|
||||
}
|
||||
|
||||
var host = new GameServerHost();
|
||||
await host.StartAsync(gamesRoot, tickMs, matchTimeoutTicks: matchTimeoutTicks, listenPort: port,
|
||||
await host.StartAsync(gamesRoot, tickMs, reconnectWindowTicks: reconnectWindowTicks,
|
||||
matchTimeoutTicks: matchTimeoutTicks, listenPort: port,
|
||||
bindAllInterfaces: lan,
|
||||
devDiscoveryToken: devToken, advertiseGatewayUrl: advertiseWs, advertiseResourceBaseUrl: advertiseCdn,
|
||||
authSecret: authSecret, authDbPath: authDbPath);
|
||||
Console.WriteLine("XWorld Gateway smoke server started.");
|
||||
Console.WriteLine(" gamesRoot: " + gamesRoot);
|
||||
Console.WriteLine(" tickMs: " + tickMs + ", matchTimeoutTicks: " + matchTimeoutTicks);
|
||||
Console.WriteLine(" tickMs: " + tickMs + ", reconnectWindowTicks: " + reconnectWindowTicks +
|
||||
", matchTimeoutTicks: " + matchTimeoutTicks);
|
||||
Console.WriteLine(" ws: " + host.WsBaseUrl + "/ws?pid=1");
|
||||
if (!string.IsNullOrEmpty(devToken))
|
||||
Console.WriteLine(" dev-discovery: ON (UDP " + host.DevDiscoveryPort + "), advertise ws=" +
|
||||
|
||||
Reference in New Issue
Block a user