diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | 7 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 123 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserAccountData.cs | 43 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLXAssetData.cs | 9 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 3 |
6 files changed, 131 insertions, 58 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index a743479..a22dc0a 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -155,7 +155,7 @@ namespace OpenSim.Data.MySQL | |||
155 | /// </summary> | 155 | /// </summary> |
156 | /// <param name="asset">Asset UUID to create</param> | 156 | /// <param name="asset">Asset UUID to create</param> |
157 | /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> | 157 | /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> |
158 | override public void StoreAsset(AssetBase asset) | 158 | override public bool StoreAsset(AssetBase asset) |
159 | { | 159 | { |
160 | lock (m_dbLock) | 160 | lock (m_dbLock) |
161 | { | 161 | { |
@@ -203,12 +203,14 @@ namespace OpenSim.Data.MySQL | |||
203 | cmd.Parameters.AddWithValue("?data", asset.Data); | 203 | cmd.Parameters.AddWithValue("?data", asset.Data); |
204 | cmd.ExecuteNonQuery(); | 204 | cmd.ExecuteNonQuery(); |
205 | cmd.Dispose(); | 205 | cmd.Dispose(); |
206 | return true; | ||
206 | } | 207 | } |
207 | } | 208 | } |
208 | catch (Exception e) | 209 | catch (Exception e) |
209 | { | 210 | { |
210 | m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}", | 211 | m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}", |
211 | asset.FullID, asset.Name, e.Message); | 212 | asset.FullID, asset.Name, e.Message); |
213 | return false; | ||
212 | } | 214 | } |
213 | } | 215 | } |
214 | } | 216 | } |
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 754cf72..786b955 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | |||
@@ -173,6 +173,11 @@ namespace OpenSim.Data.MySQL | |||
173 | int v = Convert.ToInt32(reader[name]); | 173 | int v = Convert.ToInt32(reader[name]); |
174 | m_Fields[name].SetValue(row, v); | 174 | m_Fields[name].SetValue(row, v); |
175 | } | 175 | } |
176 | else if (m_Fields[name].FieldType == typeof(uint)) | ||
177 | { | ||
178 | uint v = Convert.ToUInt32(reader[name]); | ||
179 | m_Fields[name].SetValue(row, v); | ||
180 | } | ||
176 | else | 181 | else |
177 | { | 182 | { |
178 | m_Fields[name].SetValue(row, reader[name]); | 183 | m_Fields[name].SetValue(row, reader[name]); |
@@ -294,4 +299,4 @@ namespace OpenSim.Data.MySQL | |||
294 | } | 299 | } |
295 | } | 300 | } |
296 | } | 301 | } |
297 | } \ No newline at end of file | 302 | } |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 381a514..1197548 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Data.MySQL | |||
66 | Initialise(connectionString); | 66 | Initialise(connectionString); |
67 | } | 67 | } |
68 | 68 | ||
69 | public void Initialise(string connectionString) | 69 | public virtual void Initialise(string connectionString) |
70 | { | 70 | { |
71 | m_connectionString = connectionString; | 71 | m_connectionString = connectionString; |
72 | 72 | ||
@@ -113,7 +113,7 @@ namespace OpenSim.Data.MySQL | |||
113 | 113 | ||
114 | public void Dispose() {} | 114 | public void Dispose() {} |
115 | 115 | ||
116 | public void StoreObject(SceneObjectGroup obj, UUID regionUUID) | 116 | public virtual void StoreObject(SceneObjectGroup obj, UUID regionUUID) |
117 | { | 117 | { |
118 | uint flags = obj.RootPart.GetEffectiveObjectFlags(); | 118 | uint flags = obj.RootPart.GetEffectiveObjectFlags(); |
119 | 119 | ||
@@ -170,7 +170,7 @@ namespace OpenSim.Data.MySQL | |||
170 | "ParticleSystem, ClickAction, Material, " + | 170 | "ParticleSystem, ClickAction, Material, " + |
171 | "CollisionSound, CollisionSoundVolume, " + | 171 | "CollisionSound, CollisionSoundVolume, " + |
172 | "PassTouches, " + | 172 | "PassTouches, " + |
173 | "LinkNumber, MediaURL) values (" + "?UUID, " + | 173 | "LinkNumber, MediaURL, KeyframeMotion) values (" + "?UUID, " + |
174 | "?CreationDate, ?Name, ?Text, " + | 174 | "?CreationDate, ?Name, ?Text, " + |
175 | "?Description, ?SitName, ?TouchName, " + | 175 | "?Description, ?SitName, ?TouchName, " + |
176 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + | 176 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + |
@@ -201,7 +201,7 @@ namespace OpenSim.Data.MySQL | |||
201 | "?SaleType, ?ColorR, ?ColorG, " + | 201 | "?SaleType, ?ColorR, ?ColorG, " + |
202 | "?ColorB, ?ColorA, ?ParticleSystem, " + | 202 | "?ColorB, ?ColorA, ?ParticleSystem, " + |
203 | "?ClickAction, ?Material, ?CollisionSound, " + | 203 | "?ClickAction, ?Material, ?CollisionSound, " + |
204 | "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; | 204 | "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL, ?KeyframeMotion)"; |
205 | 205 | ||
206 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); | 206 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); |
207 | 207 | ||
@@ -241,7 +241,7 @@ namespace OpenSim.Data.MySQL | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | public void RemoveObject(UUID obj, UUID regionUUID) | 244 | public virtual void RemoveObject(UUID obj, UUID regionUUID) |
245 | { | 245 | { |
246 | // m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID); | 246 | // m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID); |
247 | 247 | ||
@@ -390,7 +390,7 @@ namespace OpenSim.Data.MySQL | |||
390 | } | 390 | } |
391 | } | 391 | } |
392 | 392 | ||
393 | public List<SceneObjectGroup> LoadObjects(UUID regionID) | 393 | public virtual List<SceneObjectGroup> LoadObjects(UUID regionID) |
394 | { | 394 | { |
395 | const int ROWS_PER_QUERY = 5000; | 395 | const int ROWS_PER_QUERY = 5000; |
396 | 396 | ||
@@ -446,7 +446,11 @@ namespace OpenSim.Data.MySQL | |||
446 | foreach (SceneObjectPart prim in prims.Values) | 446 | foreach (SceneObjectPart prim in prims.Values) |
447 | { | 447 | { |
448 | if (prim.ParentUUID == UUID.Zero) | 448 | if (prim.ParentUUID == UUID.Zero) |
449 | { | ||
449 | objects[prim.UUID] = new SceneObjectGroup(prim); | 450 | objects[prim.UUID] = new SceneObjectGroup(prim); |
451 | if (prim.KeyframeMotion != null) | ||
452 | prim.KeyframeMotion.UpdateSceneObject(objects[prim.UUID]); | ||
453 | } | ||
450 | } | 454 | } |
451 | 455 | ||
452 | // Add all of the children objects to the SOGs | 456 | // Add all of the children objects to the SOGs |
@@ -559,36 +563,51 @@ namespace OpenSim.Data.MySQL | |||
559 | } | 563 | } |
560 | } | 564 | } |
561 | 565 | ||
562 | public void StoreTerrain(double[,] ter, UUID regionID) | 566 | public virtual void StoreTerrain(double[,] ter, UUID regionID) |
563 | { | 567 | { |
564 | m_log.Info("[REGION DB]: Storing terrain"); | 568 | Util.FireAndForget(delegate(object x) |
565 | |||
566 | lock (m_dbLock) | ||
567 | { | 569 | { |
568 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 570 | double[,] oldTerrain = LoadTerrain(regionID); |
569 | { | ||
570 | dbcon.Open(); | ||
571 | 571 | ||
572 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 572 | m_log.Info("[REGION DB]: Storing terrain"); |
573 | |||
574 | lock (m_dbLock) | ||
575 | { | ||
576 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
573 | { | 577 | { |
574 | cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID"; | 578 | dbcon.Open(); |
575 | cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); | ||
576 | 579 | ||
577 | ExecuteNonQuery(cmd); | 580 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
581 | { | ||
582 | cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID"; | ||
583 | cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); | ||
578 | 584 | ||
579 | cmd.CommandText = "insert into terrain (RegionUUID, " + | 585 | using (MySqlCommand cmd2 = dbcon.CreateCommand()) |
580 | "Revision, Heightfield) values (?RegionUUID, " + | 586 | { |
581 | "1, ?Heightfield)"; | 587 | try |
588 | { | ||
589 | cmd2.CommandText = "insert into terrain (RegionUUID, " + | ||
590 | "Revision, Heightfield) values (?RegionUUID, " + | ||
591 | "1, ?Heightfield)"; | ||
582 | 592 | ||
583 | cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); | 593 | cmd2.Parameters.AddWithValue("RegionUUID", regionID.ToString()); |
594 | cmd2.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter, oldTerrain)); | ||
584 | 595 | ||
585 | ExecuteNonQuery(cmd); | 596 | ExecuteNonQuery(cmd); |
597 | ExecuteNonQuery(cmd2); | ||
598 | } | ||
599 | catch (Exception e) | ||
600 | { | ||
601 | m_log.ErrorFormat(e.ToString()); | ||
602 | } | ||
603 | } | ||
604 | } | ||
586 | } | 605 | } |
587 | } | 606 | } |
588 | } | 607 | }); |
589 | } | 608 | } |
590 | 609 | ||
591 | public double[,] LoadTerrain(UUID regionID) | 610 | public virtual double[,] LoadTerrain(UUID regionID) |
592 | { | 611 | { |
593 | double[,] terrain = null; | 612 | double[,] terrain = null; |
594 | 613 | ||
@@ -638,7 +657,7 @@ namespace OpenSim.Data.MySQL | |||
638 | return terrain; | 657 | return terrain; |
639 | } | 658 | } |
640 | 659 | ||
641 | public void RemoveLandObject(UUID globalID) | 660 | public virtual void RemoveLandObject(UUID globalID) |
642 | { | 661 | { |
643 | lock (m_dbLock) | 662 | lock (m_dbLock) |
644 | { | 663 | { |
@@ -657,7 +676,7 @@ namespace OpenSim.Data.MySQL | |||
657 | } | 676 | } |
658 | } | 677 | } |
659 | 678 | ||
660 | public void StoreLandObject(ILandObject parcel) | 679 | public virtual void StoreLandObject(ILandObject parcel) |
661 | { | 680 | { |
662 | lock (m_dbLock) | 681 | lock (m_dbLock) |
663 | { | 682 | { |
@@ -714,7 +733,7 @@ namespace OpenSim.Data.MySQL | |||
714 | } | 733 | } |
715 | } | 734 | } |
716 | 735 | ||
717 | public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) | 736 | public virtual RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) |
718 | { | 737 | { |
719 | RegionLightShareData nWP = new RegionLightShareData(); | 738 | RegionLightShareData nWP = new RegionLightShareData(); |
720 | nWP.OnSave += StoreRegionWindlightSettings; | 739 | nWP.OnSave += StoreRegionWindlightSettings; |
@@ -736,7 +755,7 @@ namespace OpenSim.Data.MySQL | |||
736 | { | 755 | { |
737 | //No result, so store our default windlight profile and return it | 756 | //No result, so store our default windlight profile and return it |
738 | nWP.regionID = regionUUID; | 757 | nWP.regionID = regionUUID; |
739 | StoreRegionWindlightSettings(nWP); | 758 | // StoreRegionWindlightSettings(nWP); |
740 | return nWP; | 759 | return nWP; |
741 | } | 760 | } |
742 | else | 761 | else |
@@ -811,7 +830,7 @@ namespace OpenSim.Data.MySQL | |||
811 | return nWP; | 830 | return nWP; |
812 | } | 831 | } |
813 | 832 | ||
814 | public RegionSettings LoadRegionSettings(UUID regionUUID) | 833 | public virtual RegionSettings LoadRegionSettings(UUID regionUUID) |
815 | { | 834 | { |
816 | RegionSettings rs = null; | 835 | RegionSettings rs = null; |
817 | 836 | ||
@@ -851,7 +870,7 @@ namespace OpenSim.Data.MySQL | |||
851 | return rs; | 870 | return rs; |
852 | } | 871 | } |
853 | 872 | ||
854 | public void StoreRegionWindlightSettings(RegionLightShareData wl) | 873 | public virtual void StoreRegionWindlightSettings(RegionLightShareData wl) |
855 | { | 874 | { |
856 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 875 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
857 | { | 876 | { |
@@ -954,7 +973,7 @@ namespace OpenSim.Data.MySQL | |||
954 | } | 973 | } |
955 | } | 974 | } |
956 | 975 | ||
957 | public void RemoveRegionWindlightSettings(UUID regionID) | 976 | public virtual void RemoveRegionWindlightSettings(UUID regionID) |
958 | { | 977 | { |
959 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 978 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
960 | { | 979 | { |
@@ -969,7 +988,7 @@ namespace OpenSim.Data.MySQL | |||
969 | } | 988 | } |
970 | } | 989 | } |
971 | 990 | ||
972 | public void StoreRegionSettings(RegionSettings rs) | 991 | public virtual void StoreRegionSettings(RegionSettings rs) |
973 | { | 992 | { |
974 | lock (m_dbLock) | 993 | lock (m_dbLock) |
975 | { | 994 | { |
@@ -996,7 +1015,7 @@ namespace OpenSim.Data.MySQL | |||
996 | "use_estate_sun, fixed_sun, sun_position, " + | 1015 | "use_estate_sun, fixed_sun, sun_position, " + |
997 | "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " + | 1016 | "covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " + |
998 | "sunvectorz, loaded_creation_datetime, " + | 1017 | "sunvectorz, loaded_creation_datetime, " + |
999 | "loaded_creation_id, map_tile_ID, " + | 1018 | "loaded_creation_id, map_tile_ID, block_search, casino, " + |
1000 | "TelehubObject, parcel_tile_ID) " + | 1019 | "TelehubObject, parcel_tile_ID) " + |
1001 | "values (?RegionUUID, ?BlockTerraform, " + | 1020 | "values (?RegionUUID, ?BlockTerraform, " + |
1002 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 1021 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
@@ -1013,7 +1032,8 @@ namespace OpenSim.Data.MySQL | |||
1013 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + | 1032 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + |
1014 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 1033 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
1015 | "?LoadedCreationDateTime, ?LoadedCreationID, " + | 1034 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
1016 | "?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; | 1035 | "?TerrainImageID, ?block_search, ?casino, " + |
1036 | "?TelehubObject, ?ParcelImageID)"; | ||
1017 | 1037 | ||
1018 | FillRegionSettingsCommand(cmd, rs); | 1038 | FillRegionSettingsCommand(cmd, rs); |
1019 | 1039 | ||
@@ -1024,7 +1044,7 @@ namespace OpenSim.Data.MySQL | |||
1024 | SaveSpawnPoints(rs); | 1044 | SaveSpawnPoints(rs); |
1025 | } | 1045 | } |
1026 | 1046 | ||
1027 | public List<LandData> LoadLandObjects(UUID regionUUID) | 1047 | public virtual List<LandData> LoadLandObjects(UUID regionUUID) |
1028 | { | 1048 | { |
1029 | List<LandData> landData = new List<LandData>(); | 1049 | List<LandData> landData = new List<LandData>(); |
1030 | 1050 | ||
@@ -1211,6 +1231,18 @@ namespace OpenSim.Data.MySQL | |||
1211 | if (!(row["MediaURL"] is System.DBNull)) | 1231 | if (!(row["MediaURL"] is System.DBNull)) |
1212 | prim.MediaUrl = (string)row["MediaURL"]; | 1232 | prim.MediaUrl = (string)row["MediaURL"]; |
1213 | 1233 | ||
1234 | if (!(row["KeyframeMotion"] is DBNull)) | ||
1235 | { | ||
1236 | Byte[] data = (byte[])row["KeyframeMotion"]; | ||
1237 | if (data.Length > 0) | ||
1238 | prim.KeyframeMotion = KeyframeMotion.FromData(null, data); | ||
1239 | else | ||
1240 | prim.KeyframeMotion = null; | ||
1241 | } | ||
1242 | else | ||
1243 | { | ||
1244 | prim.KeyframeMotion = null; | ||
1245 | } | ||
1214 | return prim; | 1246 | return prim; |
1215 | } | 1247 | } |
1216 | 1248 | ||
@@ -1304,6 +1336,9 @@ namespace OpenSim.Data.MySQL | |||
1304 | newSettings.ParcelImageID = DBGuid.FromDB(row["parcel_tile_ID"]); | 1336 | newSettings.ParcelImageID = DBGuid.FromDB(row["parcel_tile_ID"]); |
1305 | newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]); | 1337 | newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]); |
1306 | 1338 | ||
1339 | newSettings.GodBlockSearch = Convert.ToBoolean(row["block_search"]); | ||
1340 | newSettings.Casino = Convert.ToBoolean(row["casino"]); | ||
1341 | |||
1307 | return newSettings; | 1342 | return newSettings; |
1308 | } | 1343 | } |
1309 | 1344 | ||
@@ -1401,7 +1436,7 @@ namespace OpenSim.Data.MySQL | |||
1401 | /// </summary> | 1436 | /// </summary> |
1402 | /// <param name="val"></param> | 1437 | /// <param name="val"></param> |
1403 | /// <returns></returns> | 1438 | /// <returns></returns> |
1404 | private static Array SerializeTerrain(double[,] val) | 1439 | private static Array SerializeTerrain(double[,] val, double[,] oldTerrain) |
1405 | { | 1440 | { |
1406 | MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); | 1441 | MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); |
1407 | BinaryWriter bw = new BinaryWriter(str); | 1442 | BinaryWriter bw = new BinaryWriter(str); |
@@ -1410,7 +1445,11 @@ namespace OpenSim.Data.MySQL | |||
1410 | for (int x = 0; x < (int)Constants.RegionSize; x++) | 1445 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
1411 | for (int y = 0; y < (int)Constants.RegionSize; y++) | 1446 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
1412 | { | 1447 | { |
1413 | double height = val[x, y]; | 1448 | double height = 20.0; |
1449 | if (oldTerrain != null) | ||
1450 | height = oldTerrain[x, y]; | ||
1451 | if (!double.IsNaN(val[x, y])) | ||
1452 | height = val[x, y]; | ||
1414 | if (height == 0.0) | 1453 | if (height == 0.0) |
1415 | height = double.Epsilon; | 1454 | height = double.Epsilon; |
1416 | 1455 | ||
@@ -1556,6 +1595,11 @@ namespace OpenSim.Data.MySQL | |||
1556 | 1595 | ||
1557 | cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); | 1596 | cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); |
1558 | cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); | 1597 | cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); |
1598 | |||
1599 | if (prim.KeyframeMotion != null) | ||
1600 | cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize()); | ||
1601 | else | ||
1602 | cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]); | ||
1559 | } | 1603 | } |
1560 | 1604 | ||
1561 | /// <summary> | 1605 | /// <summary> |
@@ -1634,6 +1678,9 @@ namespace OpenSim.Data.MySQL | |||
1634 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1678 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1635 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1679 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1636 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | 1680 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); |
1681 | cmd.Parameters.AddWithValue("block_search", settings.GodBlockSearch); | ||
1682 | cmd.Parameters.AddWithValue("casino", settings.Casino); | ||
1683 | |||
1637 | cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); | 1684 | cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); |
1638 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); | 1685 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); |
1639 | } | 1686 | } |
@@ -1794,7 +1841,7 @@ namespace OpenSim.Data.MySQL | |||
1794 | cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); | 1841 | cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); |
1795 | } | 1842 | } |
1796 | 1843 | ||
1797 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) | 1844 | public virtual void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) |
1798 | { | 1845 | { |
1799 | lock (m_dbLock) | 1846 | lock (m_dbLock) |
1800 | { | 1847 | { |
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index aa69d68..a18ac66 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs | |||
@@ -46,17 +46,21 @@ namespace OpenSim.Data.MySQL | |||
46 | { | 46 | { |
47 | string[] words = query.Split(new char[] {' '}); | 47 | string[] words = query.Split(new char[] {' '}); |
48 | 48 | ||
49 | bool valid = false; | ||
50 | |||
49 | for (int i = 0 ; i < words.Length ; i++) | 51 | for (int i = 0 ; i < words.Length ; i++) |
50 | { | 52 | { |
51 | if (words[i].Length < 3) | 53 | if (words[i].Length > 2) |
52 | { | 54 | valid = true; |
53 | if (i != words.Length - 1) | 55 | // if (words[i].Length < 3) |
54 | Array.Copy(words, i + 1, words, i, words.Length - i - 1); | 56 | // { |
55 | Array.Resize(ref words, words.Length - 1); | 57 | // if (i != words.Length - 1) |
56 | } | 58 | // Array.Copy(words, i + 1, words, i, words.Length - i - 1); |
59 | // Array.Resize(ref words, words.Length - 1); | ||
60 | // } | ||
57 | } | 61 | } |
58 | 62 | ||
59 | if (words.Length == 0) | 63 | if ((!valid) || words.Length == 0) |
60 | return new UserAccountData[0]; | 64 | return new UserAccountData[0]; |
61 | 65 | ||
62 | if (words.Length > 2) | 66 | if (words.Length > 2) |
@@ -66,18 +70,33 @@ namespace OpenSim.Data.MySQL | |||
66 | 70 | ||
67 | if (words.Length == 1) | 71 | if (words.Length == 1) |
68 | { | 72 | { |
69 | cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search)", m_Realm); | 73 | cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search) and active=1", m_Realm); |
70 | cmd.Parameters.AddWithValue("?search", "%" + words[0] + "%"); | 74 | cmd.Parameters.AddWithValue("?search", words[0] + "%"); |
71 | cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); | 75 | cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); |
72 | } | 76 | } |
73 | else | 77 | else |
74 | { | 78 | { |
75 | cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst or LastName like ?searchLast)", m_Realm); | 79 | cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst and LastName like ?searchLast) and active=1", m_Realm); |
76 | cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%"); | 80 | cmd.Parameters.AddWithValue("?searchFirst", words[0] + "%"); |
77 | cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%"); | 81 | cmd.Parameters.AddWithValue("?searchLast", words[1] + "%"); |
82 | cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); | ||
83 | } | ||
84 | |||
85 | return DoQuery(cmd); | ||
86 | } | ||
87 | |||
88 | public UserAccountData[] GetUsersWhere(UUID scopeID, string where) | ||
89 | { | ||
90 | MySqlCommand cmd = new MySqlCommand(); | ||
91 | |||
92 | if (scopeID != UUID.Zero) | ||
93 | { | ||
94 | where = "(ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (" + where + ")"; | ||
78 | cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); | 95 | cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString()); |
79 | } | 96 | } |
80 | 97 | ||
98 | cmd.CommandText = String.Format("select * from {0} where " + where, m_Realm); | ||
99 | |||
81 | return DoQuery(cmd); | 100 | return DoQuery(cmd); |
82 | } | 101 | } |
83 | } | 102 | } |
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs index 95ef72a..692ade7 100644 --- a/OpenSim/Data/MySQL/MySQLXAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs | |||
@@ -190,7 +190,7 @@ namespace OpenSim.Data.MySQL | |||
190 | /// </summary> | 190 | /// </summary> |
191 | /// <param name="asset">Asset UUID to create</param> | 191 | /// <param name="asset">Asset UUID to create</param> |
192 | /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> | 192 | /// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks> |
193 | override public void StoreAsset(AssetBase asset) | 193 | override public bool StoreAsset(AssetBase asset) |
194 | { | 194 | { |
195 | lock (m_dbLock) | 195 | lock (m_dbLock) |
196 | { | 196 | { |
@@ -265,7 +265,7 @@ namespace OpenSim.Data.MySQL | |||
265 | 265 | ||
266 | transaction.Rollback(); | 266 | transaction.Rollback(); |
267 | 267 | ||
268 | return; | 268 | return false; |
269 | } | 269 | } |
270 | 270 | ||
271 | if (!ExistsData(dbcon, transaction, hash)) | 271 | if (!ExistsData(dbcon, transaction, hash)) |
@@ -289,7 +289,7 @@ namespace OpenSim.Data.MySQL | |||
289 | 289 | ||
290 | transaction.Rollback(); | 290 | transaction.Rollback(); |
291 | 291 | ||
292 | return; | 292 | return false; |
293 | } | 293 | } |
294 | } | 294 | } |
295 | 295 | ||
@@ -297,6 +297,7 @@ namespace OpenSim.Data.MySQL | |||
297 | } | 297 | } |
298 | } | 298 | } |
299 | } | 299 | } |
300 | return true; | ||
300 | } | 301 | } |
301 | 302 | ||
302 | // private void UpdateAccessTime(AssetBase asset) | 303 | // private void UpdateAccessTime(AssetBase asset) |
@@ -497,4 +498,4 @@ namespace OpenSim.Data.MySQL | |||
497 | 498 | ||
498 | #endregion | 499 | #endregion |
499 | } | 500 | } |
500 | } \ No newline at end of file | 501 | } |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 099beaf..ef99ef8 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT | |||
717 | 717 | ||
718 | COMMIT; | 718 | COMMIT; |
719 | 719 | ||
720 | :VERSION 32 | 720 | :VERSION 32 #--------------------- |
721 | 721 | ||
722 | BEGIN; | 722 | BEGIN; |
723 | CREATE TABLE `regionwindlight` ( | 723 | CREATE TABLE `regionwindlight` ( |
@@ -883,4 +883,3 @@ ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL | |||
883 | 883 | ||
884 | COMMIT; | 884 | COMMIT; |
885 | 885 | ||
886 | |||