aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorDiva Canto2011-05-19 16:54:46 -0700
committerDiva Canto2011-05-19 16:54:46 -0700
commitd21e9c755f004d8fe03b11bc57b810dbd401435a (patch)
tree1efd9e48308192d21ca73d8ff12d6a48c186077c /OpenSim/Framework
parentAccidentally committed too early (diff)
downloadopensim-SC_OLD-d21e9c755f004d8fe03b11bc57b810dbd401435a.zip
opensim-SC_OLD-d21e9c755f004d8fe03b11bc57b810dbd401435a.tar.gz
opensim-SC_OLD-d21e9c755f004d8fe03b11bc57b810dbd401435a.tar.bz2
opensim-SC_OLD-d21e9c755f004d8fe03b11bc57b810dbd401435a.tar.xz
HG Friends working to some extent: friendships offered and accepted correctly handled. Friends list showing correct foreign names. TODO: GrantRights.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs1
-rw-r--r--OpenSim/Framework/AssetBase.cs6
-rw-r--r--OpenSim/Framework/Util.cs61
3 files changed, 68 insertions, 0 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index dbd47d3..125910e 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -345,6 +345,7 @@ namespace OpenSim.Framework
345 } 345 }
346 } 346 }
347 } 347 }
348
348 } 349 }
349 350
350 351
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index 53d28be..5f68cda 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -215,6 +215,12 @@ namespace OpenSim.Framework
215 set { m_metadata.Temporary = value; } 215 set { m_metadata.Temporary = value; }
216 } 216 }
217 217
218 public string CreatorID
219 {
220 get { return m_metadata.CreatorID; }
221 set { m_metadata.CreatorID = value; }
222 }
223
218 public AssetFlags Flags 224 public AssetFlags Flags
219 { 225 {
220 get { return m_metadata.Flags; } 226 get { return m_metadata.Flags; }
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index aaa2724..af21cb5 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1694,5 +1694,66 @@ namespace OpenSim.Framework
1694 return (T)Enum.Parse(typeof(T), value); ; 1694 return (T)Enum.Parse(typeof(T), value); ;
1695 } 1695 }
1696 #endregion 1696 #endregion
1697
1698 #region Universal User Identifiers
1699 /// <summary>
1700 /// </summary>
1701 /// <param name="value">uuid[;endpoint[;name]]</param>
1702 /// <param name="uuid"></param>
1703 /// <param name="url"></param>
1704 /// <param name="firstname"></param>
1705 /// <param name="lastname"></param>
1706 public static bool ParseUniversalUserIdentifier(string value, out UUID uuid, out string url, out string firstname, out string lastname)
1707 {
1708 uuid = UUID.Zero; url = string.Empty; firstname = "Unknown"; lastname = "User";
1709
1710 string[] parts = value.Split(';');
1711 if (parts.Length >= 1)
1712 if (!UUID.TryParse(parts[0], out uuid))
1713 return false;
1714
1715 if (parts.Length >= 2)
1716 url = parts[1];
1717
1718 if (parts.Length >= 3)
1719 {
1720 string[] name = parts[2].Split();
1721 if (name.Length == 2)
1722 {
1723 firstname = name[0];
1724 lastname = name[1];
1725 }
1726 }
1727
1728 return true;
1729 }
1730
1731 /// <summary>
1732 ///
1733 /// </summary>
1734 /// <param name="acircuit"></param>
1735 /// <returns>uuid[;endpoint[;name]]</returns>
1736 public static string ProduceUserUniversalIdentifier(AgentCircuitData acircuit)
1737 {
1738 if (acircuit.ServiceURLs.ContainsKey("HomeURI"))
1739 {
1740 string agentsURI = acircuit.ServiceURLs["HomeURI"].ToString();
1741 if (!agentsURI.EndsWith("/"))
1742 agentsURI += "/";
1743
1744 // This is ugly, but there's no other way, given that the name is changed
1745 // in the agent circuit data for foreigners
1746 if (acircuit.lastname.Contains("@"))
1747 {
1748 string[] parts = acircuit.firstname.Split(new char[] { '.' });
1749 if (parts.Length == 2)
1750 return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1];
1751 }
1752 return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + acircuit.firstname + " " + acircuit.lastname;
1753 }
1754 else
1755 return acircuit.AgentID.ToString();
1756 }
1757 #endregion
1697 } 1758 }
1698} 1759}