-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIrcAddon.cs
73 lines (61 loc) · 1.62 KB
/
IrcAddon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Linq;
using WCell.Core.Addons;
using System.Globalization;
using WCell.Core.Initialization;
using WCell.RealmServer;
namespace IRCAddon
{
public class IrcAddon : WCellAddonBase
{
private static IrcAddon _irc;
public IrcConnection[] Connections = new IrcConnection[5];
public static IrcAddon Instance
{
get { return _irc; }
}
public IrcAddon()
{
_irc = this;
RealmServer.Shutdown += TearDown;
}
public override string Name
{
get { return "IRC implementing Addon"; }
}
public override string Author
{
get { return "WCell"; }
}
public override string Website
{
get { return "http://wcell.org/"; }
}
public override string ShortName
{
get { return "Irc"; }
}
public override bool UseConfig
{
get { return true; }
}
public override string GetLocalizedName(CultureInfo culture)
{
return "Just an addon for allowing use of WCell and its commands on Irc.";
}
[Initialization(InitializationPass.Last)]
public static void PerformAutoSave()
{
Instance.Config.Save();
}
public override void TearDown()
{
Instance.Config.Save();
foreach (var con in Connections.Where(con => con != null))
{
con.Client.DisconnectNow();
con.TearDown();
}
}
}
}