diff options
author | Sean Dague | 2008-10-16 15:57:59 +0000 |
---|---|---|
committer | Sean Dague | 2008-10-16 15:57:59 +0000 |
commit | 72725a08940cb087e54ddb847224c0039e5d617b (patch) | |
tree | bd932008c5f6ee38f7120efa4b795ee38d951ddb /OpenSim | |
parent | Updated 32Bit launcher so it works in Visual Studio again. (So developers on ... (diff) | |
download | opensim-SC-72725a08940cb087e54ddb847224c0039e5d617b.zip opensim-SC-72725a08940cb087e54ddb847224c0039e5d617b.tar.gz opensim-SC-72725a08940cb087e54ddb847224c0039e5d617b.tar.bz2 opensim-SC-72725a08940cb087e54ddb847224c0039e5d617b.tar.xz |
- Enforced no user or agent with UUID 0 on agent DB insertion
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteUserData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/Tests/BasicUserTest.cs | 12 |
3 files changed, 12 insertions, 8 deletions
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 3a088cf..ecd534a 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs | |||
@@ -617,6 +617,10 @@ namespace OpenSim.Data.MySQL | |||
617 | /// <param name="agent">The agent to create</param> | 617 | /// <param name="agent">The agent to create</param> |
618 | public override void AddNewUserAgent(UserAgentData agent) | 618 | public override void AddNewUserAgent(UserAgentData agent) |
619 | { | 619 | { |
620 | UUID zero = UUID.Zero; | ||
621 | if (agent.ProfileID == zero || agent.SessionID == zero) | ||
622 | return; | ||
623 | |||
620 | MySQLSuperManager dbm = GetLockedConnection(); | 624 | MySQLSuperManager dbm = GetLockedConnection(); |
621 | try | 625 | try |
622 | { | 626 | { |
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index 448ef85..94dc1d3 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs | |||
@@ -567,6 +567,10 @@ namespace OpenSim.Data.SQLite | |||
567 | /// <param name="agent">The agent to add to the database</param> | 567 | /// <param name="agent">The agent to add to the database</param> |
568 | override public void AddNewUserAgent(UserAgentData agent) | 568 | override public void AddNewUserAgent(UserAgentData agent) |
569 | { | 569 | { |
570 | UUID zero = UUID.Zero; | ||
571 | if (agent.SessionID == zero || agent.ProfileID == zero) | ||
572 | return; | ||
573 | |||
570 | DataTable agents = ds.Tables["useragents"]; | 574 | DataTable agents = ds.Tables["useragents"]; |
571 | lock (ds) | 575 | lock (ds) |
572 | { | 576 | { |
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs index 726ae84..3830915 100644 --- a/OpenSim/Data/Tests/BasicUserTest.cs +++ b/OpenSim/Data/Tests/BasicUserTest.cs | |||
@@ -143,8 +143,8 @@ namespace OpenSim.Data.Tests | |||
143 | { | 143 | { |
144 | UserProfileData u1 = db.GetUserByName(fname1,lname1); | 144 | UserProfileData u1 = db.GetUserByName(fname1,lname1); |
145 | UserProfileData u2 = db.GetUserByName(fname2,lname2); | 145 | UserProfileData u2 = db.GetUserByName(fname2,lname2); |
146 | UserProfileData u3 = db.GetUserByName(fname3,lname3); | 146 | UserProfileData u3 = db.GetUserByName(fname3,lname3); |
147 | Assert.That(user1,Is.EqualTo(u1.ID)); //?? | 147 | Assert.That(user1,Is.EqualTo(u1.ID)); |
148 | Assert.That(user2,Is.EqualTo(u2.ID)); | 148 | Assert.That(user2,Is.EqualTo(u2.ID)); |
149 | Assert.That(user3,Is.EqualTo(u3.ID)); | 149 | Assert.That(user3,Is.EqualTo(u3.ID)); |
150 | } | 150 | } |
@@ -219,12 +219,8 @@ namespace OpenSim.Data.Tests | |||
219 | UserAgentData a4 = NewAgent(zero,agent4); | 219 | UserAgentData a4 = NewAgent(zero,agent4); |
220 | db.AddNewUserAgent(a0); | 220 | db.AddNewUserAgent(a0); |
221 | db.AddNewUserAgent(a4); | 221 | db.AddNewUserAgent(a4); |
222 | UserAgentData a0a = db.GetAgentByUUID(user4); | 222 | Assert.That(db.GetAgentByUUID(user4),Is.Null); |
223 | UserAgentData a4a = db.GetAgentByUUID(zero); | 223 | Assert.That(db.GetAgentByUUID(zero),Is.Null); |
224 | Assert.That(zero,Is.EqualTo(a0a.SessionID)); | ||
225 | Assert.That(user4,Is.EqualTo(a0a.ProfileID)); | ||
226 | Assert.That(agent4,Is.EqualTo(a4a.SessionID)); | ||
227 | Assert.That(zero,Is.EqualTo(a4a.ProfileID)); | ||
228 | } | 224 | } |
229 | 225 | ||
230 | [Test] | 226 | [Test] |