aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorTeravus Ovares2008-08-28 08:13:35 +0000
committerTeravus Ovares2008-08-28 08:13:35 +0000
commit88b3df9d522011b5188791ec8b0aa097978a043d (patch)
tree3ea8f14b828344c5de944ffca190012505b11293 /OpenSim/Region/Environment
parentthis fixes the crash reported by mantis #2046: user server crashing if (diff)
downloadopensim-SC-88b3df9d522011b5188791ec8b0aa097978a043d.zip
opensim-SC-88b3df9d522011b5188791ec8b0aa097978a043d.tar.gz
opensim-SC-88b3df9d522011b5188791ec8b0aa097978a043d.tar.bz2
opensim-SC-88b3df9d522011b5188791ec8b0aa097978a043d.tar.xz
* OGP update, deserialize the parameter array properly in rez_avatar
* Tweak rez_avatar data so it's easier to update when OGPr3 comes out
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs81
1 files changed, 75 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index c0ef208..7bbbc22 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -78,6 +78,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
78 public string inventory_host; 78 public string inventory_host;
79 public bool src_can_see_mainland; 79 public bool src_can_see_mainland;
80 public int src_estate_id; 80 public int src_estate_id;
81 public int src_version;
82 public int src_parent_estate_id;
83 public bool visible_to_parent;
81 } 84 }
82 85
83 86
@@ -390,7 +393,44 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
390 LLUUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); 393 LLUUID SecureSessionID=requestMap["secure_session_id"].AsUUID();
391 LLUUID SessionID = requestMap["session_id"].AsUUID(); 394 LLUUID SessionID = requestMap["session_id"].AsUUID();
392 int circuitcode = requestMap["circuit_code"].AsInteger(); 395 int circuitcode = requestMap["circuit_code"].AsInteger();
396 LLSDArray Parameter = new LLSDArray();
397 if (requestMap.ContainsKey("parameter"))
398 {
399 Parameter = (LLSDArray)((LLSD)requestMap["parameter"]);
400 }
401
402 int version = 1;
403 int estateID = 1;
404 int parentEstateID = 1;
405 LLUUID regionID = LLUUID.Zero;
406 bool visibleToParent = true;
407
408 for (int i = 0; i < Parameter.Count; i++)
409 {
410 LLSDMap item = (LLSDMap)Parameter[i];
411 if (item.ContainsKey("version"))
412 {
413 version = item["version"].AsInteger();
414 }
415 if (item.ContainsKey("estate_id"))
416 {
417 estateID = item["estate_id"].AsInteger();
418 }
419 if (item.ContainsKey("parent_estate_id"))
420 {
421 parentEstateID = item["parent_estate_id"].AsInteger();
422
423 }
424 if (item.ContainsKey("region_id"))
425 {
426 regionID = item["region_id"].AsUUID();
393 427
428 }
429 if (item.ContainsKey("visible_to_parent"))
430 {
431 visibleToParent = item["visible_to_parent"].AsBoolean();
432 }
433 }
394 //Update our Circuit data with the real values 434 //Update our Circuit data with the real values
395 userData.SecureSessionID = SecureSessionID; 435 userData.SecureSessionID = SecureSessionID;
396 userData.SessionID = SessionID; 436 userData.SessionID = SessionID;
@@ -426,6 +466,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
426 userState.god_overide = requestMap["god_override"].AsBoolean(); 466 userState.god_overide = requestMap["god_override"].AsBoolean();
427 userState.circuit_code = (uint)requestMap["circuit_code"].AsInteger(); 467 userState.circuit_code = (uint)requestMap["circuit_code"].AsInteger();
428 userState.limited_to_estate = requestMap["limited_to_estate"].AsInteger(); 468 userState.limited_to_estate = requestMap["limited_to_estate"].AsInteger();
469 userState.src_estate_id = estateID;
470 userState.region_id = regionID;
471 userState.src_parent_estate_id = parentEstateID;
472 userState.visible_to_parent = visibleToParent;
429 473
430 // Save state changes 474 // Save state changes
431 UpdateOGPState(userData.AgentID, userState); 475 UpdateOGPState(userData.AgentID, userState);
@@ -605,7 +649,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
605 649
606 private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) 650 private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState)
607 { 651 {
608 652
653 Scene reg = GetRootScene();
609 654
610 WebRequest DeRezRequest = WebRequest.Create(CapAddress); 655 WebRequest DeRezRequest = WebRequest.Create(CapAddress);
611 DeRezRequest.Method = "POST"; 656 DeRezRequest.Method = "POST";
@@ -615,8 +660,20 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
615 LLSDMap RAMap = new LLSDMap(); 660 LLSDMap RAMap = new LLSDMap();
616 LLSDMap AgentParms = new LLSDMap(); 661 LLSDMap AgentParms = new LLSDMap();
617 LLSDMap RegionParms = new LLSDMap(); 662 LLSDMap RegionParms = new LLSDMap();
618 663
619 664 LLSDArray Parameter = new LLSDArray(2);
665
666 LLSDMap version = new LLSDMap();
667 version["version"] = LLSD.FromInteger(userState.src_version);
668 Parameter.Add((LLSD)version);
669
670 LLSDMap SrcData = new LLSDMap();
671 SrcData["estate_id"] = LLSD.FromInteger(reg.RegionInfo.EstateSettings.EstateID);
672 SrcData["parent_estate_id"] = LLSD.FromInteger(reg.RegionInfo.EstateSettings.ParentEstateID);
673 SrcData["region_id"] = LLSD.FromUUID(reg.RegionInfo.originRegionID);
674 SrcData["visible_to_parent"] = LLSD.FromBoolean(userState.visible_to_parent);
675 Parameter.Add((LLSD)SrcData);
676
620 AgentParms["first_name"] = LLSD.FromString(userState.first_name); 677 AgentParms["first_name"] = LLSD.FromString(userState.first_name);
621 AgentParms["last_name"] = LLSD.FromString(userState.last_name); 678 AgentParms["last_name"] = LLSD.FromString(userState.last_name);
622 AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id); 679 AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id);
@@ -632,14 +689,23 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
632 AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified); 689 AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified);
633 AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate); 690 AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate);
634 AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host); 691 AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host);
635 RAMap["agent_params"] = AgentParms; 692
693 // version 1
694 RAMap = AgentParms;
695
696 // Planned for version 2
697 // RAMap["agent_params"] = AgentParms;
698
699
636 RAMap["region_params"] = RegionParms; 700 RAMap["region_params"] = RegionParms;
701 RAMap["parameter"] = Parameter;
637 702
638 string RAMapString = AgentParms.ToString(); 703 string RAMapString = RAMap.ToString();
639 m_log.InfoFormat("[OGP] RAMap string {0}", RAMapString); 704 m_log.InfoFormat("[OGP] RAMap string {0}", RAMapString);
640 LLSD LLSDofRAMap = AgentParms; // RENAME if this works 705 LLSD LLSDofRAMap = RAMap; // RENAME if this works
641 706
642 m_log.InfoFormat("[OGP]: LLSD of map as string was {0}", LLSDofRAMap.ToString()); 707 m_log.InfoFormat("[OGP]: LLSD of map as string was {0}", LLSDofRAMap.ToString());
708 //m_log.InfoFormat("[OGP]: LLSD+XML: {0}", LLSDParser.SerializeXmlString(LLSDofRAMap));
643 byte[] buffer = LLSDParser.SerializeXmlBytes(LLSDofRAMap); 709 byte[] buffer = LLSDParser.SerializeXmlBytes(LLSDofRAMap);
644 710
645 //string bufferDump = System.Text.Encoding.ASCII.GetString(buffer); 711 //string bufferDump = System.Text.Encoding.ASCII.GetString(buffer);
@@ -780,6 +846,9 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
780 returnState.sim_access = ""; 846 returnState.sim_access = "";
781 returnState.src_can_see_mainland = true; 847 returnState.src_can_see_mainland = true;
782 returnState.src_estate_id = 1; 848 returnState.src_estate_id = 1;
849 returnState.src_version = 1;
850 returnState.src_parent_estate_id = 1;
851 returnState.visible_to_parent = true;
783 852
784 return returnState; 853 return returnState;
785 } 854 }