aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar
diff options
context:
space:
mode:
authorJeff Ames2009-04-27 05:22:44 +0000
committerJeff Ames2009-04-27 05:22:44 +0000
commit8dbcfc70bf87d503edd4239bd974339a130de153 (patch)
tree9adfe4db9d5658952cf181b919cbe45db170139b /OpenSim/Region/OptionalModules/Avatar
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.zip
opensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.tar.gz
opensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.tar.bz2
opensim-SC_OLD-8dbcfc70bf87d503edd4239bd974339a130de153.tar.xz
Add copyright headers. Formatting cleanup.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs8
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs143
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs61
3 files changed, 90 insertions, 122 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs
index eb6634d..ce8917b 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs
@@ -259,7 +259,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
259 Connect(); 259 Connect();
260 } 260 }
261 261
262 lock(m_connectors) 262 lock (m_connectors)
263 m_connectors.Add(this); 263 m_connectors.Add(this);
264 264
265 m_enabled = true; 265 m_enabled = true;
@@ -306,8 +306,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
306 306
307 } 307 }
308 308
309 lock(m_connectors) 309 lock (m_connectors)
310 m_connectors.Remove(this); 310 m_connectors.Remove(this);
311 311
312 } 312 }
313 } 313 }
@@ -845,7 +845,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
845 _pdk_ = (_pdk_+1)%PING_PERIOD; // cycle the ping trigger 845 _pdk_ = (_pdk_+1)%PING_PERIOD; // cycle the ping trigger
846 _icc_++; // increment the inter-consecutive-connect-delay counter 846 _icc_++; // increment the inter-consecutive-connect-delay counter
847 847
848 lock(m_connectors) 848 lock (m_connectors)
849 foreach (IRCConnector connector in m_connectors) 849 foreach (IRCConnector connector in m_connectors)
850 { 850 {
851 851
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs
index 2dbe237..16dd0b6 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsMessaging.cs
@@ -105,7 +105,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
105 } 105 }
106 106
107 m_debugEnabled = groupsConfig.GetBoolean("XmlRpcDebugEnabled", true); 107 m_debugEnabled = groupsConfig.GetBoolean("XmlRpcDebugEnabled", true);
108
109 } 108 }
110 109
111 m_log.Info("[GROUPS-MESSAGING]: XmlRpcGroupsMessaging starting up"); 110 m_log.Info("[GROUPS-MESSAGING]: XmlRpcGroupsMessaging starting up");
@@ -123,7 +122,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
123 122
124 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 123 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
125 124
126
127 m_groupsModule = scene.RequestModuleInterface<IGroupsModule>(); 125 m_groupsModule = scene.RequestModuleInterface<IGroupsModule>();
128 126
129 // No groups module, no groups messaging 127 // No groups module, no groups messaging
@@ -164,13 +162,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
164 m_sceneList.Remove(scene); 162 m_sceneList.Remove(scene);
165 } 163 }
166 164
167
168 public void Close() 165 public void Close()
169 { 166 {
170 if (!m_groupMessagingEnabled) 167 if (!m_groupMessagingEnabled)
171 return; 168 return;
172 169
173 if(m_debugEnabled) m_log.Debug("[GROUPS-MESSAGING]: Shutting down XmlRpcGroupsMessaging module."); 170 if (m_debugEnabled) m_log.Debug("[GROUPS-MESSAGING]: Shutting down XmlRpcGroupsMessaging module.");
174 171
175 foreach (Scene scene in m_sceneList) 172 foreach (Scene scene in m_sceneList)
176 { 173 {
@@ -222,19 +219,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
222 { 219 {
223 m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 220 m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
224 221
225 DebugGridInstantMessage(msg); 222 DebugGridInstantMessage(msg);
226 } 223 }
227 224
228 // Incoming message from a group 225 // Incoming message from a group
229 if ((msg.fromGroup == true) && 226 if ((msg.fromGroup == true) &&
230 ( (msg.dialog == (byte)InstantMessageDialog.SessionSend) 227 ((msg.dialog == (byte)InstantMessageDialog.SessionSend)
231 || (msg.dialog == (byte)InstantMessageDialog.SessionAdd) 228 || (msg.dialog == (byte)InstantMessageDialog.SessionAdd)
232 || (msg.dialog == (byte)InstantMessageDialog.SessionDrop) 229 || (msg.dialog == (byte)InstantMessageDialog.SessionDrop)))
233 ))
234 { 230 {
235 ProcessMessageFromGroupSession(msg); 231 ProcessMessageFromGroupSession(msg);
236 } 232 }
237
238 } 233 }
239 234
240 private void ProcessMessageFromGroupSession(GridInstantMessage msg) 235 private void ProcessMessageFromGroupSession(GridInstantMessage msg)
@@ -254,53 +249,52 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
254 case (byte)InstantMessageDialog.SessionSend: 249 case (byte)InstantMessageDialog.SessionSend:
255 if (!m_agentsInGroupSession.ContainsKey(msg.toAgentID) 250 if (!m_agentsInGroupSession.ContainsKey(msg.toAgentID)
256 && !m_agentsDroppedSession.ContainsKey(msg.toAgentID)) 251 && !m_agentsDroppedSession.ContainsKey(msg.toAgentID))
257 { 252 {
258 // Agent not in session and hasn't dropped from session 253 // Agent not in session and hasn't dropped from session
259 // Add them to the session for now, and Invite them 254 // Add them to the session for now, and Invite them
260 AddAgentToGroupSession(msg.toAgentID, msg.imSessionID); 255 AddAgentToGroupSession(msg.toAgentID, msg.imSessionID);
261 256
262 UUID toAgentID = new UUID(msg.toAgentID); 257 UUID toAgentID = new UUID(msg.toAgentID);
263 IClientAPI activeClient = GetActiveClient(toAgentID); 258 IClientAPI activeClient = GetActiveClient(toAgentID);
264 if (activeClient != null) 259 if (activeClient != null)
265 { 260 {
266 UUID groupID = new UUID(msg.fromAgentID); 261 UUID groupID = new UUID(msg.fromAgentID);
267 262
268 GroupRecord groupInfo = m_groupsModule.GetGroupRecord(groupID); 263 GroupRecord groupInfo = m_groupsModule.GetGroupRecord(groupID);
269 if (groupInfo != null) 264 if (groupInfo != null)
270 { 265 {
271 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Sending chatterbox invite instant message"); 266 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Sending chatterbox invite instant message");
272 267
273 // Force? open the group session dialog??? 268 // Force? open the group session dialog???
274 IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>(); 269 IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>();
275 eq.ChatterboxInvitation( 270 eq.ChatterboxInvitation(
276 groupID 271 groupID
277 , groupInfo.GroupName 272 , groupInfo.GroupName
278 , new UUID(msg.fromAgentID) 273 , new UUID(msg.fromAgentID)
279 , msg.message, new UUID(msg.toAgentID) 274 , msg.message, new UUID(msg.toAgentID)
280 , msg.fromAgentName 275 , msg.fromAgentName
281 , msg.dialog 276 , msg.dialog
282 , msg.timestamp 277 , msg.timestamp
283 , msg.offline == 1 278 , msg.offline == 1
284 , (int)msg.ParentEstateID 279 , (int)msg.ParentEstateID
285 , msg.Position 280 , msg.Position
286 , 1 281 , 1
287 , new UUID(msg.imSessionID) 282 , new UUID(msg.imSessionID)
288 , msg.fromGroup 283 , msg.fromGroup
289 , Utils.StringToBytes(groupInfo.GroupName) 284 , Utils.StringToBytes(groupInfo.GroupName)
290 ); 285 );
291 286
292 eq.ChatterBoxSessionAgentListUpdates( 287 eq.ChatterBoxSessionAgentListUpdates(
293 new UUID(groupID) 288 new UUID(groupID)
294 , new UUID(msg.fromAgentID) 289 , new UUID(msg.fromAgentID)
295 , new UUID(msg.toAgentID) 290 , new UUID(msg.toAgentID)
296 , false //canVoiceChat 291 , false //canVoiceChat
297 , false //isModerator 292 , false //isModerator
298 , false //text mute 293 , false //text mute
299 ); 294 );
300 295 }
296 }
301 } 297 }
302 }
303 }
304 else if (!m_agentsDroppedSession.ContainsKey(msg.toAgentID)) 298 else if (!m_agentsDroppedSession.ContainsKey(msg.toAgentID))
305 { 299 {
306 // User hasn't dropped, so they're in the session, 300 // User hasn't dropped, so they're in the session,
@@ -322,10 +316,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
322 default: 316 default:
323 m_log.WarnFormat("[GROUPS-MESSAGING] I don't know how to proccess a {0} message.", ((InstantMessageDialog)msg.dialog).ToString()); 317 m_log.WarnFormat("[GROUPS-MESSAGING] I don't know how to proccess a {0} message.", ((InstantMessageDialog)msg.dialog).ToString());
324 break; 318 break;
319 }
325 } 320 }
326 }
327
328
329 321
330 #endregion 322 #endregion
331 323
@@ -333,16 +325,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
333 325
334 private void RemoveAgentFromGroupSession(Guid agentID, Guid sessionID) 326 private void RemoveAgentFromGroupSession(Guid agentID, Guid sessionID)
335 { 327 {
336 if( m_agentsInGroupSession.ContainsKey(sessionID) ) 328 if (m_agentsInGroupSession.ContainsKey(sessionID))
337 { 329 {
338 // If in session remove 330 // If in session remove
339 if( m_agentsInGroupSession[sessionID].Contains(agentID) ) 331 if (m_agentsInGroupSession[sessionID].Contains(agentID))
340 { 332 {
341 m_agentsInGroupSession[sessionID].Remove(agentID); 333 m_agentsInGroupSession[sessionID].Remove(agentID);
342 } 334 }
343 335
344 // If not in dropped list, add 336 // If not in dropped list, add
345 if( !m_agentsDroppedSession[sessionID].Contains(agentID) ) 337 if (!m_agentsDroppedSession[sessionID].Contains(agentID))
346 { 338 {
347 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Dropped {1} from session {0}", sessionID, agentID); 339 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Dropped {1} from session {0}", sessionID, agentID);
348 m_agentsDroppedSession[sessionID].Add(agentID); 340 m_agentsDroppedSession[sessionID].Add(agentID);
@@ -356,13 +348,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
356 CreateGroupSessionTracking(sessionID); 348 CreateGroupSessionTracking(sessionID);
357 349
358 // If nessesary, remove from dropped list 350 // If nessesary, remove from dropped list
359 if( m_agentsDroppedSession[sessionID].Contains(agentID) ) 351 if (m_agentsDroppedSession[sessionID].Contains(agentID))
360 { 352 {
361 m_agentsDroppedSession[sessionID].Remove(agentID); 353 m_agentsDroppedSession[sessionID].Remove(agentID);
362 } 354 }
363 355
364 // If nessesary, add to in session list 356 // If nessesary, add to in session list
365 if( !m_agentsInGroupSession[sessionID].Contains(agentID) ) 357 if (!m_agentsInGroupSession[sessionID].Contains(agentID))
366 { 358 {
367 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Added {1} to session {0}", sessionID, agentID); 359 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Added {1} to session {0}", sessionID, agentID);
368 m_agentsInGroupSession[sessionID].Add(agentID); 360 m_agentsInGroupSession[sessionID].Add(agentID);
@@ -385,7 +377,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
385 { 377 {
386 m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 378 m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
387 379
388 DebugGridInstantMessage(im); 380 DebugGridInstantMessage(im);
389 } 381 }
390 382
391 // Start group IM session 383 // Start group IM session
@@ -424,13 +416,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
424 SendMessageToGroup(im, groupID); 416 SendMessageToGroup(im, groupID);
425 } 417 }
426 } 418 }
419
427 #endregion 420 #endregion
428 421
429 private void SendMessageToGroup(GridInstantMessage im, UUID groupID) 422 private void SendMessageToGroup(GridInstantMessage im, UUID groupID)
430 { 423 {
431 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 424 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
432 425
433
434 foreach (GroupMembersData member in m_groupsModule.GroupMembersRequest(null, groupID)) 426 foreach (GroupMembersData member in m_groupsModule.GroupMembersRequest(null, groupID))
435 { 427 {
436 if (m_agentsDroppedSession[im.imSessionID].Contains(member.AgentID.Guid)) 428 if (m_agentsDroppedSession[im.imSessionID].Contains(member.AgentID.Guid))
@@ -441,15 +433,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
441 } 433 }
442 434
443 // Copy Message 435 // Copy Message
444 GridInstantMessage msg = new GridInstantMessage(); 436 GridInstantMessage msg = new GridInstantMessage();
445 msg.imSessionID = im.imSessionID; 437 msg.imSessionID = im.imSessionID;
446 msg.fromAgentName = im.fromAgentName; 438 msg.fromAgentName = im.fromAgentName;
447 msg.message = im.message; 439 msg.message = im.message;
448 msg.dialog = im.dialog; 440 msg.dialog = im.dialog;
449 msg.offline = im.offline; 441 msg.offline = im.offline;
450 msg.ParentEstateID = im.ParentEstateID; 442 msg.ParentEstateID = im.ParentEstateID;
451 msg.Position = im.Position; 443 msg.Position = im.Position;
452 msg.RegionID = im.RegionID; 444 msg.RegionID = im.RegionID;
453 msg.binaryBucket = im.binaryBucket; 445 msg.binaryBucket = im.binaryBucket;
454 msg.timestamp = (uint)Util.UnixTimeSinceEpoch(); 446 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
455 447
@@ -464,8 +456,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
464 { 456 {
465 // If they're not local, forward across the grid 457 // If they're not local, forward across the grid
466 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Delivering to {0} via Grid", member.AgentID); 458 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING] Delivering to {0} via Grid", member.AgentID);
467 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { }); 459 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
468 } 460 }
469 else 461 else
470 { 462 {
471 // Deliver locally, directly 463 // Deliver locally, directly
@@ -488,24 +480,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
488 sessionMap.Add("type", OSD.FromInteger(0)); 480 sessionMap.Add("type", OSD.FromInteger(0));
489 sessionMap.Add("voice_enabled", OSD.FromBoolean(false)); 481 sessionMap.Add("voice_enabled", OSD.FromBoolean(false));
490 482
491
492 OSDMap bodyMap = new OSDMap(4); 483 OSDMap bodyMap = new OSDMap(4);
493 bodyMap.Add("session_id", OSD.FromUUID(groupID)); 484 bodyMap.Add("session_id", OSD.FromUUID(groupID));
494 bodyMap.Add("temp_session_id", OSD.FromUUID(groupID)); 485 bodyMap.Add("temp_session_id", OSD.FromUUID(groupID));
495 bodyMap.Add("success", OSD.FromBoolean(true)); 486 bodyMap.Add("success", OSD.FromBoolean(true));
496 bodyMap.Add("session_info", sessionMap); 487 bodyMap.Add("session_info", sessionMap);
497 488
498
499 IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>(); 489 IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
500 490
501 if (queue != null) 491 if (queue != null)
502 { 492 {
503 queue.Enqueue(EventQueueHelper.buildEvent("ChatterBoxSessionStartReply", bodyMap), remoteClient.AgentId); 493 queue.Enqueue(EventQueueHelper.buildEvent("ChatterBoxSessionStartReply", bodyMap), remoteClient.AgentId);
504 } 494 }
505
506 } 495 }
507 496
508
509 private void DebugGridInstantMessage(GridInstantMessage im) 497 private void DebugGridInstantMessage(GridInstantMessage im)
510 { 498 {
511 if (m_debugEnabled) 499 if (m_debugEnabled)
@@ -535,7 +523,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
535 foreach (Scene scene in m_sceneList) 523 foreach (Scene scene in m_sceneList)
536 { 524 {
537 if (scene.Entities.ContainsKey(agentID) && 525 if (scene.Entities.ContainsKey(agentID) &&
538 scene.Entities[agentID] is ScenePresence) 526 scene.Entities[agentID] is ScenePresence)
539 { 527 {
540 ScenePresence user = (ScenePresence)scene.Entities[agentID]; 528 ScenePresence user = (ScenePresence)scene.Entities[agentID];
541 if (!user.IsChildAgent) 529 if (!user.IsChildAgent)
@@ -546,7 +534,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
546 { 534 {
547 child = user.ControllingClient; 535 child = user.ControllingClient;
548 } 536 }
549 } 537 }
550 } 538 }
551 539
552 // If we didn't find a root, then just return whichever child we found, or null if none 540 // If we didn't find a root, then just return whichever child we found, or null if none
@@ -555,5 +543,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
555 543
556 #endregion 544 #endregion
557 } 545 }
558
559} 546}
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
index eb9f804..a2d506c 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsModule.cs
@@ -143,13 +143,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
143 143
144 if (m_msgTransferModule == null) 144 if (m_msgTransferModule == null)
145 { 145 {
146 m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>(); 146 m_msgTransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
147 147
148 // No message transfer module, no notices, group invites, rejects, ejects, etc 148 // No message transfer module, no notices, group invites, rejects, ejects, etc
149 if (m_msgTransferModule == null) 149 if (m_msgTransferModule == null)
150 { 150 {
151 m_groupsEnabled = false; 151 m_groupsEnabled = false;
152 m_log.Error("[GROUPS]: Could not get MessageTransferModule"); 152 m_log.Error("[GROUPS]: Could not get MessageTransferModule");
153 Close(); 153 Close();
154 return; 154 return;
155 } 155 }
@@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
157 157
158 lock (m_sceneList) 158 lock (m_sceneList)
159 { 159 {
160 m_sceneList.Add(scene); 160 m_sceneList.Add(scene);
161 } 161 }
162 162
163 scene.EventManager.OnNewClient += OnNewClient; 163 scene.EventManager.OnNewClient += OnNewClient;
@@ -178,7 +178,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
178 178
179 lock (m_sceneList) 179 lock (m_sceneList)
180 { 180 {
181 m_sceneList.Remove(scene); 181 m_sceneList.Remove(scene);
182 } 182 }
183 } 183 }
184 184
@@ -313,16 +313,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
313 GroupName = "Unknown"; 313 GroupName = "Unknown";
314 } 314 }
315 315
316
317 remote_client.SendGroupNameReply(GroupID, GroupName); 316 remote_client.SendGroupNameReply(GroupID, GroupName);
318 } 317 }
319 318
320
321 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) 319 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
322 { 320 {
323 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 321 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
324 322
325
326 // Group invitations 323 // Group invitations
327 if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline)) 324 if ((im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) || (im.dialog == (byte)InstantMessageDialog.GroupInvitationDecline))
328 { 325 {
@@ -334,7 +331,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
334 UUID fromAgentID = new UUID(im.fromAgentID); 331 UUID fromAgentID = new UUID(im.fromAgentID);
335 if ((inviteInfo != null) && (fromAgentID == inviteInfo.AgentID)) 332 if ((inviteInfo != null) && (fromAgentID == inviteInfo.AgentID))
336 { 333 {
337
338 // Accept 334 // Accept
339 if (im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept) 335 if (im.dialog == (byte)InstantMessageDialog.GroupInvitationAccept)
340 { 336 {
@@ -373,10 +369,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
373 { 369 {
374 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] Received a reject invite notice."); 370 if (m_debugEnabled) m_log.DebugFormat("[GROUPS] Received a reject invite notice.");
375 m_groupData.RemoveAgentToGroupInvite(inviteID); 371 m_groupData.RemoveAgentToGroupInvite(inviteID);
376
377 } 372 }
378
379
380 } 373 }
381 } 374 }
382 375
@@ -411,14 +404,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
411 binBucket = binBucket.Remove(0, 14).Trim(); 404 binBucket = binBucket.Remove(0, 14).Trim();
412 if (m_debugEnabled) 405 if (m_debugEnabled)
413 { 406 {
414 m_log.WarnFormat("I don't understand a group notice binary bucket of: {0}", binBucket); 407 m_log.WarnFormat("I don't understand a group notice binary bucket of: {0}", binBucket);
415 408
416 OSDMap binBucketOSD = (OSDMap)OSDParser.DeserializeLLSDXml(binBucket); 409 OSDMap binBucketOSD = (OSDMap)OSDParser.DeserializeLLSDXml(binBucket);
417 410
418 foreach (string key in binBucketOSD.Keys) 411 foreach (string key in binBucketOSD.Keys)
419 { 412 {
420 m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString()); 413 m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString());
421 } 414 }
422 } 415 }
423 416
424 // treat as if no attachment 417 // treat as if no attachment
@@ -429,7 +422,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
429 bucket[18] = 0; //dunno 422 bucket[18] = 0; //dunno
430 } 423 }
431 424
432
433 m_groupData.AddGroupNotice(GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket); 425 m_groupData.AddGroupNotice(GroupID, NoticeID, im.fromAgentName, Subject, Message, bucket);
434 if (OnNewGroupNotice != null) 426 if (OnNewGroupNotice != null)
435 { 427 {
@@ -446,12 +438,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
446 438
447 msg.toAgentID = member.AgentID.Guid; 439 msg.toAgentID = member.AgentID.Guid;
448 OutgoingInstantMessage(msg, member.AgentID); 440 OutgoingInstantMessage(msg, member.AgentID);
449
450 } 441 }
451 } 442 }
452
453
454
455 } 443 }
456 } 444 }
457 445
@@ -477,11 +465,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
477 UUID groupID = new UUID(im.fromAgentID); 465 UUID groupID = new UUID(im.fromAgentID);
478 ejectee.SendAgentDropGroup(groupID); 466 ejectee.SendAgentDropGroup(groupID);
479 } 467 }
480
481 } 468 }
482
483
484
485 } 469 }
486 470
487 private void OnGridInstantMessage(GridInstantMessage msg) 471 private void OnGridInstantMessage(GridInstantMessage msg)
@@ -491,7 +475,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
491 // Trigger the above event handler 475 // Trigger the above event handler
492 OnInstantMessage(null, msg); 476 OnInstantMessage(null, msg);
493 477
494
495 // If a message from a group arrives here, it may need to be forwarded to a local client 478 // If a message from a group arrives here, it may need to be forwarded to a local client
496 if (msg.fromGroup == true) 479 if (msg.fromGroup == true)
497 { 480 {
@@ -501,17 +484,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
501 case (byte)InstantMessageDialog.GroupNotice: 484 case (byte)InstantMessageDialog.GroupNotice:
502 UUID toAgentID = new UUID(msg.toAgentID); 485 UUID toAgentID = new UUID(msg.toAgentID);
503 IClientAPI localClient = GetActiveClient(toAgentID); 486 IClientAPI localClient = GetActiveClient(toAgentID);
504 if( localClient != null ) 487 if (localClient != null)
505 { 488 {
506 localClient.SendInstantMessage(msg); 489 localClient.SendInstantMessage(msg);
507 } 490 }
508 break; 491 break;
509 } 492 }
510 } 493 }
511
512 } 494 }
513 495
514
515 #endregion 496 #endregion
516 497
517 #region IGroupsModule Members 498 #region IGroupsModule Members
@@ -570,8 +551,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
570 List<GroupMembersData> data = m_groupData.GetGroupMembers(groupID); 551 List<GroupMembersData> data = m_groupData.GetGroupMembers(groupID);
571 if (m_debugEnabled) 552 if (m_debugEnabled)
572 { 553 {
573 foreach (GroupMembersData member in data) 554 foreach (GroupMembersData member in data)
574 { 555 {
575 m_log.DebugFormat("[GROUPS] {0} {1}", member.AgentID, member.Title); 556 m_log.DebugFormat("[GROUPS] {0} {1}", member.AgentID, member.Title);
576 } 557 }
577 } 558 }
@@ -588,8 +569,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
588 569
589 if (m_debugEnabled) 570 if (m_debugEnabled)
590 { 571 {
591 foreach (GroupRolesData member in data) 572 foreach (GroupRolesData member in data)
592 { 573 {
593 m_log.DebugFormat("[GROUPS] {0} {1}", member.Title, member.Members); 574 m_log.DebugFormat("[GROUPS] {0} {1}", member.Title, member.Members);
594 } 575 }
595 } 576 }
@@ -606,8 +587,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
606 587
607 if (m_debugEnabled) 588 if (m_debugEnabled)
608 { 589 {
609 foreach (GroupRoleMembersData member in data) 590 foreach (GroupRoleMembersData member in data)
610 { 591 {
611 m_log.DebugFormat("[GROUPS] Av: {0} Role: {1}", member.MemberID, member.RoleID); 592 m_log.DebugFormat("[GROUPS] Av: {0} Role: {1}", member.MemberID, member.RoleID);
612 } 593 }
613 } 594 }