diff options
author | Justin Clarke Casey | 2009-05-07 14:20:32 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-05-07 14:20:32 +0000 |
commit | 2284c8509f29b8766794f6482839cd9bc5e9f300 (patch) | |
tree | db47fdd97f8b67d969f70aafd8429ab5fe9e0577 /OpenSim/Data/MySQL/MySQLRegionData.cs | |
parent | minor: Inconsquential change to provoke another build (diff) | |
download | opensim-SC-2284c8509f29b8766794f6482839cd9bc5e9f300.zip opensim-SC-2284c8509f29b8766794f6482839cd9bc5e9f300.tar.gz opensim-SC-2284c8509f29b8766794f6482839cd9bc5e9f300.tar.bz2 opensim-SC-2284c8509f29b8766794f6482839cd9bc5e9f300.tar.xz |
* Consistently used dashed uuid format for mysql region data, as is done for all other tables
* This revision contains a mysql data migration. Please backup your mysql region database as a precaution before using this code.
* I also advise that you do a runprebuild[.sh|.bat] and a clean build ("nant clean build" if you're using the command line).
* This change is needed for future id schemes
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLRegionData.cs | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index e39b185..b13813f 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -282,7 +282,7 @@ namespace OpenSim.Data.MySQL | |||
282 | cmd.CommandText = "select UUID from prims where "+ | 282 | cmd.CommandText = "select UUID from prims where "+ |
283 | "SceneGroupID= ?UUID"; | 283 | "SceneGroupID= ?UUID"; |
284 | 284 | ||
285 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(obj)); | 285 | cmd.Parameters.AddWithValue("UUID", obj.ToString()); |
286 | 286 | ||
287 | List<UUID> uuids = new List<UUID>(); | 287 | List<UUID> uuids = new List<UUID>(); |
288 | 288 | ||
@@ -365,7 +365,7 @@ namespace OpenSim.Data.MySQL | |||
365 | 365 | ||
366 | for (int i = 0; i < uuids.Count; i++) | 366 | for (int i = 0; i < uuids.Count; i++) |
367 | { | 367 | { |
368 | cmd.Parameters.AddWithValue("UUID" + i, Util.ToRawUuidString(uuids[i])); | 368 | cmd.Parameters.AddWithValue("UUID" + i, uuids[i].ToString()); |
369 | } | 369 | } |
370 | 370 | ||
371 | ExecuteNonQuery(cmd); | 371 | ExecuteNonQuery(cmd); |
@@ -426,8 +426,7 @@ namespace OpenSim.Data.MySQL | |||
426 | "where RegionUUID = ?RegionUUID " + | 426 | "where RegionUUID = ?RegionUUID " + |
427 | "order by SceneGroupID asc, sort asc, LinkNumber asc"; | 427 | "order by SceneGroupID asc, sort asc, LinkNumber asc"; |
428 | 428 | ||
429 | cmd.Parameters.AddWithValue("RegionUUID", | 429 | cmd.Parameters.AddWithValue("RegionUUID", regionUUID.ToString()); |
430 | Util.ToRawUuidString(regionUUID)); | ||
431 | 430 | ||
432 | IDataReader reader = ExecuteReader(cmd); | 431 | IDataReader reader = ExecuteReader(cmd); |
433 | 432 | ||
@@ -549,8 +548,7 @@ namespace OpenSim.Data.MySQL | |||
549 | 548 | ||
550 | cmd.CommandText = "delete from terrain where " + | 549 | cmd.CommandText = "delete from terrain where " + |
551 | "RegionUUID = ?RegionUUID"; | 550 | "RegionUUID = ?RegionUUID"; |
552 | cmd.Parameters.AddWithValue("RegionUUID", | 551 | cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); |
553 | Util.ToRawUuidString(regionID)); | ||
554 | 552 | ||
555 | ExecuteNonQuery(cmd); | 553 | ExecuteNonQuery(cmd); |
556 | 554 | ||
@@ -576,7 +574,7 @@ namespace OpenSim.Data.MySQL | |||
576 | cmd.CommandText = "select RegionUUID, Revision, Heightfield " + | 574 | cmd.CommandText = "select RegionUUID, Revision, Heightfield " + |
577 | "from terrain where RegionUUID = ?RegionUUID "+ | 575 | "from terrain where RegionUUID = ?RegionUUID "+ |
578 | "order by Revision desc limit 1"; | 576 | "order by Revision desc limit 1"; |
579 | cmd.Parameters.AddWithValue("RegionUUID", Util.ToRawUuidString(regionID)); | 577 | cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); |
580 | 578 | ||
581 | IDataReader reader = ExecuteReader(cmd); | 579 | IDataReader reader = ExecuteReader(cmd); |
582 | 580 | ||
@@ -621,7 +619,7 @@ namespace OpenSim.Data.MySQL | |||
621 | 619 | ||
622 | cmd.CommandText = "delete from land where UUID = ?UUID"; | 620 | cmd.CommandText = "delete from land where UUID = ?UUID"; |
623 | 621 | ||
624 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(globalID)); | 622 | cmd.Parameters.AddWithValue("UUID", globalID.ToString()); |
625 | 623 | ||
626 | ExecuteNonQuery(cmd); | 624 | ExecuteNonQuery(cmd); |
627 | cmd.Dispose(); | 625 | cmd.Dispose(); |
@@ -775,8 +773,7 @@ namespace OpenSim.Data.MySQL | |||
775 | cmd.CommandText = "select * from land where " + | 773 | cmd.CommandText = "select * from land where " + |
776 | "RegionUUID = ?RegionUUID"; | 774 | "RegionUUID = ?RegionUUID"; |
777 | 775 | ||
778 | cmd.Parameters.AddWithValue("RegionUUID", | 776 | cmd.Parameters.AddWithValue("RegionUUID", regionUUID.ToString()); |
779 | Util.ToRawUuidString(regionUUID)); | ||
780 | 777 | ||
781 | IDataReader reader = ExecuteReader(cmd); | 778 | IDataReader reader = ExecuteReader(cmd); |
782 | 779 | ||
@@ -800,8 +797,7 @@ namespace OpenSim.Data.MySQL | |||
800 | cmd.CommandText = "select * from landaccesslist " + | 797 | cmd.CommandText = "select * from landaccesslist " + |
801 | "where LandUUID = ?LandUUID"; | 798 | "where LandUUID = ?LandUUID"; |
802 | 799 | ||
803 | cmd.Parameters.AddWithValue("LandUUID", | 800 | cmd.Parameters.AddWithValue("LandUUID", land.GlobalID.ToString()); |
804 | Util.ToRawUuidString(land.GlobalID)); | ||
805 | 801 | ||
806 | reader = ExecuteReader(cmd); | 802 | reader = ExecuteReader(cmd); |
807 | 803 | ||
@@ -1157,11 +1153,11 @@ namespace OpenSim.Data.MySQL | |||
1157 | /// <param name="regionUUID"></param> | 1153 | /// <param name="regionUUID"></param> |
1158 | private void FillPrimCommand(MySqlCommand cmd, SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) | 1154 | private void FillPrimCommand(MySqlCommand cmd, SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) |
1159 | { | 1155 | { |
1160 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(prim.UUID)); | 1156 | cmd.Parameters.AddWithValue("UUID", prim.UUID.ToString()); |
1161 | cmd.Parameters.AddWithValue("RegionUUID", Util.ToRawUuidString(regionUUID)); | 1157 | cmd.Parameters.AddWithValue("RegionUUID", regionUUID.ToString()); |
1162 | cmd.Parameters.AddWithValue("CreationDate", prim.CreationDate); | 1158 | cmd.Parameters.AddWithValue("CreationDate", prim.CreationDate); |
1163 | cmd.Parameters.AddWithValue("Name", prim.Name); | 1159 | cmd.Parameters.AddWithValue("Name", prim.Name); |
1164 | cmd.Parameters.AddWithValue("SceneGroupID", Util.ToRawUuidString(sceneGroupID)); | 1160 | cmd.Parameters.AddWithValue("SceneGroupID", sceneGroupID.ToString()); |
1165 | // the UUID of the root part for this SceneObjectGroup | 1161 | // the UUID of the root part for this SceneObjectGroup |
1166 | // various text fields | 1162 | // various text fields |
1167 | cmd.Parameters.AddWithValue("Text", prim.Text); | 1163 | cmd.Parameters.AddWithValue("Text", prim.Text); |
@@ -1174,10 +1170,10 @@ namespace OpenSim.Data.MySQL | |||
1174 | cmd.Parameters.AddWithValue("TouchName", prim.TouchName); | 1170 | cmd.Parameters.AddWithValue("TouchName", prim.TouchName); |
1175 | // permissions | 1171 | // permissions |
1176 | cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); | 1172 | cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); |
1177 | cmd.Parameters.AddWithValue("CreatorID", Util.ToRawUuidString(prim.CreatorID)); | 1173 | cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString()); |
1178 | cmd.Parameters.AddWithValue("OwnerID", Util.ToRawUuidString(prim.OwnerID)); | 1174 | cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); |
1179 | cmd.Parameters.AddWithValue("GroupID", Util.ToRawUuidString(prim.GroupID)); | 1175 | cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); |
1180 | cmd.Parameters.AddWithValue("LastOwnerID", Util.ToRawUuidString(prim.LastOwnerID)); | 1176 | cmd.Parameters.AddWithValue("LastOwnerID", prim.LastOwnerID.ToString()); |
1181 | cmd.Parameters.AddWithValue("OwnerMask", prim.OwnerMask); | 1177 | cmd.Parameters.AddWithValue("OwnerMask", prim.OwnerMask); |
1182 | cmd.Parameters.AddWithValue("NextOwnerMask", prim.NextOwnerMask); | 1178 | cmd.Parameters.AddWithValue("NextOwnerMask", prim.NextOwnerMask); |
1183 | cmd.Parameters.AddWithValue("GroupMask", prim.GroupMask); | 1179 | cmd.Parameters.AddWithValue("GroupMask", prim.GroupMask); |
@@ -1361,8 +1357,8 @@ namespace OpenSim.Data.MySQL | |||
1361 | /// <param name="regionUUID"></param> | 1357 | /// <param name="regionUUID"></param> |
1362 | private static void FillLandCommand(MySqlCommand cmd, LandData land, UUID regionUUID) | 1358 | private static void FillLandCommand(MySqlCommand cmd, LandData land, UUID regionUUID) |
1363 | { | 1359 | { |
1364 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(land.GlobalID)); | 1360 | cmd.Parameters.AddWithValue("UUID", land.GlobalID.ToString()); |
1365 | cmd.Parameters.AddWithValue("RegionUUID", Util.ToRawUuidString(regionUUID)); | 1361 | cmd.Parameters.AddWithValue("RegionUUID", regionUUID.ToString()); |
1366 | cmd.Parameters.AddWithValue("LocalLandID", land.LocalID); | 1362 | cmd.Parameters.AddWithValue("LocalLandID", land.LocalID); |
1367 | 1363 | ||
1368 | // Bitmap is a byte[512] | 1364 | // Bitmap is a byte[512] |
@@ -1370,25 +1366,25 @@ namespace OpenSim.Data.MySQL | |||
1370 | 1366 | ||
1371 | cmd.Parameters.AddWithValue("Name", land.Name); | 1367 | cmd.Parameters.AddWithValue("Name", land.Name); |
1372 | cmd.Parameters.AddWithValue("Description", land.Description); | 1368 | cmd.Parameters.AddWithValue("Description", land.Description); |
1373 | cmd.Parameters.AddWithValue("OwnerUUID", Util.ToRawUuidString(land.OwnerID)); | 1369 | cmd.Parameters.AddWithValue("OwnerUUID", land.OwnerID.ToString()); |
1374 | cmd.Parameters.AddWithValue("IsGroupOwned", land.IsGroupOwned); | 1370 | cmd.Parameters.AddWithValue("IsGroupOwned", land.IsGroupOwned); |
1375 | cmd.Parameters.AddWithValue("Area", land.Area); | 1371 | cmd.Parameters.AddWithValue("Area", land.Area); |
1376 | cmd.Parameters.AddWithValue("AuctionID", land.AuctionID); //Unemplemented | 1372 | cmd.Parameters.AddWithValue("AuctionID", land.AuctionID); //Unemplemented |
1377 | cmd.Parameters.AddWithValue("Category", land.Category); //Enum libsecondlife.Parcel.ParcelCategory | 1373 | cmd.Parameters.AddWithValue("Category", land.Category); //Enum libsecondlife.Parcel.ParcelCategory |
1378 | cmd.Parameters.AddWithValue("ClaimDate", land.ClaimDate); | 1374 | cmd.Parameters.AddWithValue("ClaimDate", land.ClaimDate); |
1379 | cmd.Parameters.AddWithValue("ClaimPrice", land.ClaimPrice); | 1375 | cmd.Parameters.AddWithValue("ClaimPrice", land.ClaimPrice); |
1380 | cmd.Parameters.AddWithValue("GroupUUID", Util.ToRawUuidString(land.GroupID)); | 1376 | cmd.Parameters.AddWithValue("GroupUUID", land.GroupID.ToString()); |
1381 | cmd.Parameters.AddWithValue("SalePrice", land.SalePrice); | 1377 | cmd.Parameters.AddWithValue("SalePrice", land.SalePrice); |
1382 | cmd.Parameters.AddWithValue("LandStatus", land.Status); //Enum. libsecondlife.Parcel.ParcelStatus | 1378 | cmd.Parameters.AddWithValue("LandStatus", land.Status); //Enum. libsecondlife.Parcel.ParcelStatus |
1383 | cmd.Parameters.AddWithValue("LandFlags", land.Flags); | 1379 | cmd.Parameters.AddWithValue("LandFlags", land.Flags); |
1384 | cmd.Parameters.AddWithValue("LandingType", land.LandingType); | 1380 | cmd.Parameters.AddWithValue("LandingType", land.LandingType); |
1385 | cmd.Parameters.AddWithValue("MediaAutoScale", land.MediaAutoScale); | 1381 | cmd.Parameters.AddWithValue("MediaAutoScale", land.MediaAutoScale); |
1386 | cmd.Parameters.AddWithValue("MediaTextureUUID", Util.ToRawUuidString(land.MediaID)); | 1382 | cmd.Parameters.AddWithValue("MediaTextureUUID", land.MediaID.ToString()); |
1387 | cmd.Parameters.AddWithValue("MediaURL", land.MediaURL); | 1383 | cmd.Parameters.AddWithValue("MediaURL", land.MediaURL); |
1388 | cmd.Parameters.AddWithValue("MusicURL", land.MusicURL); | 1384 | cmd.Parameters.AddWithValue("MusicURL", land.MusicURL); |
1389 | cmd.Parameters.AddWithValue("PassHours", land.PassHours); | 1385 | cmd.Parameters.AddWithValue("PassHours", land.PassHours); |
1390 | cmd.Parameters.AddWithValue("PassPrice", land.PassPrice); | 1386 | cmd.Parameters.AddWithValue("PassPrice", land.PassPrice); |
1391 | cmd.Parameters.AddWithValue("SnapshotUUID", Util.ToRawUuidString(land.SnapshotID)); | 1387 | cmd.Parameters.AddWithValue("SnapshotUUID", land.SnapshotID.ToString()); |
1392 | cmd.Parameters.AddWithValue("UserLocationX", land.UserLocation.X); | 1388 | cmd.Parameters.AddWithValue("UserLocationX", land.UserLocation.X); |
1393 | cmd.Parameters.AddWithValue("UserLocationY", land.UserLocation.Y); | 1389 | cmd.Parameters.AddWithValue("UserLocationY", land.UserLocation.Y); |
1394 | cmd.Parameters.AddWithValue("UserLocationZ", land.UserLocation.Z); | 1390 | cmd.Parameters.AddWithValue("UserLocationZ", land.UserLocation.Z); |
@@ -1408,8 +1404,8 @@ namespace OpenSim.Data.MySQL | |||
1408 | /// <param name="parcelID"></param> | 1404 | /// <param name="parcelID"></param> |
1409 | private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID) | 1405 | private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID) |
1410 | { | 1406 | { |
1411 | cmd.Parameters.AddWithValue("LandUUID", Util.ToRawUuidString(parcelID)); | 1407 | cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString()); |
1412 | cmd.Parameters.AddWithValue("AccessUUID", Util.ToRawUuidString(entry.AgentID)); | 1408 | cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString()); |
1413 | cmd.Parameters.AddWithValue("Flags", entry.Flags); | 1409 | cmd.Parameters.AddWithValue("Flags", entry.Flags); |
1414 | } | 1410 | } |
1415 | 1411 | ||
@@ -1465,7 +1461,7 @@ namespace OpenSim.Data.MySQL | |||
1465 | private void FillShapeCommand(MySqlCommand cmd, SceneObjectPart prim) | 1461 | private void FillShapeCommand(MySqlCommand cmd, SceneObjectPart prim) |
1466 | { | 1462 | { |
1467 | PrimitiveBaseShape s = prim.Shape; | 1463 | PrimitiveBaseShape s = prim.Shape; |
1468 | cmd.Parameters.AddWithValue("UUID", Util.ToRawUuidString(prim.UUID)); | 1464 | cmd.Parameters.AddWithValue("UUID", prim.UUID.ToString()); |
1469 | // shape is an enum | 1465 | // shape is an enum |
1470 | cmd.Parameters.AddWithValue("Shape", 0); | 1466 | cmd.Parameters.AddWithValue("Shape", 0); |
1471 | // vectors | 1467 | // vectors |
@@ -1533,8 +1529,9 @@ namespace OpenSim.Data.MySQL | |||
1533 | 1529 | ||
1534 | ExecuteNonQuery(cmd); | 1530 | ExecuteNonQuery(cmd); |
1535 | } | 1531 | } |
1532 | |||
1536 | cmd.Dispose(); | 1533 | cmd.Dispose(); |
1537 | } | 1534 | } |
1538 | } | 1535 | } |
1539 | } | 1536 | } |
1540 | } | 1537 | } \ No newline at end of file |