diff options
author | Melanie | 2013-06-23 01:49:45 +0100 |
---|---|---|
committer | Melanie | 2013-06-23 01:49:45 +0100 |
commit | 936700bda3969bc54166f0d6a3ca81e3d5c42935 (patch) | |
tree | 6bb97abf25f4a3f22ccb40e3b4be20c551327b09 /OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |
parent | Fix prim locking to behave like SL (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-936700bda3969bc54166f0d6a3ca81e3d5c42935.zip opensim-SC-936700bda3969bc54166f0d6a3ca81e3d5c42935.tar.gz opensim-SC-936700bda3969bc54166f0d6a3ca81e3d5c42935.tar.bz2 opensim-SC-936700bda3969bc54166f0d6a3ca81e3d5c42935.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 57f2ffa..f51c809 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 | m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null"); | 105 | m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null"); |
@@ -95,12 +111,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
95 | try | 111 | try |
96 | { | 112 | { |
97 | OSDMap args = aCircuit.PackAgentCircuitData(); | 113 | OSDMap args = aCircuit.PackAgentCircuitData(); |
98 | 114 | PackData(args, aCircuit, destination, flags); | |
99 | args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); | ||
100 | args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); | ||
101 | args["destination_name"] = OSD.FromString(destination.RegionName); | ||
102 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); | ||
103 | args["teleport_flags"] = OSD.FromString(flags.ToString()); | ||
104 | 115 | ||
105 | OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); | 116 | OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); |
106 | bool success = result["success"].AsBoolean(); | 117 | bool success = result["success"].AsBoolean(); |
@@ -110,6 +121,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
110 | 121 | ||
111 | reason = data["reason"].AsString(); | 122 | reason = data["reason"].AsString(); |
112 | success = data["success"].AsBoolean(); | 123 | success = data["success"].AsBoolean(); |
124 | myipaddress = data["your_ip"].AsString(); | ||
113 | return success; | 125 | return success; |
114 | } | 126 | } |
115 | 127 | ||
@@ -124,6 +136,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
124 | 136 | ||
125 | reason = data["reason"].AsString(); | 137 | reason = data["reason"].AsString(); |
126 | success = data["success"].AsBoolean(); | 138 | success = data["success"].AsBoolean(); |
139 | myipaddress = data["your_ip"].AsString(); | ||
127 | m_log.WarnFormat( | 140 | m_log.WarnFormat( |
128 | "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); | 141 | "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); |
129 | return success; | 142 | return success; |
@@ -228,7 +241,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
228 | /// </summary> | 241 | /// </summary> |
229 | private bool UpdateAgent(GridRegion destination, IAgentData cAgentData, int timeout) | 242 | private bool UpdateAgent(GridRegion destination, IAgentData cAgentData, int timeout) |
230 | { | 243 | { |
231 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent start"); | 244 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent in {0}", destination.ServerURI); |
232 | 245 | ||
233 | // Eventually, we want to use a caps url instead of the agentID | 246 | // Eventually, we want to use a caps url instead of the agentID |
234 | string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/"; | 247 | string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/"; |