From 279e0061c515ee0a03036bef68eea9738273d785 Mon Sep 17 00:00:00 2001
From: Johan Berntsson
Date: Tue, 4 Mar 2008 05:31:54 +0000
Subject: Merged 3Di code that provides scene and avatar serialization, and
plugin support for region move/split/merge. See ThirdParty/3Di/README.txt.
Unless the new modules are used there should be no noticeable changes when
running OpenSim.
---
OpenSim/Framework/Data.MySQL/MySQLManager.cs | 42 ++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework/Data.MySQL/MySQLManager.cs')
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index ea11aa0..0410643 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -301,6 +301,7 @@ namespace OpenSim.Framework.Data.MySQL
// non-critical parts
retval.regionName = (string)reader["regionName"];
+ retval.originUUID = new LLUUID((string) reader["originUUID"]);
// Secrets
retval.regionRecvKey = (string) reader["regionRecvKey"];
@@ -752,13 +753,13 @@ namespace OpenSim.Framework.Data.MySQL
// server for the UUID of the region's owner (master avatar). It consists of the addition of the column and value to the relevant sql,
// as well as the related parameterization
sql +=
- "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid) VALUES ";
+ "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid, originUUID) VALUES ";
sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, ";
sql +=
"?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, ";
sql +=
- "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort, ?owner_uuid)";
+ "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort, ?owner_uuid, ?originUUID)";
if (GRID_ONLY_UPDATE_NECESSARY_DATA)
{
@@ -798,6 +799,7 @@ namespace OpenSim.Framework.Data.MySQL
parameters["?serverHttpPort"] = regiondata.httpPort.ToString();
parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString();
parameters["?owner_uuid"] = regiondata.owner_uuid.ToString();
+ parameters["?originUUID"] = regiondata.originUUID.ToString();
bool returnval = false;
@@ -821,5 +823,41 @@ namespace OpenSim.Framework.Data.MySQL
return returnval;
}
+ ///
+ /// Delete a region from the database
+ ///
+ /// The region to insert
+ /// Success?
+ //public bool deleteRegion(RegionProfileData regiondata)
+ public bool deleteRegion(string uuid)
+ {
+ bool returnval = false;
+
+ string sql =
+ "DELETE FROM regions WHERE uuid = ?uuid;";
+
+ Dictionary parameters = new Dictionary();
+
+ try
+ {
+ parameters["?uuid"] = uuid;
+
+ IDbCommand result = Query(sql, parameters);
+
+ int x;
+ if ((x = result.ExecuteNonQuery()) > 0)
+ {
+ returnval = true;
+ }
+ result.Dispose();
+ }
+ catch (Exception e)
+ {
+ m_log.Error(e.ToString());
+ return false;
+ }
+
+ return returnval;
+ }
}
}
--
cgit v1.1