diff options
author | Sean Dague | 2008-05-02 19:57:35 +0000 |
---|---|---|
committer | Sean Dague | 2008-05-02 19:57:35 +0000 |
commit | e538a34accb1032ac738eb18fe998aae1afc652d (patch) | |
tree | 4e45721c84be557b39d99fc148cf5aa06f9edcc3 /OpenSim/Data/NHibernate/NHibernateUserData.cs | |
parent | in theory fix the user table mapping (diff) | |
download | opensim-SC_OLD-e538a34accb1032ac738eb18fe998aae1afc652d.zip opensim-SC_OLD-e538a34accb1032ac738eb18fe998aae1afc652d.tar.gz opensim-SC_OLD-e538a34accb1032ac738eb18fe998aae1afc652d.tar.bz2 opensim-SC_OLD-e538a34accb1032ac738eb18fe998aae1afc652d.tar.xz |
fixed up a bunch of the nhibernate user driver. Friends are not
implemented, and something is still funny with agents, but this
at least got me logged in, so is good enough to plumb through
appearance and see how that goes.
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateUserData.cs')
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateUserData.cs | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 8983753..491cb2a 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs | |||
@@ -85,11 +85,11 @@ namespace OpenSim.Data.NHibernate | |||
85 | 85 | ||
86 | private void InitDB() | 86 | private void InitDB() |
87 | { | 87 | { |
88 | string regex = @"no such table: Users"; | 88 | string regex = @"no such table: UserProfiles"; |
89 | Regex RE = new Regex(regex, RegexOptions.Multiline); | 89 | Regex RE = new Regex(regex, RegexOptions.Multiline); |
90 | try { | 90 | try { |
91 | using(ISession session = factory.OpenSession()) { | 91 | using(ISession session = factory.OpenSession()) { |
92 | session.Load(typeof(InventoryItemBase), LLUUID.Zero); | 92 | session.Load(typeof(UserProfileData), LLUUID.Zero); |
93 | } | 93 | } |
94 | } catch (ObjectNotFoundException e) { | 94 | } catch (ObjectNotFoundException e) { |
95 | // yes, we know it's not there, but that's ok | 95 | // yes, we know it's not there, but that's ok |
@@ -104,11 +104,14 @@ namespace OpenSim.Data.NHibernate | |||
104 | 104 | ||
105 | private bool ExistsUser(LLUUID uuid) | 105 | private bool ExistsUser(LLUUID uuid) |
106 | { | 106 | { |
107 | UserProfileData user; | 107 | UserProfileData user = null; |
108 | using(ISession session = factory.OpenSession()) { | 108 | try { |
109 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; | 109 | using(ISession session = factory.OpenSession()) { |
110 | } | 110 | user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; |
111 | return (user == null) ? false : true; | 111 | } |
112 | } catch (Exception e) {} | ||
113 | |||
114 | return (user != null); | ||
112 | } | 115 | } |
113 | 116 | ||
114 | override public UserProfileData GetUserByUUID(LLUUID uuid) | 117 | override public UserProfileData GetUserByUUID(LLUUID uuid) |
@@ -201,8 +204,12 @@ namespace OpenSim.Data.NHibernate | |||
201 | 204 | ||
202 | override public UserAgentData GetAgentByUUID(LLUUID uuid) | 205 | override public UserAgentData GetAgentByUUID(LLUUID uuid) |
203 | { | 206 | { |
204 | using(ISession session = factory.OpenSession()) { | 207 | try { |
205 | return session.Load(typeof(UserAgentData), uuid) as UserAgentData; | 208 | using(ISession session = factory.OpenSession()) { |
209 | return session.Load(typeof(UserAgentData), uuid) as UserAgentData; | ||
210 | } | ||
211 | } catch { | ||
212 | return null; | ||
206 | } | 213 | } |
207 | } | 214 | } |
208 | 215 | ||