1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00
This commit is contained in:
Dan Balasescu 2021-11-28 22:24:42 +09:00
parent 27ba3c6d1a
commit 18a0a791fd
2 changed files with 17 additions and 6 deletions

View File

@ -13,7 +13,7 @@ namespace osu.Desktop.LegacyIpc
/// </summary>
public class LegacyTcpIpcProvider : TcpIpcProvider
{
private static readonly Logger logger = Logger.GetLogger("ipc");
private static readonly Logger logger = Logger.GetLogger("legacy-ipc");
/// <summary>
/// Invoked when a message is received from a legacy client.
@ -27,7 +27,8 @@ namespace osu.Desktop.LegacyIpc
{
try
{
logger.Add($"Processing incoming IPC message: {msg.Value}");
logger.Add($"Processing legacy IPC message...");
logger.Add($"\t{msg.Value}", LogLevel.Debug);
var legacyData = ((JObject)msg.Value).ToObject<LegacyIpcMessage.Data>();
object value = parseObject((JObject)legacyData!.MessageData, legacyData.MessageType);

View File

@ -28,6 +28,8 @@ namespace osu.Desktop
{
private const string base_game_name = @"osu";
private static LegacyTcpIpcProvider legacyIpc;
[STAThread]
public static void Main(string[] args)
{
@ -92,10 +94,18 @@ namespace osu.Desktop
if (host.IsPrimaryInstance)
{
var legacyIpc = new LegacyTcpIpcProvider();
legacyIpc.MessageReceived += onLegacyIpcMessageReceived;
legacyIpc.Bind();
legacyIpc.StartAsync();
try
{
Logger.Log("Starting legacy IPC provider...");
legacyIpc = new LegacyTcpIpcProvider();
legacyIpc.MessageReceived += onLegacyIpcMessageReceived;
legacyIpc.Bind();
legacyIpc.StartAsync();
}
catch (Exception ex)
{
Logger.Error(ex, "Failed to start legacy IPC provider");
}
}
if (tournamentClient)