diff options
author | Diva Canto | 2009-09-26 21:00:51 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-26 21:00:51 -0700 |
commit | f4bf581b96347b8d7f115eca74fa84a644eb729c (patch) | |
tree | c1e42376edb8d2e5a6094854dd1ac4320f0c6f23 /OpenSim/Services/Connectors | |
parent | Fixed a bug with link-region. (diff) | |
download | opensim-SC-f4bf581b96347b8d7f115eca74fa84a644eb729c.zip opensim-SC-f4bf581b96347b8d7f115eca74fa84a644eb729c.tar.gz opensim-SC-f4bf581b96347b8d7f115eca74fa84a644eb729c.tar.bz2 opensim-SC-f4bf581b96347b8d7f115eca74fa84a644eb729c.tar.xz |
Moved all HG1 operations to HGGridConnector.cs and HypergridServerConnector.cs/HypergridServiceConnector.cs, away from Region.Communications and HGNetworkServersInfo.
Fixed small bugs with hyperlinked regions' map positions.
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs index cf17557..dd19b01 100644 --- a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs | |||
@@ -149,5 +149,94 @@ namespace OpenSim.Services.Connectors.Grid | |||
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | public bool InformRegionOfUser(GridRegion regInfo, AgentCircuitData agentData, GridRegion home, string userServer, string assetServer, string inventoryServer) | ||
153 | { | ||
154 | string capsPath = agentData.CapsPath; | ||
155 | Hashtable loginParams = new Hashtable(); | ||
156 | loginParams["session_id"] = agentData.SessionID.ToString(); | ||
157 | |||
158 | loginParams["firstname"] = agentData.firstname; | ||
159 | loginParams["lastname"] = agentData.lastname; | ||
160 | |||
161 | loginParams["agent_id"] = agentData.AgentID.ToString(); | ||
162 | loginParams["circuit_code"] = agentData.circuitcode.ToString(); | ||
163 | loginParams["startpos_x"] = agentData.startpos.X.ToString(); | ||
164 | loginParams["startpos_y"] = agentData.startpos.Y.ToString(); | ||
165 | loginParams["startpos_z"] = agentData.startpos.Z.ToString(); | ||
166 | loginParams["caps_path"] = capsPath; | ||
167 | |||
168 | if (home != null) | ||
169 | { | ||
170 | loginParams["region_uuid"] = home.RegionID.ToString(); | ||
171 | loginParams["regionhandle"] = home.RegionHandle.ToString(); | ||
172 | loginParams["home_address"] = home.ExternalHostName; | ||
173 | loginParams["home_port"] = home.HttpPort.ToString(); | ||
174 | loginParams["internal_port"] = home.InternalEndPoint.Port.ToString(); | ||
175 | |||
176 | m_log.Debug(" --------- Home -------"); | ||
177 | m_log.Debug(" >> " + loginParams["home_address"] + " <<"); | ||
178 | m_log.Debug(" >> " + loginParams["region_uuid"] + " <<"); | ||
179 | m_log.Debug(" >> " + loginParams["regionhandle"] + " <<"); | ||
180 | m_log.Debug(" >> " + loginParams["home_port"] + " <<"); | ||
181 | m_log.Debug(" --------- ------------ -------"); | ||
182 | } | ||
183 | else | ||
184 | m_log.WarnFormat("[HGrid]: Home region not found for {0} {1}", agentData.firstname, agentData.lastname); | ||
185 | |||
186 | loginParams["userserver_id"] = userServer; | ||
187 | loginParams["assetserver_id"] = assetServer; | ||
188 | loginParams["inventoryserver_id"] = inventoryServer; | ||
189 | |||
190 | |||
191 | ArrayList SendParams = new ArrayList(); | ||
192 | SendParams.Add(loginParams); | ||
193 | |||
194 | // Send | ||
195 | string uri = "http://" + regInfo.ExternalHostName + ":" + regInfo.HttpPort + "/"; | ||
196 | //m_log.Debug("XXX uri: " + uri); | ||
197 | XmlRpcRequest request = new XmlRpcRequest("expect_hg_user", SendParams); | ||
198 | XmlRpcResponse reply; | ||
199 | try | ||
200 | { | ||
201 | reply = request.Send(uri, 6000); | ||
202 | } | ||
203 | catch (Exception e) | ||
204 | { | ||
205 | m_log.Warn("[HGrid]: Failed to notify region about user. Reason: " + e.Message); | ||
206 | return false; | ||
207 | } | ||
208 | |||
209 | if (!reply.IsFault) | ||
210 | { | ||
211 | bool responseSuccess = true; | ||
212 | if (reply.Value != null) | ||
213 | { | ||
214 | Hashtable resp = (Hashtable)reply.Value; | ||
215 | if (resp.ContainsKey("success")) | ||
216 | { | ||
217 | if ((string)resp["success"] == "FALSE") | ||
218 | { | ||
219 | responseSuccess = false; | ||
220 | } | ||
221 | } | ||
222 | } | ||
223 | if (responseSuccess) | ||
224 | { | ||
225 | m_log.Info("[HGrid]: Successfully informed remote region about user " + agentData.AgentID); | ||
226 | return true; | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | m_log.ErrorFormat("[HGrid]: Region responded that it is not available to receive clients"); | ||
231 | return false; | ||
232 | } | ||
233 | } | ||
234 | else | ||
235 | { | ||
236 | m_log.ErrorFormat("[HGrid]: XmlRpc request to region failed with message {0}, code {1} ", reply.FaultString, reply.FaultCode); | ||
237 | return false; | ||
238 | } | ||
239 | } | ||
240 | |||
152 | } | 241 | } |
153 | } | 242 | } |