aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/PGSQLEstateData.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-08-18 20:24:19 +0100
committerUbitUmarov2019-08-18 20:24:19 +0100
commitd5db4b9d939ff7e1f75366428a903198847fdf9e (patch)
treecd795b49a8c359e9b7d38d434c49b65cbc5a74c4 /OpenSim/Data/PGSQL/PGSQLEstateData.cs
parentoops... (diff)
downloadopensim-SC-d5db4b9d939ff7e1f75366428a903198847fdf9e.zip
opensim-SC-d5db4b9d939ff7e1f75366428a903198847fdf9e.tar.gz
opensim-SC-d5db4b9d939ff7e1f75366428a903198847fdf9e.tar.bz2
opensim-SC-d5db4b9d939ff7e1f75366428a903198847fdf9e.tar.xz
try to update PGSQL estateban
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLEstateData.cs')
-rw-r--r--OpenSim/Data/PGSQL/PGSQLEstateData.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLEstateData.cs b/OpenSim/Data/PGSQL/PGSQLEstateData.cs
index 9489d6c..16e56fa 100644
--- a/OpenSim/Data/PGSQL/PGSQLEstateData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLEstateData.cs
@@ -286,7 +286,7 @@ namespace OpenSim.Data.PGSQL
286 { 286 {
287 es.ClearBans(); 287 es.ClearBans();
288 288
289 string sql = "select \"bannedUUID\" from estateban where \"EstateID\" = :EstateID"; 289 string sql = "select * from estateban where \"EstateID\" = :EstateID";
290 290
291 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 291 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
292 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 292 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
@@ -302,6 +302,8 @@ namespace OpenSim.Data.PGSQL
302 EstateBan eb = new EstateBan(); 302 EstateBan eb = new EstateBan();
303 303
304 eb.BannedUserID = new UUID((Guid)reader["bannedUUID"]); //uuid; 304 eb.BannedUserID = new UUID((Guid)reader["bannedUUID"]); //uuid;
305 eb.BanningUserID = new UUID((Guid)reader["banningUUID"]); //uuid;
306 eb.BanTime = Convert.ToInt32(reader["banTime"]);
305 eb.BannedHostAddress = "0.0.0.0"; 307 eb.BannedHostAddress = "0.0.0.0";
306 eb.BannedHostIPMask = "0.0.0.0"; 308 eb.BannedHostIPMask = "0.0.0.0";
307 es.AddBan(eb); 309 es.AddBan(eb);
@@ -346,11 +348,15 @@ namespace OpenSim.Data.PGSQL
346 cmd.ExecuteNonQuery(); 348 cmd.ExecuteNonQuery();
347 349
348 //Insert after 350 //Insert after
349 cmd.CommandText = "insert into estateban (\"EstateID\", \"bannedUUID\",\"bannedIp\", \"bannedIpHostMask\", \"bannedNameMask\") values ( :EstateID, :bannedUUID, '','','' )"; 351 cmd.CommandText = "insert into estateban (\"EstateID\", \"bannedUUID\",\"bannedIp\", \"bannedIpHostMask\", \"bannedNameMask\", \"banningUUID\",\"banTime\" ) values ( :EstateID, :bannedUUID, '','','', :banningUUID, :banTime )";
350 cmd.Parameters.AddWithValue("bannedUUID", Guid.Empty); 352 cmd.Parameters.AddWithValue("bannedUUID", Guid.Empty);
351 foreach (EstateBan b in es.EstateBans) 353 foreach (EstateBan b in es.EstateBans)
352 { 354 {
355 cmd.Parameters["EstateID"].Value = b.EstateID;
353 cmd.Parameters["bannedUUID"].Value = b.BannedUserID.Guid; 356 cmd.Parameters["bannedUUID"].Value = b.BannedUserID.Guid;
357 cmd.Parameters["banningUUID"].Value = b.BanningUserID.Guid;
358 cmd.Parameters["banTime"].Value = b.BanTime;
359
354 cmd.ExecuteNonQuery(); 360 cmd.ExecuteNonQuery();
355 } 361 }
356 } 362 }