aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorUbitUmarov2012-07-17 00:54:23 +0100
committerUbitUmarov2012-07-17 00:54:23 +0100
commitd5f4fb7b50fb7c594b018f8241399e22f88fc951 (patch)
tree8f3dab3d170596f02b1d1d836a0bc08a3e6b8ebd /OpenSim/Services
parentUbitOde: remove useless water collider from active code. (diff)
parentMerge branch 'avination' into careminster (diff)
downloadopensim-SC-d5f4fb7b50fb7c594b018f8241399e22f88fc951.zip
opensim-SC-d5f4fb7b50fb7c594b018f8241399e22f88fc951.tar.gz
opensim-SC-d5f4fb7b50fb7c594b018f8241399e22f88fc951.tar.bz2
opensim-SC-d5f4fb7b50fb7c594b018f8241399e22f88fc951.tar.xz
Merge branch 'avination' into ubitwork
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/AvatarService/AvatarService.cs2
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs (renamed from OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs (renamed from OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs (renamed from OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs (renamed from OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs (renamed from OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServicesConnector.cs (renamed from OpenSim/Services/Connectors/Grid/GridServiceConnector.cs)23
-rw-r--r--OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs (renamed from OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs25
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs (renamed from OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs (renamed from OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs (renamed from OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Land/LandServicesConnector.cs (renamed from OpenSim/Services/Connectors/Land/LandServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs (renamed from OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs (renamed from OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs)3
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs (renamed from OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs28
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationDataService.cs15
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs39
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs (renamed from OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs)0
-rw-r--r--OpenSim/Services/GridService/GridService.cs175
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs2
-rw-r--r--OpenSim/Services/HypergridService/HGFriendsService.cs26
-rw-r--r--OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs110
-rw-r--r--OpenSim/Services/Interfaces/ISimulationService.cs22
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs55
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs69
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs73
28 files changed, 489 insertions, 178 deletions
diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs
index c59a9e0..423c781 100644
--- a/OpenSim/Services/AvatarService/AvatarService.cs
+++ b/OpenSim/Services/AvatarService/AvatarService.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Services.AvatarService
93 if (kvp.Key.StartsWith("_")) 93 if (kvp.Key.StartsWith("_"))
94 count++; 94 count++;
95 95
96 m_log.DebugFormat("[AVATAR SERVICE]: SetAvatar for {0}, attachs={1}", principalID, count); 96// m_log.DebugFormat("[AVATAR SERVICE]: SetAvatar for {0}, attachs={1}", principalID, count);
97 m_Database.Delete("PrincipalID", principalID.ToString()); 97 m_Database.Delete("PrincipalID", principalID.ToString());
98 98
99 AvatarBaseData av = new AvatarBaseData(); 99 AvatarBaseData av = new AvatarBaseData();
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 45ebf3a..45ebf3a 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs
index 2b77154..2b77154 100644
--- a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs
index 35b7109..35b7109 100644
--- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs
index ddfca57..ddfca57 100644
--- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Avatar/AvatarServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs
index b1dd84e..b1dd84e 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
index 7deaf95..f982cc1 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
@@ -116,29 +116,36 @@ namespace OpenSim.Services.Connectors
116 } 116 }
117 else if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "failure")) 117 else if (replyData.ContainsKey("Result")&& (replyData["Result"].ToString().ToLower() == "failure"))
118 { 118 {
119 m_log.DebugFormat("[GRID CONNECTOR]: Registration failed: {0}", replyData["Message"].ToString()); 119 m_log.ErrorFormat(
120 "[GRID CONNECTOR]: Registration failed: {0} when contacting {1}", replyData["Message"], uri);
121
120 return replyData["Message"].ToString(); 122 return replyData["Message"].ToString();
121 } 123 }
122 else if (!replyData.ContainsKey("Result")) 124 else if (!replyData.ContainsKey("Result"))
123 { 125 {
124 m_log.DebugFormat("[GRID CONNECTOR]: reply data does not contain result field"); 126 m_log.ErrorFormat(
127 "[GRID CONNECTOR]: reply data does not contain result field when contacting {0}", uri);
125 } 128 }
126 else 129 else
127 { 130 {
128 m_log.DebugFormat("[GRID CONNECTOR]: unexpected result {0}", replyData["Result"].ToString()); 131 m_log.ErrorFormat(
129 return "Unexpected result "+replyData["Result"].ToString(); 132 "[GRID CONNECTOR]: unexpected result {0} when contacting {1}", replyData["Result"], uri);
133
134 return "Unexpected result " + replyData["Result"].ToString();
130 } 135 }
131
132 } 136 }
133 else 137 else
134 m_log.DebugFormat("[GRID CONNECTOR]: RegisterRegion received null reply"); 138 {
139 m_log.ErrorFormat(
140 "[GRID CONNECTOR]: RegisterRegion received null reply when contacting grid server at {0}", uri);
141 }
135 } 142 }
136 catch (Exception e) 143 catch (Exception e)
137 { 144 {
138 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message); 145 m_log.ErrorFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
139 } 146 }
140 147
141 return "Error communicating with grid service"; 148 return string.Format("Error communicating with the grid service at {0}", uri);
142 } 149 }
143 150
144 public bool DeregisterRegion(UUID regionID) 151 public bool DeregisterRegion(UUID regionID)
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs
index 20d7eaf..20d7eaf 100644
--- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/GridUser/GridUserServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index bc0bc54..4cd933c 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -154,17 +154,32 @@ namespace OpenSim.Services.Connectors.Hypergrid
154 154
155 UUID mapTile = m_HGMapImage; 155 UUID mapTile = m_HGMapImage;
156 string filename = string.Empty; 156 string filename = string.Empty;
157 Bitmap bitmap = null; 157
158 try 158 try
159 { 159 {
160 WebClient c = new WebClient(); 160 WebClient c = new WebClient();
161 //m_log.Debug("JPEG: " + imageURL); 161 //m_log.Debug("JPEG: " + imageURL);
162 string name = regionID.ToString(); 162 string name = regionID.ToString();
163 filename = Path.Combine(storagePath, name + ".jpg"); 163 filename = Path.Combine(storagePath, name + ".jpg");
164 c.DownloadFile(imageURL, filename); 164 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: Map image at {0}, cached at {1}", imageURL, filename);
165 bitmap = new Bitmap(filename); 165 if (!File.Exists(filename))
166 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 166 {
167 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); 167 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: downloading...");
168 c.DownloadFile(imageURL, filename);
169 }
170 else
171 {
172 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image");
173 }
174
175 byte[] imageData = null;
176
177 using (Bitmap bitmap = new Bitmap(filename))
178 {
179 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
180 imageData = OpenJPEG.EncodeFromImage(bitmap, true);
181 }
182
168 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString()); 183 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
169 184
170 // !!! for now 185 // !!! for now
diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs
index e984a54..e984a54 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs
index 5c50936..5c50936 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HeloServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index 9d96703..9d96703 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
index 833e22a..833e22a 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
index 30bfb70..30bfb70 100644
--- a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
+++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
index 888b072..7429293 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
@@ -132,8 +132,7 @@ namespace OpenSim.Services.Connectors
132 try 132 try
133 { 133 {
134 strBuffer = OSDParser.SerializeJsonString(args); 134 strBuffer = OSDParser.SerializeJsonString(args);
135 UTF8Encoding str = new UTF8Encoding(); 135 buffer = Util.UTF8NoBomEncoding.GetBytes(strBuffer);
136 buffer = str.GetBytes(strBuffer);
137 } 136 }
138 catch (Exception e) 137 catch (Exception e)
139 { 138 {
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
index 378aab6..378aab6 100644
--- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs
index 2267325..95e4bab 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs
@@ -79,27 +79,13 @@ namespace OpenSim.Services.Connectors.SimianGrid
79 79
80 public void OnConnectionClose(IClientAPI client) 80 public void OnConnectionClose(IClientAPI client)
81 { 81 {
82 if (client.IsLoggingOut) 82 if (client.SceneAgent.IsChildAgent)
83 { 83 return;
84 object sp = null;
85 Vector3 position = new Vector3(128, 128, 0);
86 Vector3 lookat = new Vector3(0, 1, 0);
87
88 if (client.Scene.TryGetScenePresence(client.AgentId, out sp))
89 {
90 if (sp is ScenePresence)
91 {
92 if (((ScenePresence)sp).IsChildAgent)
93 return;
94
95 position = ((ScenePresence)sp).AbsolutePosition;
96 lookat = ((ScenePresence)sp).Lookat;
97 }
98 }
99 84
100// m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); 85// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
101 m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); 86 m_GridUserService.LoggedOut(
102 } 87 client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID,
88 client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat);
103 } 89 }
104 90
105 void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID) 91 void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID)
@@ -111,4 +97,4 @@ namespace OpenSim.Services.Connectors.SimianGrid
111 }); 97 });
112 } 98 }
113 } 99 }
114} 100} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
index 620bb10..6db830b 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs
@@ -149,6 +149,21 @@ namespace OpenSim.Services.Connectors
149 m_database.RemoveRegionWindlightSettings(regionID); 149 m_database.RemoveRegionWindlightSettings(regionID);
150 } 150 }
151 151
152 public string LoadRegionEnvironmentSettings(UUID regionUUID)
153 {
154 return m_database.LoadRegionEnvironmentSettings(regionUUID);
155 }
156
157 public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
158 {
159 m_database.StoreRegionEnvironmentSettings(regionUUID, settings);
160 }
161
162 public void RemoveRegionEnvironmentSettings(UUID regionUUID)
163 {
164 m_database.RemoveRegionEnvironmentSettings(regionUUID);
165 }
166
152 public UUID[] GetObjectIDs(UUID regionID) 167 public UUID[] GetObjectIDs(UUID regionID)
153 { 168 {
154 return m_database.GetObjectIDs(regionID); 169 return m_database.GetObjectIDs(regionID);
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 5037543..cd93386 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors.Simulation
62 //m_Region = region; 62 //m_Region = region;
63 } 63 }
64 64
65 public IScene GetScene(ulong regionHandle) 65 public IScene GetScene(UUID regionId)
66 { 66 {
67 return null; 67 return null;
68 } 68 }
@@ -320,29 +320,40 @@ namespace OpenSim.Services.Connectors.Simulation
320 { 320 {
321 OSDMap data = (OSDMap)result["_Result"]; 321 OSDMap data = (OSDMap)result["_Result"];
322 322
323 // FIXME: If there is a _Result map then it's the success key here that indicates the true success
324 // or failure, not the sibling result node.
325 success = data["success"];
326
323 reason = data["reason"].AsString(); 327 reason = data["reason"].AsString();
324 if (data["version"] != null && data["version"].AsString() != string.Empty) 328 if (data["version"] != null && data["version"].AsString() != string.Empty)
325 version = data["version"].AsString(); 329 version = data["version"].AsString();
326 330
327 m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1} version {2} ({3})", uri, success, version, data["version"].AsString()); 331 m_log.DebugFormat(
332 "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})",
333 uri, success, reason, version, data["version"].AsString());
328 } 334 }
329 335
330 if (!success) 336 if (!success)
331 { 337 {
332 if (result.ContainsKey("Message")) 338 // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the
339 // actual failure message
340 if (!result.ContainsKey("_Result"))
333 { 341 {
334 string message = result["Message"].AsString(); 342 if (result.ContainsKey("Message"))
335 if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region
336 { 343 {
337 m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored"); 344 string message = result["Message"].AsString();
338 return true; 345 if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region
346 {
347 m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored");
348 return true;
349 }
350
351 reason = result["Message"];
352 }
353 else
354 {
355 reason = "Communications failure";
339 } 356 }
340
341 reason = result["Message"];
342 }
343 else
344 {
345 reason = "Communications failure";
346 } 357 }
347 358
348 return false; 359 return false;
@@ -356,7 +367,7 @@ namespace OpenSim.Services.Connectors.Simulation
356 } 367 }
357 catch (Exception e) 368 catch (Exception e)
358 { 369 {
359 m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] QueryAcess failed with exception; {0}",e.ToString()); 370 m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] QueryAcesss failed with exception; {0}",e.ToString());
360 } 371 }
361 372
362 return false; 373 return false;
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
index 5731e2f..5731e2f 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 3dc87bc..aab403a 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -85,13 +85,39 @@ namespace OpenSim.Services.GridService
85 if (MainConsole.Instance != null) 85 if (MainConsole.Instance != null)
86 { 86 {
87 MainConsole.Instance.Commands.AddCommand("Regions", true, 87 MainConsole.Instance.Commands.AddCommand("Regions", true,
88 "show region", 88 "deregister region id",
89 "show region <Region name>", 89 "deregister region id <Region UUID>",
90 "Deregister a region manually.",
91 String.Empty,
92 HandleDeregisterRegion);
93
94 // A messy way of stopping this command being added if we are in standalone (since the simulator
95 // has an identically named command
96 //
97 // XXX: We're relying on the OpenSimulator version being registered first, which is not well defined.
98 if (MainConsole.Instance.Commands.Resolve(new string[] { "show", "regions" }).Length == 0)
99 MainConsole.Instance.Commands.AddCommand("Regions", true,
100 "show regions",
101 "show regions",
102 "Show details on all regions",
103 String.Empty,
104 HandleShowRegions);
105
106 MainConsole.Instance.Commands.AddCommand("Regions", true,
107 "show region name",
108 "show region name <Region name>",
90 "Show details on a region", 109 "Show details on a region",
91 String.Empty, 110 String.Empty,
92 HandleShowRegion); 111 HandleShowRegion);
93 112
94 MainConsole.Instance.Commands.AddCommand("Regions", true, 113 MainConsole.Instance.Commands.AddCommand("Regions", true,
114 "show region at",
115 "show region at <x-coord> <y-coord>",
116 "Show details on a region at the given co-ordinate.",
117 "For example, show region at 1000 1000",
118 HandleShowRegionAt);
119
120 MainConsole.Instance.Commands.AddCommand("Regions", true,
95 "set region flags", 121 "set region flags",
96 "set region flags <Region name> <flags>", 122 "set region flags <Region name> <flags>",
97 "Set database flags for region", 123 "Set database flags for region",
@@ -495,34 +521,151 @@ namespace OpenSim.Services.GridService
495 return -1; 521 return -1;
496 } 522 }
497 523
524 private void HandleDeregisterRegion(string module, string[] cmd)
525 {
526 if (cmd.Length != 4)
527 {
528 MainConsole.Instance.Output("Syntax: degregister region id <Region UUID>");
529 return;
530 }
531
532 string rawRegionUuid = cmd[3];
533 UUID regionUuid;
534
535 if (!UUID.TryParse(rawRegionUuid, out regionUuid))
536 {
537 MainConsole.Instance.OutputFormat("{0} is not a valid region uuid", rawRegionUuid);
538 return;
539 }
540
541 GridRegion region = GetRegionByUUID(UUID.Zero, regionUuid);
542
543 if (region == null)
544 {
545 MainConsole.Instance.OutputFormat("No region with UUID {0}", regionUuid);
546 return;
547 }
548
549 if (DeregisterRegion(regionUuid))
550 {
551 MainConsole.Instance.OutputFormat("Deregistered {0} {1}", region.RegionName, regionUuid);
552 }
553 else
554 {
555 // I don't think this can ever occur if we know that the region exists.
556 MainConsole.Instance.OutputFormat("Error deregistering {0} {1}", region.RegionName, regionUuid);
557 }
558
559 return;
560 }
561
562 private void HandleShowRegions(string module, string[] cmd)
563 {
564 if (cmd.Length != 2)
565 {
566 MainConsole.Instance.Output("Syntax: show regions");
567 return;
568 }
569
570 List<RegionData> regions = m_Database.Get(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue, UUID.Zero);
571
572 OutputRegionsToConsoleSummary(regions);
573 }
574
575
498 private void HandleShowRegion(string module, string[] cmd) 576 private void HandleShowRegion(string module, string[] cmd)
499 { 577 {
500 if (cmd.Length != 3) 578 if (cmd.Length != 4)
501 { 579 {
502 MainConsole.Instance.Output("Syntax: show region <region name>"); 580 MainConsole.Instance.Output("Syntax: show region name <region name>");
503 return; 581 return;
504 } 582 }
505 List<RegionData> regions = m_Database.Get(cmd[2], UUID.Zero); 583
584 string regionName = cmd[3];
585
586 List<RegionData> regions = m_Database.Get(regionName, UUID.Zero);
506 if (regions == null || regions.Count < 1) 587 if (regions == null || regions.Count < 1)
507 { 588 {
508 MainConsole.Instance.Output("Region not found"); 589 MainConsole.Instance.Output("No region with name {0} found", regionName);
590 return;
591 }
592
593 OutputRegionsToConsole(regions);
594 }
595
596 private void HandleShowRegionAt(string module, string[] cmd)
597 {
598 if (cmd.Length != 5)
599 {
600 MainConsole.Instance.Output("Syntax: show region at <x-coord> <y-coord>");
601 return;
602 }
603
604 int x, y;
605 if (!int.TryParse(cmd[3], out x))
606 {
607 MainConsole.Instance.Output("x-coord must be an integer");
509 return; 608 return;
510 } 609 }
511 610
512 MainConsole.Instance.Output("Region Name Region UUID"); 611 if (!int.TryParse(cmd[4], out y))
513 MainConsole.Instance.Output("Location URI"); 612 {
514 MainConsole.Instance.Output("Owner ID Flags"); 613 MainConsole.Instance.Output("y-coord must be an integer");
515 MainConsole.Instance.Output("-------------------------------------------------------------------------------"); 614 return;
615 }
616
617 RegionData region = m_Database.Get(x * (int)Constants.RegionSize, y * (int)Constants.RegionSize, UUID.Zero);
618 if (region == null)
619 {
620 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);
621 return;
622 }
623
624 OutputRegionToConsole(region);
625 }
626
627 private void OutputRegionToConsole(RegionData r)
628 {
629 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
630
631 ConsoleDisplayList dispList = new ConsoleDisplayList();
632 dispList.AddRow("Region Name", r.RegionName);
633 dispList.AddRow("Region ID", r.RegionID);
634 dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
635 dispList.AddRow("URI", r.Data["serverURI"]);
636 dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
637 dispList.AddRow("Flags", flags);
638
639 MainConsole.Instance.Output(dispList.ToString());
640 }
641
642 private void OutputRegionsToConsole(List<RegionData> regions)
643 {
644 foreach (RegionData r in regions)
645 OutputRegionToConsole(r);
646 }
647
648 private void OutputRegionsToConsoleSummary(List<RegionData> regions)
649 {
650 ConsoleDisplayTable dispTable = new ConsoleDisplayTable();
651 dispTable.AddColumn("Name", 16);
652 dispTable.AddColumn("ID", 36);
653 dispTable.AddColumn("Position", 11);
654 dispTable.AddColumn("Owner ID", 36);
655 dispTable.AddColumn("Flags", 60);
656
516 foreach (RegionData r in regions) 657 foreach (RegionData r in regions)
517 { 658 {
518 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); 659 OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
519 MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n", 660 dispTable.AddRow(
520 r.RegionName, r.RegionID, 661 r.RegionName,
521 String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize), 662 r.RegionID.ToString(),
522 r.Data["serverURI"], 663 string.Format("{0},{1}", r.coordX, r.coordY),
523 r.Data["owner_uuid"], flags)); 664 r.Data["owner_uuid"].ToString(),
665 flags.ToString());
524 } 666 }
525 return; 667
668 MainConsole.Instance.Output(dispTable.ToString());
526 } 669 }
527 670
528 private int ParseFlags(int prev, string flags) 671 private int ParseFlags(int prev, string flags)
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 149a0ab..47d22b9 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -370,8 +370,6 @@ namespace OpenSim.Services.HypergridService
370 return false; 370 return false;
371 } 371 }
372 } 372 }
373
374 return false;
375 } 373 }
376 374
377 // Check that the service token was generated for *this* grid. 375 // Check that the service token was generated for *this* grid.
diff --git a/OpenSim/Services/HypergridService/HGFriendsService.cs b/OpenSim/Services/HypergridService/HGFriendsService.cs
index 39524ab..98423d7 100644
--- a/OpenSim/Services/HypergridService/HGFriendsService.cs
+++ b/OpenSim/Services/HypergridService/HGFriendsService.cs
@@ -276,19 +276,19 @@ namespace OpenSim.Services.HypergridService
276 } 276 }
277 } 277 }
278 278
279 // Lastly, let's notify the rest who may be online somewhere else 279// // Lastly, let's notify the rest who may be online somewhere else
280 foreach (string user in usersToBeNotified) 280// foreach (string user in usersToBeNotified)
281 { 281// {
282 UUID id = new UUID(user); 282// UUID id = new UUID(user);
283 //m_UserAgentService.LocateUser(id); 283// //m_UserAgentService.LocateUser(id);
284 //etc... 284// //etc...
285 //if (m_TravelingAgents.ContainsKey(id) && m_TravelingAgents[id].GridExternalName != m_GridName) 285// //if (m_TravelingAgents.ContainsKey(id) && m_TravelingAgents[id].GridExternalName != m_GridName)
286 //{ 286// //{
287 // string url = m_TravelingAgents[id].GridExternalName; 287// // string url = m_TravelingAgents[id].GridExternalName;
288 // // forward 288// // // forward
289 //} 289// //}
290 //m_log.WarnFormat("[HGFRIENDS SERVICE]: User {0} is visiting another grid. HG Status notifications still not implemented.", user); 290// //m_log.WarnFormat("[HGFRIENDS SERVICE]: User {0} is visiting another grid. HG Status notifications still not implemented.", user);
291 } 291// }
292 292
293 // and finally, let's send the online friends 293 // and finally, let's send the online friends
294 if (online) 294 if (online)
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
index b6ec558..6e4b68c 100644
--- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
+++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Services.HypergridService
57 private string m_HomeURL; 57 private string m_HomeURL;
58 private IUserAccountService m_UserAccountService; 58 private IUserAccountService m_UserAccountService;
59 59
60 private UserAccountCache m_Cache; 60// private UserAccountCache m_Cache;
61 61
62 private ExpiringCache<UUID, List<XInventoryFolder>> m_SuitcaseTrees = new ExpiringCache<UUID, List<XInventoryFolder>>(); 62 private ExpiringCache<UUID, List<XInventoryFolder>> m_SuitcaseTrees = new ExpiringCache<UUID, List<XInventoryFolder>>();
63 63
@@ -92,7 +92,7 @@ namespace OpenSim.Services.HypergridService
92 // Preferred 92 // Preferred
93 m_HomeURL = invConfig.GetString("HomeURI", m_HomeURL); 93 m_HomeURL = invConfig.GetString("HomeURI", m_HomeURL);
94 94
95 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); 95// m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
96 } 96 }
97 97
98 m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Starting..."); 98 m_log.Debug("[HG SUITCASE INVENTORY SERVICE]: Starting...");
@@ -107,9 +107,8 @@ namespace OpenSim.Services.HypergridService
107 public override List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) 107 public override List<InventoryFolderBase> GetInventorySkeleton(UUID principalID)
108 { 108 {
109 XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); 109 XInventoryFolder suitcase = GetSuitcaseXFolder(principalID);
110 XInventoryFolder root = GetRootXFolder(principalID);
111 110
112 List<XInventoryFolder> tree = GetFolderTree(suitcase.folderID); 111 List<XInventoryFolder> tree = GetFolderTree(principalID, suitcase.folderID);
113 if (tree == null || (tree != null && tree.Count == 0)) 112 if (tree == null || (tree != null && tree.Count == 0))
114 return null; 113 return null;
115 114
@@ -119,7 +118,7 @@ namespace OpenSim.Services.HypergridService
119 folders.Add(ConvertToOpenSim(x)); 118 folders.Add(ConvertToOpenSim(x));
120 } 119 }
121 120
122 SetAsRootFolder(suitcase, root); 121 SetAsNormalFolder(suitcase);
123 folders.Add(ConvertToOpenSim(suitcase)); 122 folders.Add(ConvertToOpenSim(suitcase));
124 123
125 return folders; 124 return folders;
@@ -134,12 +133,11 @@ namespace OpenSim.Services.HypergridService
134 userInventory.Items = new List<InventoryItemBase>(); 133 userInventory.Items = new List<InventoryItemBase>();
135 134
136 XInventoryFolder suitcase = GetSuitcaseXFolder(userID); 135 XInventoryFolder suitcase = GetSuitcaseXFolder(userID);
137 XInventoryFolder root = GetRootXFolder(userID);
138 136
139 List<XInventoryFolder> tree = GetFolderTree(suitcase.folderID); 137 List<XInventoryFolder> tree = GetFolderTree(userID, suitcase.folderID);
140 if (tree == null || (tree != null && tree.Count == 0)) 138 if (tree == null || (tree != null && tree.Count == 0))
141 { 139 {
142 SetAsRootFolder(suitcase, root); 140 SetAsNormalFolder(suitcase);
143 userInventory.Folders.Add(ConvertToOpenSim(suitcase)); 141 userInventory.Folders.Add(ConvertToOpenSim(suitcase));
144 return userInventory; 142 return userInventory;
145 } 143 }
@@ -164,7 +162,7 @@ namespace OpenSim.Services.HypergridService
164 userInventory.Items.AddRange(items); 162 userInventory.Items.AddRange(items);
165 } 163 }
166 164
167 SetAsRootFolder(suitcase, root); 165 SetAsNormalFolder(suitcase);
168 userInventory.Folders.Add(ConvertToOpenSim(suitcase)); 166 userInventory.Folders.Add(ConvertToOpenSim(suitcase));
169 167
170 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetUserInventory for user {0} returning {1} folders and {2} items", 168 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetUserInventory for user {0} returning {1} folders and {2} items",
@@ -175,14 +173,13 @@ namespace OpenSim.Services.HypergridService
175 public override InventoryFolderBase GetRootFolder(UUID principalID) 173 public override InventoryFolderBase GetRootFolder(UUID principalID)
176 { 174 {
177 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetRootFolder for {0}", principalID); 175 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetRootFolder for {0}", principalID);
178 if (m_Database == null)
179 m_log.ErrorFormat("[XXX]: m_Database is NULL!");
180 176
181 // Let's find out the local root folder 177 // Let's find out the local root folder
182 XInventoryFolder root = GetRootXFolder(principalID); ; 178 XInventoryFolder root = GetRootXFolder(principalID); ;
183 if (root == null) 179 if (root == null)
184 { 180 {
185 m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve local root folder for user {0}", principalID); 181 m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve local root folder for user {0}", principalID);
182 return null;
186 } 183 }
187 184
188 // Warp! Root folder for travelers is the suitcase folder 185 // Warp! Root folder for travelers is the suitcase folder
@@ -202,7 +199,7 @@ namespace OpenSim.Services.HypergridService
202 CreateSystemFolders(principalID, suitcase.folderID); 199 CreateSystemFolders(principalID, suitcase.folderID);
203 } 200 }
204 201
205 SetAsRootFolder(suitcase, root); 202 SetAsNormalFolder(suitcase);
206 203
207 return ConvertToOpenSim(suitcase); 204 return ConvertToOpenSim(suitcase);
208 } 205 }
@@ -271,9 +268,8 @@ namespace OpenSim.Services.HypergridService
271 public override InventoryCollection GetFolderContent(UUID principalID, UUID folderID) 268 public override InventoryCollection GetFolderContent(UUID principalID, UUID folderID)
272 { 269 {
273 InventoryCollection coll = null; 270 InventoryCollection coll = null;
274 XInventoryFolder suitcase = GetSuitcaseXFolder(principalID);
275 271
276 if (!IsWithinSuitcaseTree(folderID, suitcase)) 272 if (!IsWithinSuitcaseTree(principalID, folderID))
277 return new InventoryCollection(); 273 return new InventoryCollection();
278 274
279 coll = base.GetFolderContent(principalID, folderID); 275 coll = base.GetFolderContent(principalID, folderID);
@@ -290,9 +286,7 @@ namespace OpenSim.Services.HypergridService
290 { 286 {
291 // Let's do a bit of sanity checking, more than the base service does 287 // Let's do a bit of sanity checking, more than the base service does
292 // make sure the given folder exists under the suitcase tree of this user 288 // make sure the given folder exists under the suitcase tree of this user
293 XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); 289 if (!IsWithinSuitcaseTree(principalID, folderID))
294
295 if (!IsWithinSuitcaseTree(folderID, suitcase))
296 return new List<InventoryItemBase>(); 290 return new List<InventoryItemBase>();
297 291
298 return base.GetFolderItems(principalID, folderID); 292 return base.GetFolderItems(principalID, folderID);
@@ -303,21 +297,27 @@ namespace OpenSim.Services.HypergridService
303 m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder {0} {1}", folder.Name, folder.ParentID); 297 m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder {0} {1}", folder.Name, folder.ParentID);
304 // Let's do a bit of sanity checking, more than the base service does 298 // Let's do a bit of sanity checking, more than the base service does
305 // make sure the given folder's parent folder exists under the suitcase tree of this user 299 // make sure the given folder's parent folder exists under the suitcase tree of this user
306 XInventoryFolder suitcase = GetSuitcaseXFolder(folder.Owner);
307 300
308 if (!IsWithinSuitcaseTree(folder.ParentID, suitcase)) 301 if (!IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
309 return false; 302 return false;
310 303
311 // OK, it's legit 304 // OK, it's legit
312 return base.AddFolder(folder); 305 if (base.AddFolder(folder))
306 {
307 List<XInventoryFolder> tree;
308 if (m_SuitcaseTrees.TryGetValue(folder.Owner, out tree))
309 tree.Add(ConvertFromOpenSim(folder));
310
311 return true;
312 }
313
314 return false;
313 } 315 }
314 316
315 public override bool UpdateFolder(InventoryFolderBase folder) 317 public override bool UpdateFolder(InventoryFolderBase folder)
316 { 318 {
317 XInventoryFolder suitcase = GetSuitcaseXFolder(folder.Owner);
318
319 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); 319 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version);
320 if (!IsWithinSuitcaseTree(folder.ID, suitcase)) 320 if (!IsWithinSuitcaseTree(folder.Owner, folder.ID))
321 { 321 {
322 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name); 322 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name);
323 return false; 323 return false;
@@ -329,9 +329,8 @@ namespace OpenSim.Services.HypergridService
329 329
330 public override bool MoveFolder(InventoryFolderBase folder) 330 public override bool MoveFolder(InventoryFolderBase folder)
331 { 331 {
332 XInventoryFolder suitcase = GetSuitcaseXFolder(folder.Owner); 332 if (!IsWithinSuitcaseTree(folder.Owner, folder.ID) ||
333 333 !IsWithinSuitcaseTree(folder.Owner, folder.ParentID))
334 if (!IsWithinSuitcaseTree(folder.ID, suitcase) || !IsWithinSuitcaseTree(folder.ParentID, suitcase))
335 return false; 334 return false;
336 335
337 return base.MoveFolder(folder); 336 return base.MoveFolder(folder);
@@ -353,9 +352,7 @@ namespace OpenSim.Services.HypergridService
353 { 352 {
354 // Let's do a bit of sanity checking, more than the base service does 353 // Let's do a bit of sanity checking, more than the base service does
355 // make sure the given folder's parent folder exists under the suitcase tree of this user 354 // make sure the given folder's parent folder exists under the suitcase tree of this user
356 XInventoryFolder suitcase = GetSuitcaseXFolder(item.Owner); 355 if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
357
358 if (!IsWithinSuitcaseTree(item.Folder, suitcase))
359 return false; 356 return false;
360 357
361 // OK, it's legit 358 // OK, it's legit
@@ -365,9 +362,7 @@ namespace OpenSim.Services.HypergridService
365 362
366 public override bool UpdateItem(InventoryItemBase item) 363 public override bool UpdateItem(InventoryItemBase item)
367 { 364 {
368 XInventoryFolder suitcase = GetSuitcaseXFolder(item.Owner); 365 if (!IsWithinSuitcaseTree(item.Owner, item.Folder))
369
370 if (!IsWithinSuitcaseTree(item.Folder, suitcase))
371 return false; 366 return false;
372 367
373 return base.UpdateItem(item); 368 return base.UpdateItem(item);
@@ -377,9 +372,7 @@ namespace OpenSim.Services.HypergridService
377 { 372 {
378 // Principal is b0rked. *sigh* 373 // Principal is b0rked. *sigh*
379 374
380 XInventoryFolder suitcase = GetSuitcaseXFolder(items[0].Owner); 375 if (!IsWithinSuitcaseTree(items[0].Owner, items[0].Folder))
381
382 if (!IsWithinSuitcaseTree(items[0].Folder, suitcase))
383 return false; 376 return false;
384 377
385 return base.MoveItems(principalID, items); 378 return base.MoveItems(principalID, items);
@@ -400,15 +393,8 @@ namespace OpenSim.Services.HypergridService
400 item.Name, item.ID, item.Folder); 393 item.Name, item.ID, item.Folder);
401 return null; 394 return null;
402 } 395 }
403 XInventoryFolder suitcase = GetSuitcaseXFolder(it.Owner);
404 if (suitcase == null)
405 {
406 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Root or Suitcase are null for user {0}",
407 it.Owner);
408 return null;
409 }
410 396
411 if (!IsWithinSuitcaseTree(it.Folder, suitcase)) 397 if (!IsWithinSuitcaseTree(it.Owner, it.Folder))
412 { 398 {
413 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0} (folder {1}) is not within Suitcase", 399 m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Item {0} (folder {1}) is not within Suitcase",
414 it.Name, it.Folder); 400 it.Name, it.Folder);
@@ -431,9 +417,7 @@ namespace OpenSim.Services.HypergridService
431 417
432 if (f != null) 418 if (f != null)
433 { 419 {
434 XInventoryFolder suitcase = GetSuitcaseXFolder(f.Owner); 420 if (!IsWithinSuitcaseTree(f.Owner, f.ID))
435
436 if (!IsWithinSuitcaseTree(f.ID, suitcase))
437 return null; 421 return null;
438 } 422 }
439 423
@@ -481,22 +465,37 @@ namespace OpenSim.Services.HypergridService
481 465
482 if (folders != null && folders.Length > 0) 466 if (folders != null && folders.Length > 0)
483 return folders[0]; 467 return folders[0];
468
469 // check to see if we have the old Suitcase folder
470 folders = m_Database.GetFolders(
471 new string[] { "agentID", "folderName", "parentFolderID" },
472 new string[] { principalID.ToString(), "My Suitcase", UUID.Zero.ToString() });
473 if (folders != null && folders.Length > 0)
474 {
475 // Move it to under the root folder
476 XInventoryFolder root = GetRootXFolder(principalID);
477 folders[0].parentFolderID = root.folderID;
478 folders[0].type = 100;
479 m_Database.StoreFolder(folders[0]);
480 return folders[0];
481 }
482
484 return null; 483 return null;
485 } 484 }
486 485
487 private void SetAsRootFolder(XInventoryFolder suitcase, XInventoryFolder root) 486 private void SetAsNormalFolder(XInventoryFolder suitcase)
488 { 487 {
489 suitcase.type = (short)AssetType.Folder; 488 suitcase.type = (short)AssetType.Folder;
490 } 489 }
491 490
492 private List<XInventoryFolder> GetFolderTree(UUID folder) 491 private List<XInventoryFolder> GetFolderTree(UUID principalID, UUID folder)
493 { 492 {
494 List<XInventoryFolder> t = null; 493 List<XInventoryFolder> t = null;
495 if (m_SuitcaseTrees.TryGetValue(folder, out t)) 494 if (m_SuitcaseTrees.TryGetValue(principalID, out t))
496 return t; 495 return t;
497 496
498 t = GetFolderTreeRecursive(folder); 497 t = GetFolderTreeRecursive(folder);
499 m_SuitcaseTrees.AddOrUpdate(folder, t, 120); 498 m_SuitcaseTrees.AddOrUpdate(principalID, t, 5*60); // 5minutes
500 return t; 499 return t;
501 } 500 }
502 501
@@ -528,11 +527,18 @@ namespace OpenSim.Services.HypergridService
528 /// <param name="root"></param> 527 /// <param name="root"></param>
529 /// <param name="suitcase"></param> 528 /// <param name="suitcase"></param>
530 /// <returns></returns> 529 /// <returns></returns>
531 private bool IsWithinSuitcaseTree(UUID folderID, XInventoryFolder suitcase) 530 private bool IsWithinSuitcaseTree(UUID principalID, UUID folderID)
532 { 531 {
532 XInventoryFolder suitcase = GetSuitcaseXFolder(principalID);
533 if (suitcase == null)
534 {
535 m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder", principalID);
536 return false;
537 }
538
533 List<XInventoryFolder> tree = new List<XInventoryFolder>(); 539 List<XInventoryFolder> tree = new List<XInventoryFolder>();
534 tree.Add(suitcase); // Warp! the tree is the real root folder plus the children of the suitcase folder 540 tree.Add(suitcase); // Warp! the tree is the real root folder plus the children of the suitcase folder
535 tree.AddRange(GetFolderTree(suitcase.folderID)); 541 tree.AddRange(GetFolderTree(principalID, suitcase.folderID));
536 XInventoryFolder f = tree.Find(delegate(XInventoryFolder fl) 542 XInventoryFolder f = tree.Find(delegate(XInventoryFolder fl)
537 { 543 {
538 if (fl.folderID == folderID) return true; 544 if (fl.folderID == folderID) return true;
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs
index 7940256..a963b8e 100644
--- a/OpenSim/Services/Interfaces/ISimulationService.cs
+++ b/OpenSim/Services/Interfaces/ISimulationService.cs
@@ -35,7 +35,17 @@ namespace OpenSim.Services.Interfaces
35{ 35{
36 public interface ISimulationService 36 public interface ISimulationService
37 { 37 {
38 IScene GetScene(ulong regionHandle); 38 /// <summary>
39 /// Retrieve the scene with the given region ID.
40 /// </summary>
41 /// <param name='regionId'>
42 /// Region identifier.
43 /// </param>
44 /// <returns>
45 /// The scene.
46 /// </returns>
47 IScene GetScene(UUID regionId);
48
39 ISimulationService GetInnerService(); 49 ISimulationService GetInnerService();
40 50
41 #region Agents 51 #region Agents
@@ -108,16 +118,6 @@ namespace OpenSim.Services.Interfaces
108 /// <returns></returns> 118 /// <returns></returns>
109 bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall); 119 bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall);
110 120
111 /// <summary>
112 /// Create an object from the user's inventory in the destination region.
113 /// This message is used primarily by clients.
114 /// </summary>
115 /// <param name="regionHandle"></param>
116 /// <param name="userID"></param>
117 /// <param name="itemID"></param>
118 /// <returns></returns>
119 bool CreateObject(GridRegion destination, UUID userID, UUID itemID);
120
121 #endregion Objects 121 #endregion Objects
122 122
123 } 123 }
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 0e7a358..7518b86 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -52,6 +52,7 @@ namespace OpenSim.Services.InventoryService
52 : this(config, "InventoryService") 52 : this(config, "InventoryService")
53 { 53 {
54 } 54 }
55
55 public XInventoryService(IConfigSource config, string configName) : base(config) 56 public XInventoryService(IConfigSource config, string configName) : base(config)
56 { 57 {
57 if (configName != string.Empty) 58 if (configName != string.Empty)
@@ -301,46 +302,62 @@ namespace OpenSim.Services.InventoryService
301 302
302 public virtual bool AddFolder(InventoryFolderBase folder) 303 public virtual bool AddFolder(InventoryFolderBase folder)
303 { 304 {
304 //m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID); 305// m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID);
306
305 InventoryFolderBase check = GetFolder(folder); 307 InventoryFolderBase check = GetFolder(folder);
306 if (check != null) 308 if (check != null)
307 return false; 309 return false;
308 310
309 if (folder.Type == (short)AssetType.Folder || folder.Type == (short)AssetType.Unknown || 311 if (folder.Type == (short)AssetType.Folder
310 GetFolderForType(folder.Owner, (AssetType)(folder.Type)) == null) 312 || folder.Type == (short)AssetType.Unknown
313 || folder.Type == (short)AssetType.OutfitFolder
314 || GetFolderForType(folder.Owner, (AssetType)(folder.Type)) == null)
311 { 315 {
312 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 316 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
313 return m_Database.StoreFolder(xFolder); 317 return m_Database.StoreFolder(xFolder);
314 } 318 }
315 else 319 else
316 m_log.DebugFormat("[XINVENTORY]: Folder {0} of type {1} already exists", folder.Name, folder.Type); 320 {
321 m_log.WarnFormat(
322 "[XINVENTORY]: Folder of type {0} already exists when tried to add {1} to {2} for {3}",
323 folder.Type, folder.Name, folder.ParentID, folder.Owner);
324 }
317 325
318 return false; 326 return false;
319 } 327 }
320 328
321 public virtual bool UpdateFolder(InventoryFolderBase folder) 329 public virtual bool UpdateFolder(InventoryFolderBase folder)
322 { 330 {
323 //m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID); 331// m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID);
332
324 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 333 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
325 InventoryFolderBase check = GetFolder(folder); 334 InventoryFolderBase check = GetFolder(folder);
335
326 if (check == null) 336 if (check == null)
327 return AddFolder(folder); 337 return AddFolder(folder);
328 338
329 if (check.Type != -1 || xFolder.type != -1) 339 if ((check.Type != (short)AssetType.Unknown || xFolder.type != (short)AssetType.Unknown)
340 && (check.Type != (short)AssetType.OutfitFolder || xFolder.type != (short)AssetType.OutfitFolder))
330 { 341 {
331 if (xFolder.version < check.Version) 342 if (xFolder.version < check.Version)
332 { 343 {
333 //m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version); 344// m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version);
334 return false; 345 return false;
335 } 346 }
347
336 check.Version = (ushort)xFolder.version; 348 check.Version = (ushort)xFolder.version;
337 xFolder = ConvertFromOpenSim(check); 349 xFolder = ConvertFromOpenSim(check);
338 //m_log.DebugFormat("[XINVENTORY]: Storing {0} {1} {2}", xFolder.folderName, xFolder.version, xFolder.type); 350
351// m_log.DebugFormat(
352// "[XINVENTORY]: Storing version only update to system folder {0} {1} {2}",
353// xFolder.folderName, xFolder.version, xFolder.type);
354
339 return m_Database.StoreFolder(xFolder); 355 return m_Database.StoreFolder(xFolder);
340 } 356 }
341 357
342 if (xFolder.version < check.Version) 358 if (xFolder.version < check.Version)
343 xFolder.version = check.Version; 359 xFolder.version = check.Version;
360
344 xFolder.folderID = check.ID; 361 xFolder.folderID = check.ID;
345 362
346 return m_Database.StoreFolder(xFolder); 363 return m_Database.StoreFolder(xFolder);
@@ -364,6 +381,11 @@ namespace OpenSim.Services.InventoryService
364 // 381 //
365 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) 382 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
366 { 383 {
384 return DeleteFolders(principalID, folderIDs, true);
385 }
386
387 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs, bool onlyIfTrash)
388 {
367 if (!m_AllowDelete) 389 if (!m_AllowDelete)
368 return false; 390 return false;
369 391
@@ -371,11 +393,12 @@ namespace OpenSim.Services.InventoryService
371 // 393 //
372 foreach (UUID id in folderIDs) 394 foreach (UUID id in folderIDs)
373 { 395 {
374 if (!ParentIsTrash(id)) 396 if (onlyIfTrash && !ParentIsTrash(id))
375 continue; 397 continue;
398 //m_log.InfoFormat("[XINVENTORY SERVICE]: Delete folder {0}", id);
376 InventoryFolderBase f = new InventoryFolderBase(); 399 InventoryFolderBase f = new InventoryFolderBase();
377 f.ID = id; 400 f.ID = id;
378 PurgeFolder(f); 401 PurgeFolder(f, onlyIfTrash);
379 m_Database.DeleteFolders("folderID", id.ToString()); 402 m_Database.DeleteFolders("folderID", id.ToString());
380 } 403 }
381 404
@@ -384,10 +407,15 @@ namespace OpenSim.Services.InventoryService
384 407
385 public virtual bool PurgeFolder(InventoryFolderBase folder) 408 public virtual bool PurgeFolder(InventoryFolderBase folder)
386 { 409 {
410 return PurgeFolder(folder, true);
411 }
412
413 public virtual bool PurgeFolder(InventoryFolderBase folder, bool onlyIfTrash)
414 {
387 if (!m_AllowDelete) 415 if (!m_AllowDelete)
388 return false; 416 return false;
389 417
390 if (!ParentIsTrash(folder.ID)) 418 if (onlyIfTrash && !ParentIsTrash(folder.ID))
391 return false; 419 return false;
392 420
393 XInventoryFolder[] subFolders = m_Database.GetFolders( 421 XInventoryFolder[] subFolders = m_Database.GetFolders(
@@ -396,7 +424,7 @@ namespace OpenSim.Services.InventoryService
396 424
397 foreach (XInventoryFolder x in subFolders) 425 foreach (XInventoryFolder x in subFolders)
398 { 426 {
399 PurgeFolder(ConvertToOpenSim(x)); 427 PurgeFolder(ConvertToOpenSim(x), onlyIfTrash);
400 m_Database.DeleteFolders("folderID", x.folderID.ToString()); 428 m_Database.DeleteFolders("folderID", x.folderID.ToString());
401 } 429 }
402 430
@@ -408,14 +436,13 @@ namespace OpenSim.Services.InventoryService
408 public virtual bool AddItem(InventoryItemBase item) 436 public virtual bool AddItem(InventoryItemBase item)
409 { 437 {
410// m_log.DebugFormat( 438// m_log.DebugFormat(
411// "[XINVENTORY SERVICE]: Adding item {0} to folder {1} for {2}", item.ID, item.Folder, item.Owner); 439// "[XINVENTORY SERVICE]: Adding item {0} {1} to folder {2} for {3}", item.Name, item.ID, item.Folder, item.Owner);
412 440
413 return m_Database.StoreItem(ConvertFromOpenSim(item)); 441 return m_Database.StoreItem(ConvertFromOpenSim(item));
414 } 442 }
415 443
416 public virtual bool UpdateItem(InventoryItemBase item) 444 public virtual bool UpdateItem(InventoryItemBase item)
417 { 445 {
418// throw new Exception("urrgh");
419 if (!m_AllowDelete) 446 if (!m_AllowDelete)
420 if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder) 447 if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder)
421 return false; 448 return false;
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index 079bcb1..a4b3cbd 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -231,7 +231,8 @@ namespace OpenSim.Services.LLLoginService
231 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, 231 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
232 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, 232 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
233 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, 233 string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
234 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency) 234 GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency,
235 string DSTZone)
235 : this() 236 : this()
236 { 237 {
237 FillOutInventoryData(invSkel, libService); 238 FillOutInventoryData(invSkel, libService);
@@ -260,7 +261,45 @@ namespace OpenSim.Services.LLLoginService
260 FillOutRegionData(destination); 261 FillOutRegionData(destination);
261 262
262 FillOutSeedCap(aCircuit, destination, clientIP); 263 FillOutSeedCap(aCircuit, destination, clientIP);
263 264
265 switch (DSTZone)
266 {
267 case "none":
268 DST = "N";
269 break;
270 case "local":
271 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
272 break;
273 default:
274 TimeZoneInfo dstTimeZone = null;
275 string[] tzList = DSTZone.Split(';');
276
277 foreach (string tzName in tzList)
278 {
279 try
280 {
281 dstTimeZone = TimeZoneInfo.FindSystemTimeZoneById(tzName);
282 }
283 catch
284 {
285 continue;
286 }
287 break;
288 }
289
290 if (dstTimeZone == null)
291 {
292 m_log.WarnFormat(
293 "[LLOGIN RESPONSE]: No valid timezone found for DST in {0}, falling back to system time.", tzList);
294 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
295 }
296 else
297 {
298 DST = dstTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
299 }
300
301 break;
302 }
264 } 303 }
265 304
266 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService) 305 private void FillOutInventoryData(List<InventoryFolderBase> invSkel, ILibraryService libService)
@@ -355,7 +394,31 @@ namespace OpenSim.Services.LLLoginService
355 394
356 private void SetDefaultValues() 395 private void SetDefaultValues()
357 { 396 {
358 DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N"; 397 TimeZoneInfo gridTimeZone;
398
399 // Disabled for now pending making timezone a config value, which can at some point have a default of
400 // a ; separated list of possible timezones.
401 // The problem here is that US/Pacific (or even the Olsen America/Los_Angeles) is not universal across
402 // windows, mac and various distributions of linux, introducing another element of consistency.
403 // The server operator needs to be able to control this setting
404// try
405// {
406// // First try to fetch DST from Pacific Standard Time, because this is
407// // the one expected by the viewer. "US/Pacific" is the string to search
408// // on linux and mac, and should work also on Windows (to confirm)
409// gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific");
410// }
411// catch (Exception e)
412// {
413// m_log.WarnFormat(
414// "[TIMEZONE]: {0} Falling back to system time. System time should be set to Pacific Standard Time to provide the expected time",
415// e.Message);
416
417 gridTimeZone = TimeZoneInfo.Local;
418// }
419
420 DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
421
359 StipendSinceLogin = "N"; 422 StipendSinceLogin = "N";
360 Gendered = "Y"; 423 Gendered = "Y";
361 EverLoggedIn = "Y"; 424 EverLoggedIn = "Y";
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 891c452..ed887d9 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -82,6 +82,8 @@ namespace OpenSim.Services.LLLoginService
82 protected string m_AllowedClients; 82 protected string m_AllowedClients;
83 protected string m_DeniedClients; 83 protected string m_DeniedClients;
84 84
85 protected string m_DSTZone;
86
85 IConfig m_LoginServerConfig; 87 IConfig m_LoginServerConfig;
86// IConfig m_ClientsConfig; 88// IConfig m_ClientsConfig;
87 89
@@ -118,6 +120,8 @@ namespace OpenSim.Services.LLLoginService
118 m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); 120 m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
119 m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); 121 m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);
120 122
123 m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time");
124
121 // Clean up some of these vars 125 // Clean up some of these vars
122 if (m_MapTileURL != String.Empty) 126 if (m_MapTileURL != String.Empty)
123 { 127 {
@@ -241,6 +245,7 @@ namespace OpenSim.Services.LLLoginService
241 245
242 m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", 246 m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}",
243 firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); 247 firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0);
248
244 try 249 try
245 { 250 {
246 // 251 //
@@ -253,7 +258,9 @@ namespace OpenSim.Services.LLLoginService
253 258
254 if (!am.Success) 259 if (!am.Success)
255 { 260 {
256 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client {0} is not allowed", clientVersion); 261 m_log.InfoFormat(
262 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: client {2} is not allowed",
263 firstName, lastName, clientVersion);
257 return LLFailedLoginResponse.LoginBlockedProblem; 264 return LLFailedLoginResponse.LoginBlockedProblem;
258 } 265 }
259 } 266 }
@@ -265,7 +272,9 @@ namespace OpenSim.Services.LLLoginService
265 272
266 if (dm.Success) 273 if (dm.Success)
267 { 274 {
268 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: client {0} is denied", clientVersion); 275 m_log.InfoFormat(
276 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: client {2} is denied",
277 firstName, lastName, clientVersion);
269 return LLFailedLoginResponse.LoginBlockedProblem; 278 return LLFailedLoginResponse.LoginBlockedProblem;
270 } 279 }
271 } 280 }
@@ -276,7 +285,8 @@ namespace OpenSim.Services.LLLoginService
276 UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); 285 UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName);
277 if (account == null) 286 if (account == null)
278 { 287 {
279 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: user not found"); 288 m_log.InfoFormat(
289 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: user not found", firstName, lastName);
280 return LLFailedLoginResponse.UserProblem; 290 return LLFailedLoginResponse.UserProblem;
281 } 291 }
282 292
@@ -288,7 +298,9 @@ namespace OpenSim.Services.LLLoginService
288 298
289 if (account.UserLevel < m_MinLoginLevel) 299 if (account.UserLevel < m_MinLoginLevel)
290 { 300 {
291 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel); 301 m_log.InfoFormat(
302 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: user level is {2} but minimum login level is {3}",
303 firstName, lastName, m_MinLoginLevel, account.UserLevel);
292 return LLFailedLoginResponse.LoginBlockedProblem; 304 return LLFailedLoginResponse.LoginBlockedProblem;
293 } 305 }
294 306
@@ -299,7 +311,8 @@ namespace OpenSim.Services.LLLoginService
299 { 311 {
300 if (account.ScopeID != scopeID && account.ScopeID != UUID.Zero) 312 if (account.ScopeID != scopeID && account.ScopeID != UUID.Zero)
301 { 313 {
302 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: user not found"); 314 m_log.InfoFormat(
315 "[LLOGIN SERVICE]: Login failed, reason: user {0} {1} not found", firstName, lastName);
303 return LLFailedLoginResponse.UserProblem; 316 return LLFailedLoginResponse.UserProblem;
304 } 317 }
305 } 318 }
@@ -318,7 +331,9 @@ namespace OpenSim.Services.LLLoginService
318 UUID secureSession = UUID.Zero; 331 UUID secureSession = UUID.Zero;
319 if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) 332 if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession)))
320 { 333 {
321 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: authentication failed"); 334 m_log.InfoFormat(
335 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: authentication failed",
336 firstName, lastName);
322 return LLFailedLoginResponse.UserProblem; 337 return LLFailedLoginResponse.UserProblem;
323 } 338 }
324 339
@@ -327,13 +342,18 @@ namespace OpenSim.Services.LLLoginService
327 // 342 //
328 if (m_RequireInventory && m_InventoryService == null) 343 if (m_RequireInventory && m_InventoryService == null)
329 { 344 {
330 m_log.WarnFormat("[LLOGIN SERVICE]: Login failed, reason: inventory service not set up"); 345 m_log.WarnFormat(
346 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: inventory service not set up",
347 firstName, lastName);
331 return LLFailedLoginResponse.InventoryProblem; 348 return LLFailedLoginResponse.InventoryProblem;
332 } 349 }
350
333 List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID); 351 List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
334 if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0))) 352 if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0)))
335 { 353 {
336 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: unable to retrieve user inventory"); 354 m_log.InfoFormat(
355 "[LLOGIN SERVICE]: Login failed, for {0} {1}, reason: unable to retrieve user inventory",
356 firstName, lastName);
337 return LLFailedLoginResponse.InventoryProblem; 357 return LLFailedLoginResponse.InventoryProblem;
338 } 358 }
339 359
@@ -347,9 +367,12 @@ namespace OpenSim.Services.LLLoginService
347 if (m_PresenceService != null) 367 if (m_PresenceService != null)
348 { 368 {
349 success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession); 369 success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession);
370
350 if (!success) 371 if (!success)
351 { 372 {
352 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: could not login presence"); 373 m_log.InfoFormat(
374 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: could not login presence",
375 firstName, lastName);
353 return LLFailedLoginResponse.GridProblem; 376 return LLFailedLoginResponse.GridProblem;
354 } 377 }
355 } 378 }
@@ -382,9 +405,18 @@ namespace OpenSim.Services.LLLoginService
382 if (destination == null) 405 if (destination == null)
383 { 406 {
384 m_PresenceService.LogoutAgent(session); 407 m_PresenceService.LogoutAgent(session);
385 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: destination not found"); 408
409 m_log.InfoFormat(
410 "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: destination not found",
411 firstName, lastName);
386 return LLFailedLoginResponse.GridProblem; 412 return LLFailedLoginResponse.GridProblem;
387 } 413 }
414 else
415 {
416 m_log.DebugFormat(
417 "[LLOGIN SERVICE]: Found destination {0}, endpoint {1} for {2} {3}",
418 destination.RegionName, destination.ExternalEndPoint, firstName, lastName);
419 }
388 420
389 if (account.UserLevel >= 200) 421 if (account.UserLevel >= 200)
390 flags |= TeleportFlags.Godlike; 422 flags |= TeleportFlags.Godlike;
@@ -408,7 +440,7 @@ namespace OpenSim.Services.LLLoginService
408 if (aCircuit == null) 440 if (aCircuit == null)
409 { 441 {
410 m_PresenceService.LogoutAgent(session); 442 m_PresenceService.LogoutAgent(session);
411 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason); 443 m_log.InfoFormat("[LLOGIN SERVICE]: Login failed for {0} {1}, reason: {2}", firstName, lastName, reason);
412 return new LLFailedLoginResponse("key", reason, "false"); 444 return new LLFailedLoginResponse("key", reason, "false");
413 445
414 } 446 }
@@ -423,10 +455,14 @@ namespace OpenSim.Services.LLLoginService
423 // 455 //
424 // Finally, fill out the response and return it 456 // Finally, fill out the response and return it
425 // 457 //
426 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, 458 LLLoginResponse response
427 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency); 459 = new LLLoginResponse(
460 account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
461 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP,
462 m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone);
463
464 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName);
428 465
429 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
430 return response; 466 return response;
431 } 467 }
432 catch (Exception e) 468 catch (Exception e)
@@ -438,11 +474,16 @@ namespace OpenSim.Services.LLLoginService
438 } 474 }
439 } 475 }
440 476
441 protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags) 477 protected GridRegion FindDestination(
478 UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation,
479 GridRegion home, out GridRegion gatekeeper,
480 out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags)
442 { 481 {
443 flags = TeleportFlags.ViaLogin; 482 flags = TeleportFlags.ViaLogin;
444 483
445 m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); 484 m_log.DebugFormat(
485 "[LLOGIN SERVICE]: Finding destination matching start location {0} for {1}",
486 startLocation, account.Name);
446 487
447 gatekeeper = null; 488 gatekeeper = null;
448 where = "home"; 489 where = "home";