diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/AgentCircuitData.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/AssetBase.cs | 6 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 63 |
3 files changed, 70 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..e5ff27a 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1694,5 +1694,68 @@ 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, out string secret) | ||
1707 | { | ||
1708 | uuid = UUID.Zero; url = string.Empty; firstname = "Unknown"; lastname = "User"; secret = string.Empty; | ||
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 | if (parts.Length >= 4) | ||
1728 | secret = parts[3]; | ||
1729 | |||
1730 | return true; | ||
1731 | } | ||
1732 | |||
1733 | /// <summary> | ||
1734 | /// | ||
1735 | /// </summary> | ||
1736 | /// <param name="acircuit"></param> | ||
1737 | /// <returns>uuid[;endpoint[;name]]</returns> | ||
1738 | public static string ProduceUserUniversalIdentifier(AgentCircuitData acircuit) | ||
1739 | { | ||
1740 | if (acircuit.ServiceURLs.ContainsKey("HomeURI")) | ||
1741 | { | ||
1742 | string agentsURI = acircuit.ServiceURLs["HomeURI"].ToString(); | ||
1743 | if (!agentsURI.EndsWith("/")) | ||
1744 | agentsURI += "/"; | ||
1745 | |||
1746 | // This is ugly, but there's no other way, given that the name is changed | ||
1747 | // in the agent circuit data for foreigners | ||
1748 | if (acircuit.lastname.Contains("@")) | ||
1749 | { | ||
1750 | string[] parts = acircuit.firstname.Split(new char[] { '.' }); | ||
1751 | if (parts.Length == 2) | ||
1752 | return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1]; | ||
1753 | } | ||
1754 | return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + acircuit.firstname + " " + acircuit.lastname; | ||
1755 | } | ||
1756 | else | ||
1757 | return acircuit.AgentID.ToString(); | ||
1758 | } | ||
1759 | #endregion | ||
1697 | } | 1760 | } |
1698 | } | 1761 | } |