Don't try and send group updates to NPCs via event queue, since NPCs have no event queue.

I think there is an argument for sending this information to NPCs anyway since in some cases it appears a lot easier to write server-side bots by hooking into such internal events.
However, would need to stop event messages building up on NPC queues if they are never retrieved.
0.7.6-extended
Justin Clark-Casey (justincc) 2013-08-12 21:02:50 +01:00
parent f3edc0d8b7
commit 377fe63c60
2 changed files with 7 additions and 4 deletions

View File

@ -1223,12 +1223,16 @@ namespace OpenSim.Groups
{ {
if (m_debugEnabled) m_log.InfoFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); if (m_debugEnabled) m_log.InfoFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
// NPCs currently don't have a CAPs structure or event queues. There is a strong argument for conveying this information
// to them anyway since it makes writing server-side bots a lot easier, but for now we don't do anything.
if (remoteClient.SceneAgent.PresenceType == PresenceType.Npc)
return;
OSDArray AgentData = new OSDArray(1); OSDArray AgentData = new OSDArray(1);
OSDMap AgentDataMap = new OSDMap(1); OSDMap AgentDataMap = new OSDMap(1);
AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID)); AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID));
AgentData.Add(AgentDataMap); AgentData.Add(AgentDataMap);
OSDArray GroupData = new OSDArray(data.Length); OSDArray GroupData = new OSDArray(data.Length);
OSDArray NewGroupData = new OSDArray(data.Length); OSDArray NewGroupData = new OSDArray(data.Length);
@ -1275,7 +1279,6 @@ namespace OpenSim.Groups
{ {
queue.Enqueue(queue.BuildEvent("AgentGroupDataUpdate", llDataStruct), GetRequestingAgentID(remoteClient)); queue.Enqueue(queue.BuildEvent("AgentGroupDataUpdate", llDataStruct), GetRequestingAgentID(remoteClient));
} }
} }
private void SendScenePresenceUpdate(UUID AgentID, string Title) private void SendScenePresenceUpdate(UUID AgentID, string Title)
@ -1337,6 +1340,7 @@ namespace OpenSim.Groups
GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, dataForAgentID); GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, dataForAgentID);
SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipArray); SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipArray);
//remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipArray); //remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipArray);
if (remoteClient.AgentId == dataForAgentID) if (remoteClient.AgentId == dataForAgentID)
remoteClient.RefreshGroupMembership(); remoteClient.RefreshGroupMembership();

View File

@ -1212,7 +1212,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID)); AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID));
AgentData.Add(AgentDataMap); AgentData.Add(AgentDataMap);
OSDArray GroupData = new OSDArray(data.Length); OSDArray GroupData = new OSDArray(data.Length);
OSDArray NewGroupData = new OSDArray(data.Length); OSDArray NewGroupData = new OSDArray(data.Length);