diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/InventoryItemBase.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/PluginLoader.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | 16 | ||||
-rw-r--r-- | OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 41 |
5 files changed, 65 insertions, 13 deletions
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 558dfd0..5761200 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs | |||
@@ -82,12 +82,15 @@ namespace OpenSim.Framework | |||
82 | set | 82 | set |
83 | { | 83 | { |
84 | m_creatorId = value; | 84 | m_creatorId = value; |
85 | |||
86 | if ((m_creatorId == null) || !UUID.TryParse(m_creatorId, out m_creatorIdAsUuid)) | ||
87 | m_creatorIdAsUuid = UUID.Zero; | ||
85 | } | 88 | } |
86 | } | 89 | } |
87 | protected string m_creatorId; | 90 | protected string m_creatorId; |
88 | 91 | ||
89 | /// <value> | 92 | /// <value> |
90 | /// The CreatorId expressed as a UUID.tely | 93 | /// The CreatorId expressed as a UUID. |
91 | /// </value> | 94 | /// </value> |
92 | public UUID CreatorIdAsUuid | 95 | public UUID CreatorIdAsUuid |
93 | { | 96 | { |
diff --git a/OpenSim/Framework/PluginLoader.cs b/OpenSim/Framework/PluginLoader.cs index 819cb7b..a2bf9f3 100644 --- a/OpenSim/Framework/PluginLoader.cs +++ b/OpenSim/Framework/PluginLoader.cs | |||
@@ -215,7 +215,7 @@ namespace OpenSim.Framework | |||
215 | AddinManager.AddinLoadError += on_addinloaderror_; | 215 | AddinManager.AddinLoadError += on_addinloaderror_; |
216 | AddinManager.AddinLoaded += on_addinloaded_; | 216 | AddinManager.AddinLoaded += on_addinloaded_; |
217 | 217 | ||
218 | clear_registry_(); | 218 | clear_registry_(dir); |
219 | 219 | ||
220 | suppress_console_output_(true); | 220 | suppress_console_output_(true); |
221 | AddinManager.Initialize(dir); | 221 | AddinManager.Initialize(dir); |
@@ -239,18 +239,19 @@ namespace OpenSim.Framework | |||
239 | + args.Exception.StackTrace); | 239 | + args.Exception.StackTrace); |
240 | } | 240 | } |
241 | 241 | ||
242 | private void clear_registry_() | 242 | private void clear_registry_(string dir) |
243 | { | 243 | { |
244 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) | 244 | // The Mono addin manager (in Mono.Addins.dll version 0.2.0.0) |
245 | // occasionally seems to corrupt its addin cache | 245 | // occasionally seems to corrupt its addin cache |
246 | // Hence, as a temporary solution we'll remove it before each startup | 246 | // Hence, as a temporary solution we'll remove it before each startup |
247 | |||
247 | try | 248 | try |
248 | { | 249 | { |
249 | if (Directory.Exists("addin-db-000")) | 250 | if (Directory.Exists(dir + "/addin-db-000")) |
250 | Directory.Delete("addin-db-000", true); | 251 | Directory.Delete(dir + "/addin-db-000", true); |
251 | 252 | ||
252 | if (Directory.Exists("addin-db-001")) | 253 | if (Directory.Exists(dir + "/addin-db-001")) |
253 | Directory.Delete("addin-db-001", true); | 254 | Directory.Delete(dir + "/addin-db-001", true); |
254 | } | 255 | } |
255 | catch (IOException) | 256 | catch (IOException) |
256 | { | 257 | { |
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index c56f213..db46ea8 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -161,7 +161,7 @@ namespace OpenSim.Framework.Serialization.External | |||
161 | if (!hasCreatorData && creator != null) | 161 | if (!hasCreatorData && creator != null) |
162 | { | 162 | { |
163 | XmlElement creatorData = doc.CreateElement("CreatorData"); | 163 | XmlElement creatorData = doc.CreateElement("CreatorData"); |
164 | creatorData.InnerText = homeURL + ";" + creator.FirstName + " " + creator.LastName; | 164 | creatorData.InnerText = CalcCreatorData(homeURL, creator.FirstName + " " + creator.LastName); |
165 | sop.AppendChild(creatorData); | 165 | sop.AppendChild(creatorData); |
166 | } | 166 | } |
167 | } | 167 | } |
@@ -172,5 +172,15 @@ namespace OpenSim.Framework.Serialization.External | |||
172 | return wr.ToString(); | 172 | return wr.ToString(); |
173 | } | 173 | } |
174 | } | 174 | } |
175 | |||
176 | public static string CalcCreatorData(string homeURL, string name) | ||
177 | { | ||
178 | return homeURL + ";" + name; | ||
179 | } | ||
180 | |||
181 | internal static string CalcCreatorData(string homeURL, UUID uuid, string name) | ||
182 | { | ||
183 | return homeURL + "/" + uuid + ";" + name; | ||
184 | } | ||
175 | } | 185 | } |
176 | } \ No newline at end of file | 186 | } |
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index f2a6b8b..135cefb 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | |||
@@ -286,7 +286,8 @@ namespace OpenSim.Framework.Serialization.External | |||
286 | UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid); | 286 | UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid); |
287 | if (account != null) | 287 | if (account != null) |
288 | { | 288 | { |
289 | writer.WriteElementString("CreatorData", (string)options["home"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName); | 289 | string creatorData = ExternalRepresentationUtils.CalcCreatorData((string)options["home"], inventoryItem.CreatorIdAsUuid, account.FirstName + " " + account.LastName); |
290 | writer.WriteElementString("CreatorData", creatorData); | ||
290 | } | 291 | } |
291 | writer.WriteElementString("CreatorID", inventoryItem.CreatorId); | 292 | writer.WriteElementString("CreatorID", inventoryItem.CreatorId); |
292 | } | 293 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index efaed62..c2c9698 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2250,10 +2250,15 @@ namespace OpenSim.Framework | |||
2250 | { | 2250 | { |
2251 | string[] parts = firstName.Split(new char[] { '.' }); | 2251 | string[] parts = firstName.Split(new char[] { '.' }); |
2252 | if (parts.Length == 2) | 2252 | if (parts.Length == 2) |
2253 | return id.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1]; | 2253 | return CalcUniversalIdentifier(id, agentsURI, parts[0] + " " + parts[1]); |
2254 | } | 2254 | } |
2255 | return id.ToString() + ";" + agentsURI + ";" + firstName + " " + lastName; | 2255 | |
2256 | return CalcUniversalIdentifier(id, agentsURI, firstName + " " + lastName); | ||
2257 | } | ||
2256 | 2258 | ||
2259 | private static string CalcUniversalIdentifier(UUID id, string agentsURI, string name) | ||
2260 | { | ||
2261 | return id.ToString() + ";" + agentsURI + ";" + name; | ||
2257 | } | 2262 | } |
2258 | 2263 | ||
2259 | /// <summary> | 2264 | /// <summary> |
@@ -2288,6 +2293,38 @@ namespace OpenSim.Framework | |||
2288 | { | 2293 | { |
2289 | return str.Replace("_", "\\_").Replace("%", "\\%"); | 2294 | return str.Replace("_", "\\_").Replace("%", "\\%"); |
2290 | } | 2295 | } |
2296 | |||
2297 | /// <summary> | ||
2298 | /// Returns the name of the user's viewer. | ||
2299 | /// </summary> | ||
2300 | /// <remarks> | ||
2301 | /// This method handles two ways that viewers specify their name: | ||
2302 | /// 1. Viewer = "Firestorm-Release 4.4.2.34167", Channel = "(don't care)" -> "Firestorm-Release 4.4.2.34167" | ||
2303 | /// 2. Viewer = "4.5.1.38838", Channel = "Firestorm-Beta" -> "Firestorm-Beta 4.5.1.38838" | ||
2304 | /// </remarks> | ||
2305 | public static string GetViewerName(AgentCircuitData agent) | ||
2306 | { | ||
2307 | string name = agent.Viewer; | ||
2308 | if (name == null) | ||
2309 | name = ""; | ||
2310 | else | ||
2311 | name = name.Trim(); | ||
2312 | |||
2313 | // Check if 'Viewer' is just a version number. If it's *not*, then we | ||
2314 | // assume that it contains the real viewer name, and we return it. | ||
2315 | foreach (char c in name) | ||
2316 | { | ||
2317 | if (Char.IsLetter(c)) | ||
2318 | return name; | ||
2319 | } | ||
2320 | |||
2321 | // The 'Viewer' string contains just a version number. If there's anything in | ||
2322 | // 'Channel' then assume that it's the viewer name. | ||
2323 | if ((agent.Channel != null) && (agent.Channel.Length > 0)) | ||
2324 | name = agent.Channel.Trim() + " " + name; | ||
2325 | |||
2326 | return name; | ||
2327 | } | ||
2291 | } | 2328 | } |
2292 | 2329 | ||
2293 | public class DoubleQueue<T> where T:class | 2330 | public class DoubleQueue<T> where T:class |