aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs31
1 files changed, 22 insertions, 9 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index ef2494a..da77719 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -79,11 +79,27 @@ namespace OpenSim.Services.Connectors.Simulation
79 return "agent/"; 79 return "agent/";
80 } 80 }
81 81
82 protected virtual void PackData(OSDMap args, AgentCircuitData aCircuit, GridRegion destination, uint flags)
83 {
84 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
85 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
86 args["destination_name"] = OSD.FromString(destination.RegionName);
87 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
88 args["teleport_flags"] = OSD.FromString(flags.ToString());
89 }
90
82 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) 91 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
83 { 92 {
84 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CreateAgent start"); 93 string tmp = String.Empty;
85 94 return CreateAgent(destination, aCircuit, flags, out tmp, out reason);
95 }
96
97 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
98 {
99 m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Creating agent at {0}", destination.ServerURI);
86 reason = String.Empty; 100 reason = String.Empty;
101 myipaddress = String.Empty;
102
87 if (destination == null) 103 if (destination == null)
88 { 104 {
89 reason = "Destination not found"; 105 reason = "Destination not found";
@@ -96,12 +112,7 @@ namespace OpenSim.Services.Connectors.Simulation
96 try 112 try
97 { 113 {
98 OSDMap args = aCircuit.PackAgentCircuitData(); 114 OSDMap args = aCircuit.PackAgentCircuitData();
99 115 PackData(args, aCircuit, destination, flags);
100 args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
101 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
102 args["destination_name"] = OSD.FromString(destination.RegionName);
103 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
104 args["teleport_flags"] = OSD.FromString(flags.ToString());
105 116
106 OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); 117 OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000);
107 bool success = result["success"].AsBoolean(); 118 bool success = result["success"].AsBoolean();
@@ -111,6 +122,7 @@ namespace OpenSim.Services.Connectors.Simulation
111 122
112 reason = data["reason"].AsString(); 123 reason = data["reason"].AsString();
113 success = data["success"].AsBoolean(); 124 success = data["success"].AsBoolean();
125 myipaddress = data["your_ip"].AsString();
114 return success; 126 return success;
115 } 127 }
116 128
@@ -125,6 +137,7 @@ namespace OpenSim.Services.Connectors.Simulation
125 137
126 reason = data["reason"].AsString(); 138 reason = data["reason"].AsString();
127 success = data["success"].AsBoolean(); 139 success = data["success"].AsBoolean();
140 myipaddress = data["your_ip"].AsString();
128 m_log.WarnFormat( 141 m_log.WarnFormat(
129 "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); 142 "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName);
130 return success; 143 return success;
@@ -229,7 +242,7 @@ namespace OpenSim.Services.Connectors.Simulation
229 /// </summary> 242 /// </summary>
230 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData, int timeout) 243 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData, int timeout)
231 { 244 {
232 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent start"); 245 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent in {0}", destination.ServerURI);
233 246
234 // Eventually, we want to use a caps url instead of the agentID 247 // Eventually, we want to use a caps url instead of the agentID
235 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/"; 248 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/";