diff options
author | Dr Scofield | 2009-02-06 16:55:34 +0000 |
---|---|---|
committer | Dr Scofield | 2009-02-06 16:55:34 +0000 |
commit | 9b66108081a8c8cf79faaa6c541554091c40850e (patch) | |
tree | 095a232ae5a9de3a9244bcd34da08294f61eeea5 /OpenSim/Region/Environment/Modules/Framework/EventQueue | |
parent | * removed superfluous constants class (diff) | |
download | opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.zip opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.gz opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.bz2 opensim-SC_OLD-9b66108081a8c8cf79faaa6c541554091c40850e.tar.xz |
This changeset is the step 1 of 2 in refactoring
OpenSim.Region.Environment into a "framework" part and a modules only
part. This first changeset refactors OpenSim.Region.Environment.Scenes,
OpenSim.Region.Environment.Interfaces, and OpenSim.Region.Interfaces
into OpenSim.Region.Framework.{Interfaces,Scenes} leaving only region
modules in OpenSim.Region.Environment.
The next step will be to move region modules up from
OpenSim.Region.Environment.Modules to OpenSim.Region.CoreModules and
then sort out which modules are really core modules and which should
move out to forge.
I've been very careful to NOT BREAK anything. i hope i've
succeeded. as this is the work of a whole week i hope i managed to
keep track with the applied patches of the last week --- could any of
you that did check in stuff have a look at whether it survived? thx!
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Framework/EventQueue')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueGetModule.cs | 77 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs | 74 |
2 files changed, 111 insertions, 40 deletions
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueGetModule.cs index bc4c5b9..fb30321 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueGetModule.cs | |||
@@ -34,6 +34,7 @@ using System.Reflection; | |||
34 | using System.Threading; | 34 | using System.Threading; |
35 | using System.Xml; | 35 | using System.Xml; |
36 | using OpenMetaverse; | 36 | using OpenMetaverse; |
37 | using OpenMetaverse.Packets; | ||
37 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
38 | using log4net; | 39 | using log4net; |
39 | using Nini.Config; | 40 | using Nini.Config; |
@@ -42,9 +43,8 @@ using OpenSim.Framework; | |||
42 | using OpenSim.Framework.Communications.Cache; | 43 | using OpenSim.Framework.Communications.Cache; |
43 | using OpenSim.Framework.Communications.Capabilities; | 44 | using OpenSim.Framework.Communications.Capabilities; |
44 | using OpenSim.Framework.Servers; | 45 | using OpenSim.Framework.Servers; |
45 | using OpenSim.Region.Environment.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Interfaces; | 47 | using OpenSim.Region.Framework.Scenes; |
47 | using OpenSim.Region.Environment.Scenes; | ||
48 | 48 | ||
49 | using OSD = OpenMetaverse.StructuredData.OSD; | 49 | using OSD = OpenMetaverse.StructuredData.OSD; |
50 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 50 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; |
@@ -555,5 +555,76 @@ namespace OpenSim.Region.Environment.Modules.Framework.EventQueue | |||
555 | 555 | ||
556 | return new OSDString("shutdown404!"); | 556 | return new OSDString("shutdown404!"); |
557 | } | 557 | } |
558 | |||
559 | public void DisableSimulator(ulong handle, UUID avatarID) | ||
560 | { | ||
561 | OSD item = EventQueueHelper.DisableSimulator(handle); | ||
562 | Enqueue(item, avatarID); | ||
563 | } | ||
564 | |||
565 | public void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID) | ||
566 | { | ||
567 | OSD item = EventQueueHelper.EnableSimulator(handle, endPoint); | ||
568 | Enqueue(item, avatarID); | ||
569 | } | ||
570 | |||
571 | public void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, string capsPath) | ||
572 | { | ||
573 | OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath); | ||
574 | Enqueue(item, avatarID); | ||
575 | } | ||
576 | |||
577 | public void TeleportFinishEvent(ulong regionHandle, byte simAccess, | ||
578 | IPEndPoint regionExternalEndPoint, | ||
579 | uint locationID, uint flags, string capsURL, | ||
580 | UUID avatarID) | ||
581 | { | ||
582 | OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint, | ||
583 | locationID, flags, capsURL, avatarID); | ||
584 | Enqueue(item, avatarID); | ||
585 | } | ||
586 | |||
587 | public void CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, | ||
588 | IPEndPoint newRegionExternalEndPoint, | ||
589 | string capsURL, UUID avatarID, UUID sessionID) | ||
590 | { | ||
591 | OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint, | ||
592 | capsURL, avatarID, sessionID); | ||
593 | Enqueue(item, avatarID); | ||
594 | } | ||
595 | |||
596 | public void ChatterboxInvitation(UUID sessionID, string sessionName, | ||
597 | UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, | ||
598 | uint timeStamp, bool offline, int parentEstateID, Vector3 position, | ||
599 | uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket) | ||
600 | { | ||
601 | OSD item = EventQueueHelper.ChatterboxInvitation(sessionID, sessionName, fromAgent, message, toAgent, fromName, dialog, | ||
602 | timeStamp, offline, parentEstateID, position, ttl, transactionID, | ||
603 | fromGroup, binaryBucket); | ||
604 | Enqueue(item, toAgent); | ||
605 | m_log.InfoFormat("########### eq ChatterboxInvitation #############\n{0}", item); | ||
606 | |||
607 | } | ||
608 | |||
609 | public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, | ||
610 | bool isModerator, bool textMute) | ||
611 | { | ||
612 | OSD item = EventQueueHelper.ChatterBoxSessionAgentListUpdates(sessionID, fromAgent, canVoiceChat, | ||
613 | isModerator, textMute); | ||
614 | Enqueue(item, toAgent); | ||
615 | m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); | ||
616 | } | ||
617 | |||
618 | public void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID) | ||
619 | { | ||
620 | OSD item = Environment.EventQueueHelper.ParcelProperties(parcelPropertiesPacket); | ||
621 | Enqueue(item, avatarID); | ||
622 | } | ||
623 | |||
624 | public void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) | ||
625 | { | ||
626 | OSD item = EventQueueHelper.GroupMembership(groupUpdate); | ||
627 | Enqueue(item, avatarID); | ||
628 | } | ||
558 | } | 629 | } |
559 | } | 630 | } |
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs index 546d9d1..b38ddba 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs | |||
@@ -71,11 +71,11 @@ namespace OpenSim.Region.Environment | |||
71 | return llsdEvent; | 71 | return llsdEvent; |
72 | } | 72 | } |
73 | 73 | ||
74 | public static OSD EnableSimulator(ulong Handle, IPEndPoint endPoint) | 74 | public static OSD EnableSimulator(ulong handle, IPEndPoint endPoint) |
75 | { | 75 | { |
76 | OSDMap llsdSimInfo = new OSDMap(3); | 76 | OSDMap llsdSimInfo = new OSDMap(3); |
77 | 77 | ||
78 | llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(Handle))); | 78 | llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle))); |
79 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); | 79 | llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); |
80 | llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); | 80 | llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); |
81 | 81 | ||
@@ -88,11 +88,11 @@ namespace OpenSim.Region.Environment | |||
88 | return buildEvent("EnableSimulator", llsdBody); | 88 | return buildEvent("EnableSimulator", llsdBody); |
89 | } | 89 | } |
90 | 90 | ||
91 | public static OSD DisableSimulator(ulong Handle) | 91 | public static OSD DisableSimulator(ulong handle) |
92 | { | 92 | { |
93 | //OSDMap llsdSimInfo = new OSDMap(1); | 93 | //OSDMap llsdSimInfo = new OSDMap(1); |
94 | 94 | ||
95 | //llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle))); | 95 | //llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(handle))); |
96 | 96 | ||
97 | //OSDArray arr = new OSDArray(1); | 97 | //OSDArray arr = new OSDArray(1); |
98 | //arr.Add(llsdSimInfo); | 98 | //arr.Add(llsdSimInfo); |
@@ -103,57 +103,57 @@ namespace OpenSim.Region.Environment | |||
103 | return buildEvent("DisableSimulator", llsdBody); | 103 | return buildEvent("DisableSimulator", llsdBody); |
104 | } | 104 | } |
105 | 105 | ||
106 | public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, | 106 | public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt, |
107 | IPEndPoint newRegionExternalEndPoint, | 107 | IPEndPoint newRegionExternalEndPoint, |
108 | string capsURL, UUID AgentID, UUID SessionID) | 108 | string capsURL, UUID agentID, UUID sessionID) |
109 | { | 109 | { |
110 | OSDArray LookAtArr = new OSDArray(3); | 110 | OSDArray lookAtArr = new OSDArray(3); |
111 | LookAtArr.Add(OSD.FromReal(lookAt.X)); | 111 | lookAtArr.Add(OSD.FromReal(lookAt.X)); |
112 | LookAtArr.Add(OSD.FromReal(lookAt.Y)); | 112 | lookAtArr.Add(OSD.FromReal(lookAt.Y)); |
113 | LookAtArr.Add(OSD.FromReal(lookAt.Z)); | 113 | lookAtArr.Add(OSD.FromReal(lookAt.Z)); |
114 | 114 | ||
115 | OSDArray PositionArr = new OSDArray(3); | 115 | OSDArray positionArr = new OSDArray(3); |
116 | PositionArr.Add(OSD.FromReal(pos.X)); | 116 | positionArr.Add(OSD.FromReal(pos.X)); |
117 | PositionArr.Add(OSD.FromReal(pos.Y)); | 117 | positionArr.Add(OSD.FromReal(pos.Y)); |
118 | PositionArr.Add(OSD.FromReal(pos.Z)); | 118 | positionArr.Add(OSD.FromReal(pos.Z)); |
119 | 119 | ||
120 | OSDMap InfoMap = new OSDMap(2); | 120 | OSDMap infoMap = new OSDMap(2); |
121 | InfoMap.Add("LookAt", LookAtArr); | 121 | infoMap.Add("LookAt", lookAtArr); |
122 | InfoMap.Add("Position", PositionArr); | 122 | infoMap.Add("Position", positionArr); |
123 | 123 | ||
124 | OSDArray InfoArr = new OSDArray(1); | 124 | OSDArray infoArr = new OSDArray(1); |
125 | InfoArr.Add(InfoMap); | 125 | infoArr.Add(infoMap); |
126 | 126 | ||
127 | OSDMap AgentDataMap = new OSDMap(2); | 127 | OSDMap agentDataMap = new OSDMap(2); |
128 | AgentDataMap.Add("AgentID", OSD.FromUUID(AgentID)); | 128 | agentDataMap.Add("AgentID", OSD.FromUUID(agentID)); |
129 | AgentDataMap.Add("SessionID", OSD.FromUUID(SessionID)); | 129 | agentDataMap.Add("SessionID", OSD.FromUUID(sessionID)); |
130 | 130 | ||
131 | OSDArray AgentDataArr = new OSDArray(1); | 131 | OSDArray agentDataArr = new OSDArray(1); |
132 | AgentDataArr.Add(AgentDataMap); | 132 | agentDataArr.Add(agentDataMap); |
133 | 133 | ||
134 | OSDMap RegionDataMap = new OSDMap(4); | 134 | OSDMap regionDataMap = new OSDMap(4); |
135 | RegionDataMap.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(Handle))); | 135 | regionDataMap.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(handle))); |
136 | RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); | 136 | regionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); |
137 | RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); | 137 | regionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); |
138 | RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); | 138 | regionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); |
139 | 139 | ||
140 | OSDArray RegionDataArr = new OSDArray(1); | 140 | OSDArray regionDataArr = new OSDArray(1); |
141 | RegionDataArr.Add(RegionDataMap); | 141 | regionDataArr.Add(regionDataMap); |
142 | 142 | ||
143 | OSDMap llsdBody = new OSDMap(3); | 143 | OSDMap llsdBody = new OSDMap(3); |
144 | llsdBody.Add("Info", InfoArr); | 144 | llsdBody.Add("Info", infoArr); |
145 | llsdBody.Add("AgentData", AgentDataArr); | 145 | llsdBody.Add("AgentData", agentDataArr); |
146 | llsdBody.Add("RegionData", RegionDataArr); | 146 | llsdBody.Add("RegionData", regionDataArr); |
147 | 147 | ||
148 | return buildEvent("CrossedRegion", llsdBody); | 148 | return buildEvent("CrossedRegion", llsdBody); |
149 | } | 149 | } |
150 | 150 | ||
151 | public static OSD TeleportFinishEvent( | 151 | public static OSD TeleportFinishEvent( |
152 | ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, | 152 | ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, |
153 | uint locationID, uint flags, string capsURL, UUID AgentID) | 153 | uint locationID, uint flags, string capsURL, UUID agentID) |
154 | { | 154 | { |
155 | OSDMap info = new OSDMap(); | 155 | OSDMap info = new OSDMap(); |
156 | info.Add("AgentID", OSD.FromUUID(AgentID)); | 156 | info.Add("AgentID", OSD.FromUUID(agentID)); |
157 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? | 157 | info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this? |
158 | info.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(regionHandle))); | 158 | info.Add("RegionHandle", OSD.FromBinary(ulongToByteArray(regionHandle))); |
159 | info.Add("SeedCapability", OSD.FromString(capsURL)); | 159 | info.Add("SeedCapability", OSD.FromString(capsURL)); |