diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 3 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLEstateData.cs | 9 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs (renamed from OpenSim/Data/MySQL/MySQLLegacyRegionData.cs) | 33 |
4 files changed, 31 insertions, 16 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index f9ce3d9..0b0a638 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -216,9 +216,6 @@ namespace OpenSim.Data.MySQL | |||
216 | 216 | ||
217 | private void UpdateAccessTime(AssetBase asset) | 217 | private void UpdateAccessTime(AssetBase asset) |
218 | { | 218 | { |
219 | // Writing to the database every time Get() is called on an asset is killing us. Seriously. -jph | ||
220 | return; | ||
221 | |||
222 | lock (m_dbLock) | 219 | lock (m_dbLock) |
223 | { | 220 | { |
224 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 221 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 9158f7a..c42c687 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs | |||
@@ -54,6 +54,15 @@ namespace OpenSim.Data.MySQL | |||
54 | private Dictionary<string, FieldInfo> m_FieldMap = | 54 | private Dictionary<string, FieldInfo> m_FieldMap = |
55 | new Dictionary<string, FieldInfo>(); | 55 | new Dictionary<string, FieldInfo>(); |
56 | 56 | ||
57 | public MySQLEstateStore() | ||
58 | { | ||
59 | } | ||
60 | |||
61 | public MySQLEstateStore(string connectionString) | ||
62 | { | ||
63 | Initialise(connectionString); | ||
64 | } | ||
65 | |||
57 | public void Initialise(string connectionString) | 66 | public void Initialise(string connectionString) |
58 | { | 67 | { |
59 | m_connectionString = connectionString; | 68 | m_connectionString = connectionString; |
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 0aea30f..2dca3eb 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -286,7 +286,7 @@ namespace OpenSim.Data.MySQL | |||
286 | InventoryItemBase item = new InventoryItemBase(); | 286 | InventoryItemBase item = new InventoryItemBase(); |
287 | 287 | ||
288 | // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. | 288 | // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. |
289 | // ( DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero ) | 289 | // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) |
290 | item.CreatorId = reader["creatorID"].ToString(); | 290 | item.CreatorId = reader["creatorID"].ToString(); |
291 | 291 | ||
292 | // Be a bit safer in parsing these because the | 292 | // Be a bit safer in parsing these because the |
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index a39e68d..87f6d07 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -45,13 +45,22 @@ namespace OpenSim.Data.MySQL | |||
45 | /// <summary> | 45 | /// <summary> |
46 | /// A MySQL Interface for the Region Server | 46 | /// A MySQL Interface for the Region Server |
47 | /// </summary> | 47 | /// </summary> |
48 | public class MySQLDataStore : IRegionDataStore | 48 | public class MySQLSimulationData : ISimulationDataStore |
49 | { | 49 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | private string m_connectionString; | 52 | private string m_connectionString; |
53 | private object m_dbLock = new object(); | 53 | private object m_dbLock = new object(); |
54 | 54 | ||
55 | public MySQLSimulationData() | ||
56 | { | ||
57 | } | ||
58 | |||
59 | public MySQLSimulationData(string connectionString) | ||
60 | { | ||
61 | Initialise(connectionString); | ||
62 | } | ||
63 | |||
55 | public void Initialise(string connectionString) | 64 | public void Initialise(string connectionString) |
56 | { | 65 | { |
57 | m_connectionString = connectionString; | 66 | m_connectionString = connectionString; |
@@ -680,7 +689,7 @@ namespace OpenSim.Data.MySQL | |||
680 | "UserLocationX, UserLocationY, UserLocationZ, " + | 689 | "UserLocationX, UserLocationY, UserLocationZ, " + |
681 | "UserLookAtX, UserLookAtY, UserLookAtZ, " + | 690 | "UserLookAtX, UserLookAtY, UserLookAtZ, " + |
682 | "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " + | 691 | "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " + |
683 | "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" + | 692 | "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" + |
684 | "?UUID, ?RegionUUID, " + | 693 | "?UUID, ?RegionUUID, " + |
685 | "?LocalLandID, ?Bitmap, ?Name, ?Description, " + | 694 | "?LocalLandID, ?Bitmap, ?Name, ?Description, " + |
686 | "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + | 695 | "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + |
@@ -691,7 +700,7 @@ namespace OpenSim.Data.MySQL | |||
691 | "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + | 700 | "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + |
692 | "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + | 701 | "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + |
693 | "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+ | 702 | "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+ |
694 | "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)"; | 703 | "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)"; |
695 | 704 | ||
696 | FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); | 705 | FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); |
697 | 706 | ||
@@ -728,7 +737,7 @@ namespace OpenSim.Data.MySQL | |||
728 | 737 | ||
729 | string command = "select * from `regionwindlight` where region_id = ?regionID"; | 738 | string command = "select * from `regionwindlight` where region_id = ?regionID"; |
730 | 739 | ||
731 | using(MySqlCommand cmd = new MySqlCommand(command)) | 740 | using (MySqlCommand cmd = new MySqlCommand(command)) |
732 | { | 741 | { |
733 | cmd.Connection = dbcon; | 742 | cmd.Connection = dbcon; |
734 | 743 | ||
@@ -1350,13 +1359,13 @@ namespace OpenSim.Data.MySQL | |||
1350 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); | 1359 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); |
1351 | } | 1360 | } |
1352 | 1361 | ||
1353 | newData.MediaDescription = (string) row["MediaDescription"]; | 1362 | newData.MediaDescription = (string) row["MediaDescription"]; |
1354 | newData.MediaType = (string) row["MediaType"]; | 1363 | newData.MediaType = (string) row["MediaType"]; |
1355 | newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]); | 1364 | newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]); |
1356 | newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]); | 1365 | newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]); |
1357 | newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); | 1366 | newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); |
1358 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); | 1367 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); |
1359 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); | 1368 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); |
1360 | 1369 | ||
1361 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); | 1370 | newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); |
1362 | 1371 | ||
@@ -1724,7 +1733,7 @@ namespace OpenSim.Data.MySQL | |||
1724 | 1733 | ||
1725 | s.State = (byte)(int)row["State"]; | 1734 | s.State = (byte)(int)row["State"]; |
1726 | 1735 | ||
1727 | if (!(row["Media"] is System.DBNull)) | 1736 | if (!(row["Media"] is System.DBNull)) |
1728 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); | 1737 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); |
1729 | 1738 | ||
1730 | return s; | 1739 | return s; |