aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Framework/Data.DB4o/DB4oUserData.cs
parent* Deleted .user file (diff)
downloadopensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Framework/Data.DB4o/DB4oUserData.cs')
-rw-r--r--OpenSim/Framework/Data.DB4o/DB4oUserData.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
index b00fd02..c7113bf 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
@@ -28,8 +28,6 @@
28using System; 28using System;
29using System.IO; 29using System.IO;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework;
32using OpenSim.Framework;
33 31
34namespace OpenSim.Framework.Data.DB4o 32namespace OpenSim.Framework.Data.DB4o
35{ 33{
@@ -41,14 +39,14 @@ namespace OpenSim.Framework.Data.DB4o
41 /// <summary> 39 /// <summary>
42 /// The database manager 40 /// The database manager
43 /// </summary> 41 /// </summary>
44 DB4oUserManager manager; 42 private DB4oUserManager manager;
45 43
46 /// <summary> 44 /// <summary>
47 /// Artificial constructor called upon plugin load 45 /// Artificial constructor called upon plugin load
48 /// </summary> 46 /// </summary>
49 public void Initialise() 47 public void Initialise()
50 { 48 {
51 manager = new DB4oUserManager(Path.Combine(Util.dataDir(),"userprofiles.yap")); 49 manager = new DB4oUserManager(Path.Combine(Util.dataDir(), "userprofiles.yap"));
52 } 50 }
53 51
54 /// <summary> 52 /// <summary>
@@ -58,7 +56,7 @@ namespace OpenSim.Framework.Data.DB4o
58 /// <returns>A user profile</returns> 56 /// <returns>A user profile</returns>
59 public UserProfileData GetUserByUUID(LLUUID uuid) 57 public UserProfileData GetUserByUUID(LLUUID uuid)
60 { 58 {
61 if(manager.userProfiles.ContainsKey(uuid)) 59 if (manager.userProfiles.ContainsKey(uuid))
62 return manager.userProfiles[uuid]; 60 return manager.userProfiles[uuid];
63 return null; 61 return null;
64 } 62 }
@@ -95,7 +93,7 @@ namespace OpenSim.Framework.Data.DB4o
95 /// <param name="uuid">The users account ID</param> 93 /// <param name="uuid">The users account ID</param>
96 /// <returns>A matching users profile</returns> 94 /// <returns>A matching users profile</returns>
97 public UserAgentData GetAgentByUUID(LLUUID uuid) 95 public UserAgentData GetAgentByUUID(LLUUID uuid)
98 { 96 {
99 try 97 try
100 { 98 {
101 return GetUserByUUID(uuid).currentAgent; 99 return GetUserByUUID(uuid).currentAgent;
@@ -126,7 +124,7 @@ namespace OpenSim.Framework.Data.DB4o
126 { 124 {
127 try 125 try
128 { 126 {
129 return GetUserByName(fname,lname).currentAgent; 127 return GetUserByName(fname, lname).currentAgent;
130 } 128 }
131 catch (Exception) 129 catch (Exception)
132 { 130 {
@@ -149,7 +147,7 @@ namespace OpenSim.Framework.Data.DB4o
149 Console.WriteLine(e.ToString()); 147 Console.WriteLine(e.ToString());
150 } 148 }
151 } 149 }
152 150
153 /// <summary> 151 /// <summary>
154 /// Creates a new user profile 152 /// Creates a new user profile
155 /// </summary> 153 /// </summary>
@@ -157,15 +155,17 @@ namespace OpenSim.Framework.Data.DB4o
157 /// <returns>True on success, false on error</returns> 155 /// <returns>True on success, false on error</returns>
158 public bool UpdateUserProfile(UserProfileData user) 156 public bool UpdateUserProfile(UserProfileData user)
159 { 157 {
160 try { 158 try
159 {
161 return manager.UpdateRecord(user); 160 return manager.UpdateRecord(user);
162 } catch (Exception e) { 161 }
162 catch (Exception e)
163 {
163 Console.WriteLine(e.ToString()); 164 Console.WriteLine(e.ToString());
164 return false; 165 return false;
165 } 166 }
166 } 167 }
167 168
168
169 169
170 /// <summary> 170 /// <summary>
171 /// Creates a new user agent 171 /// Creates a new user agent
@@ -219,4 +219,4 @@ namespace OpenSim.Framework.Data.DB4o
219 return "0.1"; 219 return "0.1";
220 } 220 }
221 } 221 }
222} 222} \ No newline at end of file