From 090159defc731fca252b2b3520364712760f0f4e Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 23 Jul 2008 15:50:32 +0000 Subject: 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). --- OpenSim/Data/SQLite/SQLiteRegionData.cs | 138 ++++++++++++++++---------------- 1 file changed, 69 insertions(+), 69 deletions(-) (limited to 'OpenSim/Data/SQLite') 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 DataTable land = ds.Tables["land"]; DataTable landaccesslist = ds.Tables["landaccesslist"]; - DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); + DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.GlobalID)); if (landRow == null) { landRow = land.NewRow(); @@ -548,14 +548,14 @@ namespace OpenSim.Data.SQLite // I know this caused someone issues before, but OpenSim is unusable if we leave this stuff around using (SqliteCommand cmd = new SqliteCommand("delete from landaccesslist where LandUUID=:LandUUID", m_conn)) { - cmd.Parameters.Add(new SqliteParameter(":LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); + cmd.Parameters.Add(new SqliteParameter(":LandUUID", Util.ToRawUuidString(parcel.landData.GlobalID))); cmd.ExecuteNonQuery(); } - foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList) + foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.ParcelAccessList) { DataRow newAccessRow = landaccesslist.NewRow(); - fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); + fillLandAccessRow(newAccessRow, entry, parcel.landData.GlobalID); landaccesslist.Rows.Add(newAccessRow); } } @@ -580,11 +580,11 @@ namespace OpenSim.Data.SQLite foreach (DataRow rawDataLand in rawDataForRegion) { LandData newLand = buildLandData(rawDataLand); - string accessListSearchExp = "LandUUID = '" + Util.ToRawUuidString(newLand.globalID) + "'"; + string accessListSearchExp = "LandUUID = '" + Util.ToRawUuidString(newLand.GlobalID) + "'"; DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp); foreach (DataRow rawDataLandAccess in rawDataForLandAccessList) { - newLand.parcelAccessList.Add(buildLandAccessData(rawDataLandAccess)); + newLand.ParcelAccessList.Add(buildLandAccessData(rawDataLandAccess)); } landDataForRegion.Add(newLand); @@ -1033,53 +1033,53 @@ namespace OpenSim.Data.SQLite { LandData newData = new LandData(); - newData.globalID = new LLUUID((String) row["UUID"]); - newData.localID = Convert.ToInt32(row["LocalLandID"]); + newData.GlobalID = new LLUUID((String) row["UUID"]); + newData.LocalID = Convert.ToInt32(row["LocalLandID"]); // Bitmap is a byte[512] - newData.landBitmapByteArray = (Byte[]) row["Bitmap"]; - - newData.landName = (String) row["Name"]; - newData.landDesc = (String) row["Desc"]; - newData.ownerID = (String) row["OwnerUUID"]; - newData.isGroupOwned = (Boolean) row["IsGroupOwned"]; - newData.area = Convert.ToInt32(row["Area"]); - newData.auctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented - newData.category = (Parcel.ParcelCategory) Convert.ToInt32(row["Category"]); + newData.Bitmap = (Byte[]) row["Bitmap"]; + + newData.Name = (String) row["Name"]; + newData.Description = (String) row["Desc"]; + newData.OwnerID = (String) row["OwnerUUID"]; + newData.IsGroupOwned = (Boolean) row["IsGroupOwned"]; + newData.Area = Convert.ToInt32(row["Area"]); + newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented + newData.Category = (Parcel.ParcelCategory) Convert.ToInt32(row["Category"]); //Enum libsecondlife.Parcel.ParcelCategory - newData.claimDate = Convert.ToInt32(row["ClaimDate"]); - newData.claimPrice = Convert.ToInt32(row["ClaimPrice"]); - newData.groupID = new LLUUID((String) row["GroupUUID"]); - newData.salePrice = Convert.ToInt32(row["SalePrice"]); - newData.landStatus = (Parcel.ParcelStatus) Convert.ToInt32(row["LandStatus"]); + newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]); + newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]); + newData.GroupID = new LLUUID((String) row["GroupUUID"]); + newData.SalePrice = Convert.ToInt32(row["SalePrice"]); + newData.Status = (Parcel.ParcelStatus) Convert.ToInt32(row["LandStatus"]); //Enum. libsecondlife.Parcel.ParcelStatus - newData.landFlags = Convert.ToUInt32(row["LandFlags"]); - newData.landingType = (Byte) row["LandingType"]; - newData.mediaAutoScale = (Byte) row["MediaAutoScale"]; - newData.mediaID = new LLUUID((String) row["MediaTextureUUID"]); - newData.mediaURL = (String) row["MediaURL"]; - newData.musicURL = (String) row["MusicURL"]; - newData.passHours = Convert.ToSingle(row["PassHours"]); - newData.passPrice = Convert.ToInt32(row["PassPrice"]); - newData.snapshotID = (String) row["SnapshotUUID"]; + newData.Flags = Convert.ToUInt32(row["LandFlags"]); + newData.LandingType = (Byte) row["LandingType"]; + newData.MediaAutoScale = (Byte) row["MediaAutoScale"]; + newData.MediaID = new LLUUID((String) row["MediaTextureUUID"]); + newData.MediaURL = (String) row["MediaURL"]; + newData.MusicURL = (String) row["MusicURL"]; + newData.PassHours = Convert.ToSingle(row["PassHours"]); + newData.PassPrice = Convert.ToInt32(row["PassPrice"]); + newData.SnapshotID = (String) row["SnapshotUUID"]; try { - newData.userLocation = + newData.UserLocation = new LLVector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]), Convert.ToSingle(row["UserLocationZ"])); - newData.userLookAt = + newData.UserLookAt = new LLVector3(Convert.ToSingle(row["UserLookAtX"]), Convert.ToSingle(row["UserLookAtY"]), Convert.ToSingle(row["UserLookAtZ"])); } catch (InvalidCastException) { - m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.landName); - newData.userLocation = LLVector3.Zero; - newData.userLookAt = LLVector3.Zero; + m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); + newData.UserLocation = LLVector3.Zero; + newData.UserLookAt = LLVector3.Zero; } - newData.parcelAccessList = new List(); + newData.ParcelAccessList = new List(); LLUUID authBuyerID = LLUUID.Zero; try @@ -1270,41 +1270,41 @@ namespace OpenSim.Data.SQLite /// private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) { - row["UUID"] = Util.ToRawUuidString(land.globalID); + row["UUID"] = Util.ToRawUuidString(land.GlobalID); row["RegionUUID"] = Util.ToRawUuidString(regionUUID); - row["LocalLandID"] = land.localID; + row["LocalLandID"] = land.LocalID; // Bitmap is a byte[512] - row["Bitmap"] = land.landBitmapByteArray; - - row["Name"] = land.landName; - row["Desc"] = land.landDesc; - row["OwnerUUID"] = Util.ToRawUuidString(land.ownerID); - row["IsGroupOwned"] = land.isGroupOwned; - row["Area"] = land.area; - row["AuctionID"] = land.auctionID; //Unemplemented - row["Category"] = land.category; //Enum libsecondlife.Parcel.ParcelCategory - row["ClaimDate"] = land.claimDate; - row["ClaimPrice"] = land.claimPrice; - row["GroupUUID"] = Util.ToRawUuidString(land.groupID); - row["SalePrice"] = land.salePrice; - row["LandStatus"] = land.landStatus; //Enum. libsecondlife.Parcel.ParcelStatus - row["LandFlags"] = land.landFlags; - row["LandingType"] = land.landingType; - row["MediaAutoScale"] = land.mediaAutoScale; - row["MediaTextureUUID"] = Util.ToRawUuidString(land.mediaID); - row["MediaURL"] = land.mediaURL; - row["MusicURL"] = land.musicURL; - row["PassHours"] = land.passHours; - row["PassPrice"] = land.passPrice; - row["SnapshotUUID"] = Util.ToRawUuidString(land.snapshotID); - row["UserLocationX"] = land.userLocation.X; - row["UserLocationY"] = land.userLocation.Y; - row["UserLocationZ"] = land.userLocation.Z; - row["UserLookAtX"] = land.userLookAt.X; - row["UserLookAtY"] = land.userLookAt.Y; - row["UserLookAtZ"] = land.userLookAt.Z; - row["AuthbuyerID"] = Util.ToRawUuidString(land.authBuyerID); + row["Bitmap"] = land.Bitmap; + + row["Name"] = land.Name; + row["Desc"] = land.Description; + row["OwnerUUID"] = Util.ToRawUuidString(land.OwnerID); + row["IsGroupOwned"] = land.IsGroupOwned; + row["Area"] = land.Area; + row["AuctionID"] = land.AuctionID; //Unemplemented + row["Category"] = land.Category; //Enum libsecondlife.Parcel.ParcelCategory + row["ClaimDate"] = land.ClaimDate; + row["ClaimPrice"] = land.ClaimPrice; + row["GroupUUID"] = Util.ToRawUuidString(land.GroupID); + row["SalePrice"] = land.SalePrice; + row["LandStatus"] = land.Status; //Enum. libsecondlife.Parcel.ParcelStatus + row["LandFlags"] = land.Flags; + row["LandingType"] = land.LandingType; + row["MediaAutoScale"] = land.MediaAutoScale; + row["MediaTextureUUID"] = Util.ToRawUuidString(land.MediaID); + row["MediaURL"] = land.MediaURL; + row["MusicURL"] = land.MusicURL; + row["PassHours"] = land.PassHours; + row["PassPrice"] = land.PassPrice; + row["SnapshotUUID"] = Util.ToRawUuidString(land.SnapshotID); + row["UserLocationX"] = land.UserLocation.X; + row["UserLocationY"] = land.UserLocation.Y; + row["UserLocationZ"] = land.UserLocation.Z; + row["UserLookAtX"] = land.UserLookAt.X; + row["UserLookAtY"] = land.UserLookAt.Y; + row["UserLookAtZ"] = land.UserLookAt.Z; + row["AuthbuyerID"] = Util.ToRawUuidString(land.AuthBuyerID); } /// -- cgit v1.1