diff options
author | UbitUmarov | 2016-11-16 00:42:08 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-16 00:42:08 +0000 |
commit | 8dd9601fdcdaf77060446f40e69b3d1524afa31f (patch) | |
tree | 62ff98768b437ab26850cdec586d74aaecd02555 /OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |
parent | change camera collision check rules (diff) | |
download | opensim-SC_OLD-8dd9601fdcdaf77060446f40e69b3d1524afa31f.zip opensim-SC_OLD-8dd9601fdcdaf77060446f40e69b3d1524afa31f.tar.gz opensim-SC_OLD-8dd9601fdcdaf77060446f40e69b3d1524afa31f.tar.bz2 opensim-SC_OLD-8dd9601fdcdaf77060446f40e69b3d1524afa31f.tar.xz |
minor change to getdisplaynames cap url
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 2ba35df..7d54a00 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -45,10 +45,6 @@ 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 | protected Timer m_logTimer = new Timer(10000); | ||
49 | protected List<GridInstantMessage> m_logData = new List<GridInstantMessage>(); | ||
50 | protected string m_restUrl; | ||
51 | |||
52 | /// <value> | 48 | /// <value> |
53 | /// Is this module enabled? | 49 | /// Is this module enabled? |
54 | /// </value> | 50 | /// </value> |
@@ -68,12 +64,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
68 | "InstantMessageModule", "InstantMessageModule") != | 64 | "InstantMessageModule", "InstantMessageModule") != |
69 | "InstantMessageModule") | 65 | "InstantMessageModule") |
70 | return; | 66 | return; |
71 | m_restUrl = config.Configs["Messaging"].GetString("LogURL", String.Empty); | ||
72 | } | 67 | } |
73 | 68 | ||
74 | m_enabled = true; | 69 | m_enabled = true; |
75 | m_logTimer.AutoReset = false; | ||
76 | m_logTimer.Elapsed += LogTimerElapsed; | ||
77 | } | 70 | } |
78 | 71 | ||
79 | public virtual void AddRegion(Scene scene) | 72 | public virtual void AddRegion(Scene scene) |
@@ -153,20 +146,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
153 | } | 146 | } |
154 | 147 | ||
155 | #endregion | 148 | #endregion |
156 | 149 | /* | |
157 | public virtual void OnViewerInstantMessage(IClientAPI client, GridInstantMessage im) | 150 | public virtual void OnViewerInstantMessage(IClientAPI client, GridInstantMessage im) |
158 | { | 151 | { |
159 | im.fromAgentName = client.FirstName + " " + client.LastName; | 152 | im.fromAgentName = client.FirstName + " " + client.LastName; |
160 | OnInstantMessage(client, im); | 153 | OnInstantMessage(client, im); |
161 | } | 154 | } |
162 | 155 | */ | |
163 | public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) | 156 | public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) |
164 | { | 157 | { |
165 | byte dialog = im.dialog; | 158 | byte dialog = im.dialog; |
166 | 159 | ||
167 | if (client != null && dialog == (byte)InstantMessageDialog.MessageFromAgent) | ||
168 | LogInstantMesssage(im); | ||
169 | |||
170 | if (dialog != (byte)InstantMessageDialog.MessageFromAgent | 160 | if (dialog != (byte)InstantMessageDialog.MessageFromAgent |
171 | && dialog != (byte)InstantMessageDialog.StartTyping | 161 | && dialog != (byte)InstantMessageDialog.StartTyping |
172 | && dialog != (byte)InstantMessageDialog.StopTyping | 162 | && dialog != (byte)InstantMessageDialog.StopTyping |
@@ -243,35 +233,5 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
243 | // | 233 | // |
244 | OnInstantMessage(null, msg); | 234 | OnInstantMessage(null, msg); |
245 | } | 235 | } |
246 | |||
247 | protected virtual void LogInstantMesssage(GridInstantMessage im) | ||
248 | { | ||
249 | if (m_logData.Count < 20) | ||
250 | { | ||
251 | // Restart the log write timer | ||
252 | m_logTimer.Stop(); | ||
253 | } | ||
254 | if (!m_logTimer.Enabled) | ||
255 | m_logTimer.Start(); | ||
256 | |||
257 | lock (m_logData) | ||
258 | { | ||
259 | m_logData.Add(im); | ||
260 | } | ||
261 | } | ||
262 | |||
263 | protected virtual void LogTimerElapsed(object source, ElapsedEventArgs e) | ||
264 | { | ||
265 | lock (m_logData) | ||
266 | { | ||
267 | if (m_restUrl != String.Empty && m_logData.Count > 0) | ||
268 | { | ||
269 | bool success = SynchronousRestObjectRequester.MakeRequest<List<GridInstantMessage>, bool>("POST", m_restUrl + "/LogMessages/", m_logData); | ||
270 | if (!success) | ||
271 | m_log.ErrorFormat("[INSTANT MESSAGE]: Failed to save log data"); | ||
272 | } | ||
273 | m_logData.Clear(); | ||
274 | } | ||
275 | } | ||
276 | } | 236 | } |
277 | } | 237 | } |