diff options
author | Justin Clarke Casey | 2007-12-20 19:13:34 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2007-12-20 19:13:34 +0000 |
commit | f1ebe79824aa82fa30af35d07bf6720e719cd741 (patch) | |
tree | 18f43d04bdf2547dd66274a96f22c85171fc892a /OpenSim/Region | |
parent | Establish Util.ToRawUuidString to get LLUUIDs in unhyphenated form (diff) | |
download | opensim-SC-f1ebe79824aa82fa30af35d07bf6720e719cd741.zip opensim-SC-f1ebe79824aa82fa30af35d07bf6720e719cd741.tar.gz opensim-SC-f1ebe79824aa82fa30af35d07bf6720e719cd741.tar.bz2 opensim-SC-f1ebe79824aa82fa30af35d07bf6720e719cd741.tar.xz |
Fix up other sqlite db interactions to use non-hyphenated uuid
Inventory contents retrieval and persistent region storage standalone now appear to work as well as they did before :)
This patch will not fix grid problems.
May be bugs present due to conversions I didn't spot.
I personally probably don't have any more time for this today. I'm also not entirely convinced this is the right way forward
so this might be a handy pause for thought. I'll also be delighted if I wake up tommorrow and everything is fine again.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 721c08e..bf521bd 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -175,12 +175,12 @@ namespace OpenSim.DataStore.MonoSqlite | |||
175 | if ((prim.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == 0) | 175 | if ((prim.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == 0) |
176 | { | 176 | { |
177 | MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID); | 177 | MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID); |
178 | addPrim(prim, obj.UUID, regionUUID); | 178 | addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); |
179 | } | 179 | } |
180 | else if (Stopped(prim)) | 180 | else if (Stopped(prim)) |
181 | { | 181 | { |
182 | MainLog.Instance.Verbose("DATASTORE", "Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); | 182 | MainLog.Instance.Verbose("DATASTORE", "Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); |
183 | addPrim(prim, obj.UUID, regionUUID); | 183 | addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); |
184 | } | 184 | } |
185 | else | 185 | else |
186 | { | 186 | { |
@@ -199,7 +199,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
199 | DataTable prims = ds.Tables["prims"]; | 199 | DataTable prims = ds.Tables["prims"]; |
200 | DataTable shapes = ds.Tables["primshapes"]; | 200 | DataTable shapes = ds.Tables["primshapes"]; |
201 | 201 | ||
202 | string selectExp = "SceneGroupID = '" + obj.ToString() + "'"; | 202 | string selectExp = "SceneGroupID = '" + Util.ToRawUuidString(obj) + "'"; |
203 | lock (ds) | 203 | lock (ds) |
204 | { | 204 | { |
205 | DataRow[] primRows = prims.Select(selectExp); | 205 | DataRow[] primRows = prims.Select(selectExp); |
@@ -227,7 +227,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
227 | DataTable prims = ds.Tables["prims"]; | 227 | DataTable prims = ds.Tables["prims"]; |
228 | DataTable shapes = ds.Tables["primshapes"]; | 228 | DataTable shapes = ds.Tables["primshapes"]; |
229 | 229 | ||
230 | string byRegion = "RegionUUID = '" + regionUUID.ToString() + "'"; | 230 | string byRegion = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'"; |
231 | string orderByParent = "ParentID ASC"; | 231 | string orderByParent = "ParentID ASC"; |
232 | 232 | ||
233 | lock (ds) | 233 | lock (ds) |
@@ -246,7 +246,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
246 | { | 246 | { |
247 | SceneObjectGroup group = new SceneObjectGroup(); | 247 | SceneObjectGroup group = new SceneObjectGroup(); |
248 | SceneObjectPart prim = buildPrim(primRow); | 248 | SceneObjectPart prim = buildPrim(primRow); |
249 | DataRow shapeRow = shapes.Rows.Find(prim.UUID); | 249 | DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); |
250 | if (shapeRow != null) | 250 | if (shapeRow != null) |
251 | { | 251 | { |
252 | prim.Shape = buildShape(shapeRow); | 252 | prim.Shape = buildShape(shapeRow); |
@@ -260,13 +260,13 @@ namespace OpenSim.DataStore.MonoSqlite | |||
260 | group.AddPart(prim); | 260 | group.AddPart(prim); |
261 | group.RootPart = prim; | 261 | group.RootPart = prim; |
262 | 262 | ||
263 | createdObjects.Add(group.UUID, group); | 263 | createdObjects.Add(Util.ToRawUuidString(group.UUID), group); |
264 | retvals.Add(group); | 264 | retvals.Add(group); |
265 | } | 265 | } |
266 | else | 266 | else |
267 | { | 267 | { |
268 | SceneObjectPart prim = buildPrim(primRow); | 268 | SceneObjectPart prim = buildPrim(primRow); |
269 | DataRow shapeRow = shapes.Rows.Find(prim.UUID); | 269 | DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); |
270 | if (shapeRow != null) | 270 | if (shapeRow != null) |
271 | { | 271 | { |
272 | prim.Shape = buildShape(shapeRow); | 272 | prim.Shape = buildShape(shapeRow); |
@@ -310,7 +310,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
310 | 310 | ||
311 | using(SqliteCommand cmd = new SqliteCommand(sql, conn)) | 311 | using(SqliteCommand cmd = new SqliteCommand(sql, conn)) |
312 | { | 312 | { |
313 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); | 313 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", Util.ToRawUuidString(regionID))); |
314 | cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); | 314 | cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); |
315 | cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); | 315 | cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); |
316 | cmd.ExecuteNonQuery(); | 316 | cmd.ExecuteNonQuery(); |
@@ -325,7 +325,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
325 | 325 | ||
326 | using(SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision < :Revision", conn)) | 326 | using(SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision < :Revision", conn)) |
327 | { | 327 | { |
328 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); | 328 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", Util.ToRawUuidString(regionID))); |
329 | cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); | 329 | cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); |
330 | cmd.ExecuteNonQuery(); | 330 | cmd.ExecuteNonQuery(); |
331 | } | 331 | } |
@@ -348,7 +348,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
348 | 348 | ||
349 | using (SqliteCommand cmd = new SqliteCommand(sql, conn)) | 349 | using (SqliteCommand cmd = new SqliteCommand(sql, conn)) |
350 | { | 350 | { |
351 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); | 351 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", Util.ToRawUuidString(regionID))); |
352 | 352 | ||
353 | using (IDataReader row = cmd.ExecuteReader()) | 353 | using (IDataReader row = cmd.ExecuteReader()) |
354 | { | 354 | { |
@@ -390,13 +390,13 @@ namespace OpenSim.DataStore.MonoSqlite | |||
390 | 390 | ||
391 | using (SqliteCommand cmd = new SqliteCommand("delete from land where UUID=:UUID", conn)) | 391 | using (SqliteCommand cmd = new SqliteCommand("delete from land where UUID=:UUID", conn)) |
392 | { | 392 | { |
393 | cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString())); | 393 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(globalID))); |
394 | cmd.ExecuteNonQuery(); | 394 | cmd.ExecuteNonQuery(); |
395 | } | 395 | } |
396 | 396 | ||
397 | using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:UUID", conn)) | 397 | using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:UUID", conn)) |
398 | { | 398 | { |
399 | cmd.Parameters.Add(new SqliteParameter(":UUID", globalID.ToString())); | 399 | cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(globalID))); |
400 | cmd.ExecuteNonQuery(); | 400 | cmd.ExecuteNonQuery(); |
401 | } | 401 | } |
402 | conn.Close(); | 402 | conn.Close(); |
@@ -412,7 +412,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
412 | DataTable land = ds.Tables["land"]; | 412 | DataTable land = ds.Tables["land"]; |
413 | DataTable landaccesslist = ds.Tables["landaccesslist"]; | 413 | DataTable landaccesslist = ds.Tables["landaccesslist"]; |
414 | 414 | ||
415 | DataRow landRow = land.Rows.Find(parcel.landData.globalID.ToString()); | 415 | DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); |
416 | if (landRow == null) | 416 | if (landRow == null) |
417 | { | 417 | { |
418 | landRow = land.NewRow(); | 418 | landRow = land.NewRow(); |
@@ -426,7 +426,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
426 | 426 | ||
427 | using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", conn)) | 427 | using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", conn)) |
428 | { | 428 | { |
429 | cmd.Parameters.Add(new SqliteParameter(":LandUUID", parcel.landData.globalID.ToString())); | 429 | cmd.Parameters.Add(new SqliteParameter(":LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); |
430 | cmd.ExecuteNonQuery(); | 430 | cmd.ExecuteNonQuery(); |
431 | } | 431 | } |
432 | 432 | ||
@@ -450,12 +450,12 @@ namespace OpenSim.DataStore.MonoSqlite | |||
450 | { | 450 | { |
451 | DataTable land = ds.Tables["land"]; | 451 | DataTable land = ds.Tables["land"]; |
452 | DataTable landaccesslist = ds.Tables["landaccesslist"]; | 452 | DataTable landaccesslist = ds.Tables["landaccesslist"]; |
453 | string searchExp = "RegionUUID = '" + regionUUID.ToString() + "'"; | 453 | string searchExp = "RegionUUID = '" + Util.ToRawUuidString(regionUUID) + "'"; |
454 | DataRow[] rawDataForRegion = land.Select(searchExp); | 454 | DataRow[] rawDataForRegion = land.Select(searchExp); |
455 | foreach (DataRow rawDataLand in rawDataForRegion) | 455 | foreach (DataRow rawDataLand in rawDataForRegion) |
456 | { | 456 | { |
457 | LandData newLand = buildLandData(rawDataLand); | 457 | LandData newLand = buildLandData(rawDataLand); |
458 | string accessListSearchExp = "LandUUID = '" + newLand.globalID.ToString() + "'"; | 458 | string accessListSearchExp = "LandUUID = '" + Util.ToRawUuidString(newLand.globalID) + "'"; |
459 | DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp); | 459 | DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp); |
460 | foreach (DataRow rawDataLandAccess in rawDataForLandAccessList) | 460 | foreach (DataRow rawDataLandAccess in rawDataForLandAccessList) |
461 | { | 461 | { |
@@ -811,12 +811,12 @@ namespace OpenSim.DataStore.MonoSqlite | |||
811 | 811 | ||
812 | private void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) | 812 | private void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID, LLUUID regionUUID) |
813 | { | 813 | { |
814 | row["UUID"] = prim.UUID; | 814 | row["UUID"] = Util.ToRawUuidString(prim.UUID); |
815 | row["RegionUUID"] = regionUUID; | 815 | row["RegionUUID"] = Util.ToRawUuidString(regionUUID); |
816 | row["ParentID"] = prim.ParentID; | 816 | row["ParentID"] = prim.ParentID; |
817 | row["CreationDate"] = prim.CreationDate; | 817 | row["CreationDate"] = prim.CreationDate; |
818 | row["Name"] = prim.Name; | 818 | row["Name"] = prim.Name; |
819 | row["SceneGroupID"] = sceneGroupID; // the UUID of the root part for this SceneObjectGroup | 819 | row["SceneGroupID"] = Util.ToRawUuidString(sceneGroupID); // the UUID of the root part for this SceneObjectGroup |
820 | // various text fields | 820 | // various text fields |
821 | row["Text"] = prim.Text; | 821 | row["Text"] = prim.Text; |
822 | row["Description"] = prim.Description; | 822 | row["Description"] = prim.Description; |
@@ -824,10 +824,10 @@ namespace OpenSim.DataStore.MonoSqlite | |||
824 | row["TouchName"] = prim.TouchName; | 824 | row["TouchName"] = prim.TouchName; |
825 | // permissions | 825 | // permissions |
826 | row["ObjectFlags"] = prim.ObjectFlags; | 826 | row["ObjectFlags"] = prim.ObjectFlags; |
827 | row["CreatorID"] = prim.CreatorID; | 827 | row["CreatorID"] = Util.ToRawUuidString(prim.CreatorID); |
828 | row["OwnerID"] = prim.OwnerID; | 828 | row["OwnerID"] = Util.ToRawUuidString(prim.OwnerID); |
829 | row["GroupID"] = prim.GroupID; | 829 | row["GroupID"] = Util.ToRawUuidString(prim.GroupID); |
830 | row["LastOwnerID"] = prim.LastOwnerID; | 830 | row["LastOwnerID"] = Util.ToRawUuidString(prim.LastOwnerID); |
831 | row["OwnerMask"] = prim.OwnerMask; | 831 | row["OwnerMask"] = prim.OwnerMask; |
832 | row["NextOwnerMask"] = prim.NextOwnerMask; | 832 | row["NextOwnerMask"] = prim.NextOwnerMask; |
833 | row["GroupMask"] = prim.GroupMask; | 833 | row["GroupMask"] = prim.GroupMask; |
@@ -858,8 +858,8 @@ namespace OpenSim.DataStore.MonoSqlite | |||
858 | 858 | ||
859 | private void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) | 859 | private void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) |
860 | { | 860 | { |
861 | row["UUID"] = land.globalID.ToString(); | 861 | row["UUID"] = Util.ToRawUuidString(land.globalID); |
862 | row["RegionUUID"] = regionUUID.ToString(); | 862 | row["RegionUUID"] = Util.ToRawUuidString(regionUUID); |
863 | row["LocalLandID"] = land.localID; | 863 | row["LocalLandID"] = land.localID; |
864 | 864 | ||
865 | // Bitmap is a byte[512] | 865 | // Bitmap is a byte[512] |
@@ -867,25 +867,25 @@ namespace OpenSim.DataStore.MonoSqlite | |||
867 | 867 | ||
868 | row["Name"] = land.landName; | 868 | row["Name"] = land.landName; |
869 | row["Desc"] = land.landDesc; | 869 | row["Desc"] = land.landDesc; |
870 | row["OwnerUUID"] = land.ownerID.ToString(); | 870 | row["OwnerUUID"] = Util.ToRawUuidString(land.ownerID); |
871 | row["IsGroupOwned"] = land.isGroupOwned; | 871 | row["IsGroupOwned"] = land.isGroupOwned; |
872 | row["Area"] = land.area; | 872 | row["Area"] = land.area; |
873 | row["AuctionID"] = land.auctionID; //Unemplemented | 873 | row["AuctionID"] = land.auctionID; //Unemplemented |
874 | row["Category"] = land.category; //Enum libsecondlife.Parcel.ParcelCategory | 874 | row["Category"] = land.category; //Enum libsecondlife.Parcel.ParcelCategory |
875 | row["ClaimDate"] = land.claimDate; | 875 | row["ClaimDate"] = land.claimDate; |
876 | row["ClaimPrice"] = land.claimPrice; | 876 | row["ClaimPrice"] = land.claimPrice; |
877 | row["GroupUUID"] = land.groupID.ToString(); | 877 | row["GroupUUID"] = Util.ToRawUuidString(land.groupID); |
878 | row["SalePrice"] = land.salePrice; | 878 | row["SalePrice"] = land.salePrice; |
879 | row["LandStatus"] = land.landStatus; //Enum. libsecondlife.Parcel.ParcelStatus | 879 | row["LandStatus"] = land.landStatus; //Enum. libsecondlife.Parcel.ParcelStatus |
880 | row["LandFlags"] = land.landFlags; | 880 | row["LandFlags"] = land.landFlags; |
881 | row["LandingType"] = land.landingType; | 881 | row["LandingType"] = land.landingType; |
882 | row["MediaAutoScale"] = land.mediaAutoScale; | 882 | row["MediaAutoScale"] = land.mediaAutoScale; |
883 | row["MediaTextureUUID"] = land.mediaID.ToString(); | 883 | row["MediaTextureUUID"] = Util.ToRawUuidString(land.mediaID); |
884 | row["MediaURL"] = land.mediaURL; | 884 | row["MediaURL"] = land.mediaURL; |
885 | row["MusicURL"] = land.musicURL; | 885 | row["MusicURL"] = land.musicURL; |
886 | row["PassHours"] = land.passHours; | 886 | row["PassHours"] = land.passHours; |
887 | row["PassPrice"] = land.passPrice; | 887 | row["PassPrice"] = land.passPrice; |
888 | row["SnapshotUUID"] = land.snapshotID.ToString(); | 888 | row["SnapshotUUID"] = Util.ToRawUuidString(land.snapshotID); |
889 | row["UserLocationX"] = land.userLocation.X; | 889 | row["UserLocationX"] = land.userLocation.X; |
890 | row["UserLocationY"] = land.userLocation.Y; | 890 | row["UserLocationY"] = land.userLocation.Y; |
891 | row["UserLocationZ"] = land.userLocation.Z; | 891 | row["UserLocationZ"] = land.userLocation.Z; |
@@ -896,8 +896,8 @@ namespace OpenSim.DataStore.MonoSqlite | |||
896 | 896 | ||
897 | private void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID) | 897 | private void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, LLUUID parcelID) |
898 | { | 898 | { |
899 | row["LandUUID"] = parcelID.ToString(); | 899 | row["LandUUID"] = Util.ToRawUuidString(parcelID); |
900 | row["AccessUUID"] = entry.AgentID.ToString(); | 900 | row["AccessUUID"] = Util.ToRawUuidString(entry.AgentID); |
901 | row["Flags"] = entry.Flags; | 901 | row["Flags"] = entry.Flags; |
902 | } | 902 | } |
903 | 903 | ||
@@ -956,7 +956,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
956 | private void fillShapeRow(DataRow row, SceneObjectPart prim) | 956 | private void fillShapeRow(DataRow row, SceneObjectPart prim) |
957 | { | 957 | { |
958 | PrimitiveBaseShape s = prim.Shape; | 958 | PrimitiveBaseShape s = prim.Shape; |
959 | row["UUID"] = prim.UUID; | 959 | row["UUID"] = Util.ToRawUuidString(prim.UUID); |
960 | // shape is an enum | 960 | // shape is an enum |
961 | row["Shape"] = 0; | 961 | row["Shape"] = 0; |
962 | // vectors | 962 | // vectors |
@@ -994,7 +994,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
994 | DataTable prims = ds.Tables["prims"]; | 994 | DataTable prims = ds.Tables["prims"]; |
995 | DataTable shapes = ds.Tables["primshapes"]; | 995 | DataTable shapes = ds.Tables["primshapes"]; |
996 | 996 | ||
997 | DataRow primRow = prims.Rows.Find(prim.UUID); | 997 | DataRow primRow = prims.Rows.Find(Util.ToRawUuidString(prim.UUID)); |
998 | if (primRow == null) | 998 | if (primRow == null) |
999 | { | 999 | { |
1000 | primRow = prims.NewRow(); | 1000 | primRow = prims.NewRow(); |
@@ -1006,7 +1006,7 @@ namespace OpenSim.DataStore.MonoSqlite | |||
1006 | fillPrimRow(primRow, prim, sceneGroupID, regionUUID); | 1006 | fillPrimRow(primRow, prim, sceneGroupID, regionUUID); |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | DataRow shapeRow = shapes.Rows.Find(prim.UUID); | 1009 | DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); |
1010 | if (shapeRow == null) | 1010 | if (shapeRow == null) |
1011 | { | 1011 | { |
1012 | shapeRow = shapes.NewRow(); | 1012 | shapeRow = shapes.NewRow(); |