aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-03-25 00:20:38 +0000
committerJustin Clark-Casey (justincc)2014-03-25 00:20:38 +0000
commit091f3a80008a0f4a756fcb9ff4e87a24c2948c3c (patch)
treea98354e9317e0ed6892dec344a69447c0e9c70b8 /OpenSim/Framework/Util.cs
parentDon't fail to enable permissions modules correctly if there is any leading or... (diff)
parentFixed Debug command for Groups. (Use of wrong capitalization caused *two* "de... (diff)
downloadopensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.zip
opensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.tar.gz
opensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.tar.bz2
opensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs41
1 files changed, 39 insertions, 2 deletions
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