aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/SQLite/Resources/EstateStore.migrations9
-rw-r--r--OpenSim/Data/SQLite/SQLiteEstateData.cs13
2 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Data/SQLite/Resources/EstateStore.migrations b/OpenSim/Data/SQLite/Resources/EstateStore.migrations
index 37fa1d9..30e04fd 100644
--- a/OpenSim/Data/SQLite/Resources/EstateStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/EstateStore.migrations
@@ -63,7 +63,16 @@ CREATE TABLE IF NOT EXISTS estateban (
63 bannedIpHostMask varchar(16) NOT NULL, 63 bannedIpHostMask varchar(16) NOT NULL,
64 bannedNameMask varchar(64) default NULL 64 bannedNameMask varchar(64) default NULL
65); 65);
66
66CREATE INDEX estate_ban_estate_id on estateban(EstateID); 67CREATE INDEX estate_ban_estate_id on estateban(EstateID);
67 68
68COMMIT; 69COMMIT;
69 70
71:VERSION 11
72BEGIN;
73ALTER TABLE `estateban`
74 ADD COLUMN `banningUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
75 ADD COLUMN `banTime` integer NOT NULL DEFAULT 0;
76COMMIT;
77
78
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
index 0fcab21..5e55323 100644
--- a/OpenSim/Data/SQLite/SQLiteEstateData.cs
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -278,7 +278,7 @@ namespace OpenSim.Data.SQLite
278 278
279 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 279 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
280 { 280 {
281 cmd.CommandText = "select bannedUUID from estateban where EstateID = :EstateID"; 281 cmd.CommandText = "select * from estateban where EstateID = :EstateID";
282 cmd.Parameters.AddWithValue(":EstateID", es.EstateID); 282 cmd.Parameters.AddWithValue(":EstateID", es.EstateID);
283 283
284 r = cmd.ExecuteReader(); 284 r = cmd.ExecuteReader();
@@ -288,12 +288,11 @@ namespace OpenSim.Data.SQLite
288 { 288 {
289 EstateBan eb = new EstateBan(); 289 EstateBan eb = new EstateBan();
290 290
291 UUID uuid = new UUID(); 291 eb.BannedUserID = DBGuid.FromDB(r["bannedUUID"]); ;
292 UUID.TryParse(r["bannedUUID"].ToString(), out uuid);
293
294 eb.BannedUserID = uuid;
295 eb.BannedHostAddress = "0.0.0.0"; 292 eb.BannedHostAddress = "0.0.0.0";
296 eb.BannedHostIPMask = "0.0.0.0"; 293 eb.BannedHostIPMask = "0.0.0.0";
294 eb.BanningUserID = DBGuid.FromDB(r["banningUUID"]);
295 eb.BanTime = Convert.ToInt32(r["banTime"]);
297 es.AddBan(eb); 296 es.AddBan(eb);
298 } 297 }
299 r.Close(); 298 r.Close();
@@ -310,12 +309,14 @@ namespace OpenSim.Data.SQLite
310 309
311 cmd.Parameters.Clear(); 310 cmd.Parameters.Clear();
312 311
313 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; 312 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask, banningUUID, banTime) values ( :EstateID, :bannedUUID, '', '', '', :banningUUID, :banTime )";
314 313
315 foreach (EstateBan b in es.EstateBans) 314 foreach (EstateBan b in es.EstateBans)
316 { 315 {
317 cmd.Parameters.AddWithValue(":EstateID", es.EstateID.ToString()); 316 cmd.Parameters.AddWithValue(":EstateID", es.EstateID.ToString());
318 cmd.Parameters.AddWithValue(":bannedUUID", b.BannedUserID.ToString()); 317 cmd.Parameters.AddWithValue(":bannedUUID", b.BannedUserID.ToString());
318 cmd.Parameters.AddWithValue(":banningUUID", b.BanningUserID.ToString());
319 cmd.Parameters.AddWithValue(":banTime", b.BanTime);
319 320
320 cmd.ExecuteNonQuery(); 321 cmd.ExecuteNonQuery();
321 cmd.Parameters.Clear(); 322 cmd.Parameters.Clear();