aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL/MySQLManager.cs
diff options
context:
space:
mode:
authorJohan Berntsson2008-03-04 05:31:54 +0000
committerJohan Berntsson2008-03-04 05:31:54 +0000
commit279e0061c515ee0a03036bef68eea9738273d785 (patch)
tree4502228eb7b87a760e0b0e67aded9d1d870d0bed /OpenSim/Framework/Data.MySQL/MySQLManager.cs
parentAdded copyright heaaders. Minor cleanup. (diff)
downloadopensim-SC_OLD-279e0061c515ee0a03036bef68eea9738273d785.zip
opensim-SC_OLD-279e0061c515ee0a03036bef68eea9738273d785.tar.gz
opensim-SC_OLD-279e0061c515ee0a03036bef68eea9738273d785.tar.bz2
opensim-SC_OLD-279e0061c515ee0a03036bef68eea9738273d785.tar.xz
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.
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLManager.cs')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLManager.cs42
1 files changed, 40 insertions, 2 deletions
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
301 301
302 // non-critical parts 302 // non-critical parts
303 retval.regionName = (string)reader["regionName"]; 303 retval.regionName = (string)reader["regionName"];
304 retval.originUUID = new LLUUID((string) reader["originUUID"]);
304 305
305 // Secrets 306 // Secrets
306 retval.regionRecvKey = (string) reader["regionRecvKey"]; 307 retval.regionRecvKey = (string) reader["regionRecvKey"];
@@ -752,13 +753,13 @@ namespace OpenSim.Framework.Data.MySQL
752 // 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, 753 // 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,
753 // as well as the related parameterization 754 // as well as the related parameterization
754 sql += 755 sql +=
755 "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid) VALUES "; 756 "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid, originUUID) VALUES ";
756 757
757 sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, "; 758 sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, ";
758 sql += 759 sql +=
759 "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, "; 760 "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, ";
760 sql += 761 sql +=
761 "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort, ?owner_uuid)"; 762 "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture, ?serverHttpPort, ?serverRemotingPort, ?owner_uuid, ?originUUID)";
762 763
763 if (GRID_ONLY_UPDATE_NECESSARY_DATA) 764 if (GRID_ONLY_UPDATE_NECESSARY_DATA)
764 { 765 {
@@ -798,6 +799,7 @@ namespace OpenSim.Framework.Data.MySQL
798 parameters["?serverHttpPort"] = regiondata.httpPort.ToString(); 799 parameters["?serverHttpPort"] = regiondata.httpPort.ToString();
799 parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString(); 800 parameters["?serverRemotingPort"] = regiondata.remotingPort.ToString();
800 parameters["?owner_uuid"] = regiondata.owner_uuid.ToString(); 801 parameters["?owner_uuid"] = regiondata.owner_uuid.ToString();
802 parameters["?originUUID"] = regiondata.originUUID.ToString();
801 803
802 bool returnval = false; 804 bool returnval = false;
803 805
@@ -821,5 +823,41 @@ namespace OpenSim.Framework.Data.MySQL
821 823
822 return returnval; 824 return returnval;
823 } 825 }
826 /// <summary>
827 /// Delete a region from the database
828 /// </summary>
829 /// <param name="profile">The region to insert</param>
830 /// <returns>Success?</returns>
831 //public bool deleteRegion(RegionProfileData regiondata)
832 public bool deleteRegion(string uuid)
833 {
834 bool returnval = false;
835
836 string sql =
837 "DELETE FROM regions WHERE uuid = ?uuid;";
838
839 Dictionary<string, string> parameters = new Dictionary<string, string>();
840
841 try
842 {
843 parameters["?uuid"] = uuid;
844
845 IDbCommand result = Query(sql, parameters);
846
847 int x;
848 if ((x = result.ExecuteNonQuery()) > 0)
849 {
850 returnval = true;
851 }
852 result.Dispose();
853 }
854 catch (Exception e)
855 {
856 m_log.Error(e.ToString());
857 return false;
858 }
859
860 return returnval;
861 }
824 } 862 }
825} 863}