Bind legacy IPC on startup

This commit is contained in:
Dan Balasescu 2021-11-28 21:15:29 +09:00
parent 5711c428ca
commit f506cb35bc
1 changed files with 8 additions and 21 deletions

View File

@ -61,27 +61,6 @@ public static void Main(string[] args)
gameName = $"{base_game_name}-{clientID}";
break;
case "--legacy-ipc-server":
using (legacyIpcProvider = new LegacyTcpIpcProvider())
{
legacyIpcProvider.MessageReceived += onLegacyIpcMessageReceived;
legacyIpcProvider.Bind();
legacyIpcProvider.StartAsync().Wait();
}
return;
case "--legacy-ipc-client":
using (legacyIpcProvider = new LegacyTcpIpcProvider())
{
Console.WriteLine(legacyIpcProvider.SendMessageWithResponseAsync<LegacyIpcDifficultyCalculationResponse>(new LegacyIpcDifficultyCalculationRequest
{
BeatmapFile = "/home/smgi/Downloads/osu_files/129891.osu",
}).Result.StarRating);
}
return;
}
}
@ -113,6 +92,14 @@ public static void Main(string[] args)
}
}
if (host.IsPrimaryInstance)
{
var legacyIpc = new LegacyTcpIpcProvider();
legacyIpc.MessageReceived += onLegacyIpcMessageReceived;
legacyIpc.Bind();
legacyIpc.StartAsync();
}
if (tournamentClient)
host.Run(new TournamentGame());
else