From f8c79fe20acb165adc363c3a0565ad53810ae341 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 2 Jan 2010 20:11:59 -0800 Subject: Flattening the ServiceURLs --- OpenSim/Services/Interfaces/IUserAccountService.cs | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index b2d5d48..87f0e6c 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -66,8 +66,22 @@ namespace OpenSim.Services.Interfaces UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); if (kvp.ContainsKey("Created")) Convert.ToInt32(kvp["Created"].ToString()); - if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null && (kvp["ServiceURLs"] is Dictionary)) - ServiceURLs = (Dictionary)kvp["ServiceURLs"]; + if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null) + { + ServiceURLs = new Dictionary(); + string str = kvp["ServiceURLs"].ToString(); + if (str != string.Empty) + { + string[] parts = str.Split(new char[] { '#' }); + Dictionary dic = new Dictionary(); + foreach (string s in parts) + { + string[] parts2 = s.Split(new char[] { '=' }); + if (parts2.Length == 2) + ServiceURLs[parts2[0]] = parts2[1]; + } + } + } } public Dictionary ToKeyValuePairs() @@ -79,10 +93,16 @@ namespace OpenSim.Services.Interfaces result["PrincipalID"] = PrincipalID.ToString(); result["ScopeID"] = ScopeID.ToString(); result["Created"] = Created.ToString(); - result["ServiceURLs"] = ServiceURLs; + string str = string.Empty; + foreach (KeyValuePair kvp in ServiceURLs) + { + str += kvp.Key + "=" + kvp.Value + "#"; + } + result["ServiceURLs"] = str; return result; } + }; public interface IUserAccountService -- cgit v1.1