mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:07:52 +08:00
Refactor
This commit is contained in:
parent
27ba3c6d1a
commit
18a0a791fd
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user