Merge pull request #8636 from Mailaender/irc

Added the in-game IRC client again
This commit is contained in:
abcdefg30
2015-09-13 17:14:36 +02:00
20 changed files with 672 additions and 66 deletions

View File

@@ -288,6 +288,17 @@ namespace OpenRA
}
}
public class IrcSettings
{
public string[] Hostname = { "irc.openra.net" };
public int Port = 6667;
public string Channel = "lobby";
public string Nickname = "Newbie";
public string QuitMessage = "Battle control terminated!";
public string TimestampFormat = "HH:mm";
public bool ConnectAutomatically = false;
}
public class Settings
{
string settingsFile;
@@ -299,6 +310,7 @@ namespace OpenRA
public ServerSettings Server = new ServerSettings();
public DebugSettings Debug = new DebugSettings();
public KeySettings Keys = new KeySettings();
public IrcSettings Irc = new IrcSettings();
public Dictionary<string, object> Sections;
@@ -314,6 +326,7 @@ namespace OpenRA
{ "Server", Server },
{ "Debug", Debug },
{ "Keys", Keys },
{ "Irc", Irc }
};
// Override fieldloader to ignore invalid entries

View File

@@ -61,6 +61,18 @@ namespace OpenRA
catch (IOException) { }
}
public static void Write(string channel, string value)
{
ChannelInfo info;
if (!Channels.TryGetValue(channel, out info))
throw new Exception("Tried logging to non-existant channel " + channel);
if (info.Writer == null)
return;
info.Writer.WriteLine(value);
}
public static void Write(string channel, string format, params object[] args)
{
ChannelInfo info;