diff options
author | Jeff Ames | 2008-03-18 03:41:05 +0000 |
---|---|---|
committer | Jeff Ames | 2008-03-18 03:41:05 +0000 |
commit | 9f7639fd6d2d7fd37587223259303377ee15bab4 (patch) | |
tree | 686d6d493fda3dd2de2fa83221a1e5500ddcd37a /OpenSim/Framework/Data.MySQL/MySQLUserData.cs | |
parent | Building on Joha's update... (diff) | |
download | opensim-SC-9f7639fd6d2d7fd37587223259303377ee15bab4.zip opensim-SC-9f7639fd6d2d7fd37587223259303377ee15bab4.tar.gz opensim-SC-9f7639fd6d2d7fd37587223259303377ee15bab4.tar.bz2 opensim-SC-9f7639fd6d2d7fd37587223259303377ee15bab4.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLUserData.cs')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/MySQLUserData.cs | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs index 4c76461..1370b1b 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs | |||
@@ -108,7 +108,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
108 | UpgradeAgentsTable(tableList[m_agentsTableName]); | 108 | UpgradeAgentsTable(tableList[m_agentsTableName]); |
109 | UpgradeUsersTable(tableList[m_usersTableName]); | 109 | UpgradeUsersTable(tableList[m_usersTableName]); |
110 | UpgradeFriendsTable(tableList[m_userFriendsTableName]); | 110 | UpgradeFriendsTable(tableList[m_userFriendsTableName]); |
111 | |||
112 | } | 111 | } |
113 | 112 | ||
114 | /// <summary> | 113 | /// <summary> |
@@ -227,7 +226,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
227 | "(?friendID,?ownerID,?friendPerms,?datetimestamp)", | 226 | "(?friendID,?ownerID,?friendPerms,?datetimestamp)", |
228 | param); | 227 | param); |
229 | adder.ExecuteNonQuery(); | 228 | adder.ExecuteNonQuery(); |
230 | |||
231 | } | 229 | } |
232 | } | 230 | } |
233 | catch (Exception e) | 231 | catch (Exception e) |
@@ -244,23 +242,21 @@ namespace OpenSim.Framework.Data.MySQL | |||
244 | param["?ownerID"] = friendlistowner.UUID.ToString(); | 242 | param["?ownerID"] = friendlistowner.UUID.ToString(); |
245 | param["?friendID"] = friend.UUID.ToString(); | 243 | param["?friendID"] = friend.UUID.ToString(); |
246 | 244 | ||
247 | |||
248 | try | 245 | try |
249 | { | 246 | { |
250 | lock (database) | 247 | lock (database) |
251 | { | 248 | { |
252 | IDbCommand updater = | 249 | IDbCommand updater = |
253 | database.Query( | 250 | database.Query( |
254 | "delete from " + m_userFriendsTableName + " where ownerID = ?ownerID and friendID = ?friendID", | 251 | "delete from " + m_userFriendsTableName + " where ownerID = ?ownerID and friendID = ?friendID", |
255 | param); | 252 | param); |
256 | updater.ExecuteNonQuery(); | 253 | updater.ExecuteNonQuery(); |
257 | 254 | ||
258 | updater = | 255 | updater = |
259 | database.Query( | 256 | database.Query( |
260 | "delete from " + m_userFriendsTableName + " where ownerID = ?friendID and friendID = ?ownerID", | 257 | "delete from " + m_userFriendsTableName + " where ownerID = ?friendID and friendID = ?ownerID", |
261 | param); | 258 | param); |
262 | updater.ExecuteNonQuery(); | 259 | updater.ExecuteNonQuery(); |
263 | |||
264 | } | 260 | } |
265 | } | 261 | } |
266 | catch (Exception e) | 262 | catch (Exception e) |
@@ -270,13 +266,13 @@ namespace OpenSim.Framework.Data.MySQL | |||
270 | return; | 266 | return; |
271 | } | 267 | } |
272 | } | 268 | } |
269 | |||
273 | public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) | 270 | public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) |
274 | { | 271 | { |
275 | Dictionary<string, string> param = new Dictionary<string, string>(); | 272 | Dictionary<string, string> param = new Dictionary<string, string>(); |
276 | param["?ownerID"] = friendlistowner.UUID.ToString(); | 273 | param["?ownerID"] = friendlistowner.UUID.ToString(); |
277 | param["?friendID"] = friend.UUID.ToString(); | 274 | param["?friendID"] = friend.UUID.ToString(); |
278 | param["?friendPerms"] = perms.ToString(); | 275 | param["?friendPerms"] = perms.ToString(); |
279 | |||
280 | 276 | ||
281 | try | 277 | try |
282 | { | 278 | { |
@@ -284,12 +280,11 @@ namespace OpenSim.Framework.Data.MySQL | |||
284 | { | 280 | { |
285 | IDbCommand updater = | 281 | IDbCommand updater = |
286 | database.Query( | 282 | database.Query( |
287 | "update " + m_userFriendsTableName + | 283 | "update " + m_userFriendsTableName + |
288 | " SET friendPerms = ?friendPerms " + | 284 | " SET friendPerms = ?friendPerms " + |
289 | "where ownerID = ?ownerID and friendID = ?friendID", | 285 | "where ownerID = ?ownerID and friendID = ?friendID", |
290 | param); | 286 | param); |
291 | updater.ExecuteNonQuery(); | 287 | updater.ExecuteNonQuery(); |
292 | |||
293 | } | 288 | } |
294 | } | 289 | } |
295 | catch (Exception e) | 290 | catch (Exception e) |
@@ -300,7 +295,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
300 | } | 295 | } |
301 | } | 296 | } |
302 | 297 | ||
303 | |||
304 | public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) | 298 | public List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) |
305 | { | 299 | { |
306 | List<FriendListItem> Lfli = new List<FriendListItem>(); | 300 | List<FriendListItem> Lfli = new List<FriendListItem>(); |
@@ -315,12 +309,11 @@ namespace OpenSim.Framework.Data.MySQL | |||
315 | //Left Join userfriends to itself | 309 | //Left Join userfriends to itself |
316 | IDbCommand result = | 310 | IDbCommand result = |
317 | database.Query( | 311 | database.Query( |
318 | "select a.ownerID,a.friendID,a.friendPerms,b.friendPerms as ownerperms from " + m_userFriendsTableName + " as a, " + m_userFriendsTableName + " as b" + | 312 | "select a.ownerID,a.friendID,a.friendPerms,b.friendPerms as ownerperms from " + m_userFriendsTableName + " as a, " + m_userFriendsTableName + " as b" + |
319 | " where a.ownerID = ?ownerID and b.ownerID = a.friendID and b.friendID = a.ownerID", | 313 | " where a.ownerID = ?ownerID and b.ownerID = a.friendID and b.friendID = a.ownerID", |
320 | param); | 314 | param); |
321 | IDataReader reader = result.ExecuteReader(); | 315 | IDataReader reader = result.ExecuteReader(); |
322 | 316 | ||
323 | |||
324 | while (reader.Read()) | 317 | while (reader.Read()) |
325 | { | 318 | { |
326 | FriendListItem fli = new FriendListItem(); | 319 | FriendListItem fli = new FriendListItem(); |
@@ -354,7 +347,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
354 | m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); | 347 | m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); |
355 | } | 348 | } |
356 | 349 | ||
357 | |||
358 | public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) | 350 | public List<Framework.AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) |
359 | { | 351 | { |
360 | List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); | 352 | List<Framework.AvatarPickerAvatar> returnlist = new List<Framework.AvatarPickerAvatar>(); |
@@ -378,7 +370,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
378 | param); | 370 | param); |
379 | IDataReader reader = result.ExecuteReader(); | 371 | IDataReader reader = result.ExecuteReader(); |
380 | 372 | ||
381 | |||
382 | while (reader.Read()) | 373 | while (reader.Read()) |
383 | { | 374 | { |
384 | Framework.AvatarPickerAvatar user = new Framework.AvatarPickerAvatar(); | 375 | Framework.AvatarPickerAvatar user = new Framework.AvatarPickerAvatar(); |
@@ -413,7 +404,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
413 | param); | 404 | param); |
414 | IDataReader reader = result.ExecuteReader(); | 405 | IDataReader reader = result.ExecuteReader(); |
415 | 406 | ||
416 | |||
417 | while (reader.Read()) | 407 | while (reader.Read()) |
418 | { | 408 | { |
419 | Framework.AvatarPickerAvatar user = new Framework.AvatarPickerAvatar(); | 409 | Framework.AvatarPickerAvatar user = new Framework.AvatarPickerAvatar(); |
@@ -489,7 +479,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
489 | 479 | ||
490 | public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) | 480 | public void StoreWebLoginKey(LLUUID AgentID, LLUUID WebLoginKey) |
491 | { | 481 | { |
492 | |||
493 | Dictionary<string, string> param = new Dictionary<string, string>(); | 482 | Dictionary<string, string> param = new Dictionary<string, string>(); |
494 | param["?UUID"] = AgentID.UUID.ToString(); | 483 | param["?UUID"] = AgentID.UUID.ToString(); |
495 | param["?webLoginKey"] = WebLoginKey.UUID.ToString(); | 484 | param["?webLoginKey"] = WebLoginKey.UUID.ToString(); |
@@ -500,11 +489,10 @@ namespace OpenSim.Framework.Data.MySQL | |||
500 | { | 489 | { |
501 | IDbCommand updater = | 490 | IDbCommand updater = |
502 | database.Query( | 491 | database.Query( |
503 | "update " + m_usersTableName + " SET webLoginKey = ?webLoginKey " + | 492 | "update " + m_usersTableName + " SET webLoginKey = ?webLoginKey " + |
504 | "where UUID = ?UUID", | 493 | "where UUID = ?UUID", |
505 | param); | 494 | param); |
506 | updater.ExecuteNonQuery(); | 495 | updater.ExecuteNonQuery(); |
507 | |||
508 | } | 496 | } |
509 | } | 497 | } |
510 | catch (Exception e) | 498 | catch (Exception e) |
@@ -513,10 +501,6 @@ namespace OpenSim.Framework.Data.MySQL | |||
513 | m_log.Error(e.ToString()); | 501 | m_log.Error(e.ToString()); |
514 | return; | 502 | return; |
515 | } | 503 | } |
516 | |||
517 | |||
518 | |||
519 | |||
520 | } | 504 | } |
521 | 505 | ||
522 | /// <summary> | 506 | /// <summary> |
@@ -605,11 +589,11 @@ namespace OpenSim.Framework.Data.MySQL | |||
605 | /// <param name="user">The profile data to use to update the DB</param> | 589 | /// <param name="user">The profile data to use to update the DB</param> |
606 | public bool UpdateUserProfile(UserProfileData user) | 590 | public bool UpdateUserProfile(UserProfileData user) |
607 | { | 591 | { |
608 | database.updateUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt | 592 | database.updateUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, |
609 | , user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, user.homeLookAt.X | 593 | user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z, user.homeLookAt.X, |
610 | , user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI | 594 | user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, |
611 | , user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, user.profileAboutText | 595 | user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask, user.profileAboutText, |
612 | , user.profileFirstText, user.profileImage, user.profileFirstImage, user.webLoginKey); | 596 | user.profileFirstText, user.profileImage, user.profileFirstImage, user.webLoginKey); |
613 | return true; | 597 | return true; |
614 | } | 598 | } |
615 | 599 | ||