diff options
Diffstat (limited to 'OpenSim/Server/Handlers/Hypergrid')
8 files changed, 103 insertions, 184 deletions
diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs index cf1af15..95a0510 100644 --- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs | |||
@@ -61,9 +61,10 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
61 | m_Proxy = proxy; | 61 | m_Proxy = proxy; |
62 | } | 62 | } |
63 | 63 | ||
64 | protected override bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) | 64 | protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, |
65 | AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) | ||
65 | { | 66 | { |
66 | return m_GatekeeperService.LoginAgent(aCircuit, destination, out reason); | 67 | return m_GatekeeperService.LoginAgent(source, aCircuit, destination, out reason); |
67 | } | 68 | } |
68 | } | 69 | } |
69 | } | 70 | } |
diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs index 0d4990a..ffe2f36 100644 --- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs | |||
@@ -76,10 +76,14 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
76 | server.AddStreamHandler(new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy)); | 76 | server.AddStreamHandler(new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy)); |
77 | } | 77 | } |
78 | 78 | ||
79 | public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server) | 79 | public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, string configName) |
80 | : this(config, server, null) | 80 | : this(config, server, (ISimulationService)null) |
81 | { | 81 | { |
82 | } | 82 | } |
83 | 83 | ||
84 | public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server) | ||
85 | : this(config, server, String.Empty) | ||
86 | { | ||
87 | } | ||
84 | } | 88 | } |
85 | } | 89 | } |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index 0aa2729..37b47ed 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
68 | m_log.ErrorFormat("[HGFRIENDS HANDLER]: TheService is null!"); | 68 | m_log.ErrorFormat("[HGFRIENDS HANDLER]: TheService is null!"); |
69 | } | 69 | } |
70 | 70 | ||
71 | public override byte[] Handle(string path, Stream requestData, | 71 | protected override byte[] ProcessRequest(string path, Stream requestData, |
72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
73 | { | 73 | { |
74 | StreamReader sr = new StreamReader(requestData); | 74 | StreamReader sr = new StreamReader(requestData); |
@@ -335,7 +335,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
335 | 335 | ||
336 | rootElement.AppendChild(result); | 336 | rootElement.AppendChild(result); |
337 | 337 | ||
338 | return DocToBytes(doc); | 338 | return Util.DocToBytes(doc); |
339 | } | 339 | } |
340 | 340 | ||
341 | private byte[] SuccessResult(string value) | 341 | private byte[] SuccessResult(string value) |
@@ -362,7 +362,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
362 | 362 | ||
363 | rootElement.AppendChild(message); | 363 | rootElement.AppendChild(message); |
364 | 364 | ||
365 | return DocToBytes(doc); | 365 | return Util.DocToBytes(doc); |
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
@@ -395,7 +395,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
395 | 395 | ||
396 | rootElement.AppendChild(message); | 396 | rootElement.AppendChild(message); |
397 | 397 | ||
398 | return DocToBytes(doc); | 398 | return Util.DocToBytes(doc); |
399 | } | 399 | } |
400 | 400 | ||
401 | private byte[] BoolResult(bool value) | 401 | private byte[] BoolResult(bool value) |
@@ -417,21 +417,9 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
417 | 417 | ||
418 | rootElement.AppendChild(result); | 418 | rootElement.AppendChild(result); |
419 | 419 | ||
420 | return DocToBytes(doc); | 420 | return Util.DocToBytes(doc); |
421 | } | 421 | } |
422 | 422 | ||
423 | private byte[] DocToBytes(XmlDocument doc) | ||
424 | { | ||
425 | MemoryStream ms = new MemoryStream(); | ||
426 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
427 | xw.Formatting = Formatting.Indented; | ||
428 | doc.WriteTo(xw); | ||
429 | xw.Flush(); | ||
430 | |||
431 | return ms.ToArray(); | ||
432 | } | ||
433 | |||
434 | |||
435 | #endregion | 423 | #endregion |
436 | } | 424 | } |
437 | } | 425 | } |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs index f306b1c..dac4ca8 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs | |||
@@ -44,7 +44,9 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
44 | public HeloServiceInConnector(IConfigSource config, IHttpServer server, string configName) : | 44 | public HeloServiceInConnector(IConfigSource config, IHttpServer server, string configName) : |
45 | base(config, server, configName) | 45 | base(config, server, configName) |
46 | { | 46 | { |
47 | #pragma warning disable 0612 | ||
47 | server.AddStreamHandler(new HeloServerGetHandler("opensim-robust")); | 48 | server.AddStreamHandler(new HeloServerGetHandler("opensim-robust")); |
49 | #pragma warning restore 0612 | ||
48 | server.AddStreamHandler(new HeloServerHeadHandler("opensim-robust")); | 50 | server.AddStreamHandler(new HeloServerHeadHandler("opensim-robust")); |
49 | } | 51 | } |
50 | } | 52 | } |
@@ -91,7 +93,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
91 | m_HandlersType = handlersType; | 93 | m_HandlersType = handlersType; |
92 | } | 94 | } |
93 | 95 | ||
94 | public override byte[] Handle(string path, Stream requestData, | 96 | protected override byte[] ProcessRequest(string path, Stream requestData, |
95 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 97 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
96 | { | 98 | { |
97 | return OKResponse(httpResponse); | 99 | return OKResponse(httpResponse); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index 968c1e6..e787f7c 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | |||
@@ -49,191 +49,89 @@ using log4net; | |||
49 | 49 | ||
50 | namespace OpenSim.Server.Handlers.Hypergrid | 50 | namespace OpenSim.Server.Handlers.Hypergrid |
51 | { | 51 | { |
52 | public class HomeAgentHandler | 52 | public class HomeAgentHandler : AgentPostHandler |
53 | { | 53 | { |
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
55 | private IUserAgentService m_UserAgentService; | 55 | private IUserAgentService m_UserAgentService; |
56 | 56 | ||
57 | private string m_LoginServerIP; | 57 | private string m_LoginServerIP; |
58 | private bool m_Proxy = false; | ||
59 | 58 | ||
60 | public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy) | 59 | public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy) : |
60 | base("/homeagent") | ||
61 | { | 61 | { |
62 | m_UserAgentService = userAgentService; | 62 | m_UserAgentService = userAgentService; |
63 | m_LoginServerIP = loginServerIP; | 63 | m_LoginServerIP = loginServerIP; |
64 | m_Proxy = proxy; | 64 | m_Proxy = proxy; |
65 | } | 65 | } |
66 | 66 | ||
67 | public Hashtable Handler(Hashtable request) | 67 | protected override AgentDestinationData CreateAgentDestinationData() |
68 | { | 68 | { |
69 | // m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called"); | 69 | return new ExtendedAgentDestinationData(); |
70 | // | 70 | } |
71 | // m_log.Debug("---------------------------"); | 71 | |
72 | // m_log.Debug(" >> uri=" + request["uri"]); | 72 | protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request) |
73 | // m_log.Debug(" >> content-type=" + request["content-type"]); | 73 | { |
74 | // m_log.Debug(" >> http-method=" + request["http-method"]); | 74 | base.UnpackData(args, d, request); |
75 | // m_log.Debug("---------------------------\n"); | 75 | ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d; |
76 | 76 | try | |
77 | Hashtable responsedata = new Hashtable(); | ||
78 | responsedata["content_type"] = "text/html"; | ||
79 | responsedata["keepalive"] = false; | ||
80 | |||
81 | |||
82 | UUID agentID; | ||
83 | UUID regionID; | ||
84 | string action; | ||
85 | if (!Utils.GetParams((string)request["uri"], out agentID, out regionID, out action)) | ||
86 | { | 77 | { |
87 | m_log.InfoFormat("[HOME AGENT HANDLER]: Invalid parameters for agent message {0}", request["uri"]); | 78 | if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null) |
88 | responsedata["int_response_code"] = 404; | 79 | data.host = args["gatekeeper_host"].AsString(); |
89 | responsedata["str_response_string"] = "false"; | 80 | if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null) |
81 | Int32.TryParse(args["gatekeeper_port"].AsString(), out data.port); | ||
82 | if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] != null) | ||
83 | data.gatekeeperServerURI = args["gatekeeper_serveruri"]; | ||
84 | if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] != null) | ||
85 | data.destinationServerURI = args["destination_serveruri"]; | ||
90 | 86 | ||
91 | return responsedata; | ||
92 | } | 87 | } |
93 | 88 | catch (InvalidCastException) | |
94 | // Next, let's parse the verb | ||
95 | string method = (string)request["http-method"]; | ||
96 | if (method.Equals("POST")) | ||
97 | { | 89 | { |
98 | DoAgentPost(request, responsedata, agentID); | 90 | m_log.ErrorFormat("[HOME AGENT HANDLER]: Bad cast in UnpackData"); |
99 | return responsedata; | ||
100 | } | 91 | } |
101 | else | ||
102 | { | ||
103 | m_log.InfoFormat("[HOME AGENT HANDLER]: method {0} not supported in agent message", method); | ||
104 | responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; | ||
105 | responsedata["str_response_string"] = "Method not allowed"; | ||
106 | 92 | ||
107 | return responsedata; | 93 | string callerIP = GetCallerIP(request); |
108 | } | 94 | // Verify if this call came from the login server |
95 | if (callerIP == m_LoginServerIP) | ||
96 | data.fromLogin = true; | ||
109 | 97 | ||
110 | } | 98 | } |
111 | 99 | ||
112 | protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id) | 100 | protected override GridRegion ExtractGatekeeper(AgentDestinationData d) |
113 | { | 101 | { |
114 | OSDMap args = Utils.GetOSDMap((string)request["body"]); | 102 | if (d is ExtendedAgentDestinationData) |
115 | if (args == null) | ||
116 | { | 103 | { |
117 | responsedata["int_response_code"] = HttpStatusCode.BadRequest; | 104 | ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d; |
118 | responsedata["str_response_string"] = "Bad request"; | 105 | GridRegion gatekeeper = new GridRegion(); |
119 | return; | 106 | gatekeeper.ServerURI = data.gatekeeperServerURI; |
107 | gatekeeper.ExternalHostName = data.host; | ||
108 | gatekeeper.HttpPort = (uint)data.port; | ||
109 | gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); | ||
110 | |||
111 | return gatekeeper; | ||
120 | } | 112 | } |
121 | |||
122 | // retrieve the input arguments | ||
123 | int x = 0, y = 0; | ||
124 | UUID uuid = UUID.Zero; | ||
125 | string regionname = string.Empty; | ||
126 | string gatekeeper_host = string.Empty; | ||
127 | string gatekeeper_serveruri = string.Empty; | ||
128 | string destination_serveruri = string.Empty; | ||
129 | int gatekeeper_port = 0; | ||
130 | IPEndPoint client_ipaddress = null; | ||
131 | |||
132 | if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null) | ||
133 | gatekeeper_host = args["gatekeeper_host"].AsString(); | ||
134 | if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null) | ||
135 | Int32.TryParse(args["gatekeeper_port"].AsString(), out gatekeeper_port); | ||
136 | if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] !=null) | ||
137 | gatekeeper_serveruri = args["gatekeeper_serveruri"]; | ||
138 | if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] !=null) | ||
139 | destination_serveruri = args["destination_serveruri"]; | ||
140 | |||
141 | GridRegion gatekeeper = new GridRegion(); | ||
142 | gatekeeper.ServerURI = gatekeeper_serveruri; | ||
143 | gatekeeper.ExternalHostName = gatekeeper_host; | ||
144 | gatekeeper.HttpPort = (uint)gatekeeper_port; | ||
145 | gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); | ||
146 | |||
147 | if (args.ContainsKey("destination_x") && args["destination_x"] != null) | ||
148 | Int32.TryParse(args["destination_x"].AsString(), out x); | ||
149 | else | ||
150 | m_log.WarnFormat(" -- request didn't have destination_x"); | ||
151 | if (args.ContainsKey("destination_y") && args["destination_y"] != null) | ||
152 | Int32.TryParse(args["destination_y"].AsString(), out y); | ||
153 | else | 113 | else |
154 | m_log.WarnFormat(" -- request didn't have destination_y"); | 114 | m_log.WarnFormat("[HOME AGENT HANDLER]: Wrong data type"); |
155 | if (args.ContainsKey("destination_uuid") && args["destination_uuid"] != null) | ||
156 | UUID.TryParse(args["destination_uuid"].AsString(), out uuid); | ||
157 | if (args.ContainsKey("destination_name") && args["destination_name"] != null) | ||
158 | regionname = args["destination_name"].ToString(); | ||
159 | |||
160 | if (args.ContainsKey("client_ip") && args["client_ip"] != null) | ||
161 | { | ||
162 | string ip_str = args["client_ip"].ToString(); | ||
163 | try | ||
164 | { | ||
165 | string callerIP = GetCallerIP(request); | ||
166 | // Verify if this caller has authority to send the client IP | ||
167 | if (callerIP == m_LoginServerIP) | ||
168 | client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0); | ||
169 | else // leaving this for now, but this warning should be removed | ||
170 | m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str); | ||
171 | } | ||
172 | catch | ||
173 | { | ||
174 | m_log.DebugFormat("[HOME AGENT HANDLER]: Exception parsing client ip address from {0}", ip_str); | ||
175 | } | ||
176 | } | ||
177 | 115 | ||
178 | GridRegion destination = new GridRegion(); | 116 | return null; |
179 | destination.RegionID = uuid; | ||
180 | destination.RegionLocX = x; | ||
181 | destination.RegionLocY = y; | ||
182 | destination.RegionName = regionname; | ||
183 | destination.ServerURI = destination_serveruri; | ||
184 | |||
185 | AgentCircuitData aCircuit = new AgentCircuitData(); | ||
186 | try | ||
187 | { | ||
188 | aCircuit.UnpackAgentCircuitData(args); | ||
189 | } | ||
190 | catch (Exception ex) | ||
191 | { | ||
192 | m_log.InfoFormat("[HOME AGENT HANDLER]: exception on unpacking ChildCreate message {0}", ex.Message); | ||
193 | responsedata["int_response_code"] = HttpStatusCode.BadRequest; | ||
194 | responsedata["str_response_string"] = "Bad request"; | ||
195 | return; | ||
196 | } | ||
197 | |||
198 | OSDMap resp = new OSDMap(2); | ||
199 | string reason = String.Empty; | ||
200 | |||
201 | bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, client_ipaddress, out reason); | ||
202 | |||
203 | resp["reason"] = OSD.FromString(reason); | ||
204 | resp["success"] = OSD.FromBoolean(result); | ||
205 | |||
206 | // TODO: add reason if not String.Empty? | ||
207 | responsedata["int_response_code"] = HttpStatusCode.OK; | ||
208 | responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); | ||
209 | } | 117 | } |
210 | 118 | ||
211 | private string GetCallerIP(Hashtable request) | ||
212 | { | ||
213 | if (!m_Proxy) | ||
214 | return Util.GetCallerIP(request); | ||
215 | |||
216 | // We're behind a proxy | ||
217 | Hashtable headers = (Hashtable)request["headers"]; | ||
218 | string xff = "X-Forwarded-For"; | ||
219 | if (headers.ContainsKey(xff.ToLower())) | ||
220 | xff = xff.ToLower(); | ||
221 | 119 | ||
222 | if (!headers.ContainsKey(xff) || headers[xff] == null) | 120 | protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination, |
223 | { | 121 | AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason) |
224 | m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); | 122 | { |
225 | return Util.GetCallerIP(request); | 123 | return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason); |
226 | } | 124 | } |
227 | 125 | ||
228 | m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); | 126 | } |
229 | 127 | ||
230 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); | 128 | public class ExtendedAgentDestinationData : AgentDestinationData |
231 | if (ep != null) | 129 | { |
232 | return ep.Address.ToString(); | 130 | public string host; |
131 | public int port; | ||
132 | public string gatekeeperServerURI; | ||
133 | public string destinationServerURI; | ||
233 | 134 | ||
234 | // Oops | ||
235 | return Util.GetCallerIP(request); | ||
236 | } | ||
237 | } | 135 | } |
238 | 136 | ||
239 | } | 137 | } |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs index 5d03097..c7ac9be 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -94,22 +94,38 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
94 | UUID regionID = UUID.Zero; | 94 | UUID regionID = UUID.Zero; |
95 | UUID.TryParse(regionID_str, out regionID); | 95 | UUID.TryParse(regionID_str, out regionID); |
96 | 96 | ||
97 | GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID); | 97 | UUID agentID = UUID.Zero; |
98 | string agentHomeURI = null; | ||
99 | if (requestData.ContainsKey("agent_id")) | ||
100 | agentID = UUID.Parse((string)requestData["agent_id"]); | ||
101 | if (requestData.ContainsKey("agent_home_uri")) | ||
102 | agentHomeURI = (string)requestData["agent_home_uri"]; | ||
103 | |||
104 | string message; | ||
105 | GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID, agentID, agentHomeURI, out message); | ||
98 | 106 | ||
99 | Hashtable hash = new Hashtable(); | 107 | Hashtable hash = new Hashtable(); |
100 | if (regInfo == null) | 108 | if (regInfo == null) |
109 | { | ||
101 | hash["result"] = "false"; | 110 | hash["result"] = "false"; |
111 | } | ||
102 | else | 112 | else |
103 | { | 113 | { |
104 | hash["result"] = "true"; | 114 | hash["result"] = "true"; |
105 | hash["uuid"] = regInfo.RegionID.ToString(); | 115 | hash["uuid"] = regInfo.RegionID.ToString(); |
106 | hash["x"] = regInfo.RegionLocX.ToString(); | 116 | hash["x"] = regInfo.RegionLocX.ToString(); |
107 | hash["y"] = regInfo.RegionLocY.ToString(); | 117 | hash["y"] = regInfo.RegionLocY.ToString(); |
118 | hash["size_x"] = regInfo.RegionSizeX.ToString(); | ||
119 | hash["size_y"] = regInfo.RegionSizeY.ToString(); | ||
108 | hash["region_name"] = regInfo.RegionName; | 120 | hash["region_name"] = regInfo.RegionName; |
109 | hash["hostname"] = regInfo.ExternalHostName; | 121 | hash["hostname"] = regInfo.ExternalHostName; |
110 | hash["http_port"] = regInfo.HttpPort.ToString(); | 122 | hash["http_port"] = regInfo.HttpPort.ToString(); |
111 | hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); | 123 | hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); |
112 | } | 124 | } |
125 | |||
126 | if (message != null) | ||
127 | hash["message"] = message; | ||
128 | |||
113 | XmlRpcResponse response = new XmlRpcResponse(); | 129 | XmlRpcResponse response = new XmlRpcResponse(); |
114 | response.Value = hash; | 130 | response.Value = hash; |
115 | return response; | 131 | return response; |
diff --git a/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs index 80eb5d2..8145a21 100644 --- a/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs | |||
@@ -54,10 +54,15 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
54 | private IInstantMessage m_IMService; | 54 | private IInstantMessage m_IMService; |
55 | 55 | ||
56 | public InstantMessageServerConnector(IConfigSource config, IHttpServer server) : | 56 | public InstantMessageServerConnector(IConfigSource config, IHttpServer server) : |
57 | this(config, server, null) | 57 | this(config, server, (IInstantMessageSimConnector)null) |
58 | { | 58 | { |
59 | } | 59 | } |
60 | 60 | ||
61 | public InstantMessageServerConnector(IConfigSource config, IHttpServer server, string configName) : | ||
62 | this(config, server) | ||
63 | { | ||
64 | } | ||
65 | |||
61 | public InstantMessageServerConnector(IConfigSource config, IHttpServer server, IInstantMessageSimConnector simConnector) : | 66 | public InstantMessageServerConnector(IConfigSource config, IHttpServer server, IInstantMessageSimConnector simConnector) : |
62 | base(config, server, String.Empty) | 67 | base(config, server, String.Empty) |
63 | { | 68 | { |
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index db62aaa..e112e0e 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | |||
@@ -62,10 +62,15 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
62 | private bool m_VerifyCallers = false; | 62 | private bool m_VerifyCallers = false; |
63 | 63 | ||
64 | public UserAgentServerConnector(IConfigSource config, IHttpServer server) : | 64 | public UserAgentServerConnector(IConfigSource config, IHttpServer server) : |
65 | this(config, server, null) | 65 | this(config, server, (IFriendsSimConnector)null) |
66 | { | 66 | { |
67 | } | 67 | } |
68 | 68 | ||
69 | public UserAgentServerConnector(IConfigSource config, IHttpServer server, string configName) : | ||
70 | this(config, server) | ||
71 | { | ||
72 | } | ||
73 | |||
69 | public UserAgentServerConnector(IConfigSource config, IHttpServer server, IFriendsSimConnector friendsConnector) : | 74 | public UserAgentServerConnector(IConfigSource config, IHttpServer server, IFriendsSimConnector friendsConnector) : |
70 | base(config, server, String.Empty) | 75 | base(config, server, String.Empty) |
71 | { | 76 | { |
@@ -94,8 +99,10 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
94 | server.AddXmlRPCHandler("verify_client", VerifyClient, false); | 99 | server.AddXmlRPCHandler("verify_client", VerifyClient, false); |
95 | server.AddXmlRPCHandler("logout_agent", LogoutAgent, false); | 100 | server.AddXmlRPCHandler("logout_agent", LogoutAgent, false); |
96 | 101 | ||
102 | #pragma warning disable 0612 | ||
97 | server.AddXmlRPCHandler("status_notification", StatusNotification, false); | 103 | server.AddXmlRPCHandler("status_notification", StatusNotification, false); |
98 | server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false); | 104 | server.AddXmlRPCHandler("get_online_friends", GetOnlineFriends, false); |
105 | #pragma warning restore 0612 | ||
99 | server.AddXmlRPCHandler("get_user_info", GetUserInfo, false); | 106 | server.AddXmlRPCHandler("get_user_info", GetUserInfo, false); |
100 | server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false); | 107 | server.AddXmlRPCHandler("get_server_urls", GetServerURLs, false); |
101 | 108 | ||
@@ -103,7 +110,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
103 | server.AddXmlRPCHandler("get_uui", GetUUI, false); | 110 | server.AddXmlRPCHandler("get_uui", GetUUI, false); |
104 | server.AddXmlRPCHandler("get_uuid", GetUUID, false); | 111 | server.AddXmlRPCHandler("get_uuid", GetUUID, false); |
105 | 112 | ||
106 | server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy).Handler); | 113 | server.AddStreamHandler(new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy)); |
107 | } | 114 | } |
108 | 115 | ||
109 | public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient) | 116 | public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient) |
@@ -127,6 +134,8 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
127 | hash["uuid"] = regInfo.RegionID.ToString(); | 134 | hash["uuid"] = regInfo.RegionID.ToString(); |
128 | hash["x"] = regInfo.RegionLocX.ToString(); | 135 | hash["x"] = regInfo.RegionLocX.ToString(); |
129 | hash["y"] = regInfo.RegionLocY.ToString(); | 136 | hash["y"] = regInfo.RegionLocY.ToString(); |
137 | hash["size_x"] = regInfo.RegionSizeX.ToString(); | ||
138 | hash["size_y"] = regInfo.RegionSizeY.ToString(); | ||
130 | hash["region_name"] = regInfo.RegionName; | 139 | hash["region_name"] = regInfo.RegionName; |
131 | hash["hostname"] = regInfo.ExternalHostName; | 140 | hash["hostname"] = regInfo.ExternalHostName; |
132 | hash["http_port"] = regInfo.HttpPort.ToString(); | 141 | hash["http_port"] = regInfo.HttpPort.ToString(); |
@@ -448,7 +457,6 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
448 | XmlRpcResponse response = new XmlRpcResponse(); | 457 | XmlRpcResponse response = new XmlRpcResponse(); |
449 | response.Value = hash; | 458 | response.Value = hash; |
450 | return response; | 459 | return response; |
451 | |||
452 | } | 460 | } |
453 | 461 | ||
454 | /// <summary> | 462 | /// <summary> |
@@ -466,9 +474,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
466 | //string portstr = (string)requestData["port"]; | 474 | //string portstr = (string)requestData["port"]; |
467 | if (requestData.ContainsKey("first") && requestData.ContainsKey("last")) | 475 | if (requestData.ContainsKey("first") && requestData.ContainsKey("last")) |
468 | { | 476 | { |
469 | UUID userID = UUID.Zero; | ||
470 | string first = (string)requestData["first"]; | 477 | string first = (string)requestData["first"]; |
471 | |||
472 | string last = (string)requestData["last"]; | 478 | string last = (string)requestData["last"]; |
473 | UUID uuid = m_HomeUsersService.GetUUID(first, last); | 479 | UUID uuid = m_HomeUsersService.GetUUID(first, last); |
474 | hash["UUID"] = uuid.ToString(); | 480 | hash["UUID"] = uuid.ToString(); |
@@ -477,7 +483,6 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
477 | XmlRpcResponse response = new XmlRpcResponse(); | 483 | XmlRpcResponse response = new XmlRpcResponse(); |
478 | response.Value = hash; | 484 | response.Value = hash; |
479 | return response; | 485 | return response; |
480 | |||
481 | } | 486 | } |
482 | } | 487 | } |
483 | } | 488 | } \ No newline at end of file |