diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent')
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs index cfe1278..ec040db 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs | |||
@@ -25,9 +25,11 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using System.Net; | 29 | using System.Net; |
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
31 | using Nini.Config; | 33 | using Nini.Config; |
32 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
33 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
@@ -35,24 +37,23 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server; | |||
35 | 37 | ||
36 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | 38 | namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView |
37 | { | 39 | { |
38 | public class IRCStackModule : IRegionModule | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
41 | public class IRCStackModule : INonSharedRegionModule | ||
39 | { | 42 | { |
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
41 | 44 | ||
42 | private IRCServer m_server; | 45 | private IRCServer m_server; |
43 | // private Scene m_scene; | 46 | // private Scene m_scene; |
47 | private int portNo; | ||
44 | 48 | ||
45 | #region Implementation of IRegionModule | 49 | #region Implementation of ISharedRegionModule |
46 | 50 | ||
47 | public void Initialise(Scene scene, IConfigSource source) | 51 | public void Initialise(IConfigSource source) |
48 | { | 52 | { |
49 | if (null != source.Configs["IRCd"] && | 53 | if (null != source.Configs["IRCd"] && |
50 | source.Configs["IRCd"].GetBoolean("Enabled",false)) | 54 | source.Configs["IRCd"].GetBoolean("Enabled",false)) |
51 | { | 55 | { |
52 | int portNo = source.Configs["IRCd"].GetInt("Port",6666); | 56 | portNo = source.Configs["IRCd"].GetInt("Port",6666); |
53 | // m_scene = scene; | ||
54 | m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); | ||
55 | m_server.OnNewIRCClient += m_server_OnNewIRCClient; | ||
56 | } | 57 | } |
57 | } | 58 | } |
58 | 59 | ||
@@ -68,9 +69,20 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | |||
68 | m_log.Info("[IRCd] Added user to Scene"); | 69 | m_log.Info("[IRCd] Added user to Scene"); |
69 | } | 70 | } |
70 | 71 | ||
71 | public void PostInitialise() | 72 | public void AddRegion(Scene scene) |
73 | { | ||
74 | if (portNo != null) | ||
75 | { | ||
76 | m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); | ||
77 | m_server.OnNewIRCClient += m_server_OnNewIRCClient; | ||
78 | } | ||
79 | } | ||
80 | public void RegionLoaded(Scene scene) | ||
72 | { | 81 | { |
82 | } | ||
73 | 83 | ||
84 | public void RemoveRegion(Scene scene) | ||
85 | { | ||
74 | } | 86 | } |
75 | 87 | ||
76 | public void Close() | 88 | public void Close() |
@@ -83,9 +95,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView | |||
83 | get { return "IRCClientStackModule"; } | 95 | get { return "IRCClientStackModule"; } |
84 | } | 96 | } |
85 | 97 | ||
86 | public bool IsSharedModule | 98 | public Type ReplaceableInterface |
87 | { | 99 | { |
88 | get { return false; } | 100 | get { return null; } |
89 | } | 101 | } |
90 | 102 | ||
91 | #endregion | 103 | #endregion |