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/MSSQL/MSSQLDataStore.cs | 132 +++++++++++++++--------------- OpenSim/Data/MySQL/MySQLDataStore.cs | 140 ++++++++++++++++---------------- OpenSim/Data/SQLite/SQLiteRegionData.cs | 138 +++++++++++++++---------------- 3 files changed, 205 insertions(+), 205 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs index 569268e..0ae879a 100644 --- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs @@ -470,7 +470,7 @@ namespace OpenSim.Data.MSSQL DataTable land = m_landTable; DataTable landaccesslist = m_landAccessListTable; - DataRow landRow = land.Rows.Find(parcel.landData.globalID.UUID); + DataRow landRow = land.Rows.Find(parcel.landData.GlobalID.UUID); if (landRow == null) { landRow = land.NewRow(); @@ -486,14 +486,14 @@ namespace OpenSim.Data.MSSQL SqlCommand cmd = new SqlCommand("delete from landaccesslist where LandUUID=@LandUUID", m_connection)) { - cmd.Parameters.Add(new SqlParameter("@LandUUID", parcel.landData.globalID.UUID)); + cmd.Parameters.Add(new SqlParameter("@LandUUID", parcel.landData.GlobalID.UUID)); 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); } @@ -518,11 +518,11 @@ namespace OpenSim.Data.MSSQL foreach (DataRow rawDataLand in rawDataForRegion) { LandData newLand = buildLandData(rawDataLand); - string accessListSearchExp = "LandUUID = '" + newLand.globalID.UUID + "'"; + string accessListSearchExp = "LandUUID = '" + newLand.GlobalID.UUID + "'"; DataRow[] rawDataForLandAccessList = landaccesslist.Select(accessListSearchExp); foreach (DataRow rawDataLandAccess in rawDataForLandAccessList) { - newLand.parcelAccessList.Add(buildLandAccessData(rawDataLandAccess)); + newLand.ParcelAccessList.Add(buildLandAccessData(rawDataLandAccess)); } landDataForRegion.Add(newLand); @@ -992,43 +992,43 @@ namespace OpenSim.Data.MSSQL { 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["Description"]; - newData.ownerID = (String)row["OwnerUUID"]; - newData.isGroupOwned = Convert.ToBoolean(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["Description"]; + newData.OwnerID = (String)row["OwnerUUID"]; + newData.IsGroupOwned = Convert.ToBoolean(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 = Convert.ToByte(row["LandingType"]); - newData.mediaAutoScale = Convert.ToByte(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.userLocation = + newData.Flags = Convert.ToUInt32(row["LandFlags"]); + newData.LandingType = Convert.ToByte(row["LandingType"]); + newData.MediaAutoScale = Convert.ToByte(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.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"])); - newData.parcelAccessList = new List(); + newData.ParcelAccessList = new List(); return newData; } @@ -1186,40 +1186,40 @@ namespace OpenSim.Data.MSSQL /// private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) { - row["UUID"] = land.globalID.UUID; + row["UUID"] = land.GlobalID.UUID; row["RegionUUID"] = regionUUID.UUID; - row["LocalLandID"] = land.localID; + row["LocalLandID"] = land.LocalID; // Bitmap is a byte[512] - row["Bitmap"] = land.landBitmapByteArray; - - row["Name"] = land.landName; - row["Description"] = land.landDesc; - row["OwnerUUID"] = land.ownerID.UUID; - 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"] = land.groupID.UUID; - 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"] = land.mediaID.UUID; - row["MediaURL"] = land.mediaURL; - row["MusicURL"] = land.musicURL; - row["PassHours"] = land.passHours; - row["PassPrice"] = land.passPrice; - row["SnapshotUUID"] = land.snapshotID.UUID; - 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["Bitmap"] = land.Bitmap; + + row["Name"] = land.Name; + row["Description"] = land.Description; + row["OwnerUUID"] = land.OwnerID.UUID; + 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"] = land.GroupID.UUID; + 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"] = land.MediaID.UUID; + row["MediaURL"] = land.MediaURL; + row["MusicURL"] = land.MusicURL; + row["PassHours"] = land.PassHours; + row["PassPrice"] = land.PassPrice; + row["SnapshotUUID"] = land.SnapshotID.UUID; + 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; } /// diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index 74f15cb..2ace4b1 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs @@ -692,7 +692,7 @@ namespace OpenSim.Data.MySQL DataTable land = m_landTable; DataTable landaccesslist = m_landAccessListTable; - 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(); @@ -708,14 +708,14 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand("delete from landaccesslist where LandUUID=?LandUUID", m_connection)) { - cmd.Parameters.Add(new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); + cmd.Parameters.Add(new MySqlParameter("?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); } @@ -787,11 +787,11 @@ namespace OpenSim.Data.MySQL 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); @@ -1319,59 +1319,59 @@ namespace OpenSim.Data.MySQL { 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["Description"]; - newData.ownerID = (String) row["OwnerUUID"]; - newData.isGroupOwned = Convert.ToBoolean(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["Description"]; + newData.OwnerID = (String) row["OwnerUUID"]; + newData.IsGroupOwned = Convert.ToBoolean(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 = Convert.ToByte(row["LandingType"]); - newData.mediaAutoScale = Convert.ToByte(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.Flags = Convert.ToUInt32(row["LandFlags"]); + newData.LandingType = Convert.ToByte(row["LandingType"]); + newData.MediaAutoScale = Convert.ToByte(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"]); LLUUID authedbuyer = LLUUID.Zero; LLUUID snapshotID = LLUUID.Zero; Helpers.TryParse((string)row["AuthBuyerID"], out authedbuyer); Helpers.TryParse((string)row["SnapshotUUID"], out snapshotID); - newData.authBuyerID = authedbuyer; - newData.snapshotID = snapshotID; + newData.AuthBuyerID = authedbuyer; + newData.SnapshotID = snapshotID; 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) { - newData.userLocation = LLVector3.Zero; - newData.userLookAt = LLVector3.Zero; - 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.parcelAccessList = new List(); + newData.ParcelAccessList = new List(); return newData; } @@ -1576,41 +1576,41 @@ namespace OpenSim.Data.MySQL /// 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["Description"] = 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"] = land.authBuyerID; + row["Bitmap"] = land.Bitmap; + + row["Name"] = land.Name; + row["Description"] = 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"] = land.AuthBuyerID; } /// 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