aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
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)0
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs (renamed from OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs)0
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServicesConnector.cs (renamed from OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs)0
-rw-r--r--OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs106
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs20
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs69
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs17
21 files changed, 188 insertions, 74 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 2882906..2882906 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..888b072 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
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/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/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
index b6ec558..53fbea6 100644
--- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
+++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs
@@ -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/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 0e7a358..15156d0 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)
@@ -364,6 +365,11 @@ namespace OpenSim.Services.InventoryService
364 // 365 //
365 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) 366 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
366 { 367 {
368 return DeleteFolders(principalID, folderIDs, true);
369 }
370
371 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs, bool onlyIfTrash)
372 {
367 if (!m_AllowDelete) 373 if (!m_AllowDelete)
368 return false; 374 return false;
369 375
@@ -371,11 +377,12 @@ namespace OpenSim.Services.InventoryService
371 // 377 //
372 foreach (UUID id in folderIDs) 378 foreach (UUID id in folderIDs)
373 { 379 {
374 if (!ParentIsTrash(id)) 380 if (onlyIfTrash && !ParentIsTrash(id))
375 continue; 381 continue;
382 //m_log.InfoFormat("[XINVENTORY SERVICE]: Delete folder {0}", id);
376 InventoryFolderBase f = new InventoryFolderBase(); 383 InventoryFolderBase f = new InventoryFolderBase();
377 f.ID = id; 384 f.ID = id;
378 PurgeFolder(f); 385 PurgeFolder(f, onlyIfTrash);
379 m_Database.DeleteFolders("folderID", id.ToString()); 386 m_Database.DeleteFolders("folderID", id.ToString());
380 } 387 }
381 388
@@ -384,10 +391,15 @@ namespace OpenSim.Services.InventoryService
384 391
385 public virtual bool PurgeFolder(InventoryFolderBase folder) 392 public virtual bool PurgeFolder(InventoryFolderBase folder)
386 { 393 {
394 return PurgeFolder(folder, true);
395 }
396
397 public virtual bool PurgeFolder(InventoryFolderBase folder, bool onlyIfTrash)
398 {
387 if (!m_AllowDelete) 399 if (!m_AllowDelete)
388 return false; 400 return false;
389 401
390 if (!ParentIsTrash(folder.ID)) 402 if (onlyIfTrash && !ParentIsTrash(folder.ID))
391 return false; 403 return false;
392 404
393 XInventoryFolder[] subFolders = m_Database.GetFolders( 405 XInventoryFolder[] subFolders = m_Database.GetFolders(
@@ -396,7 +408,7 @@ namespace OpenSim.Services.InventoryService
396 408
397 foreach (XInventoryFolder x in subFolders) 409 foreach (XInventoryFolder x in subFolders)
398 { 410 {
399 PurgeFolder(ConvertToOpenSim(x)); 411 PurgeFolder(ConvertToOpenSim(x), onlyIfTrash);
400 m_Database.DeleteFolders("folderID", x.folderID.ToString()); 412 m_Database.DeleteFolders("folderID", x.folderID.ToString());
401 } 413 }
402 414
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..06e05a9 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 //
@@ -423,8 +428,11 @@ namespace OpenSim.Services.LLLoginService
423 // 428 //
424 // Finally, fill out the response and return it 429 // Finally, fill out the response and return it
425 // 430 //
426 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, 431 LLLoginResponse response
427 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency); 432 = new LLLoginResponse(
433 account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
434 where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP,
435 m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone);
428 436
429 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); 437 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
430 return response; 438 return response;
@@ -438,7 +446,10 @@ namespace OpenSim.Services.LLLoginService
438 } 446 }
439 } 447 }
440 448
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) 449 protected GridRegion FindDestination(
450 UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation,
451 GridRegion home, out GridRegion gatekeeper,
452 out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags)
442 { 453 {
443 flags = TeleportFlags.ViaLogin; 454 flags = TeleportFlags.ViaLogin;
444 455