diff options
author | Johan Berntsson | 2008-03-04 05:31:54 +0000 |
---|---|---|
committer | Johan Berntsson | 2008-03-04 05:31:54 +0000 |
commit | 279e0061c515ee0a03036bef68eea9738273d785 (patch) | |
tree | 4502228eb7b87a760e0b0e67aded9d1d870d0bed /OpenSim/Framework/Data | |
parent | Added copyright heaaders. Minor cleanup. (diff) | |
download | opensim-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 '')
5 files changed, 80 insertions, 6 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs index 3737e48..eefb4e9 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs | |||
@@ -97,6 +97,11 @@ namespace OpenSim.Framework.Data.MySQL | |||
97 | database.ExecuteResourceSql("CreateRegionsTable.sql"); | 97 | database.ExecuteResourceSql("CreateRegionsTable.sql"); |
98 | return; | 98 | return; |
99 | } | 99 | } |
100 | else if (oldVersion.Contains("Rev. 1")) | ||
101 | { | ||
102 | database.ExecuteResourceSql("UpgradeRegionsTableToVersion2.sql"); | ||
103 | return; | ||
104 | } | ||
100 | } | 105 | } |
101 | 106 | ||
102 | #endregion | 107 | #endregion |
@@ -260,6 +265,27 @@ namespace OpenSim.Framework.Data.MySQL | |||
260 | } | 265 | } |
261 | 266 | ||
262 | /// <summary> | 267 | /// <summary> |
268 | /// Deletes a profile from the database | ||
269 | /// </summary> | ||
270 | /// <param name="profile">The profile to delete</param> | ||
271 | /// <returns>Successful?</returns> | ||
272 | //public DataResponse DeleteProfile(RegionProfileData profile) | ||
273 | public DataResponse DeleteProfile(string uuid) | ||
274 | { | ||
275 | lock (database) | ||
276 | { | ||
277 | if (database.deleteRegion(uuid)) | ||
278 | { | ||
279 | return DataResponse.RESPONSE_OK; | ||
280 | } | ||
281 | else | ||
282 | { | ||
283 | return DataResponse.RESPONSE_ERROR; | ||
284 | } | ||
285 | } | ||
286 | } | ||
287 | |||
288 | /// <summary> | ||
263 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. | 289 | /// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret. |
264 | /// </summary> | 290 | /// </summary> |
265 | /// <param name="uuid">The UUID of the challenger</param> | 291 | /// <param name="uuid">The UUID of the challenger</param> |
@@ -328,4 +354,4 @@ namespace OpenSim.Framework.Data.MySQL | |||
328 | } | 354 | } |
329 | } | 355 | } |
330 | } | 356 | } |
331 | } \ No newline at end of file | 357 | } |
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 | } |
diff --git a/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql b/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql index 07b0d9b..23535af 100644 --- a/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql +++ b/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql | |||
@@ -23,8 +23,9 @@ CREATE TABLE `regions` ( | |||
23 | `regionUserRecvKey` varchar(128) default NULL, | 23 | `regionUserRecvKey` varchar(128) default NULL, |
24 | `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, | 24 | `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, |
25 | `serverHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL, | 25 | `serverHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL, |
26 | `originUUID` varchar(36), | ||
26 | PRIMARY KEY (`uuid`), | 27 | PRIMARY KEY (`uuid`), |
27 | KEY `regionName` (`regionName`), | 28 | KEY `regionName` (`regionName`), |
28 | KEY `regionHandle` (`regionHandle`), | 29 | KEY `regionHandle` (`regionHandle`), |
29 | KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`) | 30 | KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`) |
30 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 1'; | 31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 2'; |
diff --git a/OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion2.sql b/OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion2.sql new file mode 100644 index 0000000..5880954 --- /dev/null +++ b/OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion2.sql | |||
@@ -0,0 +1,3 @@ | |||
1 | ALTER TABLE `regions` | ||
2 | ADD COLUMN `originUUID` varchar(36), | ||
3 | COMMENT='Rev. 2'; | ||
diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs index f9f4283..e4b48b7 100644 --- a/OpenSim/Framework/Data/RegionProfileData.cs +++ b/OpenSim/Framework/Data/RegionProfileData.cs | |||
@@ -130,6 +130,12 @@ namespace OpenSim.Framework.Data | |||
130 | public LLUUID owner_uuid = LLUUID.Zero; | 130 | public LLUUID owner_uuid = LLUUID.Zero; |
131 | 131 | ||
132 | /// <summary> | 132 | /// <summary> |
133 | /// OGS/OpenSim Specific original ID for a region after move/split | ||
134 | /// </summary> | ||
135 | public LLUUID originUUID; | ||
136 | |||
137 | |||
138 | /// <summary> | ||
133 | /// Get Sim profile data from grid server when in grid mode | 139 | /// Get Sim profile data from grid server when in grid mode |
134 | /// </summary> | 140 | /// </summary> |
135 | /// <param name="region_uuid"></param> | 141 | /// <param name="region_uuid"></param> |
@@ -162,7 +168,7 @@ namespace OpenSim.Framework.Data | |||
162 | simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); | 168 | simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); |
163 | simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); | 169 | simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); |
164 | simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); | 170 | simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); |
165 | simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; | 171 | simData.serverURI = (string)responseData["server_uri"]; |
166 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; | 172 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; |
167 | simData.UUID = new LLUUID((string) responseData["region_UUID"]); | 173 | simData.UUID = new LLUUID((string) responseData["region_UUID"]); |
168 | simData.regionName = (string) responseData["region_name"]; | 174 | simData.regionName = (string) responseData["region_name"]; |
@@ -205,7 +211,7 @@ namespace OpenSim.Framework.Data | |||
205 | simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); | 211 | simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); |
206 | simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); | 212 | simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); |
207 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; | 213 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; |
208 | simData.serverURI = "http://" + simData.serverIP + ":" + simData.serverPort.ToString() + "/"; | 214 | simData.serverURI = (string)responseData["server_uri"]; |
209 | simData.UUID = new LLUUID((string) responseData["region_UUID"]); | 215 | simData.UUID = new LLUUID((string) responseData["region_UUID"]); |
210 | simData.regionName = (string) responseData["region_name"]; | 216 | simData.regionName = (string) responseData["region_name"]; |
211 | 217 | ||