aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs74
1 files changed, 64 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index 8fd4104..6d06bb5 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -45,11 +45,13 @@ using Nini.Config;
45using Nwc.XmlRpc; 45using Nwc.XmlRpc;
46 46
47using OpenSim.Framework; 47using OpenSim.Framework;
48using OpenSim.Region.Environment.Interfaces;
49using OpenSim.Region.Environment.Scenes;
50using OpenSim.Framework.Communications.Cache; 48using OpenSim.Framework.Communications.Cache;
51using OpenSim.Framework.Communications.Capabilities; 49using OpenSim.Framework.Communications.Capabilities;
52using OpenSim.Framework.Statistics; 50using OpenSim.Framework.Statistics;
51using OpenSim.Framework.Servers;
52using OpenSim.Region.Environment.Interfaces;
53using OpenSim.Region.Environment.Scenes;
54
53using LLSD = OpenMetaverse.StructuredData.LLSD; 55using LLSD = OpenMetaverse.StructuredData.LLSD;
54using LLSDMap = OpenMetaverse.StructuredData.LLSDMap; 56using LLSDMap = OpenMetaverse.StructuredData.LLSDMap;
55using LLSDArray = OpenMetaverse.StructuredData.LLSDArray; 57using LLSDArray = OpenMetaverse.StructuredData.LLSDArray;
@@ -208,6 +210,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
208 //break; 210 //break;
209 case "rez_avatar/request": 211 case "rez_avatar/request":
210 return RequestRezAvatarMethod(path, request); 212 return RequestRezAvatarMethod(path, request);
213 case "rez_avatar/place":
214 return RequestRezAvatarMethod(path, request);
211 //break; 215 //break;
212 default: 216 default:
213 return GenerateNoHandlerMessage(); 217 return GenerateNoHandlerMessage();
@@ -215,6 +219,27 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
215 //return null; 219 //return null;
216 } 220 }
217 221
222 // Using OpenSim.Framework.Communications.Capabilities.Caps here one time..
223 // so the long name is probably better then a using statement
224 public void OnRegisterCaps(UUID agentID, OpenSim.Framework.Communications.Capabilities.Caps caps)
225 {
226 /* If we ever want to register our own caps here....
227 *
228 string capsBase = "/CAPS/" + caps.CapsObjectPath;
229 caps.RegisterHandler("CAPNAME",
230 new RestStreamHandler("POST", capsBase + CAPSPOSTFIX!,
231 delegate(string request, string path, string param,
232 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
233 {
234 return METHODHANDLER(request, path, param,
235 agentID, caps);
236 }));
237
238 *
239 */
240 }
241
242
218 public LLSD RequestRezAvatarMethod(string path, LLSD request) 243 public LLSD RequestRezAvatarMethod(string path, LLSD request)
219 { 244 {
220 m_log.WarnFormat("[REQUESTREZAVATAR]: {0}", request.ToString()); 245 m_log.WarnFormat("[REQUESTREZAVATAR]: {0}", request.ToString());
@@ -262,8 +287,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
262 UpdateOGPState(LocalAgentID, userState); 287 UpdateOGPState(LocalAgentID, userState);
263 288
264 LLSDMap responseMap = new LLSDMap(); 289 LLSDMap responseMap = new LLSDMap();
265 responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); 290 responseMap["sim_host"] = LLSD.FromString(reg.ExternalHostName);
291
292 // DEPRECIATED
266 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); 293 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
294
267 responseMap["connect"] = LLSD.FromBoolean(true); 295 responseMap["connect"] = LLSD.FromBoolean(true);
268 responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); 296 responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port);
269 responseMap["region_x"] = LLSD.FromInteger(reg.RegionLocX * (uint)Constants.RegionSize); // LLX 297 responseMap["region_x"] = LLSD.FromInteger(reg.RegionLocX * (uint)Constants.RegionSize); // LLX
@@ -349,14 +377,19 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
349 //string raCap = string.Empty; 377 //string raCap = string.Empty;
350 378
351 UUID AvatarRezCapUUID = UUID.Random(); 379 UUID AvatarRezCapUUID = UUID.Random();
352 string rezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar"; 380 string rezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar/rez";
353 381 string derezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar/derez";
354 // Get a reference to the user's cap so we can pull out the Caps Object Path 382 // Get a reference to the user's cap so we can pull out the Caps Object Path
355 OpenSim.Framework.Communications.Capabilities.Caps userCap = homeScene.GetCapsHandlerForUser(agentData.AgentID); 383 OpenSim.Framework.Communications.Capabilities.Caps userCap = homeScene.GetCapsHandlerForUser(agentData.AgentID);
356 384
385 // DEPRECIATED
357 responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); 386 responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/");
358 387
388 // REPLACEMENT
389 responseMap["region_seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/");
390
359 responseMap["rez_avatar/rez"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + rezAvatarPath); 391 responseMap["rez_avatar/rez"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + rezAvatarPath);
392 responseMap["rez_avatar/derez"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + derezAvatarPath);
360 393
361 // Add the user to the list of CAPS that are outstanding. 394 // Add the user to the list of CAPS that are outstanding.
362 // well allow the caps hosts in this dictionary 395 // well allow the caps hosts in this dictionary
@@ -364,6 +397,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
364 { 397 {
365 if (CapsLoginID.ContainsKey(rezAvatarPath)) 398 if (CapsLoginID.ContainsKey(rezAvatarPath))
366 { 399 {
400 // This is a joke, if you didn't notice... It's so unlikely to happen, that I'll print this message if it does occur!
367 m_log.Error("[OGP]: Holy anomoly batman! Caps path already existed! All the UUID Duplication worries were founded!"); 401 m_log.Error("[OGP]: Holy anomoly batman! Caps path already existed! All the UUID Duplication worries were founded!");
368 } 402 }
369 else 403 else
@@ -504,7 +538,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
504 responseMap["look_at"] = LookAtArray; 538 responseMap["look_at"] = LookAtArray;
505 539
506 responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); 540 responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port);
507 responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());// + ":" + reg.InternalEndPoint.Port.ToString()); 541 responseMap["sim_host"] = LLSD.FromString(reg.ExternalHostName);// + ":" + reg.InternalEndPoint.Port.ToString());
542
543 // DEPRECIATED
508 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); 544 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
509 545
510 responseMap["session_id"] = LLSD.FromUUID(SessionID); 546 responseMap["session_id"] = LLSD.FromUUID(SessionID);
@@ -584,8 +620,19 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
584 } 620 }
585 } 621 }
586 622
587 string rezRespSeedCap = rezResponseMap["seed_capability"].AsString(); 623 string rezRespSeedCap = "";
624
625 // DEPRECIATED
626 if (rezResponseMap.ContainsKey("seed_capability"))
627 rezRespSeedCap = rezResponseMap["seed_capability"].AsString();
628
629 // REPLACEMENT
630 if (rezResponseMap.ContainsKey("region_seed_capability"))
631 rezRespSeedCap = rezResponseMap["region_seed_capability"].AsString();
632
633 // DEPRECIATED
588 string rezRespSim_ip = rezResponseMap["sim_ip"].AsString(); 634 string rezRespSim_ip = rezResponseMap["sim_ip"].AsString();
635
589 string rezRespSim_host = rezResponseMap["sim_host"].AsString(); 636 string rezRespSim_host = rezResponseMap["sim_host"].AsString();
590 637
591 int rrPort = rezResponseMap["sim_port"].AsInteger(); 638 int rrPort = rezResponseMap["sim_port"].AsInteger();
@@ -598,9 +645,16 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
598 645
599 LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; 646 LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"];
600 647
648 // DEPRECIATED
601 responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); 649 responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap);
650
651 // REPLACEMENT r3
652 responseMap["region_seed_capability"] = LLSD.FromString(rezRespSeedCap);
653
654 // DEPRECIATED
602 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); 655 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString());
603 responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_host).ToString()); 656
657 responseMap["sim_host"] = LLSD.FromString(rezRespSim_host);
604 responseMap["sim_port"] = LLSD.FromInteger(rrPort); 658 responseMap["sim_port"] = LLSD.FromInteger(rrPort);
605 responseMap["region_x"] = LLSD.FromInteger(rrX ); 659 responseMap["region_x"] = LLSD.FromInteger(rrX );
606 responseMap["region_y"] = LLSD.FromInteger(rrY ); 660 responseMap["region_y"] = LLSD.FromInteger(rrY );
@@ -754,7 +808,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
754 map["reason"] = LLSD.FromString("LLSDRequest"); 808 map["reason"] = LLSD.FromString("LLSDRequest");
755 map["message"] = LLSD.FromString("No handler registered for LLSD Requests"); 809 map["message"] = LLSD.FromString("No handler registered for LLSD Requests");
756 map["login"] = LLSD.FromString("false"); 810 map["login"] = LLSD.FromString("false");
757 811 map["connect"] = LLSD.FromString("false");
758 return map; 812 return map;
759 } 813 }
760 814