diff options
author | Teravus Ovares | 2008-10-03 09:53:49 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-10-03 09:53:49 +0000 |
commit | 8de395d379ba3278b2160b66dd8da7f973a2cf10 (patch) | |
tree | 58d3f43d7ef9d9d6a48c189cd7d607e54dcbcded /OpenSim | |
parent | Reintroduces the discovery mechanism to use llRequestSimulatorData("", 128) (diff) | |
download | opensim-SC-8de395d379ba3278b2160b66dd8da7f973a2cf10.zip opensim-SC-8de395d379ba3278b2160b66dd8da7f973a2cf10.tar.gz opensim-SC-8de395d379ba3278b2160b66dd8da7f973a2cf10.tar.bz2 opensim-SC-8de395d379ba3278b2160b66dd8da7f973a2cf10.tar.xz |
* EventQueueGet is now working.
* Switched it on by default
* Updated OpenSim.ini.example to reflect this
* Caught a UDP Server issue that occurs when the network pipe is saturated
* Still experimental :D
Diffstat (limited to 'OpenSim')
5 files changed, 344 insertions, 27 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index b6776f2..da0ce79 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -593,14 +593,26 @@ namespace OpenSim.Framework.Servers | |||
593 | case "text/xml": | 593 | case "text/xml": |
594 | case "application/xml": | 594 | case "application/xml": |
595 | default: | 595 | default: |
596 | // Point of note.. the DoWeHaveA methods check for an EXACT path | ||
597 | if (request.RawUrl.Contains("/CAPS/EQG")) | ||
598 | { | ||
599 | int i = 1; | ||
600 | } | ||
596 | if (DoWeHaveALLSDHandler(request.RawUrl)) | 601 | if (DoWeHaveALLSDHandler(request.RawUrl)) |
597 | { | 602 | { |
598 | // Check if we have a LLSD handler here for the EXACT path. | ||
599 | HandleLLSDRequests(request, response); | 603 | HandleLLSDRequests(request, response); |
604 | return; | ||
605 | } | ||
600 | 606 | ||
607 | if (DoWeHaveAHTTPHandler(request.RawUrl)) | ||
608 | { | ||
609 | HandleHTTPRequest(request, response); | ||
601 | return; | 610 | return; |
602 | } | 611 | } |
612 | |||
613 | // generic login request. | ||
603 | HandleXmlRpcRequests(request, response); | 614 | HandleXmlRpcRequests(request, response); |
615 | |||
604 | return; | 616 | return; |
605 | } | 617 | } |
606 | } | 618 | } |
@@ -846,11 +858,21 @@ namespace OpenSim.Framework.Servers | |||
846 | { | 858 | { |
847 | llsdResponse = GenerateNoLLSDHandlerResponse(); | 859 | llsdResponse = GenerateNoLLSDHandlerResponse(); |
848 | } | 860 | } |
861 | byte[] buffer = new byte[0]; | ||
862 | if (llsdResponse.ToString() == "shutdown404!") | ||
863 | { | ||
864 | response.ContentType = "text/plain"; | ||
865 | response.StatusCode = 404; | ||
866 | response.StatusDescription = "Not Found"; | ||
867 | response.ProtocolVersion = "HTTP/1.0"; | ||
868 | buffer = Encoding.UTF8.GetBytes("Not found"); | ||
869 | } | ||
870 | else | ||
871 | { | ||
872 | response.ContentType = "application/llsd+xml"; | ||
849 | 873 | ||
850 | response.ContentType = "application/llsd+xml"; | 874 | buffer = LLSDParser.SerializeXmlBytes(llsdResponse); |
851 | 875 | } | |
852 | byte[] buffer = LLSDParser.SerializeXmlBytes(llsdResponse); | ||
853 | |||
854 | response.SendChunked = false; | 876 | response.SendChunked = false; |
855 | response.ContentLength64 = buffer.Length; | 877 | response.ContentLength64 = buffer.Length; |
856 | response.ContentEncoding = Encoding.UTF8; | 878 | response.ContentEncoding = Encoding.UTF8; |
@@ -878,6 +900,11 @@ namespace OpenSim.Framework.Servers | |||
878 | } | 900 | } |
879 | } | 901 | } |
880 | 902 | ||
903 | /// <summary> | ||
904 | /// Checks if we have an Exact path in the LLSD handlers for the path provided | ||
905 | /// </summary> | ||
906 | /// <param name="path">URI of the request</param> | ||
907 | /// <returns>true if we have one, false if not</returns> | ||
881 | private bool DoWeHaveALLSDHandler(string path) | 908 | private bool DoWeHaveALLSDHandler(string path) |
882 | { | 909 | { |
883 | 910 | ||
@@ -908,6 +935,59 @@ namespace OpenSim.Framework.Servers | |||
908 | } | 935 | } |
909 | 936 | ||
910 | // extra kicker to remove the default XMLRPC login case.. just in case.. | 937 | // extra kicker to remove the default XMLRPC login case.. just in case.. |
938 | if (path != "/" && bestMatch == "/" && searchquery != "/") | ||
939 | return false; | ||
940 | |||
941 | if (path == "/") | ||
942 | return false; | ||
943 | |||
944 | if (String.IsNullOrEmpty(bestMatch)) | ||
945 | { | ||
946 | |||
947 | return false; | ||
948 | } | ||
949 | else | ||
950 | { | ||
951 | |||
952 | return true; | ||
953 | } | ||
954 | } | ||
955 | |||
956 | /// <summary> | ||
957 | /// Checks if we have an Exact path in the HTTP handlers for the path provided | ||
958 | /// </summary> | ||
959 | /// <param name="path">URI of the request</param> | ||
960 | /// <returns>true if we have one, false if not</returns> | ||
961 | private bool DoWeHaveAHTTPHandler(string path) | ||
962 | { | ||
963 | |||
964 | string[] pathbase = path.Split('/'); | ||
965 | string searchquery = "/"; | ||
966 | |||
967 | if (pathbase.Length < 1) | ||
968 | return false; | ||
969 | |||
970 | for (int i = 1; i < pathbase.Length; i++) | ||
971 | { | ||
972 | searchquery += pathbase[i]; | ||
973 | if (pathbase.Length - 1 != i) | ||
974 | searchquery += "/"; | ||
975 | } | ||
976 | |||
977 | string bestMatch = null; | ||
978 | |||
979 | foreach (string pattern in m_HTTPHandlers.Keys) | ||
980 | { | ||
981 | |||
982 | if (searchquery.StartsWith(pattern) && searchquery.Length >= pattern.Length) | ||
983 | { | ||
984 | |||
985 | bestMatch = pattern; | ||
986 | |||
987 | } | ||
988 | } | ||
989 | |||
990 | // extra kicker to remove the default XMLRPC login case.. just in case.. | ||
911 | if (path == "/") | 991 | if (path == "/") |
912 | return false; | 992 | return false; |
913 | 993 | ||
@@ -1074,7 +1154,7 @@ namespace OpenSim.Framework.Servers | |||
1074 | Encoding encoding = Encoding.UTF8; | 1154 | Encoding encoding = Encoding.UTF8; |
1075 | StreamReader reader = new StreamReader(requestStream, encoding); | 1155 | StreamReader reader = new StreamReader(requestStream, encoding); |
1076 | 1156 | ||
1077 | //string requestBody = reader.ReadToEnd(); | 1157 | string requestBody = reader.ReadToEnd(); |
1078 | // avoid warning for now | 1158 | // avoid warning for now |
1079 | reader.ReadToEnd(); | 1159 | reader.ReadToEnd(); |
1080 | reader.Close(); | 1160 | reader.Close(); |
@@ -1087,6 +1167,10 @@ namespace OpenSim.Framework.Servers | |||
1087 | string[] querystringkeys = request.QueryString.AllKeys; | 1167 | string[] querystringkeys = request.QueryString.AllKeys; |
1088 | string[] rHeaders = request.Headers.AllKeys; | 1168 | string[] rHeaders = request.Headers.AllKeys; |
1089 | 1169 | ||
1170 | keysvals.Add("body", requestBody); | ||
1171 | keysvals.Add("uri", request.RawUrl); | ||
1172 | keysvals.Add("content-type", request.ContentType); | ||
1173 | |||
1090 | 1174 | ||
1091 | foreach (string queryname in querystringkeys) | 1175 | foreach (string queryname in querystringkeys) |
1092 | { | 1176 | { |
@@ -1113,8 +1197,26 @@ namespace OpenSim.Framework.Servers | |||
1113 | bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); | 1197 | bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); |
1114 | if (foundHandler) | 1198 | if (foundHandler) |
1115 | { | 1199 | { |
1116 | Hashtable responsedata = requestprocessor(keysvals); | 1200 | Hashtable responsedata1 = requestprocessor(keysvals); |
1117 | DoHTTPGruntWork(responsedata,response); | 1201 | DoHTTPGruntWork(responsedata1,response); |
1202 | |||
1203 | //SendHTML500(response); | ||
1204 | } | ||
1205 | else | ||
1206 | { | ||
1207 | //m_log.Warn("[HTTP]: Handler Not Found"); | ||
1208 | SendHTML404(response, host); | ||
1209 | } | ||
1210 | } | ||
1211 | else | ||
1212 | { | ||
1213 | |||
1214 | GenericHTTPMethod requestprocessor; | ||
1215 | bool foundHandler = TryGetHTTPHandlerPathBased(request.RawUrl, out requestprocessor); | ||
1216 | if (foundHandler) | ||
1217 | { | ||
1218 | Hashtable responsedata2 = requestprocessor(keysvals); | ||
1219 | DoHTTPGruntWork(responsedata2, response); | ||
1118 | 1220 | ||
1119 | //SendHTML500(response); | 1221 | //SendHTML500(response); |
1120 | } | 1222 | } |
@@ -1124,10 +1226,67 @@ namespace OpenSim.Framework.Servers | |||
1124 | SendHTML404(response, host); | 1226 | SendHTML404(response, host); |
1125 | } | 1227 | } |
1126 | } | 1228 | } |
1229 | } | ||
1230 | |||
1231 | private bool TryGetHTTPHandlerPathBased(string path, out GenericHTTPMethod httpHandler) | ||
1232 | { | ||
1233 | httpHandler = null; | ||
1234 | // Pull out the first part of the path | ||
1235 | // splitting the path by '/' means we'll get the following return.. | ||
1236 | // {0}/{1}/{2} | ||
1237 | // where {0} isn't something we really control 100% | ||
1238 | |||
1239 | string[] pathbase = path.Split('/'); | ||
1240 | string searchquery = "/"; | ||
1241 | |||
1242 | if (pathbase.Length < 1) | ||
1243 | return false; | ||
1244 | |||
1245 | for (int i = 1; i < pathbase.Length; i++) | ||
1246 | { | ||
1247 | searchquery += pathbase[i]; | ||
1248 | if (pathbase.Length - 1 != i) | ||
1249 | searchquery += "/"; | ||
1250 | } | ||
1251 | |||
1252 | // while the matching algorithm below doesn't require it, we're expecting a query in the form | ||
1253 | // | ||
1254 | // [] = optional | ||
1255 | // /resource/UUID/action[/action] | ||
1256 | // | ||
1257 | // now try to get the closest match to the reigstered path | ||
1258 | // at least for OGP, registered path would probably only consist of the /resource/ | ||
1259 | |||
1260 | string bestMatch = null; | ||
1261 | |||
1262 | foreach (string pattern in m_HTTPHandlers.Keys) | ||
1263 | { | ||
1264 | if (searchquery.ToLower().StartsWith(pattern.ToLower())) | ||
1265 | { | ||
1266 | if (String.IsNullOrEmpty(bestMatch) || searchquery.Length > bestMatch.Length) | ||
1267 | { | ||
1268 | // You have to specifically register for '/' and to get it, you must specificaly request it | ||
1269 | // | ||
1270 | if (pattern == "/" && searchquery == "/" || pattern != "/") | ||
1271 | bestMatch = pattern; | ||
1272 | } | ||
1273 | } | ||
1274 | } | ||
1275 | |||
1276 | |||
1277 | |||
1278 | if (String.IsNullOrEmpty(bestMatch)) | ||
1279 | { | ||
1280 | httpHandler = null; | ||
1281 | return false; | ||
1282 | } | ||
1127 | else | 1283 | else |
1128 | { | 1284 | { |
1129 | //m_log.Warn("[HTTP]: No Method specified"); | 1285 | if (bestMatch == "/" && searchquery != "/") |
1130 | SendHTML404(response, host); | 1286 | return false; |
1287 | |||
1288 | httpHandler = m_HTTPHandlers[bestMatch]; | ||
1289 | return true; | ||
1131 | } | 1290 | } |
1132 | } | 1291 | } |
1133 | 1292 | ||
@@ -1342,6 +1501,11 @@ namespace OpenSim.Framework.Servers | |||
1342 | 1501 | ||
1343 | public void RemoveHTTPHandler(string httpMethod, string path) | 1502 | public void RemoveHTTPHandler(string httpMethod, string path) |
1344 | { | 1503 | { |
1504 | if (httpMethod != null && httpMethod.Length == 0) | ||
1505 | { | ||
1506 | m_HTTPHandlers.Remove(path); | ||
1507 | return; | ||
1508 | } | ||
1345 | m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); | 1509 | m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); |
1346 | } | 1510 | } |
1347 | 1511 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index f56c0bf..c20c7bc 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -449,7 +449,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
449 | else | 449 | else |
450 | { | 450 | { |
451 | //MainLog.Instance.Verbose("UDPSERVER", "SendPacketTo : client " + sendto.ToString()); | 451 | //MainLog.Instance.Verbose("UDPSERVER", "SendPacketTo : client " + sendto.ToString()); |
452 | m_socket.SendTo(buffer, size, flags, sendto); | 452 | try |
453 | { | ||
454 | m_socket.SendTo(buffer, size, flags, sendto); | ||
455 | } | ||
456 | catch (SocketException SockE) | ||
457 | { | ||
458 | m_log.ErrorFormat("[UDPSERVER]: Caught Socket Error in the send buffer!. {0}",SockE.ToString()); | ||
459 | } | ||
453 | } | 460 | } |
454 | } | 461 | } |
455 | } | 462 | } |
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs index 1726ea2..2eb1618 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs | |||
@@ -90,7 +90,8 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
90 | 90 | ||
91 | // Register fallback handler | 91 | // Register fallback handler |
92 | // Why does EQG Fail on region crossings! | 92 | // Why does EQG Fail on region crossings! |
93 | scene.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); | 93 | |
94 | //scene.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); | ||
94 | 95 | ||
95 | scene.EventManager.OnNewClient += OnNewClient; | 96 | scene.EventManager.OnNewClient += OnNewClient; |
96 | scene.EventManager.OnClientClosed += ClientClosed; | 97 | scene.EventManager.OnClientClosed += ClientClosed; |
@@ -109,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
109 | 110 | ||
110 | private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) | 111 | private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) |
111 | { | 112 | { |
112 | enabledYN = startupConfig.GetBoolean("EventQueue", false); | 113 | enabledYN = startupConfig.GetBoolean("EventQueue", true); |
113 | } | 114 | } |
114 | 115 | ||
115 | public void PostInitialise() | 116 | public void PostInitialise() |
@@ -166,6 +167,44 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
166 | private void ClientClosed(UUID AgentID) | 167 | private void ClientClosed(UUID AgentID) |
167 | { | 168 | { |
168 | queues.Remove(AgentID); | 169 | queues.Remove(AgentID); |
170 | List<UUID> removeitems = new List<UUID>(); | ||
171 | lock (m_AvatarQueueUUIDMapping) | ||
172 | { | ||
173 | foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys) | ||
174 | { | ||
175 | if (ky == AgentID) | ||
176 | { | ||
177 | removeitems.Add(ky); | ||
178 | } | ||
179 | } | ||
180 | |||
181 | foreach (UUID ky in removeitems) | ||
182 | { | ||
183 | m_AvatarQueueUUIDMapping.Remove(ky); | ||
184 | m_scene.RemoveHTTPHandler("","/CAPS/EQG/" + ky.ToString() + "/"); | ||
185 | } | ||
186 | |||
187 | } | ||
188 | UUID searchval = UUID.Zero; | ||
189 | |||
190 | removeitems.Clear(); | ||
191 | |||
192 | lock (m_QueueUUIDAvatarMapping) | ||
193 | { | ||
194 | foreach (UUID ky in m_QueueUUIDAvatarMapping.Keys) | ||
195 | { | ||
196 | searchval = m_QueueUUIDAvatarMapping[ky]; | ||
197 | |||
198 | if (searchval == AgentID) | ||
199 | { | ||
200 | removeitems.Add(ky); | ||
201 | } | ||
202 | } | ||
203 | |||
204 | foreach (UUID ky in removeitems) | ||
205 | m_QueueUUIDAvatarMapping.Remove(ky); | ||
206 | |||
207 | } | ||
169 | m_log.DebugFormat("[EVENTQUEUE]: Client {0} deregistered in region {1}.", AgentID, m_scene.RegionInfo.RegionName); | 208 | m_log.DebugFormat("[EVENTQUEUE]: Client {0} deregistered in region {1}.", AgentID, m_scene.RegionInfo.RegionName); |
170 | } | 209 | } |
171 | 210 | ||
@@ -177,15 +216,15 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
177 | 216 | ||
178 | private void MakeChildAgent(ScenePresence avatar) | 217 | private void MakeChildAgent(ScenePresence avatar) |
179 | { | 218 | { |
180 | m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0} in region {1}.", avatar.UUID, m_scene.RegionInfo.RegionName); | 219 | //m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0} in region {1}.", avatar.UUID, m_scene.RegionInfo.RegionName); |
181 | lock (m_ids) | 220 | //lock (m_ids) |
182 | { | 221 | // { |
183 | if (m_ids.ContainsKey(avatar.UUID)) | 222 | //if (m_ids.ContainsKey(avatar.UUID)) |
184 | { | 223 | //{ |
185 | // close the event queue. | 224 | // close the event queue. |
186 | //m_ids[avatar.UUID] = -1; | 225 | //m_ids[avatar.UUID] = -1; |
187 | } | 226 | //} |
188 | } | 227 | //} |
189 | } | 228 | } |
190 | 229 | ||
191 | public void OnRegisterCaps(UUID agentID, Caps caps) | 230 | public void OnRegisterCaps(UUID agentID, Caps caps) |
@@ -222,12 +261,18 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
222 | } | 261 | } |
223 | 262 | ||
224 | m_log.DebugFormat("[EVENTQUEUE]: CAPS URL: {0}", capsBase + EventQueueGetUUID.ToString() + "/"); | 263 | m_log.DebugFormat("[EVENTQUEUE]: CAPS URL: {0}", capsBase + EventQueueGetUUID.ToString() + "/"); |
264 | // Register this as a caps handler | ||
225 | caps.RegisterHandler("EventQueueGet", | 265 | caps.RegisterHandler("EventQueueGet", |
226 | new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString(), | 266 | new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/", |
227 | delegate(Hashtable m_dhttpMethod) | 267 | delegate(Hashtable m_dhttpMethod) |
228 | { | 268 | { |
229 | return ProcessQueue(m_dhttpMethod,agentID, caps); | 269 | return ProcessQueue(m_dhttpMethod,agentID, caps); |
230 | })); | 270 | })); |
271 | |||
272 | bool boolval = false; | ||
273 | // This will persist this beyond the expiry of the caps handlers | ||
274 | boolval = m_scene.AddHTTPHandler(capsBase + EventQueueGetUUID.ToString() + "/", EventQueuePath2); | ||
275 | |||
231 | Random rnd = new Random(System.Environment.TickCount); | 276 | Random rnd = new Random(System.Environment.TickCount); |
232 | lock (m_ids) | 277 | lock (m_ids) |
233 | { | 278 | { |
@@ -262,6 +307,14 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
262 | 307 | ||
263 | if (element == null) | 308 | if (element == null) |
264 | { | 309 | { |
310 | if (thisID == -1) // close-request | ||
311 | { | ||
312 | responsedata["int_response_code"] = 404; | ||
313 | responsedata["content_type"] = "text/plain"; | ||
314 | responsedata["keepalive"] = false; | ||
315 | responsedata["str_response_string"] = ""; | ||
316 | return responsedata; | ||
317 | } | ||
265 | responsedata["int_response_code"] = 502; | 318 | responsedata["int_response_code"] = 502; |
266 | responsedata["content_type"] = "text/plain"; | 319 | responsedata["content_type"] = "text/plain"; |
267 | responsedata["keepalive"] = false; | 320 | responsedata["keepalive"] = false; |
@@ -272,6 +325,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
272 | } | 325 | } |
273 | 326 | ||
274 | 327 | ||
328 | |||
275 | LLSDArray array = new LLSDArray(); | 329 | LLSDArray array = new LLSDArray(); |
276 | if (element == null) // didn't have an event in 15s | 330 | if (element == null) // didn't have an event in 15s |
277 | { | 331 | { |
@@ -306,6 +360,59 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
306 | 360 | ||
307 | return responsedata; | 361 | return responsedata; |
308 | } | 362 | } |
363 | |||
364 | public Hashtable EventQueuePath2(Hashtable request) | ||
365 | { | ||
366 | string capuuid = (string)request["uri"]; //path.Replace("/CAPS/EQG/",""); | ||
367 | // pull off the last "/" in the path. | ||
368 | Hashtable responsedata = new Hashtable(); | ||
369 | capuuid = capuuid.Substring(0, capuuid.Length - 1); | ||
370 | capuuid = capuuid.Replace("/CAPS/EQG/", ""); | ||
371 | UUID AvatarID = UUID.Zero; | ||
372 | UUID capUUID = UUID.Zero; | ||
373 | |||
374 | // parse the path and search for the avatar with it registered | ||
375 | if (UUID.TryParse(capuuid, out capUUID)) | ||
376 | { | ||
377 | lock (m_QueueUUIDAvatarMapping) | ||
378 | { | ||
379 | if (m_QueueUUIDAvatarMapping.ContainsKey(capUUID)) | ||
380 | { | ||
381 | AvatarID = m_QueueUUIDAvatarMapping[capUUID]; | ||
382 | } | ||
383 | } | ||
384 | if (AvatarID != UUID.Zero) | ||
385 | { | ||
386 | // m_scene.GetCapsHandlerForUser will return null if the agent doesn't have a caps handler | ||
387 | // registered | ||
388 | return ProcessQueue(request, AvatarID, m_scene.GetCapsHandlerForUser(AvatarID)); | ||
389 | } | ||
390 | else | ||
391 | { | ||
392 | responsedata["int_response_code"] = 404; | ||
393 | responsedata["content_type"] = "text/plain"; | ||
394 | responsedata["keepalive"] = false; | ||
395 | responsedata["str_response_string"] = "Not Found"; | ||
396 | responsedata["error_status_text"] = "Not Found"; | ||
397 | responsedata["http_protocol_version"] = "HTTP/1.0"; | ||
398 | return responsedata; | ||
399 | // return 404 | ||
400 | } | ||
401 | } | ||
402 | else | ||
403 | { | ||
404 | responsedata["int_response_code"] = 404; | ||
405 | responsedata["content_type"] = "text/plain"; | ||
406 | responsedata["keepalive"] = false; | ||
407 | responsedata["str_response_string"] = "Not Found"; | ||
408 | responsedata["error_status_text"] = "Not Found"; | ||
409 | responsedata["http_protocol_version"] = "HTTP/1.0"; | ||
410 | return responsedata; | ||
411 | // return 404 | ||
412 | } | ||
413 | |||
414 | } | ||
415 | |||
309 | public LLSD EventQueueFallBack(string path, LLSD request, string endpoint) | 416 | public LLSD EventQueueFallBack(string path, LLSD request, string endpoint) |
310 | { | 417 | { |
311 | // This is a fallback element to keep the client from loosing EventQueueGet | 418 | // This is a fallback element to keep the client from loosing EventQueueGet |
@@ -318,7 +425,9 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
318 | UUID capUUID = UUID.Zero; | 425 | UUID capUUID = UUID.Zero; |
319 | if (UUID.TryParse(capuuid, out capUUID)) | 426 | if (UUID.TryParse(capuuid, out capUUID)) |
320 | { | 427 | { |
321 | 428 | /* Don't remove this yet code cleaners! | |
429 | * Still testing this! | ||
430 | * | ||
322 | lock (m_QueueUUIDAvatarMapping) | 431 | lock (m_QueueUUIDAvatarMapping) |
323 | { | 432 | { |
324 | if (m_QueueUUIDAvatarMapping.ContainsKey(capUUID)) | 433 | if (m_QueueUUIDAvatarMapping.ContainsKey(capUUID)) |
@@ -326,8 +435,28 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
326 | AvatarID = m_QueueUUIDAvatarMapping[capUUID]; | 435 | AvatarID = m_QueueUUIDAvatarMapping[capUUID]; |
327 | } | 436 | } |
328 | } | 437 | } |
438 | |||
439 | |||
329 | if (AvatarID != UUID.Zero) | 440 | if (AvatarID != UUID.Zero) |
330 | { | 441 | { |
442 | // Repair the CAP! | ||
443 | //OpenSim.Framework.Communications.Capabilities.Caps caps = m_scene.GetCapsHandlerForUser(AvatarID); | ||
444 | //string capsBase = "/CAPS/EQG/"; | ||
445 | //caps.RegisterHandler("EventQueueGet", | ||
446 | //new RestHTTPHandler("POST", capsBase + capUUID.ToString() + "/", | ||
447 | //delegate(Hashtable m_dhttpMethod) | ||
448 | //{ | ||
449 | // return ProcessQueue(m_dhttpMethod, AvatarID, caps); | ||
450 | //})); | ||
451 | // start new ID sequence. | ||
452 | Random rnd = new Random(System.Environment.TickCount); | ||
453 | lock (m_ids) | ||
454 | { | ||
455 | if (!m_ids.ContainsKey(AvatarID)) | ||
456 | m_ids.Add(AvatarID, rnd.Next(30000000)); | ||
457 | } | ||
458 | |||
459 | |||
331 | int thisID = 0; | 460 | int thisID = 0; |
332 | lock (m_ids) | 461 | lock (m_ids) |
333 | thisID = m_ids[AvatarID]; | 462 | thisID = m_ids[AvatarID]; |
@@ -365,11 +494,14 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
365 | { | 494 | { |
366 | return new LLSD(); | 495 | return new LLSD(); |
367 | } | 496 | } |
497 | * | ||
498 | */ | ||
368 | } | 499 | } |
369 | else | 500 | else |
370 | { | 501 | { |
371 | return new LLSD(); | 502 | //return new LLSD(); |
372 | } | 503 | } |
504 | return new LLSDString("shutdown404!"); | ||
373 | } | 505 | } |
374 | } | 506 | } |
375 | } | 507 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapSearchModule.cs index 9a522ff..1a15585 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapSearchModule.cs | |||
@@ -83,7 +83,12 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap | |||
83 | // TODO currently, this only returns one region per name. LL servers will return all starting with the provided name. | 83 | // TODO currently, this only returns one region per name. LL servers will return all starting with the provided name. |
84 | RegionInfo info = m_scene.SceneGridService.RequestClosestRegion(mapName); | 84 | RegionInfo info = m_scene.SceneGridService.RequestClosestRegion(mapName); |
85 | // fetch the mapblock of the named sim. We need this anyway (we have the map open, and just jumped to the sim), | 85 | // fetch the mapblock of the named sim. We need this anyway (we have the map open, and just jumped to the sim), |
86 | // so there shouldn't be any penalty for that. | 86 | // so there shouldn't be any penalty for that. |
87 | if (info == null) | ||
88 | { | ||
89 | m_log.Warn("[MAPSEARCHMODULE]: Got Null Region Question!"); | ||
90 | return; | ||
91 | } | ||
87 | List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)info.RegionLocX, | 92 | List<MapBlockData> mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks((int)info.RegionLocX, |
88 | (int)info.RegionLocY, | 93 | (int)info.RegionLocY, |
89 | (int)info.RegionLocX, | 94 | (int)info.RegionLocX, |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 3f3a68d..c33c777 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -608,6 +608,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
608 | { | 608 | { |
609 | bool destRegionUp = false; | 609 | bool destRegionUp = false; |
610 | 610 | ||
611 | IEventQueue eq = avatar.Scene.RequestModuleInterface<IEventQueue>(); | ||
612 | |||
611 | if (regionHandle == m_regionInfo.RegionHandle) | 613 | if (regionHandle == m_regionInfo.RegionHandle) |
612 | { | 614 | { |
613 | // Teleport within the same region | 615 | // Teleport within the same region |
@@ -628,7 +630,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
628 | { | 630 | { |
629 | position.Z = newPosZ; | 631 | position.Z = newPosZ; |
630 | } | 632 | } |
631 | avatar.ControllingClient.SendTeleportLocationStart(); | 633 | |
634 | // Only send this if the event queue is null | ||
635 | if (eq == null) | ||
636 | avatar.ControllingClient.SendTeleportLocationStart(); | ||
637 | |||
638 | |||
632 | avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); | 639 | avatar.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); |
633 | avatar.Teleport(position); | 640 | avatar.Teleport(position); |
634 | } | 641 | } |
@@ -637,7 +644,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
637 | RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); | 644 | RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); |
638 | if (reg != null) | 645 | if (reg != null) |
639 | { | 646 | { |
640 | avatar.ControllingClient.SendTeleportLocationStart(); | 647 | if (eq == null) |
648 | avatar.ControllingClient.SendTeleportLocationStart(); | ||
649 | |||
641 | AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); | 650 | AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); |
642 | agent.BaseFolder = UUID.Zero; | 651 | agent.BaseFolder = UUID.Zero; |
643 | agent.InventoryFolder = UUID.Zero; | 652 | agent.InventoryFolder = UUID.Zero; |
@@ -687,7 +696,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
687 | m_log.DebugFormat( | 696 | m_log.DebugFormat( |
688 | "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID); | 697 | "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID); |
689 | 698 | ||
690 | IEventQueue eq = avatar.Scene.RequestModuleInterface<IEventQueue>(); | 699 | |
691 | if (eq != null) | 700 | if (eq != null) |
692 | { | 701 | { |
693 | LLSD Item = EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13, reg.ExternalEndPoint, | 702 | LLSD Item = EventQueueHelper.TeleportFinishEvent(reg.RegionHandle, 13, reg.ExternalEndPoint, |