Move channel reading to new ipc file

This commit is contained in:
Dean Herbert 2018-11-17 21:26:56 +09:00
parent 852f0337dd
commit 8b820f7346

View File

@ -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))