diff options
Diffstat (limited to 'OpenSim/Services')
8 files changed, 190 insertions, 103 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 42eca05..96d2605 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
358 | 358 | ||
359 | private bool GetBoolResponse(XmlRpcRequest request, out string reason) | 359 | private bool GetBoolResponse(XmlRpcRequest request, out string reason) |
360 | { | 360 | { |
361 | //m_log.Debug("[HGrid]: Linking to " + uri); | 361 | //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); |
362 | XmlRpcResponse response = null; | 362 | XmlRpcResponse response = null; |
363 | try | 363 | try |
364 | { | 364 | { |
@@ -366,14 +366,14 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
366 | } | 366 | } |
367 | catch (Exception e) | 367 | catch (Exception e) |
368 | { | 368 | { |
369 | m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server "); | 369 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); |
370 | reason = "Exception: " + e.Message; | 370 | reason = "Exception: " + e.Message; |
371 | return false; | 371 | return false; |
372 | } | 372 | } |
373 | 373 | ||
374 | if (response.IsFault) | 374 | if (response.IsFault) |
375 | { | 375 | { |
376 | m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString); | 376 | m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); |
377 | reason = "XMLRPC Fault"; | 377 | reason = "XMLRPC Fault"; |
378 | return false; | 378 | return false; |
379 | } | 379 | } |
@@ -383,15 +383,29 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
383 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | 383 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); |
384 | try | 384 | try |
385 | { | 385 | { |
386 | if (hash == null) | ||
387 | { | ||
388 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
389 | reason = "Internal error 1"; | ||
390 | return false; | ||
391 | } | ||
386 | bool success = false; | 392 | bool success = false; |
387 | reason = string.Empty; | 393 | reason = string.Empty; |
388 | Boolean.TryParse((string)hash["result"], out success); | 394 | if (hash.ContainsKey("result")) |
395 | Boolean.TryParse((string)hash["result"], out success); | ||
396 | else | ||
397 | { | ||
398 | reason = "Internal error 2"; | ||
399 | m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL); | ||
400 | } | ||
389 | 401 | ||
390 | return success; | 402 | return success; |
391 | } | 403 | } |
392 | catch (Exception e) | 404 | catch (Exception e) |
393 | { | 405 | { |
394 | m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace); | 406 | m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response."); |
407 | if (hash.ContainsKey("result") && hash["result"] != null) | ||
408 | m_log.ErrorFormat("Reply was ", (string)hash["result"]); | ||
395 | reason = "Exception: " + e.Message; | 409 | reason = "Exception: " + e.Message; |
396 | return false; | 410 | return false; |
397 | } | 411 | } |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index dc68259..2b6d29c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | |||
@@ -745,6 +745,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
745 | } | 745 | } |
746 | } | 746 | } |
747 | 747 | ||
748 | m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response"); | ||
748 | return invFolders; | 749 | return invFolders; |
749 | } | 750 | } |
750 | 751 | ||
@@ -810,6 +811,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
810 | } | 811 | } |
811 | } | 812 | } |
812 | 813 | ||
814 | m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response"); | ||
813 | return invItems; | 815 | return invItems; |
814 | } | 816 | } |
815 | 817 | ||
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 46d72dc..ebaed42 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Services.GridService | |||
50 | private bool m_DeleteOnUnregister = true; | 50 | private bool m_DeleteOnUnregister = true; |
51 | private static GridService m_RootInstance = null; | 51 | private static GridService m_RootInstance = null; |
52 | protected IConfigSource m_config; | 52 | protected IConfigSource m_config; |
53 | protected HypergridLinker m_HypergridLinker; | 53 | protected static HypergridLinker m_HypergridLinker; |
54 | 54 | ||
55 | protected IAuthenticationService m_AuthenticationService = null; | 55 | protected IAuthenticationService m_AuthenticationService = null; |
56 | protected bool m_AllowDuplicateNames = false; | 56 | protected bool m_AllowDuplicateNames = false; |
@@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService | |||
124 | { | 124 | { |
125 | // Regions reserved for the null key cannot be taken. | 125 | // Regions reserved for the null key cannot be taken. |
126 | if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) | 126 | if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) |
127 | return "Region location us reserved"; | 127 | return "Region location is reserved"; |
128 | 128 | ||
129 | // Treat it as an auth request | 129 | // Treat it as an auth request |
130 | // | 130 | // |
@@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService | |||
210 | { | 210 | { |
211 | int newFlags = 0; | 211 | int newFlags = 0; |
212 | string regionName = rdata.RegionName.Trim().Replace(' ', '_'); | 212 | string regionName = rdata.RegionName.Trim().Replace(' ', '_'); |
213 | newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty)); | ||
213 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); | 214 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); |
214 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); | 215 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); |
215 | rdata.Data["flags"] = newFlags.ToString(); | 216 | rdata.Data["flags"] = newFlags.ToString(); |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index ae80a8c..1f53007 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -378,32 +378,31 @@ namespace OpenSim.Services.GridService | |||
378 | 378 | ||
379 | public void HandleShow(string module, string[] cmd) | 379 | public void HandleShow(string module, string[] cmd) |
380 | { | 380 | { |
381 | MainConsole.Instance.Output("Not Implemented Yet"); | 381 | if (cmd.Length != 2) |
382 | //if (cmd.Length != 2) | 382 | { |
383 | //{ | 383 | MainConsole.Instance.Output("Syntax: show hyperlinks"); |
384 | // MainConsole.Instance.Output("Syntax: show hyperlinks"); | 384 | return; |
385 | // return; | 385 | } |
386 | //} | 386 | List<RegionData> regions = m_Database.GetHyperlinks(UUID.Zero); |
387 | //List<GridRegion> regions = new List<GridRegion>(m_HypergridService.m_HyperlinkRegions.Values); | 387 | if (regions == null || regions.Count < 1) |
388 | //if (regions == null || regions.Count < 1) | 388 | { |
389 | //{ | 389 | MainConsole.Instance.Output("No hyperlinks"); |
390 | // MainConsole.Instance.Output("No hyperlinks"); | 390 | return; |
391 | // return; | 391 | } |
392 | //} | ||
393 | 392 | ||
394 | //MainConsole.Instance.Output("Region Name Region UUID"); | 393 | MainConsole.Instance.Output("Region Name Region UUID"); |
395 | //MainConsole.Instance.Output("Location URI"); | 394 | MainConsole.Instance.Output("Location URI"); |
396 | //MainConsole.Instance.Output("Owner ID "); | 395 | MainConsole.Instance.Output("-------------------------------------------------------------------------------"); |
397 | //MainConsole.Instance.Output("-------------------------------------------------------------------------------"); | 396 | foreach (RegionData r in regions) |
398 | //foreach (GridRegion r in regions) | 397 | { |
399 | //{ | 398 | MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", |
400 | // MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} \n\n", | 399 | r.RegionName, r.RegionID, |
401 | // r.RegionName, r.RegionID, | 400 | String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), |
402 | // String.Format("{0},{1}", r.RegionLocX, r.RegionLocY), "http://" + r.ExternalHostName + ":" + r.HttpPort.ToString(), | 401 | "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString())); |
403 | // r.EstateOwner.ToString())); | 402 | } |
404 | //} | 403 | return; |
405 | //return; | ||
406 | } | 404 | } |
405 | |||
407 | public void RunCommand(string module, string[] cmdparams) | 406 | public void RunCommand(string module, string[] cmdparams) |
408 | { | 407 | { |
409 | List<string> args = new List<string>(cmdparams); | 408 | List<string> args = new List<string>(cmdparams); |
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index c5cfe75..3aaafe8 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService | |||
49 | LogManager.GetLogger( | 49 | LogManager.GetLogger( |
50 | MethodBase.GetCurrentMethod().DeclaringType); | 50 | MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | IGridService m_GridService; | 52 | private static bool m_Initialized = false; |
53 | IPresenceService m_PresenceService; | ||
54 | IUserAccountService m_UserAccountService; | ||
55 | IUserAgentService m_UserAgentService; | ||
56 | ISimulationService m_SimulationService; | ||
57 | 53 | ||
58 | string m_AuthDll; | 54 | private static IGridService m_GridService; |
55 | private static IPresenceService m_PresenceService; | ||
56 | private static IUserAccountService m_UserAccountService; | ||
57 | private static IUserAgentService m_UserAgentService; | ||
58 | private static ISimulationService m_SimulationService; | ||
59 | 59 | ||
60 | UUID m_ScopeID; | 60 | private static UUID m_ScopeID; |
61 | bool m_AllowTeleportsToAnyRegion; | 61 | private static bool m_AllowTeleportsToAnyRegion; |
62 | string m_ExternalName; | 62 | private static string m_ExternalName; |
63 | GridRegion m_DefaultGatewayRegion; | 63 | private static GridRegion m_DefaultGatewayRegion; |
64 | 64 | ||
65 | public GatekeeperService(IConfigSource config, ISimulationService simService) | 65 | public GatekeeperService(IConfigSource config, ISimulationService simService) |
66 | { | 66 | { |
67 | IConfig serverConfig = config.Configs["GatekeeperService"]; | 67 | if (!m_Initialized) |
68 | if (serverConfig == null) | 68 | { |
69 | throw new Exception(String.Format("No section GatekeeperService in config file")); | 69 | m_Initialized = true; |
70 | 70 | ||
71 | string accountService = serverConfig.GetString("UserAccountService", String.Empty); | 71 | IConfig serverConfig = config.Configs["GatekeeperService"]; |
72 | string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); | 72 | if (serverConfig == null) |
73 | string gridService = serverConfig.GetString("GridService", String.Empty); | 73 | throw new Exception(String.Format("No section GatekeeperService in config file")); |
74 | string presenceService = serverConfig.GetString("PresenceService", String.Empty); | 74 | |
75 | string simulationService = serverConfig.GetString("SimulationService", String.Empty); | 75 | string accountService = serverConfig.GetString("UserAccountService", String.Empty); |
76 | 76 | string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty); | |
77 | //m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty); | 77 | string gridService = serverConfig.GetString("GridService", String.Empty); |
78 | 78 | string presenceService = serverConfig.GetString("PresenceService", String.Empty); | |
79 | // These 3 are mandatory, the others aren't | 79 | string simulationService = serverConfig.GetString("SimulationService", String.Empty); |
80 | if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty) | 80 | |
81 | throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); | 81 | // These 3 are mandatory, the others aren't |
82 | 82 | if (gridService == string.Empty || presenceService == string.Empty) | |
83 | string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); | 83 | throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); |
84 | UUID.TryParse(scope, out m_ScopeID); | 84 | |
85 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); | 85 | string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); |
86 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | 86 | UUID.TryParse(scope, out m_ScopeID); |
87 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); | 87 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); |
88 | 88 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | |
89 | Object[] args = new Object[] { config }; | 89 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); |
90 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 90 | |
91 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); | 91 | Object[] args = new Object[] { config }; |
92 | 92 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | |
93 | if (accountService != string.Empty) | 93 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); |
94 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); | 94 | |
95 | if (homeUsersService != string.Empty) | 95 | if (accountService != string.Empty) |
96 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); | 96 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); |
97 | 97 | if (homeUsersService != string.Empty) | |
98 | if (simService != null) | 98 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); |
99 | m_SimulationService = simService; | 99 | |
100 | else if (simulationService != string.Empty) | 100 | if (simService != null) |
101 | m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); | 101 | m_SimulationService = simService; |
102 | 102 | else if (simulationService != string.Empty) | |
103 | if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) | 103 | m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); |
104 | throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); | 104 | |
105 | 105 | if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) | |
106 | m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); | 106 | throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); |
107 | |||
108 | m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); | ||
109 | } | ||
107 | } | 110 | } |
108 | 111 | ||
109 | public GatekeeperService(IConfigSource config) | 112 | public GatekeeperService(IConfigSource config) |
@@ -280,18 +283,23 @@ namespace OpenSim.Services.HypergridService | |||
280 | return false; | 283 | return false; |
281 | } | 284 | } |
282 | 285 | ||
283 | Object[] args = new Object[] { userURL }; | 286 | if (userURL == m_ExternalName) |
284 | IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin<IUserAgentService>(m_AuthDll, args); | 287 | return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); |
285 | if (userAgentService != null) | 288 | else |
286 | { | 289 | { |
287 | try | 290 | Object[] args = new Object[] { userURL }; |
291 | IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); | ||
292 | if (userAgentService != null) | ||
288 | { | 293 | { |
289 | return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); | 294 | try |
290 | } | 295 | { |
291 | catch | 296 | return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); |
292 | { | 297 | } |
293 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); | 298 | catch |
294 | return false; | 299 | { |
300 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); | ||
301 | return false; | ||
302 | } | ||
295 | } | 303 | } |
296 | } | 304 | } |
297 | 305 | ||
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 2f1fed4..181d7f2 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -62,11 +62,18 @@ namespace OpenSim.Services.HypergridService | |||
62 | protected static IGridUserService m_GridUserService; | 62 | protected static IGridUserService m_GridUserService; |
63 | protected static IGridService m_GridService; | 63 | protected static IGridService m_GridService; |
64 | protected static GatekeeperServiceConnector m_GatekeeperConnector; | 64 | protected static GatekeeperServiceConnector m_GatekeeperConnector; |
65 | protected static IGatekeeperService m_GatekeeperService; | ||
66 | |||
67 | protected static string m_GridName; | ||
68 | |||
69 | protected static bool m_BypassClientVerification; | ||
65 | 70 | ||
66 | public UserAgentService(IConfigSource config) | 71 | public UserAgentService(IConfigSource config) |
67 | { | 72 | { |
68 | if (!m_Initialized) | 73 | if (!m_Initialized) |
69 | { | 74 | { |
75 | m_Initialized = true; | ||
76 | |||
70 | m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); | 77 | m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); |
71 | 78 | ||
72 | IConfig serverConfig = config.Configs["UserAgentService"]; | 79 | IConfig serverConfig = config.Configs["UserAgentService"]; |
@@ -75,16 +82,25 @@ namespace OpenSim.Services.HypergridService | |||
75 | 82 | ||
76 | string gridService = serverConfig.GetString("GridService", String.Empty); | 83 | string gridService = serverConfig.GetString("GridService", String.Empty); |
77 | string gridUserService = serverConfig.GetString("GridUserService", String.Empty); | 84 | string gridUserService = serverConfig.GetString("GridUserService", String.Empty); |
85 | string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); | ||
86 | |||
87 | m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); | ||
78 | 88 | ||
79 | if (gridService == string.Empty || gridUserService == string.Empty) | 89 | if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) |
80 | throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); | 90 | throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); |
81 | 91 | ||
82 | Object[] args = new Object[] { config }; | 92 | Object[] args = new Object[] { config }; |
83 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 93 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
84 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); | 94 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); |
85 | m_GatekeeperConnector = new GatekeeperServiceConnector(); | 95 | m_GatekeeperConnector = new GatekeeperServiceConnector(); |
96 | m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); | ||
86 | 97 | ||
87 | m_Initialized = true; | 98 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); |
99 | if (m_GridName == string.Empty) | ||
100 | { | ||
101 | serverConfig = config.Configs["GatekeeperService"]; | ||
102 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); | ||
103 | } | ||
88 | } | 104 | } |
89 | } | 105 | } |
90 | 106 | ||
@@ -131,7 +147,13 @@ namespace OpenSim.Services.HypergridService | |||
131 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); | 147 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); |
132 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); | 148 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); |
133 | 149 | ||
134 | bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | 150 | //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); |
151 | bool success = false; | ||
152 | string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; | ||
153 | if (m_GridName == gridName) | ||
154 | success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); | ||
155 | else | ||
156 | success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | ||
135 | 157 | ||
136 | if (!success) | 158 | if (!success) |
137 | { | 159 | { |
@@ -171,7 +193,7 @@ namespace OpenSim.Services.HypergridService | |||
171 | m_TravelingAgents[agentCircuit.SessionID] = travel; | 193 | m_TravelingAgents[agentCircuit.SessionID] = travel; |
172 | } | 194 | } |
173 | travel.UserID = agentCircuit.AgentID; | 195 | travel.UserID = agentCircuit.AgentID; |
174 | travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort; | 196 | travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; |
175 | travel.ServiceToken = agentCircuit.ServiceSessionID; | 197 | travel.ServiceToken = agentCircuit.ServiceSessionID; |
176 | if (old != null) | 198 | if (old != null) |
177 | travel.ClientToken = old.ClientToken; | 199 | travel.ClientToken = old.ClientToken; |
@@ -207,16 +229,16 @@ namespace OpenSim.Services.HypergridService | |||
207 | return false; | 229 | return false; |
208 | 230 | ||
209 | TravelingAgentInfo travel = m_TravelingAgents[sessionID]; | 231 | TravelingAgentInfo travel = m_TravelingAgents[sessionID]; |
232 | |||
210 | return travel.GridExternalName == thisGridExternalName; | 233 | return travel.GridExternalName == thisGridExternalName; |
211 | } | 234 | } |
212 | 235 | ||
213 | public bool VerifyClient(UUID sessionID, string token) | 236 | public bool VerifyClient(UUID sessionID, string token) |
214 | { | 237 | { |
215 | m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); | 238 | if (m_BypassClientVerification) |
216 | //return true; | 239 | return true; |
217 | 240 | ||
218 | // Commenting this for now until I understand better what part of a sender's | 241 | m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); |
219 | // info stays unchanged throughout a session | ||
220 | 242 | ||
221 | if (m_TravelingAgents.ContainsKey(sessionID)) | 243 | if (m_TravelingAgents.ContainsKey(sessionID)) |
222 | return m_TravelingAgents[sessionID].ClientToken == token; | 244 | return m_TravelingAgents[sessionID].ClientToken == token; |
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index bb24292..f63ab16 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService | |||
45 | MethodBase.GetCurrentMethod().DeclaringType); | 45 | MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | protected IXInventoryData m_Database; | 47 | protected IXInventoryData m_Database; |
48 | protected bool m_AllowDelete = true; | ||
48 | 49 | ||
49 | public XInventoryService(IConfigSource config) : base(config) | 50 | public XInventoryService(IConfigSource config) : base(config) |
50 | { | 51 | { |
@@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService | |||
60 | { | 61 | { |
61 | dllName = authConfig.GetString("StorageProvider", dllName); | 62 | dllName = authConfig.GetString("StorageProvider", dllName); |
62 | connString = authConfig.GetString("ConnectionString", connString); | 63 | connString = authConfig.GetString("ConnectionString", connString); |
64 | m_AllowDelete = authConfig.GetBoolean("AllowDelete", true); | ||
63 | // realm = authConfig.GetString("Realm", realm); | 65 | // realm = authConfig.GetString("Realm", realm); |
64 | } | 66 | } |
65 | 67 | ||
@@ -304,10 +306,15 @@ namespace OpenSim.Services.InventoryService | |||
304 | // | 306 | // |
305 | public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | 307 | public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) |
306 | { | 308 | { |
309 | if (!m_AllowDelete) | ||
310 | return false; | ||
311 | |||
307 | // Ignore principal ID, it's bogus at connector level | 312 | // Ignore principal ID, it's bogus at connector level |
308 | // | 313 | // |
309 | foreach (UUID id in folderIDs) | 314 | foreach (UUID id in folderIDs) |
310 | { | 315 | { |
316 | if (!ParentIsTrash(id)) | ||
317 | continue; | ||
311 | InventoryFolderBase f = new InventoryFolderBase(); | 318 | InventoryFolderBase f = new InventoryFolderBase(); |
312 | f.ID = id; | 319 | f.ID = id; |
313 | PurgeFolder(f); | 320 | PurgeFolder(f); |
@@ -319,6 +326,12 @@ namespace OpenSim.Services.InventoryService | |||
319 | 326 | ||
320 | public virtual bool PurgeFolder(InventoryFolderBase folder) | 327 | public virtual bool PurgeFolder(InventoryFolderBase folder) |
321 | { | 328 | { |
329 | if (!m_AllowDelete) | ||
330 | return false; | ||
331 | |||
332 | if (!ParentIsTrash(folder.ID)) | ||
333 | return false; | ||
334 | |||
322 | XInventoryFolder[] subFolders = m_Database.GetFolders( | 335 | XInventoryFolder[] subFolders = m_Database.GetFolders( |
323 | new string[] { "parentFolderID" }, | 336 | new string[] { "parentFolderID" }, |
324 | new string[] { folder.ID.ToString() }); | 337 | new string[] { folder.ID.ToString() }); |
@@ -358,6 +371,9 @@ namespace OpenSim.Services.InventoryService | |||
358 | 371 | ||
359 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 372 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
360 | { | 373 | { |
374 | if (!m_AllowDelete) | ||
375 | return false; | ||
376 | |||
361 | // Just use the ID... *facepalms* | 377 | // Just use the ID... *facepalms* |
362 | // | 378 | // |
363 | foreach (UUID id in itemIDs) | 379 | foreach (UUID id in itemIDs) |
@@ -519,5 +535,32 @@ namespace OpenSim.Services.InventoryService | |||
519 | 535 | ||
520 | return newItem; | 536 | return newItem; |
521 | } | 537 | } |
538 | |||
539 | private bool ParentIsTrash(UUID folderID) | ||
540 | { | ||
541 | XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()}); | ||
542 | if (folder.Length < 1) | ||
543 | return false; | ||
544 | |||
545 | if (folder[0].type == (int)AssetType.TrashFolder) | ||
546 | return true; | ||
547 | |||
548 | UUID parentFolder = folder[0].parentFolderID; | ||
549 | |||
550 | while (parentFolder != UUID.Zero) | ||
551 | { | ||
552 | XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()}); | ||
553 | if (parent.Length < 1) | ||
554 | return false; | ||
555 | |||
556 | if (parent[0].type == (int)AssetType.TrashFolder) | ||
557 | return true; | ||
558 | if (parent[0].type == (int)AssetType.RootFolder) | ||
559 | return false; | ||
560 | |||
561 | parentFolder = parent[0].parentFolderID; | ||
562 | } | ||
563 | return false; | ||
564 | } | ||
522 | } | 565 | } |
523 | } | 566 | } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index f4e045c..036bec6 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -754,10 +754,8 @@ namespace OpenSim.Services.LLLoginService | |||
754 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); | 754 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); |
755 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) | 755 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) |
756 | { | 756 | { |
757 | // We may need to do this at some point, | 757 | IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address); |
758 | // so leaving it here in comments. | 758 | m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */); |
759 | //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address); | ||
760 | m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString()); | ||
761 | return true; | 759 | return true; |
762 | } | 760 | } |
763 | return false; | 761 | return false; |