diff options
Diffstat (limited to 'OpenSim/Services/UserAccountService')
-rw-r--r-- | OpenSim/Services/UserAccountService/GridUserService.cs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index bfc27b5..5aa2078 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs | |||
@@ -120,11 +120,13 @@ namespace OpenSim.Services.UserAccountService | |||
120 | MainConsole.Instance.OutputFormat("Users online: {0}", onlineRecentlyCount); | 120 | MainConsole.Instance.OutputFormat("Users online: {0}", onlineRecentlyCount); |
121 | } | 121 | } |
122 | 122 | ||
123 | public virtual GridUserInfo GetGridUserInfo(string userID) | 123 | private GridUserData GetGridUserData(string userID) |
124 | { | 124 | { |
125 | GridUserData d = null; | 125 | GridUserData d = null; |
126 | if (userID.Length > 36) // it's a UUI | 126 | if (userID.Length > 36) // it's a UUI |
127 | { | ||
127 | d = m_Database.Get(userID); | 128 | d = m_Database.Get(userID); |
129 | } | ||
128 | else // it's a UUID | 130 | else // it's a UUID |
129 | { | 131 | { |
130 | GridUserData[] ds = m_Database.GetAll(userID); | 132 | GridUserData[] ds = m_Database.GetAll(userID); |
@@ -140,6 +142,13 @@ namespace OpenSim.Services.UserAccountService | |||
140 | } | 142 | } |
141 | } | 143 | } |
142 | 144 | ||
145 | return d; | ||
146 | } | ||
147 | |||
148 | public virtual GridUserInfo GetGridUserInfo(string userID) | ||
149 | { | ||
150 | GridUserData d = GetGridUserData(userID); | ||
151 | |||
143 | if (d == null) | 152 | if (d == null) |
144 | return null; | 153 | return null; |
145 | 154 | ||
@@ -173,7 +182,8 @@ namespace OpenSim.Services.UserAccountService | |||
173 | public GridUserInfo LoggedIn(string userID) | 182 | public GridUserInfo LoggedIn(string userID) |
174 | { | 183 | { |
175 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is online", userID); | 184 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is online", userID); |
176 | GridUserData d = m_Database.Get(userID); | 185 | |
186 | GridUserData d = GetGridUserData(userID); | ||
177 | 187 | ||
178 | if (d == null) | 188 | if (d == null) |
179 | { | 189 | { |
@@ -192,7 +202,8 @@ namespace OpenSim.Services.UserAccountService | |||
192 | public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) | 202 | public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) |
193 | { | 203 | { |
194 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID); | 204 | m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID); |
195 | GridUserData d = m_Database.Get(userID); | 205 | |
206 | GridUserData d = GetGridUserData(userID); | ||
196 | 207 | ||
197 | if (d == null) | 208 | if (d == null) |
198 | { | 209 | { |
@@ -211,7 +222,8 @@ namespace OpenSim.Services.UserAccountService | |||
211 | 222 | ||
212 | public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) | 223 | public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) |
213 | { | 224 | { |
214 | GridUserData d = m_Database.Get(userID); | 225 | GridUserData d = GetGridUserData(userID); |
226 | |||
215 | if (d == null) | 227 | if (d == null) |
216 | { | 228 | { |
217 | d = new GridUserData(); | 229 | d = new GridUserData(); |
@@ -229,7 +241,8 @@ namespace OpenSim.Services.UserAccountService | |||
229 | { | 241 | { |
230 | // m_log.DebugFormat("[GRID USER SERVICE]: SetLastPosition for {0}", userID); | 242 | // m_log.DebugFormat("[GRID USER SERVICE]: SetLastPosition for {0}", userID); |
231 | 243 | ||
232 | GridUserData d = m_Database.Get(userID); | 244 | GridUserData d = GetGridUserData(userID); |
245 | |||
233 | if (d == null) | 246 | if (d == null) |
234 | { | 247 | { |
235 | d = new GridUserData(); | 248 | d = new GridUserData(); |
@@ -243,4 +256,4 @@ namespace OpenSim.Services.UserAccountService | |||
243 | return m_Database.Store(d); | 256 | return m_Database.Store(d); |
244 | } | 257 | } |
245 | } | 258 | } |
246 | } | 259 | } \ No newline at end of file |