aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteRegionData.cs
diff options
context:
space:
mode:
authorSean Dague2008-07-23 15:50:32 +0000
committerSean Dague2008-07-23 15:50:32 +0000
commit090159defc731fca252b2b3520364712760f0f4e (patch)
tree78fe9dde5a9902d67aa6d1690cf575d778d154f2 /OpenSim/Data/SQLite/SQLiteRegionData.cs
parentSend Animation data for other avatars to new users joining the region (tested... (diff)
downloadopensim-SC_OLD-090159defc731fca252b2b3520364712760f0f4e.zip
opensim-SC_OLD-090159defc731fca252b2b3520364712760f0f4e.tar.gz
opensim-SC_OLD-090159defc731fca252b2b3520364712760f0f4e.tar.bz2
opensim-SC_OLD-090159defc731fca252b2b3520364712760f0f4e.tar.xz
refactored LandData to use properties, and cleaned up the naming on
the properties a bit to be more consistant with other objects (having things like .Name .Description, etc).
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteRegionData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs138
1 files changed, 69 insertions, 69 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 6e30060..0f9323b 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -533,7 +533,7 @@ namespace OpenSim.Data.SQLite
533 DataTable land = ds.Tables["land"]; 533 DataTable land = ds.Tables["land"];
534 DataTable landaccesslist = ds.Tables["landaccesslist"]; 534 DataTable landaccesslist = ds.Tables["landaccesslist"];
535 535
536 DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); 536 DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.GlobalID));
537 if (landRow == null) 537 if (landRow == null)
538 { 538 {
539 landRow = land.NewRow(); 539 landRow = land.NewRow();
@@ -548,14 +548,14 @@ namespace OpenSim.Data.SQLite
548 // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around 548 // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around
549 using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", m_conn)) 549 using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", m_conn))
550 { 550 {
551 cmd.Parameters.Add(new SqliteParameter(":LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); 551 cmd.Parameters.Add(new SqliteParameter(":LandUUID", Util.ToRawUuidString(parcel.landData.GlobalID)));
552 cmd.ExecuteNonQuery(); 552 cmd.ExecuteNonQuery();
553 } 553 }
554 554
555 foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList) 555 foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.ParcelAccessList)
556 { 556 {
557 DataRow newAccessRow = landaccesslist.NewRow(); 557 DataRow newAccessRow = landaccesslist.NewRow();
558 fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); 558 fillLandAccessRow(newAccessRow, entry, parcel.landData.GlobalID);
559 landaccesslist.Rows.Add(newAccessRow); 559 landaccesslist.Rows.Add(newAccessRow);
560 } 560 }
561 } 561 }
@@ -580,11 +580,11 @@ namespace OpenSim.Data.SQLite
580 foreach (DataRow rawDataLand in rawDataForRegion) 580 foreach (DataRow rawDataLand in rawDataForRegion)
581 { 581 {
582 LandData newLand = buildLandData(rawDataLand); 582 LandData newLand = buildLandData(rawDataLand);
583 string accessListSearchExp = "LandUUID = '" + Util.ToRawUuidString(newLand.globalID) + "'"; 583 string accessListSearchExp = "LandUUID = '" + Util.ToRawUuidString(newLand.GlobalID) + "'";
584 DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp); 584 DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp);
585 foreach (DataRow rawDataLandAccess in rawDataForLandAccessList) 585 foreach (DataRow rawDataLandAccess in rawDataForLandAccessList)
586 { 586 {
587 newLand.parcelAccessList.Add(buildLandAccessData(rawDataLandAccess)); 587 newLand.ParcelAccessList.Add(buildLandAccessData(rawDataLandAccess));
588 } 588 }
589 589
590 landDataForRegion.Add(newLand); 590 landDataForRegion.Add(newLand);
@@ -1033,53 +1033,53 @@ namespace OpenSim.Data.SQLite
1033 { 1033 {
1034 LandData newData = new LandData(); 1034 LandData newData = new LandData();
1035 1035
1036 newData.globalID = new LLUUID((String) row["UUID"]); 1036 newData.GlobalID = new LLUUID((String) row["UUID"]);
1037 newData.localID = Convert.ToInt32(row["LocalLandID"]); 1037 newData.LocalID = Convert.ToInt32(row["LocalLandID"]);
1038 1038
1039 // Bitmap is a byte[512] 1039 // Bitmap is a byte[512]
1040 newData.landBitmapByteArray = (Byte[]) row["Bitmap"]; 1040 newData.Bitmap = (Byte[]) row["Bitmap"];
1041 1041
1042 newData.landName = (String) row["Name"]; 1042 newData.Name = (String) row["Name"];
1043 newData.landDesc = (String) row["Desc"]; 1043 newData.Description = (String) row["Desc"];
1044 newData.ownerID = (String) row["OwnerUUID"]; 1044 newData.OwnerID = (String) row["OwnerUUID"];
1045 newData.isGroupOwned = (Boolean) row["IsGroupOwned"]; 1045 newData.IsGroupOwned = (Boolean) row["IsGroupOwned"];
1046 newData.area = Convert.ToInt32(row["Area"]); 1046 newData.Area = Convert.ToInt32(row["Area"]);
1047 newData.auctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented 1047 newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented
1048 newData.category = (Parcel.ParcelCategory) Convert.ToInt32(row["Category"]); 1048 newData.Category = (Parcel.ParcelCategory) Convert.ToInt32(row["Category"]);
1049 //Enum libsecondlife.Parcel.ParcelCategory 1049 //Enum libsecondlife.Parcel.ParcelCategory
1050 newData.claimDate = Convert.ToInt32(row["ClaimDate"]); 1050 newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]);
1051 newData.claimPrice = Convert.ToInt32(row["ClaimPrice"]); 1051 newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]);
1052 newData.groupID = new LLUUID((String) row["GroupUUID"]); 1052 newData.GroupID = new LLUUID((String) row["GroupUUID"]);
1053 newData.salePrice = Convert.ToInt32(row["SalePrice"]); 1053 newData.SalePrice = Convert.ToInt32(row["SalePrice"]);
1054 newData.landStatus = (Parcel.ParcelStatus) Convert.ToInt32(row["LandStatus"]); 1054 newData.Status = (Parcel.ParcelStatus) Convert.ToInt32(row["LandStatus"]);
1055 //Enum. libsecondlife.Parcel.ParcelStatus 1055 //Enum. libsecondlife.Parcel.ParcelStatus
1056 newData.landFlags = Convert.ToUInt32(row["LandFlags"]); 1056 newData.Flags = Convert.ToUInt32(row["LandFlags"]);
1057 newData.landingType = (Byte) row["LandingType"]; 1057 newData.LandingType = (Byte) row["LandingType"];
1058 newData.mediaAutoScale = (Byte) row["MediaAutoScale"]; 1058 newData.MediaAutoScale = (Byte) row["MediaAutoScale"];
1059 newData.mediaID = new LLUUID((String) row["MediaTextureUUID"]); 1059 newData.MediaID = new LLUUID((String) row["MediaTextureUUID"]);
1060 newData.mediaURL = (String) row["MediaURL"]; 1060 newData.MediaURL = (String) row["MediaURL"];
1061 newData.musicURL = (String) row["MusicURL"]; 1061 newData.MusicURL = (String) row["MusicURL"];
1062 newData.passHours = Convert.ToSingle(row["PassHours"]); 1062 newData.PassHours = Convert.ToSingle(row["PassHours"]);
1063 newData.passPrice = Convert.ToInt32(row["PassPrice"]); 1063 newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
1064 newData.snapshotID = (String) row["SnapshotUUID"]; 1064 newData.SnapshotID = (String) row["SnapshotUUID"];
1065 try 1065 try
1066 { 1066 {
1067 1067
1068 newData.userLocation = 1068 newData.UserLocation =
1069 new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), 1069 new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
1070 Convert.ToSingle(row["UserLocationZ"])); 1070 Convert.ToSingle(row["UserLocationZ"]));
1071 newData.userLookAt = 1071 newData.UserLookAt =
1072 new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), 1072 new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]),
1073 Convert.ToSingle(row["UserLookAtZ"])); 1073 Convert.ToSingle(row["UserLookAtZ"]));
1074 1074
1075 } 1075 }
1076 catch (InvalidCastException) 1076 catch (InvalidCastException)
1077 { 1077 {
1078 m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.landName); 1078 m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
1079 newData.userLocation = LLVector3.Zero; 1079 newData.UserLocation = LLVector3.Zero;
1080 newData.userLookAt = LLVector3.Zero; 1080 newData.UserLookAt = LLVector3.Zero;
1081 } 1081 }
1082 newData.parcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); 1082 newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
1083 LLUUID authBuyerID = LLUUID.Zero; 1083 LLUUID authBuyerID = LLUUID.Zero;
1084 1084
1085 try 1085 try
@@ -1270,41 +1270,41 @@ namespace OpenSim.Data.SQLite
1270 /// <param name="regionUUID"></param> 1270 /// <param name="regionUUID"></param>
1271 private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) 1271 private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID)
1272 { 1272 {
1273 row["UUID"] = Util.ToRawUuidString(land.globalID); 1273 row["UUID"] = Util.ToRawUuidString(land.GlobalID);
1274 row["RegionUUID"] = Util.ToRawUuidString(regionUUID); 1274 row["RegionUUID"] = Util.ToRawUuidString(regionUUID);
1275 row["LocalLandID"] = land.localID; 1275 row["LocalLandID"] = land.LocalID;
1276 1276
1277 // Bitmap is a byte[512] 1277 // Bitmap is a byte[512]
1278 row["Bitmap"] = land.landBitmapByteArray; 1278 row["Bitmap"] = land.Bitmap;
1279 1279
1280 row["Name"] = land.landName; 1280 row["Name"] = land.Name;
1281 row["Desc"] = land.landDesc; 1281 row["Desc"] = land.Description;
1282 row["OwnerUUID"] = Util.ToRawUuidString(land.ownerID); 1282 row["OwnerUUID"] = Util.ToRawUuidString(land.OwnerID);
1283 row["IsGroupOwned"] = land.isGroupOwned; 1283 row["IsGroupOwned"] = land.IsGroupOwned;
1284 row["Area"] = land.area; 1284 row["Area"] = land.Area;
1285 row["AuctionID"] = land.auctionID; //Unemplemented 1285 row["AuctionID"] = land.AuctionID; //Unemplemented
1286 row["Category"] = land.category; //Enum libsecondlife.Parcel.ParcelCategory 1286 row["Category"] = land.Category; //Enum libsecondlife.Parcel.ParcelCategory
1287 row["ClaimDate"] = land.claimDate; 1287 row["ClaimDate"] = land.ClaimDate;
1288 row["ClaimPrice"] = land.claimPrice; 1288 row["ClaimPrice"] = land.ClaimPrice;
1289 row["GroupUUID"] = Util.ToRawUuidString(land.groupID); 1289 row["GroupUUID"] = Util.ToRawUuidString(land.GroupID);
1290 row["SalePrice"] = land.salePrice; 1290 row["SalePrice"] = land.SalePrice;
1291 row["LandStatus"] = land.landStatus; //Enum. libsecondlife.Parcel.ParcelStatus 1291 row["LandStatus"] = land.Status; //Enum. libsecondlife.Parcel.ParcelStatus
1292 row["LandFlags"] = land.landFlags; 1292 row["LandFlags"] = land.Flags;
1293 row["LandingType"] = land.landingType; 1293 row["LandingType"] = land.LandingType;
1294 row["MediaAutoScale"] = land.mediaAutoScale; 1294 row["MediaAutoScale"] = land.MediaAutoScale;
1295 row["MediaTextureUUID"] = Util.ToRawUuidString(land.mediaID); 1295 row["MediaTextureUUID"] = Util.ToRawUuidString(land.MediaID);
1296 row["MediaURL"] = land.mediaURL; 1296 row["MediaURL"] = land.MediaURL;
1297 row["MusicURL"] = land.musicURL; 1297 row["MusicURL"] = land.MusicURL;
1298 row["PassHours"] = land.passHours; 1298 row["PassHours"] = land.PassHours;
1299 row["PassPrice"] = land.passPrice; 1299 row["PassPrice"] = land.PassPrice;
1300 row["SnapshotUUID"] = Util.ToRawUuidString(land.snapshotID); 1300 row["SnapshotUUID"] = Util.ToRawUuidString(land.SnapshotID);
1301 row["UserLocationX"] = land.userLocation.X; 1301 row["UserLocationX"] = land.UserLocation.X;
1302 row["UserLocationY"] = land.userLocation.Y; 1302 row["UserLocationY"] = land.UserLocation.Y;
1303 row["UserLocationZ"] = land.userLocation.Z; 1303 row["UserLocationZ"] = land.UserLocation.Z;
1304 row["UserLookAtX"] = land.userLookAt.X; 1304 row["UserLookAtX"] = land.UserLookAt.X;
1305 row["UserLookAtY"] = land.userLookAt.Y; 1305 row["UserLookAtY"] = land.UserLookAt.Y;
1306 row["UserLookAtZ"] = land.userLookAt.Z; 1306 row["UserLookAtZ"] = land.UserLookAt.Z;
1307 row["AuthbuyerID"] = Util.ToRawUuidString(land.authBuyerID); 1307 row["AuthbuyerID"] = Util.ToRawUuidString(land.AuthBuyerID);
1308 } 1308 }
1309 1309
1310 /// <summary> 1310 /// <summary>