From 8b820f7346f851cc95cecd4db61391493c48d056 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 21:26:56 +0900 Subject: [PATCH] Move channel reading to new ipc file --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 4bf2cfee38..83dbe11ffa 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -43,6 +43,7 @@ namespace osu.Game.Tournament.IPC const string file_ipc_filename = "ipc.txt"; const string file_ipc_state_filename = "ipc-state.txt"; const string file_ipc_scores_filename = "ipc-scores.txt"; + const string file_ipc_channel_filename = "ipc-channel.txt"; if (stable.Exists(file_ipc_filename)) Scheduler.AddDelayed(delegate @@ -72,7 +73,6 @@ namespace osu.Game.Tournament.IPC } Mods.Value = (LegacyMods)mods; - ChatChannel.Value = sr.ReadLine(); } } catch @@ -80,6 +80,19 @@ namespace osu.Game.Tournament.IPC // file might be in use. } + try + { + using (var stream = stable.GetStream(file_ipc_channel_filename)) + using (var sr = new StreamReader(stream)) + { + ChatChannel.Value = sr.ReadLine(); + } + } + catch (Exception) + { + // file might be in use. + } + try { using (var stream = stable.GetStream(file_ipc_state_filename))