diff options
author | Sean Dague | 2008-04-10 13:53:06 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-10 13:53:06 +0000 |
commit | c176caeb05c2264654b764e4d010561da60c24fc (patch) | |
tree | 87e0cab128ecaac57c5995df4cf5048185fe383f /OpenSim/Framework | |
parent | * Brings back map tile generation based on the terrain. The algorithm produc... (diff) | |
download | opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.zip opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.gz opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.bz2 opensim-SC_OLD-c176caeb05c2264654b764e4d010561da60c24fc.tar.xz |
moved fields to properties for UserDataProfile, which was
actually a little more work than I expected given the copious
use of out params.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/CommunicationsManager.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 46 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 72 | ||||
-rw-r--r-- | OpenSim/Framework/UserProfileData.cs | 244 |
5 files changed, 290 insertions, 92 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index e39333b..75fe1aa 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -114,7 +114,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
114 | // "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", | 114 | // "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", |
115 | // folderInfo.name, folderInfo.folderID, userID); | 115 | // folderInfo.name, folderInfo.folderID, userID); |
116 | 116 | ||
117 | if (userID == UserProfile.UUID) | 117 | if (userID == UserProfile.Id) |
118 | { | 118 | { |
119 | if (RootFolder == null) | 119 | if (RootFolder == null) |
120 | { | 120 | { |
@@ -169,7 +169,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
169 | /// <param name="folderInfo"></param> | 169 | /// <param name="folderInfo"></param> |
170 | public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) | 170 | public void ItemReceive(LLUUID userID, InventoryItemBase itemInfo) |
171 | { | 171 | { |
172 | if ((userID == UserProfile.UUID) && (RootFolder != null)) | 172 | if ((userID == UserProfile.Id) && (RootFolder != null)) |
173 | { | 173 | { |
174 | if (itemInfo.Folder == RootFolder.ID) | 174 | if (itemInfo.Folder == RootFolder.ID) |
175 | { | 175 | { |
@@ -194,7 +194,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
194 | 194 | ||
195 | public void AddItem(LLUUID userID, InventoryItemBase itemInfo) | 195 | public void AddItem(LLUUID userID, InventoryItemBase itemInfo) |
196 | { | 196 | { |
197 | if ((userID == UserProfile.UUID) && (RootFolder != null)) | 197 | if ((userID == UserProfile.Id) && (RootFolder != null)) |
198 | { | 198 | { |
199 | ItemReceive(userID, itemInfo); | 199 | ItemReceive(userID, itemInfo); |
200 | m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); | 200 | m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
203 | 203 | ||
204 | public void UpdateItem(LLUUID userID, InventoryItemBase itemInfo) | 204 | public void UpdateItem(LLUUID userID, InventoryItemBase itemInfo) |
205 | { | 205 | { |
206 | if ((userID == UserProfile.UUID) && (RootFolder != null)) | 206 | if ((userID == UserProfile.Id) && (RootFolder != null)) |
207 | { | 207 | { |
208 | m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); | 208 | m_parentCommsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
209 | } | 209 | } |
@@ -212,7 +212,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
212 | public bool DeleteItem(LLUUID userID, InventoryItemBase item) | 212 | public bool DeleteItem(LLUUID userID, InventoryItemBase item) |
213 | { | 213 | { |
214 | bool result = false; | 214 | bool result = false; |
215 | if ((userID == UserProfile.UUID) && (RootFolder != null)) | 215 | if ((userID == UserProfile.Id) && (RootFolder != null)) |
216 | { | 216 | { |
217 | result = RootFolder.DeleteItem(item.ID); | 217 | result = RootFolder.DeleteItem(item.ID); |
218 | if (result) | 218 | if (result) |
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 95a0e05..6b01d8f 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs | |||
@@ -164,9 +164,9 @@ namespace OpenSim.Framework.Communications | |||
164 | } | 164 | } |
165 | else | 165 | else |
166 | { | 166 | { |
167 | m_inventoryService.CreateNewUserInventory(userProf.UUID); | 167 | m_inventoryService.CreateNewUserInventory(userProf.Id); |
168 | m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); | 168 | m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); |
169 | return userProf.UUID; | 169 | return userProf.Id; |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
@@ -249,9 +249,9 @@ namespace OpenSim.Framework.Communications | |||
249 | UserProfileData profileData = m_userService.GetUserProfile(uuid); | 249 | UserProfileData profileData = m_userService.GetUserProfile(uuid); |
250 | if (profileData != null) | 250 | if (profileData != null) |
251 | { | 251 | { |
252 | LLUUID profileId = profileData.UUID; | 252 | LLUUID profileId = profileData.Id; |
253 | string firstname = profileData.username; | 253 | string firstname = profileData.FirstName; |
254 | string lastname = profileData.surname; | 254 | string lastname = profileData.SurName; |
255 | 255 | ||
256 | remote_client.SendNameReply(profileId, firstname, lastname); | 256 | remote_client.SendNameReply(profileId, firstname, lastname); |
257 | } | 257 | } |
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 6f558a0..e5ad7a0 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -184,13 +184,13 @@ namespace OpenSim.Framework.UserManagement | |||
184 | else | 184 | else |
185 | { | 185 | { |
186 | // If we already have a session... | 186 | // If we already have a session... |
187 | if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) | 187 | if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) |
188 | { | 188 | { |
189 | //TODO: The following statements can cause trouble: | 189 | //TODO: The following statements can cause trouble: |
190 | // If agentOnline could not turn from true back to false normally | 190 | // If agentOnline could not turn from true back to false normally |
191 | // because of some problem, for instance, the crashment of server or client, | 191 | // because of some problem, for instance, the crashment of server or client, |
192 | // the user cannot log in any longer. | 192 | // the user cannot log in any longer. |
193 | userProfile.currentAgent.agentOnline = false; | 193 | userProfile.CurrentAgent.agentOnline = false; |
194 | m_userManager.CommitAgent(ref userProfile); | 194 | m_userManager.CommitAgent(ref userProfile); |
195 | 195 | ||
196 | // Reject the login | 196 | // Reject the login |
@@ -207,7 +207,7 @@ namespace OpenSim.Framework.UserManagement | |||
207 | 207 | ||
208 | try | 208 | try |
209 | { | 209 | { |
210 | LLUUID agentID = userProfile.UUID; | 210 | LLUUID agentID = userProfile.Id; |
211 | 211 | ||
212 | // Inventory Library Section | 212 | // Inventory Library Section |
213 | InventoryData inventData = GetInventorySkeleton(agentID); | 213 | InventoryData inventData = GetInventorySkeleton(agentID); |
@@ -217,16 +217,16 @@ namespace OpenSim.Framework.UserManagement | |||
217 | InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); | 217 | InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); |
218 | ArrayList InventoryRoot = new ArrayList(); | 218 | ArrayList InventoryRoot = new ArrayList(); |
219 | InventoryRoot.Add(InventoryRootHash); | 219 | InventoryRoot.Add(InventoryRootHash); |
220 | userProfile.rootInventoryFolderID = inventData.RootFolderID; | 220 | userProfile.RootInventoryFolderID = inventData.RootFolderID; |
221 | 221 | ||
222 | // Circuit Code | 222 | // Circuit Code |
223 | uint circode = (uint) (Util.RandomClass.Next()); | 223 | uint circode = (uint) (Util.RandomClass.Next()); |
224 | 224 | ||
225 | logResponse.Lastname = userProfile.surname; | 225 | logResponse.Lastname = userProfile.SurName; |
226 | logResponse.Firstname = userProfile.username; | 226 | logResponse.Firstname = userProfile.FirstName; |
227 | logResponse.AgentID = agentID.ToString(); | 227 | logResponse.AgentID = agentID.ToString(); |
228 | logResponse.SessionID = userProfile.currentAgent.sessionID.ToString(); | 228 | logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); |
229 | logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToString(); | 229 | logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); |
230 | logResponse.InventoryRoot = InventoryRoot; | 230 | logResponse.InventoryRoot = InventoryRoot; |
231 | logResponse.InventorySkeleton = AgentInventoryArray; | 231 | logResponse.InventorySkeleton = AgentInventoryArray; |
232 | logResponse.InventoryLibrary = GetInventoryLibrary(); | 232 | logResponse.InventoryLibrary = GetInventoryLibrary(); |
@@ -334,9 +334,9 @@ namespace OpenSim.Framework.UserManagement | |||
334 | else | 334 | else |
335 | { | 335 | { |
336 | // If we already have a session... | 336 | // If we already have a session... |
337 | if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) | 337 | if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) |
338 | { | 338 | { |
339 | userProfile.currentAgent = null; | 339 | userProfile.CurrentAgent = null; |
340 | m_userManager.CommitAgent(ref userProfile); | 340 | m_userManager.CommitAgent(ref userProfile); |
341 | 341 | ||
342 | // Reject the login | 342 | // Reject the login |
@@ -349,7 +349,7 @@ namespace OpenSim.Framework.UserManagement | |||
349 | 349 | ||
350 | try | 350 | try |
351 | { | 351 | { |
352 | LLUUID agentID = userProfile.UUID; | 352 | LLUUID agentID = userProfile.Id; |
353 | 353 | ||
354 | // Inventory Library Section | 354 | // Inventory Library Section |
355 | InventoryData inventData = GetInventorySkeleton(agentID); | 355 | InventoryData inventData = GetInventorySkeleton(agentID); |
@@ -359,16 +359,16 @@ namespace OpenSim.Framework.UserManagement | |||
359 | InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); | 359 | InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); |
360 | ArrayList InventoryRoot = new ArrayList(); | 360 | ArrayList InventoryRoot = new ArrayList(); |
361 | InventoryRoot.Add(InventoryRootHash); | 361 | InventoryRoot.Add(InventoryRootHash); |
362 | userProfile.rootInventoryFolderID = inventData.RootFolderID; | 362 | userProfile.RootInventoryFolderID = inventData.RootFolderID; |
363 | 363 | ||
364 | // Circuit Code | 364 | // Circuit Code |
365 | uint circode = (uint)(Util.RandomClass.Next()); | 365 | uint circode = (uint)(Util.RandomClass.Next()); |
366 | 366 | ||
367 | logResponse.Lastname = userProfile.surname; | 367 | logResponse.Lastname = userProfile.SurName; |
368 | logResponse.Firstname = userProfile.username; | 368 | logResponse.Firstname = userProfile.FirstName; |
369 | logResponse.AgentID = agentID.ToString(); | 369 | logResponse.AgentID = agentID.ToString(); |
370 | logResponse.SessionID = userProfile.currentAgent.sessionID.ToString(); | 370 | logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToString(); |
371 | logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToString(); | 371 | logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToString(); |
372 | logResponse.InventoryRoot = InventoryRoot; | 372 | logResponse.InventoryRoot = InventoryRoot; |
373 | logResponse.InventorySkeleton = AgentInventoryArray; | 373 | logResponse.InventorySkeleton = AgentInventoryArray; |
374 | logResponse.InventoryLibrary = GetInventoryLibrary(); | 374 | logResponse.InventoryLibrary = GetInventoryLibrary(); |
@@ -491,7 +491,7 @@ namespace OpenSim.Framework.UserManagement | |||
491 | if (goodweblogin) | 491 | if (goodweblogin) |
492 | { | 492 | { |
493 | LLUUID webloginkey = LLUUID.Random(); | 493 | LLUUID webloginkey = LLUUID.Random(); |
494 | m_userManager.StoreWebLoginKey(user.UUID, webloginkey); | 494 | m_userManager.StoreWebLoginKey(user.Id, webloginkey); |
495 | statuscode = 301; | 495 | statuscode = 301; |
496 | 496 | ||
497 | string redirectURL = "about:blank?redirect-http-hack=" + | 497 | string redirectURL = "about:blank?redirect-http-hack=" + |
@@ -639,7 +639,7 @@ namespace OpenSim.Framework.UserManagement | |||
639 | public virtual bool AuthenticateUser(UserProfileData profile, string password) | 639 | public virtual bool AuthenticateUser(UserProfileData profile, string password) |
640 | { | 640 | { |
641 | bool passwordSuccess = false; | 641 | bool passwordSuccess = false; |
642 | m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); | 642 | m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.Id); |
643 | 643 | ||
644 | // Web Login method seems to also occasionally send the hashed password itself | 644 | // Web Login method seems to also occasionally send the hashed password itself |
645 | 645 | ||
@@ -650,13 +650,13 @@ namespace OpenSim.Framework.UserManagement | |||
650 | 650 | ||
651 | password = password.Remove(0, 3); //remove $1$ | 651 | password = password.Remove(0, 3); //remove $1$ |
652 | 652 | ||
653 | string s = Util.Md5Hash(password + ":" + profile.passwordSalt); | 653 | string s = Util.Md5Hash(password + ":" + profile.PasswordSalt); |
654 | // Testing... | 654 | // Testing... |
655 | //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash); | 655 | //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash); |
656 | //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password); | 656 | //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password); |
657 | 657 | ||
658 | passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) | 658 | passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) |
659 | || profile.passwordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); | 659 | || profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); |
660 | 660 | ||
661 | return passwordSuccess; | 661 | return passwordSuccess; |
662 | } | 662 | } |
@@ -664,10 +664,10 @@ namespace OpenSim.Framework.UserManagement | |||
664 | public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) | 664 | public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) |
665 | { | 665 | { |
666 | bool passwordSuccess = false; | 666 | bool passwordSuccess = false; |
667 | m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); | 667 | m_log.InfoFormat("[LOGIN]: Authenticating {0} {1} ({2})", profile.FirstName, profile.SurName, profile.Id); |
668 | 668 | ||
669 | // Match web login key unless it's the default weblogin key LLUUID.Zero | 669 | // Match web login key unless it's the default weblogin key LLUUID.Zero |
670 | passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero); | 670 | passwordSuccess = ((profile.WebLoginKey==webloginkey) && profile.WebLoginKey != LLUUID.Zero); |
671 | 671 | ||
672 | return passwordSuccess; | 672 | return passwordSuccess; |
673 | } | 673 | } |
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 332583c..02be6bd 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs | |||
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.UserManagement | |||
96 | 96 | ||
97 | if (profile != null) | 97 | if (profile != null) |
98 | { | 98 | { |
99 | profile.currentAgent = getUserAgent(profile.UUID); | 99 | profile.CurrentAgent = getUserAgent(profile.Id); |
100 | return profile; | 100 | return profile; |
101 | } | 101 | } |
102 | } | 102 | } |
@@ -113,7 +113,7 @@ namespace OpenSim.Framework.UserManagement | |||
113 | 113 | ||
114 | if (null != profile) | 114 | if (null != profile) |
115 | { | 115 | { |
116 | profile.currentAgent = getUserAgent(profile.UUID); | 116 | profile.CurrentAgent = getUserAgent(profile.Id); |
117 | return profile; | 117 | return profile; |
118 | } | 118 | } |
119 | } | 119 | } |
@@ -298,7 +298,7 @@ namespace OpenSim.Framework.UserManagement | |||
298 | public void clearUserAgent(LLUUID agentID) | 298 | public void clearUserAgent(LLUUID agentID) |
299 | { | 299 | { |
300 | UserProfileData profile = GetUserProfile(agentID); | 300 | UserProfileData profile = GetUserProfile(agentID); |
301 | profile.currentAgent = null; | 301 | profile.CurrentAgent = null; |
302 | 302 | ||
303 | setUserProfile(profile); | 303 | setUserProfile(profile); |
304 | } | 304 | } |
@@ -355,28 +355,28 @@ namespace OpenSim.Framework.UserManagement | |||
355 | agent.sessionID = new LLUUID(randDataS, 0); | 355 | agent.sessionID = new LLUUID(randDataS, 0); |
356 | 356 | ||
357 | // Profile UUID | 357 | // Profile UUID |
358 | agent.UUID = profile.UUID; | 358 | agent.UUID = profile.Id; |
359 | 359 | ||
360 | // Current position (from Home) | 360 | // Current position (from Home) |
361 | agent.currentHandle = profile.homeRegion; | 361 | agent.currentHandle = profile.HomeRegion; |
362 | agent.currentPos = profile.homeLocation; | 362 | agent.currentPos = profile.HomeLocation; |
363 | 363 | ||
364 | // If user specified additional start, use that | 364 | // If user specified additional start, use that |
365 | if (requestData.ContainsKey("start")) | 365 | if (requestData.ContainsKey("start")) |
366 | { | 366 | { |
367 | string startLoc = ((string)requestData["start"]).Trim(); | 367 | string startLoc = ((string)requestData["start"]).Trim(); |
368 | if (("last" == startLoc) && (profile.currentAgent != null)) | 368 | if (("last" == startLoc) && (profile.CurrentAgent != null)) |
369 | { | 369 | { |
370 | if ((profile.currentAgent.currentPos.X > 0) | 370 | if ((profile.CurrentAgent.currentPos.X > 0) |
371 | && (profile.currentAgent.currentPos.Y > 0) | 371 | && (profile.CurrentAgent.currentPos.Y > 0) |
372 | && (profile.currentAgent.currentPos.Z > 0) | 372 | && (profile.CurrentAgent.currentPos.Z > 0) |
373 | ) | 373 | ) |
374 | { | 374 | { |
375 | // TODO: Right now, currentRegion has not been used in GridServer for requesting region. | 375 | // TODO: Right now, currentRegion has not been used in GridServer for requesting region. |
376 | // TODO: It is only using currentHandle. | 376 | // TODO: It is only using currentHandle. |
377 | agent.currentRegion = profile.currentAgent.currentRegion; | 377 | agent.currentRegion = profile.CurrentAgent.currentRegion; |
378 | agent.currentHandle = profile.currentAgent.currentHandle; | 378 | agent.currentHandle = profile.CurrentAgent.currentHandle; |
379 | agent.currentPos = profile.currentAgent.currentPos; | 379 | agent.currentPos = profile.CurrentAgent.currentPos; |
380 | } | 380 | } |
381 | } | 381 | } |
382 | 382 | ||
@@ -406,7 +406,7 @@ namespace OpenSim.Framework.UserManagement | |||
406 | agent.regionID = LLUUID.Zero; // Fill in later | 406 | agent.regionID = LLUUID.Zero; // Fill in later |
407 | agent.currentRegion = LLUUID.Zero; // Fill in later | 407 | agent.currentRegion = LLUUID.Zero; // Fill in later |
408 | 408 | ||
409 | profile.currentAgent = agent; | 409 | profile.CurrentAgent = agent; |
410 | } | 410 | } |
411 | 411 | ||
412 | /// <summary> | 412 | /// <summary> |
@@ -432,9 +432,9 @@ namespace OpenSim.Framework.UserManagement | |||
432 | if (userProfile != null) | 432 | if (userProfile != null) |
433 | { | 433 | { |
434 | // This line needs to be in side the above if statement or the UserServer will crash on some logouts. | 434 | // This line needs to be in side the above if statement or the UserServer will crash on some logouts. |
435 | m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); | 435 | m_log.Info("[LOGOUT]: " + userProfile.FirstName + " " + userProfile.SurName + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); |
436 | 436 | ||
437 | userAgent = userProfile.currentAgent; | 437 | userAgent = userProfile.CurrentAgent; |
438 | if (userAgent != null) | 438 | if (userAgent != null) |
439 | { | 439 | { |
440 | userAgent.agentOnline = false; | 440 | userAgent.agentOnline = false; |
@@ -447,7 +447,7 @@ namespace OpenSim.Framework.UserManagement | |||
447 | 447 | ||
448 | userAgent.currentHandle = regionhandle; | 448 | userAgent.currentHandle = regionhandle; |
449 | userAgent.currentPos = currentPos; | 449 | userAgent.currentPos = currentPos; |
450 | userProfile.currentAgent = userAgent; | 450 | userProfile.CurrentAgent = userAgent; |
451 | 451 | ||
452 | CommitAgent(ref userProfile); | 452 | CommitAgent(ref userProfile); |
453 | } | 453 | } |
@@ -481,11 +481,11 @@ namespace OpenSim.Framework.UserManagement | |||
481 | agent.sessionID = new LLUUID(randDataS, 0); | 481 | agent.sessionID = new LLUUID(randDataS, 0); |
482 | 482 | ||
483 | // Profile UUID | 483 | // Profile UUID |
484 | agent.UUID = profile.UUID; | 484 | agent.UUID = profile.Id; |
485 | 485 | ||
486 | // Current position (from Home) | 486 | // Current position (from Home) |
487 | agent.currentHandle = profile.homeRegion; | 487 | agent.currentHandle = profile.HomeRegion; |
488 | agent.currentPos = profile.homeLocation; | 488 | agent.currentPos = profile.HomeLocation; |
489 | 489 | ||
490 | // What time did the user login? | 490 | // What time did the user login? |
491 | agent.loginTime = Util.UnixTimeSinceEpoch(); | 491 | agent.loginTime = Util.UnixTimeSinceEpoch(); |
@@ -495,7 +495,7 @@ namespace OpenSim.Framework.UserManagement | |||
495 | agent.regionID = LLUUID.Zero; // Fill in later | 495 | agent.regionID = LLUUID.Zero; // Fill in later |
496 | agent.currentRegion = LLUUID.Zero; // Fill in later | 496 | agent.currentRegion = LLUUID.Zero; // Fill in later |
497 | 497 | ||
498 | profile.currentAgent = agent; | 498 | profile.CurrentAgent = agent; |
499 | } | 499 | } |
500 | 500 | ||
501 | /// <summary> | 501 | /// <summary> |
@@ -508,7 +508,7 @@ namespace OpenSim.Framework.UserManagement | |||
508 | // TODO: how is this function different from setUserProfile? -> Add AddUserAgent() here and commit both tables "users" and "agents" | 508 | // TODO: how is this function different from setUserProfile? -> Add AddUserAgent() here and commit both tables "users" and "agents" |
509 | // TODO: what is the logic should be? | 509 | // TODO: what is the logic should be? |
510 | bool ret = false; | 510 | bool ret = false; |
511 | ret = AddUserAgent(profile.currentAgent); | 511 | ret = AddUserAgent(profile.CurrentAgent); |
512 | ret = ret & setUserProfile(profile); | 512 | ret = ret & setUserProfile(profile); |
513 | return ret; | 513 | return ret; |
514 | } | 514 | } |
@@ -522,16 +522,16 @@ namespace OpenSim.Framework.UserManagement | |||
522 | public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) | 522 | public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) |
523 | { | 523 | { |
524 | UserProfileData user = new UserProfileData(); | 524 | UserProfileData user = new UserProfileData(); |
525 | user.homeLocation = new LLVector3(128, 128, 100); | 525 | user.HomeLocation = new LLVector3(128, 128, 100); |
526 | user.UUID = LLUUID.Random(); | 526 | user.Id = LLUUID.Random(); |
527 | user.username = firstName; | 527 | user.FirstName = firstName; |
528 | user.surname = lastName; | 528 | user.SurName = lastName; |
529 | user.passwordHash = pass; | 529 | user.PasswordHash = pass; |
530 | user.passwordSalt = String.Empty; | 530 | user.PasswordSalt = String.Empty; |
531 | user.created = Util.UnixTimeSinceEpoch(); | 531 | user.Created = Util.UnixTimeSinceEpoch(); |
532 | user.homeLookAt = new LLVector3(100, 100, 100); | 532 | user.HomeLookAt = new LLVector3(100, 100, 100); |
533 | user.homeRegionX = regX; | 533 | user.HomeRegionX = regX; |
534 | user.homeRegionY = regY; | 534 | user.HomeRegionY = regY; |
535 | 535 | ||
536 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 536 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
537 | { | 537 | { |
@@ -545,14 +545,14 @@ namespace OpenSim.Framework.UserManagement | |||
545 | } | 545 | } |
546 | } | 546 | } |
547 | 547 | ||
548 | return user.UUID; | 548 | return user.Id; |
549 | } | 549 | } |
550 | 550 | ||
551 | public bool UpdateUserProfileProperties(UserProfileData UserProfile) | 551 | public bool UpdateUserProfileProperties(UserProfileData UserProfile) |
552 | { | 552 | { |
553 | if (null == GetUserProfile(UserProfile.UUID)) | 553 | if (null == GetUserProfile(UserProfile.Id)) |
554 | { | 554 | { |
555 | m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.UUID.ToString()); | 555 | m_log.Info("[USERSTORAGE]: Failed to find User by UUID " + UserProfile.Id.ToString()); |
556 | return false; | 556 | return false; |
557 | } | 557 | } |
558 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | 558 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) |
@@ -563,7 +563,7 @@ namespace OpenSim.Framework.UserManagement | |||
563 | } | 563 | } |
564 | catch (Exception e) | 564 | catch (Exception e) |
565 | { | 565 | { |
566 | m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.UUID.ToString() | 566 | m_log.Info("[USERSTORAGE]: Unable to update user " + UserProfile.Id.ToString() |
567 | + " via " + plugin.Key + "(" + e.ToString() + ")"); | 567 | + " via " + plugin.Key + "(" + e.ToString() + ")"); |
568 | return false; | 568 | return false; |
569 | } | 569 | } |
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index 6a49f0d..016dc8d 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs | |||
@@ -38,37 +38,37 @@ namespace OpenSim.Framework | |||
38 | /// <summary> | 38 | /// <summary> |
39 | /// The ID value for this user | 39 | /// The ID value for this user |
40 | /// </summary> | 40 | /// </summary> |
41 | public LLUUID UUID; | 41 | private LLUUID _id; |
42 | 42 | ||
43 | /// <summary> | 43 | /// <summary> |
44 | /// The last used Web_login_key | 44 | /// The last used Web_login_key |
45 | /// </summary> | 45 | /// </summary> |
46 | public LLUUID webLoginKey; | 46 | private LLUUID webLoginKey; |
47 | /// <summary> | 47 | /// <summary> |
48 | /// The first component of a users account name | 48 | /// The first component of a users account name |
49 | /// </summary> | 49 | /// </summary> |
50 | public string username; | 50 | private string username; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// The second component of a users account name | 53 | /// The second component of a users account name |
54 | /// </summary> | 54 | /// </summary> |
55 | public string surname; | 55 | private string surname; |
56 | 56 | ||
57 | /// <summary> | 57 | /// <summary> |
58 | /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) | 58 | /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) |
59 | /// </summary> | 59 | /// </summary> |
60 | /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> | 60 | /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> |
61 | public string passwordHash; | 61 | private string passwordHash; |
62 | 62 | ||
63 | /// <summary> | 63 | /// <summary> |
64 | /// The salt used for the users hash, should be 32 bytes or longer | 64 | /// The salt used for the users hash, should be 32 bytes or longer |
65 | /// </summary> | 65 | /// </summary> |
66 | public string passwordSalt; | 66 | private string passwordSalt; |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
69 | /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into | 69 | /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into |
70 | /// </summary> | 70 | /// </summary> |
71 | public ulong homeRegion | 71 | public ulong HomeRegion |
72 | { | 72 | { |
73 | get { return Helpers.UIntsToLong((homeRegionX * (uint)Constants.RegionSize), (homeRegionY * (uint)Constants.RegionSize)); } | 73 | get { return Helpers.UIntsToLong((homeRegionX * (uint)Constants.RegionSize), (homeRegionY * (uint)Constants.RegionSize)); } |
74 | set | 74 | set |
@@ -78,74 +78,272 @@ namespace OpenSim.Framework | |||
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | public uint homeRegionX; | 81 | public LLUUID Id { |
82 | public uint homeRegionY; | 82 | get { |
83 | return _id; | ||
84 | } | ||
85 | set { | ||
86 | _id = value; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | public LLUUID WebLoginKey { | ||
91 | get { | ||
92 | return webLoginKey; | ||
93 | } | ||
94 | set { | ||
95 | webLoginKey = value; | ||
96 | } | ||
97 | } | ||
98 | |||
99 | public string FirstName { | ||
100 | get { | ||
101 | return username; | ||
102 | } | ||
103 | set { | ||
104 | username = value; | ||
105 | } | ||
106 | } | ||
107 | |||
108 | public string SurName { | ||
109 | get { | ||
110 | return surname; | ||
111 | } | ||
112 | set { | ||
113 | surname = value; | ||
114 | } | ||
115 | } | ||
116 | |||
117 | public string PasswordHash { | ||
118 | get { | ||
119 | return passwordHash; | ||
120 | } | ||
121 | set { | ||
122 | passwordHash = value; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | public string PasswordSalt { | ||
127 | get { | ||
128 | return passwordSalt; | ||
129 | } | ||
130 | set { | ||
131 | passwordSalt = value; | ||
132 | } | ||
133 | } | ||
134 | |||
135 | public uint HomeRegionX { | ||
136 | get { | ||
137 | return homeRegionX; | ||
138 | } | ||
139 | set { | ||
140 | homeRegionX = value; | ||
141 | } | ||
142 | } | ||
143 | |||
144 | public uint HomeRegionY { | ||
145 | get { | ||
146 | return homeRegionY; | ||
147 | } | ||
148 | set { | ||
149 | homeRegionY = value; | ||
150 | } | ||
151 | } | ||
152 | |||
153 | public LLVector3 HomeLocation { | ||
154 | get { | ||
155 | return homeLocation; | ||
156 | } | ||
157 | set { | ||
158 | homeLocation = value; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | public LLVector3 HomeLookAt { | ||
163 | get { | ||
164 | return homeLookAt; | ||
165 | } | ||
166 | set { | ||
167 | homeLookAt = value; | ||
168 | } | ||
169 | } | ||
170 | |||
171 | public int Created { | ||
172 | get { | ||
173 | return created; | ||
174 | } | ||
175 | set { | ||
176 | created = value; | ||
177 | } | ||
178 | } | ||
179 | |||
180 | public int LastLogin { | ||
181 | get { | ||
182 | return lastLogin; | ||
183 | } | ||
184 | set { | ||
185 | lastLogin = value; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | public LLUUID RootInventoryFolderID { | ||
190 | get { | ||
191 | return rootInventoryFolderID; | ||
192 | } | ||
193 | set { | ||
194 | rootInventoryFolderID = value; | ||
195 | } | ||
196 | } | ||
197 | |||
198 | public string UserInventoryURI { | ||
199 | get { | ||
200 | return userInventoryURI; | ||
201 | } | ||
202 | set { | ||
203 | userInventoryURI = value; | ||
204 | } | ||
205 | } | ||
206 | |||
207 | public string UserAssetURI { | ||
208 | get { | ||
209 | return userAssetURI; | ||
210 | } | ||
211 | set { | ||
212 | userAssetURI = value; | ||
213 | } | ||
214 | } | ||
215 | |||
216 | public uint ProfileCanDoMask { | ||
217 | get { | ||
218 | return profileCanDoMask; | ||
219 | } | ||
220 | set { | ||
221 | profileCanDoMask = value; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | public uint ProfileWantDoMask { | ||
226 | get { | ||
227 | return profileWantDoMask; | ||
228 | } | ||
229 | set { | ||
230 | profileWantDoMask = value; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | public string ProfileAboutText { | ||
235 | get { | ||
236 | return profileAboutText; | ||
237 | } | ||
238 | set { | ||
239 | profileAboutText = value; | ||
240 | } | ||
241 | } | ||
242 | |||
243 | public string ProfileFirstText { | ||
244 | get { | ||
245 | return profileFirstText; | ||
246 | } | ||
247 | set { | ||
248 | profileFirstText = value; | ||
249 | } | ||
250 | } | ||
251 | |||
252 | public LLUUID ProfileImage { | ||
253 | get { | ||
254 | return profileImage; | ||
255 | } | ||
256 | set { | ||
257 | profileImage = value; | ||
258 | } | ||
259 | } | ||
260 | |||
261 | public LLUUID ProfileFirstImage { | ||
262 | get { | ||
263 | return profileFirstImage; | ||
264 | } | ||
265 | set { | ||
266 | profileFirstImage = value; | ||
267 | } | ||
268 | } | ||
269 | |||
270 | public UserAgentData CurrentAgent { | ||
271 | get { | ||
272 | return currentAgent; | ||
273 | } | ||
274 | set { | ||
275 | currentAgent = value; | ||
276 | } | ||
277 | } | ||
278 | |||
279 | private uint homeRegionX; | ||
280 | private uint homeRegionY; | ||
83 | 281 | ||
84 | /// <summary> | 282 | /// <summary> |
85 | /// The coordinates inside the region of the home location | 283 | /// The coordinates inside the region of the home location |
86 | /// </summary> | 284 | /// </summary> |
87 | public LLVector3 homeLocation; | 285 | private LLVector3 homeLocation; |
88 | 286 | ||
89 | /// <summary> | 287 | /// <summary> |
90 | /// Where the user will be looking when they rez. | 288 | /// Where the user will be looking when they rez. |
91 | /// </summary> | 289 | /// </summary> |
92 | public LLVector3 homeLookAt; | 290 | private LLVector3 homeLookAt; |
93 | 291 | ||
94 | /// <summary> | 292 | /// <summary> |
95 | /// A UNIX Timestamp (seconds since epoch) for the users creation | 293 | /// A UNIX Timestamp (seconds since epoch) for the users creation |
96 | /// </summary> | 294 | /// </summary> |
97 | public int created; | 295 | private int created; |
98 | 296 | ||
99 | /// <summary> | 297 | /// <summary> |
100 | /// A UNIX Timestamp for the users last login date / time | 298 | /// A UNIX Timestamp for the users last login date / time |
101 | /// </summary> | 299 | /// </summary> |
102 | public int lastLogin; | 300 | private int lastLogin; |
103 | 301 | ||
104 | public LLUUID rootInventoryFolderID; | 302 | private LLUUID rootInventoryFolderID; |
105 | 303 | ||
106 | /// <summary> | 304 | /// <summary> |
107 | /// A URI to the users inventory server, used for foreigners and large grids | 305 | /// A URI to the users inventory server, used for foreigners and large grids |
108 | /// </summary> | 306 | /// </summary> |
109 | public string userInventoryURI = String.Empty; | 307 | private string userInventoryURI = String.Empty; |
110 | 308 | ||
111 | /// <summary> | 309 | /// <summary> |
112 | /// A URI to the users asset server, used for foreigners and large grids. | 310 | /// A URI to the users asset server, used for foreigners and large grids. |
113 | /// </summary> | 311 | /// </summary> |
114 | public string userAssetURI = String.Empty; | 312 | private string userAssetURI = String.Empty; |
115 | 313 | ||
116 | /// <summary> | 314 | /// <summary> |
117 | /// A uint mask containing the "I can do" fields of the users profile | 315 | /// A uint mask containing the "I can do" fields of the users profile |
118 | /// </summary> | 316 | /// </summary> |
119 | public uint profileCanDoMask; | 317 | private uint profileCanDoMask; |
120 | 318 | ||
121 | /// <summary> | 319 | /// <summary> |
122 | /// A uint mask containing the "I want to do" part of the users profile | 320 | /// A uint mask containing the "I want to do" part of the users profile |
123 | /// </summary> | 321 | /// </summary> |
124 | public uint profileWantDoMask; // Profile window "I want to" mask | 322 | private uint profileWantDoMask; // Profile window "I want to" mask |
125 | 323 | ||
126 | /// <summary> | 324 | /// <summary> |
127 | /// The about text listed in a users profile. | 325 | /// The about text listed in a users profile. |
128 | /// </summary> | 326 | /// </summary> |
129 | public string profileAboutText = String.Empty; | 327 | private string profileAboutText = String.Empty; |
130 | 328 | ||
131 | /// <summary> | 329 | /// <summary> |
132 | /// The first life about text listed in a users profile | 330 | /// The first life about text listed in a users profile |
133 | /// </summary> | 331 | /// </summary> |
134 | public string profileFirstText = String.Empty; | 332 | private string profileFirstText = String.Empty; |
135 | 333 | ||
136 | /// <summary> | 334 | /// <summary> |
137 | /// The profile image for an avatar stored on the asset server | 335 | /// The profile image for an avatar stored on the asset server |
138 | /// </summary> | 336 | /// </summary> |
139 | public LLUUID profileImage; | 337 | private LLUUID profileImage; |
140 | 338 | ||
141 | /// <summary> | 339 | /// <summary> |
142 | /// The profile image for the users first life tab | 340 | /// The profile image for the users first life tab |
143 | /// </summary> | 341 | /// </summary> |
144 | public LLUUID profileFirstImage; | 342 | private LLUUID profileFirstImage; |
145 | 343 | ||
146 | /// <summary> | 344 | /// <summary> |
147 | /// The users last registered agent (filled in on the user server) | 345 | /// The users last registered agent (filled in on the user server) |
148 | /// </summary> | 346 | /// </summary> |
149 | public UserAgentData currentAgent; | 347 | private UserAgentData currentAgent; |
150 | } | 348 | } |
151 | } | 349 | } |