diff options
author | UbitUmarov | 2019-08-18 20:35:24 +0100 |
---|---|---|
committer | UbitUmarov | 2019-08-18 20:35:24 +0100 |
commit | 7f52bcbc7f1f518d49b84a5c642b3b065e0bb656 (patch) | |
tree | f33dd032b2230fd74859cbe1cdb6ba0e0def0c5f /OpenSim/Data/SQLite/SQLiteEstateData.cs | |
parent | try to update PGSQL estateban (diff) | |
download | opensim-SC-7f52bcbc7f1f518d49b84a5c642b3b065e0bb656.zip opensim-SC-7f52bcbc7f1f518d49b84a5c642b3b065e0bb656.tar.gz opensim-SC-7f52bcbc7f1f518d49b84a5c642b3b065e0bb656.tar.bz2 opensim-SC-7f52bcbc7f1f518d49b84a5c642b3b065e0bb656.tar.xz |
try to update SQLite estateban
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteEstateData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteEstateData.cs | 13 |
1 files changed, 7 insertions, 6 deletions
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(); |