diff options
author | Dahlia Trimble | 2009-01-27 06:14:11 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-01-27 06:14:11 +0000 |
commit | c747990187f7ad655434c61d033de0ebbbf2da8d (patch) | |
tree | 584be8eeb77af1451010c6c556c0f441f7e2b47f /OpenSim | |
parent | correct formatting if parcel description field in event queue message (diff) | |
download | opensim-SC-c747990187f7ad655434c61d033de0ebbbf2da8d.zip opensim-SC-c747990187f7ad655434c61d033de0ebbbf2da8d.tar.gz opensim-SC-c747990187f7ad655434c61d033de0ebbbf2da8d.tar.bz2 opensim-SC-c747990187f7ad655434c61d033de0ebbbf2da8d.tar.xz |
Send groups list via event queue
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs | 85 |
2 files changed, 92 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e58549a..42bb783 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1216,7 +1216,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1216 | 1216 | ||
1217 | OSD Item = Environment.EventQueueHelper.ChatterboxInvitation( | 1217 | OSD Item = Environment.EventQueueHelper.ChatterboxInvitation( |
1218 | new UUID("00000000-68f9-1111-024e-222222111123"), | 1218 | new UUID("00000000-68f9-1111-024e-222222111123"), |
1219 | "Test Group", fromAgent, message, toAgent, fromName, dialog, 0, | 1219 | "OpenSimulator Testing", fromAgent, message, toAgent, fromName, dialog, 0, |
1220 | false, 0, new Vector3(), 1, transactionID, fromGroup, binaryBucket); | 1220 | false, 0, new Vector3(), 1, transactionID, fromGroup, binaryBucket); |
1221 | 1221 | ||
1222 | eq.Enqueue(Item, toAgent); | 1222 | eq.Enqueue(Item, toAgent); |
@@ -7600,7 +7600,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7600 | Groupupdate.AgentData.AgentID = AgentId; | 7600 | Groupupdate.AgentData.AgentID = AgentId; |
7601 | OutPacket(Groupupdate, ThrottleOutPacketType.Task); | 7601 | OutPacket(Groupupdate, ThrottleOutPacketType.Task); |
7602 | 7602 | ||
7603 | try | ||
7604 | { | ||
7605 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
7606 | if (eq != null) | ||
7607 | { | ||
7608 | OSD Item = Environment.EventQueueHelper.GroupMembership(Groupupdate); | ||
7609 | |||
7610 | eq.Enqueue(Item, this.AgentId); | ||
7611 | } | ||
7612 | } | ||
7613 | catch (Exception ex) | ||
7614 | { | ||
7615 | m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString()); | ||
7616 | m_log.Warn("sending group membership data via UDP"); | ||
7617 | OutPacket(Groupupdate, ThrottleOutPacketType.Task); | ||
7618 | } | ||
7603 | } | 7619 | } |
7620 | |||
7621 | |||
7604 | public void SendGroupNameReply(UUID groupLLUID, string GroupName) | 7622 | public void SendGroupNameReply(UUID groupLLUID, string GroupName) |
7605 | { | 7623 | { |
7606 | UUIDGroupNameReplyPacket pack = new UUIDGroupNameReplyPacket(); | 7624 | UUIDGroupNameReplyPacket pack = new UUIDGroupNameReplyPacket(); |
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs index aa57bd0..a64418d 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs | |||
@@ -37,19 +37,19 @@ namespace OpenSim.Region.Environment | |||
37 | { | 37 | { |
38 | private EventQueueHelper() {} // no construction possible, it's an utility class | 38 | private EventQueueHelper() {} // no construction possible, it's an utility class |
39 | 39 | ||
40 | private static byte[] regionHandleToByteArray(ulong regionHandle) | 40 | private static byte[] ulongToByteArray(ulong uLongValue) |
41 | { | 41 | { |
42 | // Reverse endianness of RegionHandle | 42 | // Reverse endianness of RegionHandle |
43 | return new byte[] | 43 | return new byte[] |
44 | { | 44 | { |
45 | (byte)((regionHandle >> 56) % 256), | 45 | (byte)((uLongValue >> 56) % 256), |
46 | (byte)((regionHandle >> 48) % 256), | 46 | (byte)((uLongValue >> 48) % 256), |
47 | (byte)((regionHandle >> 40) % 256), | 47 | (byte)((uLongValue >> 40) % 256), |
48 | (byte)((regionHandle >> 32) % 256), | 48 | (byte)((uLongValue >> 32) % 256), |
49 | (byte)((regionHandle >> 24) % 256), | 49 | (byte)((uLongValue >> 24) % 256), |
50 | (byte)((regionHandle >> 16) % 256), | 50 | (byte)((uLongValue >> 16) % 256), |
51 | (byte)((regionHandle >> 8) % 256), | 51 | (byte)((uLongValue >> 8) % 256), |
52 | (byte)(regionHandle % 256) | 52 | (byte)(uLongValue % 256) |
53 | }; | 53 | }; |
54 | } | 54 | } |
55 | 55 | ||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment | |||
79 | { | 79 | { |
80 | OSDMap llsdSimInfo = new OSDMap(3); | 80 | OSDMap llsdSimInfo = new OSDMap(3); |
81 | 81 | ||
82 | llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle))); | 82 | llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(Handle))); |
83 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); | 83 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); |
84 | llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); | 84 | llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); |
85 | 85 | ||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment | |||
136 | AgentDataArr.Add(AgentDataMap); | 136 | AgentDataArr.Add(AgentDataMap); |
137 | 137 | ||
138 | OSDMap RegionDataMap = new OSDMap(4); | 138 | OSDMap RegionDataMap = new OSDMap(4); |
139 | RegionDataMap.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(Handle))); | 139 | RegionDataMap.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(Handle))); |
140 | RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); | 140 | RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); |
141 | RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); | 141 | RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); |
142 | RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); | 142 | RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); |
@@ -159,7 +159,7 @@ namespace OpenSim.Region.Environment | |||
159 | OSDMap info = new OSDMap(); | 159 | OSDMap info = new OSDMap(); |
160 | info.Add("AgentID", OSD.FromUUID(AgentID)); | 160 | info.Add("AgentID", OSD.FromUUID(AgentID)); |
161 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? | 161 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? |
162 | info.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(regionHandle))); | 162 | info.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(regionHandle))); |
163 | info.Add("SeedCapability", OSD.FromString(capsURL)); | 163 | info.Add("SeedCapability", OSD.FromString(capsURL)); |
164 | info.Add("SimAccess", OSD.FromInteger(simAccess)); | 164 | info.Add("SimAccess", OSD.FromInteger(simAccess)); |
165 | info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); | 165 | info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); |
@@ -418,5 +418,66 @@ namespace OpenSim.Region.Environment | |||
418 | return parcelProperties; | 418 | return parcelProperties; |
419 | } | 419 | } |
420 | 420 | ||
421 | public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) | ||
422 | { | ||
423 | OSDMap groupUpdate = new OSDMap(); | ||
424 | groupUpdate.Add("message", OSD.FromString("AgentGroupDataUpdate")); | ||
425 | |||
426 | OSDMap body = new OSDMap(); | ||
427 | OSDArray agentData = new OSDArray(); | ||
428 | OSDMap agentDataMap = new OSDMap(); | ||
429 | agentDataMap.Add("AgentID", OSD.FromUUID(groupUpdatePacket.AgentData.AgentID)); | ||
430 | agentData.Add(agentDataMap); | ||
431 | body.Add("AgentData", agentData); | ||
432 | |||
433 | OSDArray groupData = new OSDArray(); | ||
434 | |||
435 | foreach (AgentGroupDataUpdatePacket.GroupDataBlock groupDataBlock in groupUpdatePacket.GroupData) | ||
436 | { | ||
437 | OSDMap groupDataMap = new OSDMap(); | ||
438 | groupDataMap.Add("ListInProfile", OSD.FromBoolean(false)); | ||
439 | groupDataMap.Add("GroupID", OSD.FromUUID(groupDataBlock.GroupID)); | ||
440 | groupDataMap.Add("GroupInsigniaID", OSD.FromUUID(groupDataBlock.GroupInsigniaID)); | ||
441 | groupDataMap.Add("Contribution", OSD.FromInteger(groupDataBlock.Contribution)); | ||
442 | groupDataMap.Add("GroupPowers", OSD.FromBinary(ulongToByteArray(groupDataBlock.GroupPowers))); | ||
443 | groupDataMap.Add("GroupName", OSD.FromString(Utils.BytesToString(groupDataBlock.GroupName))); | ||
444 | groupDataMap.Add("AcceptNotices", OSD.FromBoolean(groupDataBlock.AcceptNotices)); | ||
445 | |||
446 | groupData.Add(groupDataMap); | ||
447 | |||
448 | } | ||
449 | body.Add("GroupData", groupData); | ||
450 | groupUpdate.Add("body", body); | ||
451 | |||
452 | return groupUpdate; | ||
453 | } | ||
454 | /* | ||
455 | public void SendGroupMembership(GroupMembershipData[] GroupMembership) | ||
456 | { | ||
457 | m_groupPowers.Clear(); | ||
458 | |||
459 | AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); | ||
460 | AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; | ||
461 | for (int i = 0; i < GroupMembership.Length; i++) | ||
462 | { | ||
463 | m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; | ||
464 | |||
465 | AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); | ||
466 | Group.AcceptNotices = GroupMembership[i].AcceptNotices; | ||
467 | Group.Contribution = GroupMembership[i].Contribution; | ||
468 | Group.GroupID = GroupMembership[i].GroupID; | ||
469 | Group.GroupInsigniaID = GroupMembership[i].GroupPicture; | ||
470 | Group.GroupName = Utils.StringToBytes(GroupMembership[i].GroupName); | ||
471 | Group.GroupPowers = GroupMembership[i].GroupPowers; | ||
472 | Groups[i] = Group; | ||
473 | Groupupdate.GroupData = Groups; | ||
474 | |||
475 | } | ||
476 | Groupupdate.AgentData.AgentID = AgentId; | ||
477 | OutPacket(Groupupdate, ThrottleOutPacketType.Task); | ||
478 | |||
479 | } | ||
480 | */ | ||
481 | |||
421 | } | 482 | } |
422 | } | 483 | } |