diff options
author | Melanie Thielker | 2016-06-14 00:03:40 +0200 |
---|---|---|
committer | Melanie Thielker | 2016-06-14 00:03:40 +0200 |
commit | 141205532b0ea4a9f757dbb5317eda0517e40c49 (patch) | |
tree | 156cbd6bd3b164e2b7ba4ea04d1f3e052b4afa40 /OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |
parent | Mantis #7923. EDIT BEAMS ARE BACK! (diff) | |
download | opensim-SC_OLD-141205532b0ea4a9f757dbb5317eda0517e40c49.zip opensim-SC_OLD-141205532b0ea4a9f757dbb5317eda0517e40c49.tar.gz opensim-SC_OLD-141205532b0ea4a9f757dbb5317eda0517e40c49.tar.bz2 opensim-SC_OLD-141205532b0ea4a9f757dbb5317eda0517e40c49.tar.xz |
Make chat and instant message modules fully subclassable
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 55e30a0..fb868be 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -45,22 +45,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
45 | private static readonly ILog m_log = LogManager.GetLogger( | 45 | private static readonly ILog m_log = LogManager.GetLogger( |
46 | MethodBase.GetCurrentMethod().DeclaringType); | 46 | MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private Timer m_logTimer = new Timer(10000); | 48 | protected Timer m_logTimer = new Timer(10000); |
49 | private List<GridInstantMessage> m_logData = new List<GridInstantMessage>(); | 49 | protected List<GridInstantMessage> m_logData = new List<GridInstantMessage>(); |
50 | private string m_restUrl; | 50 | protected string m_restUrl; |
51 | 51 | ||
52 | /// <value> | 52 | /// <value> |
53 | /// Is this module enabled? | 53 | /// Is this module enabled? |
54 | /// </value> | 54 | /// </value> |
55 | private bool m_enabled = false; | 55 | protected bool m_enabled = false; |
56 | 56 | ||
57 | private readonly List<Scene> m_scenes = new List<Scene>(); | 57 | protected readonly List<Scene> m_scenes = new List<Scene>(); |
58 | 58 | ||
59 | #region Region Module interface | 59 | #region Region Module interface |
60 | 60 | ||
61 | private IMessageTransferModule m_TransferModule = null; | 61 | protected IMessageTransferModule m_TransferModule = null; |
62 | 62 | ||
63 | public void Initialise(IConfigSource config) | 63 | public virtual void Initialise(IConfigSource config) |
64 | { | 64 | { |
65 | if (config.Configs["Messaging"] != null) | 65 | if (config.Configs["Messaging"] != null) |
66 | { | 66 | { |
@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
76 | m_logTimer.Elapsed += LogTimerElapsed; | 76 | m_logTimer.Elapsed += LogTimerElapsed; |
77 | } | 77 | } |
78 | 78 | ||
79 | public void AddRegion(Scene scene) | 79 | public virtual void AddRegion(Scene scene) |
80 | { | 80 | { |
81 | if (!m_enabled) | 81 | if (!m_enabled) |
82 | return; | 82 | return; |
@@ -92,7 +92,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | public void RegionLoaded(Scene scene) | 95 | public virtual void RegionLoaded(Scene scene) |
96 | { | 96 | { |
97 | if (!m_enabled) | 97 | if (!m_enabled) |
98 | return; | 98 | return; |
@@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | public void RemoveRegion(Scene scene) | 117 | public virtual void RemoveRegion(Scene scene) |
118 | { | 118 | { |
119 | if (!m_enabled) | 119 | if (!m_enabled) |
120 | return; | 120 | return; |
@@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | void OnClientConnect(IClientCore client) | 128 | protected virtual void OnClientConnect(IClientCore client) |
129 | { | 129 | { |
130 | IClientIM clientIM; | 130 | IClientIM clientIM; |
131 | if (client.TryGet(out clientIM)) | 131 | if (client.TryGet(out clientIM)) |
@@ -134,27 +134,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | public void PostInitialise() | 137 | public virtual void PostInitialise() |
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | public void Close() | 141 | public virtual void Close() |
142 | { | 142 | { |
143 | } | 143 | } |
144 | 144 | ||
145 | public string Name | 145 | public virtual string Name |
146 | { | 146 | { |
147 | get { return "InstantMessageModule"; } | 147 | get { return "InstantMessageModule"; } |
148 | } | 148 | } |
149 | 149 | ||
150 | public Type ReplaceableInterface | 150 | public virtual Type ReplaceableInterface |
151 | { | 151 | { |
152 | get { return null; } | 152 | get { return null; } |
153 | } | 153 | } |
154 | 154 | ||
155 | #endregion | 155 | #endregion |
156 | 156 | ||
157 | public void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 157 | public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
158 | { | 158 | { |
159 | byte dialog = im.dialog; | 159 | byte dialog = im.dialog; |
160 | 160 | ||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
230 | /// | 230 | /// |
231 | /// </summary> | 231 | /// </summary> |
232 | /// <param name="msg"></param> | 232 | /// <param name="msg"></param> |
233 | private void OnGridInstantMessage(GridInstantMessage msg) | 233 | protected virtual void OnGridInstantMessage(GridInstantMessage msg) |
234 | { | 234 | { |
235 | // Just call the Text IM handler above | 235 | // Just call the Text IM handler above |
236 | // This event won't be raised unless we have that agent, | 236 | // This event won't be raised unless we have that agent, |
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
240 | OnInstantMessage(null, msg); | 240 | OnInstantMessage(null, msg); |
241 | } | 241 | } |
242 | 242 | ||
243 | private void LogInstantMesssage(GridInstantMessage im) | 243 | protected virtual void LogInstantMesssage(GridInstantMessage im) |
244 | { | 244 | { |
245 | if (m_logData.Count < 20) | 245 | if (m_logData.Count < 20) |
246 | { | 246 | { |
@@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
256 | } | 256 | } |
257 | } | 257 | } |
258 | 258 | ||
259 | private void LogTimerElapsed(object source, ElapsedEventArgs e) | 259 | protected virtual void LogTimerElapsed(object source, ElapsedEventArgs e) |
260 | { | 260 | { |
261 | lock (m_logData) | 261 | lock (m_logData) |
262 | { | 262 | { |