aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Null/NullUserAccountData.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/Null/NullUserAccountData.cs32
1 files changed, 16 insertions, 16 deletions
diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs
index 241616b..6d2e05a 100644
--- a/OpenSim/Data/Null/NullUserAccountData.cs
+++ b/OpenSim/Data/Null/NullUserAccountData.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Data.Null
40 public class NullUserAccountData : IUserAccountData 40 public class NullUserAccountData : IUserAccountData
41 { 41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>(); 44 private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>();
45 private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>(); 45 private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>();
46 private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>(); 46 private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>();
@@ -48,7 +48,7 @@ namespace OpenSim.Data.Null
48 public NullUserAccountData(string connectionString, string realm) 48 public NullUserAccountData(string connectionString, string realm)
49 { 49 {
50// m_log.DebugFormat( 50// m_log.DebugFormat(
51// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]", 51// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]",
52// connectionString, realm); 52// connectionString, realm);
53 } 53 }
54 54
@@ -65,12 +65,12 @@ namespace OpenSim.Data.Null
65// if (m_log.IsDebugEnabled) 65// if (m_log.IsDebugEnabled)
66// { 66// {
67// m_log.DebugFormat( 67// m_log.DebugFormat(
68// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]", 68// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]",
69// string.Join(", ", fields), string.Join(", ", values)); 69// string.Join(", ", fields), string.Join(", ", values));
70// } 70// }
71 71
72 UserAccountData[] userAccounts = new UserAccountData[0]; 72 UserAccountData[] userAccounts = new UserAccountData[0];
73 73
74 List<string> fieldsLst = new List<string>(fields); 74 List<string> fieldsLst = new List<string>(fields);
75 if (fieldsLst.Contains("PrincipalID")) 75 if (fieldsLst.Contains("PrincipalID"))
76 { 76 {
@@ -79,33 +79,33 @@ namespace OpenSim.Data.Null
79 if (UUID.TryParse(values[i], out id)) 79 if (UUID.TryParse(values[i], out id))
80 if (m_DataByUUID.ContainsKey(id)) 80 if (m_DataByUUID.ContainsKey(id))
81 userAccounts = new UserAccountData[] { m_DataByUUID[id] }; 81 userAccounts = new UserAccountData[] { m_DataByUUID[id] };
82 } 82 }
83 else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName")) 83 else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName"))
84 { 84 {
85 int findex = fieldsLst.IndexOf("FirstName"); 85 int findex = fieldsLst.IndexOf("FirstName");
86 int lindex = fieldsLst.IndexOf("LastName"); 86 int lindex = fieldsLst.IndexOf("LastName");
87 if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex])) 87 if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex]))
88 { 88 {
89 userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] }; 89 userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] };
90 } 90 }
91 } 91 }
92 else if (fieldsLst.Contains("Email")) 92 else if (fieldsLst.Contains("Email"))
93 { 93 {
94 int i = fieldsLst.IndexOf("Email"); 94 int i = fieldsLst.IndexOf("Email");
95 if (m_DataByEmail.ContainsKey(values[i])) 95 if (m_DataByEmail.ContainsKey(values[i]))
96 userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] }; 96 userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] };
97 } 97 }
98 98
99// if (m_log.IsDebugEnabled) 99// if (m_log.IsDebugEnabled)
100// { 100// {
101// StringBuilder sb = new StringBuilder(); 101// StringBuilder sb = new StringBuilder();
102// foreach (UserAccountData uad in userAccounts) 102// foreach (UserAccountData uad in userAccounts)
103// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID); 103// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID);
104// 104//
105// m_log.DebugFormat( 105// m_log.DebugFormat(
106// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb); 106// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb);
107// } 107// }
108 108
109 return userAccounts; 109 return userAccounts;
110 } 110 }
111 111
@@ -113,16 +113,16 @@ namespace OpenSim.Data.Null
113 { 113 {
114 if (data == null) 114 if (data == null)
115 return false; 115 return false;
116 116
117 m_log.DebugFormat( 117 m_log.DebugFormat(
118 "[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}", 118 "[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}",
119 data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode()); 119 data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode());
120 120
121 m_DataByUUID[data.PrincipalID] = data; 121 m_DataByUUID[data.PrincipalID] = data;
122 m_DataByName[data.FirstName + " " + data.LastName] = data; 122 m_DataByName[data.FirstName + " " + data.LastName] = data;
123 if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty) 123 if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
124 m_DataByEmail[data.Data["Email"]] = data; 124 m_DataByEmail[data.Data["Email"]] = data;
125 125
126// m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count); 126// m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count);
127 127
128 return true; 128 return true;
@@ -132,7 +132,7 @@ namespace OpenSim.Data.Null
132 { 132 {
133// m_log.DebugFormat( 133// m_log.DebugFormat(
134// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query); 134// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query);
135 135
136 string[] words = query.Split(new char[] { ' ' }); 136 string[] words = query.Split(new char[] { ' ' });
137 137
138 for (int i = 0; i < words.Length; i++) 138 for (int i = 0; i < words.Length; i++)