aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Addons/Groups/GroupsModule.cs47
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs20
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEventQueue.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs46
-rw-r--r--OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs2
6 files changed, 85 insertions, 36 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs
index f24670a..d27797e 100644
--- a/OpenSim/Addons/Groups/GroupsModule.cs
+++ b/OpenSim/Addons/Groups/GroupsModule.cs
@@ -394,9 +394,8 @@ namespace OpenSim.Groups
394 394
395 OutgoingInstantMessage(msg, invitee); 395 OutgoingInstantMessage(msg, invitee);
396 396
397 IClientAPI client = GetActiveClient(invitee); 397 UpdateAllClientsWithGroupInfo(invitee);
398 if (client != null) 398
399 SendDataUpdate(remoteClient, true);
400 } 399 }
401 400
402 m_groupData.RemoveAgentToGroupInvite(GetRequestingAgentIDStr(remoteClient), inviteID); 401 m_groupData.RemoveAgentToGroupInvite(GetRequestingAgentIDStr(remoteClient), inviteID);
@@ -1112,7 +1111,7 @@ namespace OpenSim.Groups
1112 1111
1113 // SL sends out messages to everyone in the group 1112 // SL sends out messages to everyone in the group
1114 // Who all should receive updates and what should they be updated with? 1113 // Who all should receive updates and what should they be updated with?
1115 SendAgentGroupDataUpdate(remoteClient, false); 1114 UpdateAllClientsWithGroupInfo(ejecteeID);
1116 } 1115 }
1117 1116
1118 public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID) 1117 public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID)
@@ -1226,16 +1225,44 @@ namespace OpenSim.Groups
1226 } 1225 }
1227 } 1226 }
1228 1227
1228 /// <summary>
1229 /// Send updates to all clients who might be interested in groups data for dataForClientID
1230 /// </summary>
1231 private void UpdateAllClientsWithGroupInfo(UUID dataForClientID)
1232 {
1233 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1234
1235 // TODO: Probably isn't nessesary to update every client in every scene.
1236 // Need to examine client updates and do only what's nessesary.
1237 lock (m_sceneList)
1238 {
1239 foreach (Scene scene in m_sceneList)
1240 {
1241 scene.ForEachClient(delegate (IClientAPI client) { SendAgentGroupDataUpdate(client, dataForClientID); });
1242 }
1243 }
1244 }
1245
1229 public void SendAgentGroupDataUpdate(IClientAPI remoteClient) 1246 public void SendAgentGroupDataUpdate(IClientAPI remoteClient)
1230 { 1247 {
1231 SendAgentGroupDataUpdate(remoteClient, true); 1248 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient), true);
1249 }
1250
1251 public void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForClientID)
1252 {
1253 SendAgentGroupDataUpdate(remoteClient, dataForClientID, true);
1232 } 1254 }
1233 1255
1234 /// <summary>
1235 /// Tell remoteClient about its agent groups, and optionally send title to others
1236 /// </summary>
1237 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, bool tellOthers) 1256 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, bool tellOthers)
1238 { 1257 {
1258 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient), tellOthers);
1259 }
1260
1261 /// <summary>
1262 /// Tell remoteClient about its agent groups, and optionally send title to others
1263 /// </summary>
1264 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForClientID, bool tellOthers)
1265 {
1239 if (m_debugEnabled) m_log.InfoFormat("[Groups]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name); 1266 if (m_debugEnabled) m_log.InfoFormat("[Groups]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name);
1240 1267
1241 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff 1268 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
@@ -1246,7 +1273,7 @@ namespace OpenSim.Groups
1246 1273
1247 GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); 1274 GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID);
1248 IEventQueue eq = remoteClient.Scene.RequestModuleInterface<IEventQueue>(); 1275 IEventQueue eq = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
1249 eq.GroupMembershipData(GetRequestingAgentID(remoteClient), membershipArray); 1276 eq.GroupMembershipData(GetRequestingAgentID(remoteClient), dataForClientID, membershipArray);
1250 1277
1251 remoteClient.RefreshGroupMembership(); 1278 remoteClient.RefreshGroupMembership();
1252 } 1279 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 9a1cef4..d628cfc 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -585,9 +585,9 @@ namespace OpenSim.Region.ClientStack.Linden
585 Enqueue(item, avatarID); 585 Enqueue(item, avatarID);
586 } 586 }
587 587
588 public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) 588 public void GroupMembershipData(UUID receiverAgent, UUID dataForClientID, GroupMembershipData[] data)
589 { 589 {
590 OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, data); 590 OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, dataForClientID, data);
591 Enqueue(item, receiverAgent); 591 Enqueue(item, receiverAgent);
592 } 592 }
593 593
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
index 2344fc6..7c8f441 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
@@ -367,7 +367,7 @@ namespace OpenSim.Region.ClientStack.Linden
367 return groupUpdate; 367 return groupUpdate;
368 } 368 }
369 369
370 public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) 370 public static OSD GroupMembershipData(UUID receiverAgent, UUID dataForAgentID, GroupMembershipData[] data)
371 { 371 {
372 OSDArray AgentData = new OSDArray(1); 372 OSDArray AgentData = new OSDArray(1);
373 OSDMap AgentDataMap = new OSDMap(1); 373 OSDMap AgentDataMap = new OSDMap(1);
@@ -379,15 +379,15 @@ namespace OpenSim.Region.ClientStack.Linden
379 379
380 foreach (GroupMembershipData membership in data) 380 foreach (GroupMembershipData membership in data)
381 { 381 {
382 //if (receiverAgent != dataForAgentID) 382 if (receiverAgent != dataForAgentID)
383 //{ 383 {
384 // if (!membership.ListInProfile) 384 if (!membership.ListInProfile)
385 // { 385 {
386 // // If we're sending group info to remoteclient about another agent, 386 // If we're sending group info to remoteclient about another agent,
387 // // filter out groups the other agent doesn't want to share. 387 // filter out groups the other agent doesn't want to share.
388 // continue; 388 continue;
389 // } 389 }
390 //} 390 }
391 391
392 OSDMap GroupDataMap = new OSDMap(6); 392 OSDMap GroupDataMap = new OSDMap(6);
393 OSDMap NewGroupDataMap = new OSDMap(1); 393 OSDMap NewGroupDataMap = new OSDMap(1);
diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
index f4014db..1f29f7b 100644
--- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces
59 bool isModerator, bool textMute); 59 bool isModerator, bool textMute);
60 void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); 60 void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
61 void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); 61 void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID);
62 void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data); 62 void GroupMembershipData(UUID receiverAgent, UUID dataForClientID, GroupMembershipData[] data);
63 OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); 63 OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono);
64 OSD BuildEvent(string eventName, OSD eventBody); 64 OSD BuildEvent(string eventName, OSD eventBody);
65 void partPhysicsProperties(uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID); 65 void partPhysicsProperties(uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 5dfbe2c..ef14270 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -442,12 +442,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
442 442
443 OutgoingInstantMessage(msg, inviteInfo.AgentID); 443 OutgoingInstantMessage(msg, inviteInfo.AgentID);
444 444
445 IClientAPI client = GetActiveClient(inviteInfo.AgentID); 445 UpdateAllClientsWithGroupInfo(inviteInfo.AgentID);
446 if (client != null)
447 SendDataUpdate(remoteClient, true);
448
449 // TODO: If the inviter is still online, they need an agent dataupdate
450 // and maybe group membership updates for the invitee
451 446
452 m_groupData.RemoveAgentToGroupInvite(GetRequestingAgentID(remoteClient), inviteID); 447 m_groupData.RemoveAgentToGroupInvite(GetRequestingAgentID(remoteClient), inviteID);
453 } 448 }
@@ -1207,8 +1202,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1207 // SL sends out messages to everyone in the group 1202 // SL sends out messages to everyone in the group
1208 // Who all should receive updates and what should they be updated with? 1203 // Who all should receive updates and what should they be updated with?
1209 // just tell this the group change 1204 // just tell this the group change
1210 SendAgentGroupDataUpdate(remoteClient, false); 1205 UpdateAllClientsWithGroupInfo(ejecteeID);
1211 // TODO fix the rest of sends
1212 } 1206 }
1213 1207
1214 public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID) 1208 public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID)
@@ -1353,16 +1347,44 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1353 } 1347 }
1354 } 1348 }
1355 1349
1350 /// <summary>
1351 /// Send updates to all clients who might be interested in groups data for dataForClientID
1352 /// </summary>
1353 private void UpdateAllClientsWithGroupInfo(UUID dataForClientID)
1354 {
1355 if (m_debugEnabled) m_log.InfoFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1356
1357 // TODO: Probably isn't nessesary to update every client in every scene.
1358 // Need to examine client updates and do only what's nessesary.
1359 lock (m_sceneList)
1360 {
1361 foreach (Scene scene in m_sceneList)
1362 {
1363 scene.ForEachClient(delegate (IClientAPI client) { SendAgentGroupDataUpdate(client, dataForClientID); });
1364 }
1365 }
1366 }
1367
1356 public void SendAgentGroupDataUpdate(IClientAPI remoteClient) 1368 public void SendAgentGroupDataUpdate(IClientAPI remoteClient)
1357 { 1369 {
1358 SendAgentGroupDataUpdate(remoteClient, true); 1370 SendAgentGroupDataUpdate(remoteClient, true);
1359 } 1371 }
1360 1372
1361 /// <summary> 1373 public void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForClientID)
1362 /// Tell remoteClient about its agent groups, and optionally send title to others 1374 {
1363 /// </summary> 1375 SendAgentGroupDataUpdate(remoteClient, dataForClientID, true);
1376 }
1377
1364 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, bool tellOthers) 1378 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, bool tellOthers)
1365 { 1379 {
1380 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient), tellOthers);
1381 }
1382
1383 /// <summary>
1384 /// Tell remoteClient about its agent groups, and optionally send title to others
1385 /// </summary>
1386 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForClientID, bool tellOthers)
1387 {
1366 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name); 1388 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name);
1367 1389
1368 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff 1390 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
@@ -1373,7 +1395,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1373 1395
1374 GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); 1396 GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID);
1375 IEventQueue eq = remoteClient.Scene.RequestModuleInterface<IEventQueue>(); 1397 IEventQueue eq = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
1376 eq.GroupMembershipData(GetRequestingAgentID(remoteClient), membershipArray); 1398 eq.GroupMembershipData(GetRequestingAgentID(remoteClient), dataForClientID, membershipArray);
1377 1399
1378 remoteClient.RefreshGroupMembership(); 1400 remoteClient.RefreshGroupMembership();
1379 } 1401 }
diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs
index 332d59c..192f84f 100644
--- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs
+++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Tests.Common
162 AddEvent(avatarID, "GroupMembership", groupUpdate); 162 AddEvent(avatarID, "GroupMembership", groupUpdate);
163 } 163 }
164 164
165 public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) 165 public void GroupMembershipData(UUID receiverAgent, UUID dataForClientID, GroupMembershipData[] data)
166 { 166 {
167 AddEvent(receiverAgent, "AgentGroupDataUpdate", data); 167 AddEvent(receiverAgent, "AgentGroupDataUpdate", data);
168 } 168 }