aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs24
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs35
-rw-r--r--OpenSim/Services/GridService/GridService.cs11
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs47
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs128
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs38
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs46
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs21
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs10
10 files changed, 251 insertions, 111 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/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index fbf4648..704790e 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
88 88
89 public void Initialise(IConfigSource source) 89 public void Initialise(IConfigSource source)
90 { 90 {
91 if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) 91 if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector"))
92 { 92 {
93 IConfig gridConfig = source.Configs["UserAccountService"]; 93 IConfig gridConfig = source.Configs["UserAccountService"];
94 if (gridConfig == null) 94 if (gridConfig == null)
@@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
108 serviceUrl = serviceUrl + '/'; 108 serviceUrl = serviceUrl + '/';
109 109
110 m_serverUrl = serviceUrl; 110 m_serverUrl = serviceUrl;
111 IConfig profilesConfig = source.Configs["Profiles"];
112 if (profilesConfig == null)
113 {
114 // Do not run this module by default.
115 return;
116 }
117 else
118 {
119 // if profiles aren't enabled, we're not needed.
120 // if we're not specified as the connector to use, then we're not wanted
121 if (profilesConfig.GetString("Module", String.Empty) != Name)
122 {
123
124 return;
125 }
126 m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
127 }
111 } 128 }
112 } 129 }
113 130
@@ -135,6 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
135 152
136 // Profiles 153 // Profiles
137 client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; 154 client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler;
155
138 client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; 156 client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler;
139 client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; 157 client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler;
140 client.OnUserInfoRequest += UserInfoRequestHandler; 158 client.OnUserInfoRequest += UserInfoRequestHandler;
@@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
302 System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, 320 System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
303 about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); 321 about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID());
304 322
323 OSDMap interests = null;
324 if (user.ContainsKey("LLInterests"))
325 {
326 try
327 {
328 interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap;
329 client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString());
330 }
331 catch { }
332 }
333
334 if (about == null)
335 about = new OSDMap(0);
305 } 336 }
306 else 337 else
307 { 338 {
308 m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); 339 m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
309 client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, 340 client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes,
310 String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); 341 String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
311 } 342 }
312 } 343 }
313 344
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 225530f..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();
@@ -278,7 +279,11 @@ namespace OpenSim.Services.GridService
278 279
279 foreach (RegionData rdata in rdatas) 280 foreach (RegionData rdata in rdatas)
280 if (rdata.RegionID != regionID) 281 if (rdata.RegionID != regionID)
281 rinfos.Add(RegionData2RegionInfo(rdata)); 282 {
283 int flags = Convert.ToInt32(rdata.Data["flags"]);
284 if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
285 rinfos.Add(RegionData2RegionInfo(rdata));
286 }
282 287
283 } 288 }
284 m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); 289 m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count);
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 f48bf60..f581f76 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
@@ -259,13 +261,15 @@ namespace OpenSim.Services.InventoryService
259 261
260 public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) 262 public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID)
261 { 263 {
264// m_log.DebugFormat("[XINVENTORY]: Fetch items for folder {0}", folderID);
265
262 // Since we probably don't get a valid principal here, either ... 266 // Since we probably don't get a valid principal here, either ...
263 // 267 //
264 List<InventoryItemBase> invItems = new List<InventoryItemBase>(); 268 List<InventoryItemBase> invItems = new List<InventoryItemBase>();
265 269
266 XInventoryItem[] items = m_Database.GetItems( 270 XInventoryItem[] items = m_Database.GetItems(
267 new string[] { "parentFolderID"}, 271 new string[] { "parentFolderID" },
268 new string[] { UUID.Zero.ToString() }); 272 new string[] { folderID.ToString() });
269 273
270 foreach (XInventoryItem i in items) 274 foreach (XInventoryItem i in items)
271 invItems.Add(ConvertToOpenSim(i)); 275 invItems.Add(ConvertToOpenSim(i));
@@ -302,10 +306,15 @@ namespace OpenSim.Services.InventoryService
302 // 306 //
303 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) 307 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
304 { 308 {
309 if (!m_AllowDelete)
310 return false;
311
305 // Ignore principal ID, it's bogus at connector level 312 // Ignore principal ID, it's bogus at connector level
306 // 313 //
307 foreach (UUID id in folderIDs) 314 foreach (UUID id in folderIDs)
308 { 315 {
316 if (!ParentIsTrash(id))
317 continue;
309 InventoryFolderBase f = new InventoryFolderBase(); 318 InventoryFolderBase f = new InventoryFolderBase();
310 f.ID = id; 319 f.ID = id;
311 PurgeFolder(f); 320 PurgeFolder(f);
@@ -317,6 +326,12 @@ namespace OpenSim.Services.InventoryService
317 326
318 public virtual bool PurgeFolder(InventoryFolderBase folder) 327 public virtual bool PurgeFolder(InventoryFolderBase folder)
319 { 328 {
329 if (!m_AllowDelete)
330 return false;
331
332 if (!ParentIsTrash(folder.ID))
333 return false;
334
320 XInventoryFolder[] subFolders = m_Database.GetFolders( 335 XInventoryFolder[] subFolders = m_Database.GetFolders(
321 new string[] { "parentFolderID" }, 336 new string[] { "parentFolderID" },
322 new string[] { folder.ID.ToString() }); 337 new string[] { folder.ID.ToString() });
@@ -356,6 +371,9 @@ namespace OpenSim.Services.InventoryService
356 371
357 public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) 372 public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
358 { 373 {
374 if (!m_AllowDelete)
375 return false;
376
359 // Just use the ID... *facepalms* 377 // Just use the ID... *facepalms*
360 // 378 //
361 foreach (UUID id in itemIDs) 379 foreach (UUID id in itemIDs)
@@ -517,5 +535,29 @@ namespace OpenSim.Services.InventoryService
517 535
518 return newItem; 536 return newItem;
519 } 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 UUID parentFolder = folder[0].parentFolderID;
546
547 while (parentFolder != UUID.Zero)
548 {
549 XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
550 if (parent.Length < 1)
551 return false;
552
553 if (parent[0].type == (int)AssetType.TrashFolder)
554 return true;
555 if (parent[0].type == (int)AssetType.RootFolder)
556 return false;
557
558 parentFolder = parent[0].parentFolderID;
559 }
560 return false;
561 }
520 } 562 }
521} 563}
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index 54d53fb..3366922 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -170,6 +170,9 @@ namespace OpenSim.Services.LLLoginService
170 private string firstname; 170 private string firstname;
171 private string lastname; 171 private string lastname;
172 172
173 // Web map
174 private string mapTileURL;
175
173 // Error Flags 176 // Error Flags
174 private string errorReason; 177 private string errorReason;
175 private string errorMessage; 178 private string errorMessage;
@@ -218,7 +221,7 @@ namespace OpenSim.Services.LLLoginService
218 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, 221 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
219 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, 222 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
220 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, 223 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
221 GridRegion home, IPEndPoint clientIP) 224 GridRegion home, IPEndPoint clientIP, string mapTileURL)
222 : this() 225 : this()
223 { 226 {
224 FillOutInventoryData(invSkel, libService); 227 FillOutInventoryData(invSkel, libService);
@@ -234,6 +237,7 @@ namespace OpenSim.Services.LLLoginService
234 Message = message; 237 Message = message;
235 BuddList = ConvertFriendListItem(friendsList); 238 BuddList = ConvertFriendListItem(friendsList);
236 StartLocation = where; 239 StartLocation = where;
240 MapTileURL = mapTileURL;
237 241
238 FillOutHomeData(pinfo, home); 242 FillOutHomeData(pinfo, home);
239 LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); 243 LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
@@ -405,6 +409,7 @@ namespace OpenSim.Services.LLLoginService
405 InitialOutfitHash["folder_name"] = "Nightclub Female"; 409 InitialOutfitHash["folder_name"] = "Nightclub Female";
406 InitialOutfitHash["gender"] = "female"; 410 InitialOutfitHash["gender"] = "female";
407 initialOutfit.Add(InitialOutfitHash); 411 initialOutfit.Add(InitialOutfitHash);
412 mapTileURL = String.Empty;
408 } 413 }
409 414
410 415
@@ -468,6 +473,9 @@ namespace OpenSim.Services.LLLoginService
468 responseData["region_x"] = (Int32)(RegionX); 473 responseData["region_x"] = (Int32)(RegionX);
469 responseData["region_y"] = (Int32)(RegionY); 474 responseData["region_y"] = (Int32)(RegionY);
470 475
476 if (mapTileURL != String.Empty)
477 responseData["map-server-url"] = mapTileURL;
478
471 if (m_buddyList != null) 479 if (m_buddyList != null)
472 { 480 {
473 responseData["buddy-list"] = m_buddyList.ToArray(); 481 responseData["buddy-list"] = m_buddyList.ToArray();
@@ -564,6 +572,9 @@ namespace OpenSim.Services.LLLoginService
564 map["region_x"] = OSD.FromInteger(RegionX); 572 map["region_x"] = OSD.FromInteger(RegionX);
565 map["region_y"] = OSD.FromInteger(RegionY); 573 map["region_y"] = OSD.FromInteger(RegionY);
566 574
575 if (mapTileURL != String.Empty)
576 map["map-server-url"] = OSD.FromString(mapTileURL);
577
567 if (m_buddyList != null) 578 if (m_buddyList != null)
568 { 579 {
569 map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); 580 map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray());
@@ -647,7 +658,7 @@ namespace OpenSim.Services.LLLoginService
647 Hashtable TempHash; 658 Hashtable TempHash;
648 foreach (InventoryFolderBase InvFolder in folders) 659 foreach (InventoryFolderBase InvFolder in folders)
649 { 660 {
650 if (InvFolder.ParentID == UUID.Zero) 661 if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory")
651 { 662 {
652 rootID = InvFolder.ID; 663 rootID = InvFolder.ID;
653 } 664 }
@@ -915,6 +926,12 @@ namespace OpenSim.Services.LLLoginService
915 set { home = value; } 926 set { home = value; }
916 } 927 }
917 928
929 public string MapTileURL
930 {
931 get { return mapTileURL; }
932 set { mapTileURL = value; }
933 }
934
918 public string Message 935 public string Message
919 { 936 {
920 get { return welcomeMessage; } 937 get { return welcomeMessage; }
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 00fffff..036bec6 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -73,6 +73,7 @@ namespace OpenSim.Services.LLLoginService
73 protected int m_MinLoginLevel; 73 protected int m_MinLoginLevel;
74 protected string m_GatekeeperURL; 74 protected string m_GatekeeperURL;
75 protected bool m_AllowRemoteSetLoginLevel; 75 protected bool m_AllowRemoteSetLoginLevel;
76 protected string m_MapTileURL;
76 77
77 IConfig m_LoginServerConfig; 78 IConfig m_LoginServerConfig;
78 79
@@ -100,6 +101,7 @@ namespace OpenSim.Services.LLLoginService
100 m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); 101 m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
101 m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); 102 m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
102 m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); 103 m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
104 m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
103 105
104 // These are required; the others aren't 106 // These are required; the others aren't
105 if (accountService == string.Empty || authService == string.Empty) 107 if (accountService == string.Empty || authService == string.Empty)
@@ -356,7 +358,7 @@ namespace OpenSim.Services.LLLoginService
356 // Finally, fill out the response and return it 358 // Finally, fill out the response and return it
357 // 359 //
358 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, 360 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
359 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP); 361 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL);
360 362
361 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); 363 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
362 return response; 364 return response;
@@ -752,10 +754,8 @@ namespace OpenSim.Services.LLLoginService
752 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); 754 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
753 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) 755 if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
754 { 756 {
755 // We may need to do this at some point, 757 IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address);
756 // so leaving it here in comments. 758 m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */);
757 //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
758 m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
759 return true; 759 return true;
760 } 760 }
761 return false; 761 return false;