aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Framework')
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs30
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs110
2 files changed, 70 insertions, 70 deletions
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
index c532ac0..3fc8005 100644
--- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
@@ -44,18 +44,18 @@ using OpenSim.Region.Environment.Interfaces;
44using OpenSim.Region.Interfaces; 44using OpenSim.Region.Interfaces;
45using OpenSim.Region.Environment.Scenes; 45using OpenSim.Region.Environment.Scenes;
46 46
47using LLSD = OpenMetaverse.StructuredData.LLSD; 47using OSD = OpenMetaverse.StructuredData.OSD;
48using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; 48using OSDMap = OpenMetaverse.StructuredData.OSDMap;
49using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; 49using OSDArray = OpenMetaverse.StructuredData.OSDArray;
50using Caps = OpenSim.Framework.Communications.Capabilities.Caps; 50using Caps = OpenSim.Framework.Communications.Capabilities.Caps;
51using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.LLSD>; 51using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.OSD>;
52 52
53namespace OpenSim.Region.Environment.Modules.Framework 53namespace OpenSim.Region.Environment.Modules.Framework
54{ 54{
55 public struct QueueItem 55 public struct QueueItem
56 { 56 {
57 public int id; 57 public int id;
58 public LLSDMap body; 58 public OSDMap body;
59 } 59 }
60 60
61 public class EventQueueGetModule : IEventQueue, IRegionModule 61 public class EventQueueGetModule : IEventQueue, IRegionModule
@@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
146 146
147 147
148 #region IEventQueue Members 148 #region IEventQueue Members
149 public bool Enqueue(LLSD ev, UUID avatarID) 149 public bool Enqueue(OSD ev, UUID avatarID)
150 { 150 {
151 m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); 151 m_log.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName);
152 try 152 try
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
308// } 308// }
309 309
310 BlockingLLSDQueue queue = GetQueue(agentID); 310 BlockingLLSDQueue queue = GetQueue(agentID);
311 LLSD element = queue.Dequeue(15000); // 15s timeout 311 OSD element = queue.Dequeue(15000); // 15s timeout
312 312
313 Hashtable responsedata = new Hashtable(); 313 Hashtable responsedata = new Hashtable();
314 314
@@ -337,7 +337,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
337 337
338 338
339 339
340 LLSDArray array = new LLSDArray(); 340 OSDArray array = new OSDArray();
341 if (element == null) // didn't have an event in 15s 341 if (element == null) // didn't have an event in 15s
342 { 342 {
343 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! 343 // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
@@ -354,10 +354,10 @@ namespace OpenSim.Region.Environment.Modules.Framework
354 } 354 }
355 } 355 }
356 356
357 LLSDMap events = new LLSDMap(); 357 OSDMap events = new OSDMap();
358 events.Add("events", array); 358 events.Add("events", array);
359 359
360 events.Add("id", new LLSDInteger(thisID)); 360 events.Add("id", new OSDInteger(thisID));
361 lock (m_ids) 361 lock (m_ids)
362 { 362 {
363 m_ids[agentID] = thisID + 1; 363 m_ids[agentID] = thisID + 1;
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
366 responsedata["int_response_code"] = 200; 366 responsedata["int_response_code"] = 200;
367 responsedata["content_type"] = "application/xml"; 367 responsedata["content_type"] = "application/xml";
368 responsedata["keepalive"] = false; 368 responsedata["keepalive"] = false;
369 responsedata["str_response_string"] = LLSDParser.SerializeXmlString(events); 369 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
370 m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); 370 m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
371 371
372 return responsedata; 372 return responsedata;
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
424 424
425 } 425 }
426 426
427 public LLSD EventQueueFallBack(string path, LLSD request, string endpoint) 427 public OSD EventQueueFallBack(string path, OSD request, string endpoint)
428 { 428 {
429 // This is a fallback element to keep the client from loosing EventQueueGet 429 // This is a fallback element to keep the client from loosing EventQueueGet
430 // Why does CAPS fail sometimes!? 430 // Why does CAPS fail sometimes!?
@@ -473,7 +473,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
473 thisID = m_ids[AvatarID]; 473 thisID = m_ids[AvatarID];
474 474
475 BlockingLLSDQueue queue = GetQueue(AvatarID); 475 BlockingLLSDQueue queue = GetQueue(AvatarID);
476 LLSDArray array = new LLSDArray(); 476 OSDArray array = new OSDArray();
477 LLSD element = queue.Dequeue(15000); // 15s timeout 477 LLSD element = queue.Dequeue(15000); // 15s timeout
478 if (element == null) 478 if (element == null)
479 { 479 {
@@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
489 thisID++; 489 thisID++;
490 } 490 }
491 } 491 }
492 LLSDMap events = new LLSDMap(); 492 OSDMap events = new OSDMap();
493 events.Add("events", array); 493 events.Add("events", array);
494 494
495 events.Add("id", new LLSDInteger(thisID)); 495 events.Add("id", new LLSDInteger(thisID));
@@ -512,7 +512,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
512 { 512 {
513 //return new LLSD(); 513 //return new LLSD();
514 } 514 }
515 return new LLSDString("shutdown404!"); 515 return new OSDString("shutdown404!");
516 } 516 }
517 } 517 }
518} 518}
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs
index 0d0eed2..21be82a 100644
--- a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs
@@ -52,70 +52,70 @@ namespace OpenSim.Region.Environment
52 }; 52 };
53 } 53 }
54 54
55 public static LLSD buildEvent(string eventName, LLSD eventBody) 55 public static OSD buildEvent(string eventName, OSD eventBody)
56 { 56 {
57 LLSDMap llsdEvent = new LLSDMap(2); 57 OSDMap llsdEvent = new OSDMap(2);
58 llsdEvent.Add("message", new LLSDString(eventName)); 58 llsdEvent.Add("message", new OSDString(eventName));
59 llsdEvent.Add("body", eventBody); 59 llsdEvent.Add("body", eventBody);
60 60
61 return llsdEvent; 61 return llsdEvent;
62 } 62 }
63 63
64 public static LLSD EnableSimulator(ulong Handle, IPEndPoint endPoint) 64 public static OSD EnableSimulator(ulong Handle, IPEndPoint endPoint)
65 { 65 {
66 LLSDMap llsdSimInfo = new LLSDMap(3); 66 OSDMap llsdSimInfo = new OSDMap(3);
67 67
68 llsdSimInfo.Add("Handle", new LLSDBinary(regionHandleToByteArray(Handle))); 68 llsdSimInfo.Add("Handle", new OSDBinary(regionHandleToByteArray(Handle)));
69 llsdSimInfo.Add("IP", new LLSDBinary(endPoint.Address.GetAddressBytes())); 69 llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes()));
70 llsdSimInfo.Add("Port", new LLSDInteger(endPoint.Port)); 70 llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port));
71 71
72 LLSDArray arr = new LLSDArray(1); 72 OSDArray arr = new OSDArray(1);
73 arr.Add(llsdSimInfo); 73 arr.Add(llsdSimInfo);
74 74
75 LLSDMap llsdBody = new LLSDMap(1); 75 OSDMap llsdBody = new OSDMap(1);
76 llsdBody.Add("SimulatorInfo", arr); 76 llsdBody.Add("SimulatorInfo", arr);
77 77
78 return buildEvent("EnableSimulator", llsdBody); 78 return buildEvent("EnableSimulator", llsdBody);
79 } 79 }
80 80
81 public static LLSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt, 81 public static OSD CrossRegion(ulong Handle, Vector3 pos, Vector3 lookAt,
82 IPEndPoint newRegionExternalEndPoint, 82 IPEndPoint newRegionExternalEndPoint,
83 string capsURL, UUID AgentID, UUID SessionID) 83 string capsURL, UUID AgentID, UUID SessionID)
84 { 84 {
85 LLSDArray LookAtArr = new LLSDArray(3); 85 OSDArray LookAtArr = new OSDArray(3);
86 LookAtArr.Add(LLSD.FromReal(lookAt.X)); 86 LookAtArr.Add(OSD.FromReal(lookAt.X));
87 LookAtArr.Add(LLSD.FromReal(lookAt.Y)); 87 LookAtArr.Add(OSD.FromReal(lookAt.Y));
88 LookAtArr.Add(LLSD.FromReal(lookAt.Z)); 88 LookAtArr.Add(OSD.FromReal(lookAt.Z));
89 89
90 LLSDArray PositionArr = new LLSDArray(3); 90 OSDArray PositionArr = new OSDArray(3);
91 PositionArr.Add(LLSD.FromReal(pos.X)); 91 PositionArr.Add(OSD.FromReal(pos.X));
92 PositionArr.Add(LLSD.FromReal(pos.Y)); 92 PositionArr.Add(OSD.FromReal(pos.Y));
93 PositionArr.Add(LLSD.FromReal(pos.Z)); 93 PositionArr.Add(OSD.FromReal(pos.Z));
94 94
95 LLSDMap InfoMap = new LLSDMap(2); 95 OSDMap InfoMap = new OSDMap(2);
96 InfoMap.Add("LookAt", LookAtArr); 96 InfoMap.Add("LookAt", LookAtArr);
97 InfoMap.Add("Position", PositionArr); 97 InfoMap.Add("Position", PositionArr);
98 98
99 LLSDArray InfoArr = new LLSDArray(1); 99 OSDArray InfoArr = new OSDArray(1);
100 InfoArr.Add(InfoMap); 100 InfoArr.Add(InfoMap);
101 101
102 LLSDMap AgentDataMap = new LLSDMap(2); 102 OSDMap AgentDataMap = new OSDMap(2);
103 AgentDataMap.Add("AgentID", LLSD.FromUUID(AgentID)); 103 AgentDataMap.Add("AgentID", OSD.FromUUID(AgentID));
104 AgentDataMap.Add("SessionID", LLSD.FromUUID(SessionID)); 104 AgentDataMap.Add("SessionID", OSD.FromUUID(SessionID));
105 105
106 LLSDArray AgentDataArr = new LLSDArray(1); 106 OSDArray AgentDataArr = new OSDArray(1);
107 AgentDataArr.Add(AgentDataMap); 107 AgentDataArr.Add(AgentDataMap);
108 108
109 LLSDMap RegionDataMap = new LLSDMap(4); 109 OSDMap RegionDataMap = new OSDMap(4);
110 RegionDataMap.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(Handle))); 110 RegionDataMap.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(Handle)));
111 RegionDataMap.Add("SeedCapability", LLSD.FromString(capsURL)); 111 RegionDataMap.Add("SeedCapability", OSD.FromString(capsURL));
112 RegionDataMap.Add("SimIP", LLSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); 112 RegionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes()));
113 RegionDataMap.Add("SimPort", LLSD.FromInteger(newRegionExternalEndPoint.Port)); 113 RegionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port));
114 114
115 LLSDArray RegionDataArr = new LLSDArray(1); 115 OSDArray RegionDataArr = new OSDArray(1);
116 RegionDataArr.Add(RegionDataMap); 116 RegionDataArr.Add(RegionDataMap);
117 117
118 LLSDMap llsdBody = new LLSDMap(3); 118 OSDMap llsdBody = new OSDMap(3);
119 llsdBody.Add("Info", InfoArr); 119 llsdBody.Add("Info", InfoArr);
120 llsdBody.Add("AgentData", AgentDataArr); 120 llsdBody.Add("AgentData", AgentDataArr);
121 llsdBody.Add("RegionData", RegionDataArr); 121 llsdBody.Add("RegionData", RegionDataArr);
@@ -123,49 +123,49 @@ namespace OpenSim.Region.Environment
123 return buildEvent("CrossedRegion", llsdBody); 123 return buildEvent("CrossedRegion", llsdBody);
124 } 124 }
125 125
126 public static LLSD TeleportFinishEvent( 126 public static OSD TeleportFinishEvent(
127 ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, 127 ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint,
128 uint locationID, uint flags, string capsURL, UUID AgentID) 128 uint locationID, uint flags, string capsURL, UUID AgentID)
129 { 129 {
130 LLSDMap info = new LLSDMap(); 130 OSDMap info = new OSDMap();
131 info.Add("AgentID", LLSD.FromUUID(AgentID)); 131 info.Add("AgentID", OSD.FromUUID(AgentID));
132 info.Add("LocationID", LLSD.FromInteger(4)); // TODO what is this? 132 info.Add("LocationID", OSD.FromInteger(4)); // TODO what is this?
133 info.Add("RegionHandle", LLSD.FromBinary(regionHandleToByteArray(regionHandle))); 133 info.Add("RegionHandle", OSD.FromBinary(regionHandleToByteArray(regionHandle)));
134 info.Add("SeedCapability", LLSD.FromString(capsURL)); 134 info.Add("SeedCapability", OSD.FromString(capsURL));
135 info.Add("SimAccess", LLSD.FromInteger(simAccess)); 135 info.Add("SimAccess", OSD.FromInteger(simAccess));
136 info.Add("SimIP", LLSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); 136 info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
137 info.Add("SimPort", LLSD.FromInteger(regionExternalEndPoint.Port)); 137 info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port));
138 info.Add("TeleportFlags", LLSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation 138 info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
139 139
140 LLSDArray infoArr = new LLSDArray(); 140 OSDArray infoArr = new OSDArray();
141 infoArr.Add(info); 141 infoArr.Add(info);
142 142
143 LLSDMap body = new LLSDMap(); 143 OSDMap body = new OSDMap();
144 body.Add("Info", infoArr); 144 body.Add("Info", infoArr);
145 145
146 return buildEvent("TeleportFinish", body); 146 return buildEvent("TeleportFinish", body);
147 } 147 }
148 148
149 public static LLSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono) 149 public static OSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono)
150 { 150 {
151 LLSDMap script = new LLSDMap(); 151 OSDMap script = new OSDMap();
152 script.Add("ObjectID", LLSD.FromUUID(objectID)); 152 script.Add("ObjectID", OSD.FromUUID(objectID));
153 script.Add("ItemID", LLSD.FromUUID(itemID)); 153 script.Add("ItemID", OSD.FromUUID(itemID));
154 script.Add("Running", LLSD.FromBoolean(running)); 154 script.Add("Running", OSD.FromBoolean(running));
155 script.Add("Mono", LLSD.FromBoolean(mono)); 155 script.Add("Mono", OSD.FromBoolean(mono));
156 156
157 LLSDArray scriptArr = new LLSDArray(); 157 OSDArray scriptArr = new OSDArray();
158 scriptArr.Add(script); 158 scriptArr.Add(script);
159 159
160 LLSDMap body = new LLSDMap(); 160 OSDMap body = new OSDMap();
161 body.Add("Script", scriptArr); 161 body.Add("Script", scriptArr);
162 162
163 return buildEvent("ScriptRunningReply", body); 163 return buildEvent("ScriptRunningReply", body);
164 } 164 }
165 165
166 public static LLSD KeepAliveEvent() 166 public static OSD KeepAliveEvent()
167 { 167 {
168 return buildEvent("FAKEEVENT", new LLSDMap()); 168 return buildEvent("FAKEEVENT", new OSDMap());
169 } 169 }
170 } 170 }
171} 171}