aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs1
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs81
-rw-r--r--OpenSim/Data/MySQL/Resources/GridStore.migrations9
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations23
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs12
5 files changed, 115 insertions, 11 deletions
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index 3d647ca..3dd46cb 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -210,7 +210,6 @@ namespace OpenSim.Data.MySQL
210 } 210 }
211 211
212 LoadBanList(es); 212 LoadBanList(es);
213
214 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers"); 213 es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
215 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users"); 214 es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
216 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups"); 215 es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 6d14b82..3123edf 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -846,6 +846,8 @@ namespace OpenSim.Data.MySQL
846 } 846 }
847 } 847 }
848 848
849 LoadSpawnPoints(rs);
850
849 return rs; 851 return rs;
850 } 852 }
851 853
@@ -994,7 +996,9 @@ namespace OpenSim.Data.MySQL
994 "use_estate_sun, fixed_sun, sun_position, " + 996 "use_estate_sun, fixed_sun, sun_position, " +
995 "covenant, Sandbox, sunvectorx, sunvectory, " + 997 "covenant, Sandbox, sunvectorx, sunvectory, " +
996 "sunvectorz, loaded_creation_datetime, " + 998 "sunvectorz, loaded_creation_datetime, " +
997 "loaded_creation_id, map_tile_ID) values (?RegionUUID, ?BlockTerraform, " + 999 "loaded_creation_id, map_tile_ID, " +
1000 "TelehubObject, parcel_tile_ID) " +
1001 "values (?RegionUUID, ?BlockTerraform, " +
998 "?BlockFly, ?AllowDamage, ?RestrictPushing, " + 1002 "?BlockFly, ?AllowDamage, ?RestrictPushing, " +
999 "?AllowLandResell, ?AllowLandJoinDivide, " + 1003 "?AllowLandResell, ?AllowLandJoinDivide, " +
1000 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + 1004 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
@@ -1009,7 +1013,7 @@ namespace OpenSim.Data.MySQL
1009 "?SunPosition, ?Covenant, ?Sandbox, " + 1013 "?SunPosition, ?Covenant, ?Sandbox, " +
1010 "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + 1014 "?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
1011 "?LoadedCreationDateTime, ?LoadedCreationID, " + 1015 "?LoadedCreationDateTime, ?LoadedCreationID, " +
1012 "?TerrainImageID)"; 1016 "?TerrainImageID, ?TelehubObject, ?ParcelImageID) ";
1013 1017
1014 FillRegionSettingsCommand(cmd, rs); 1018 FillRegionSettingsCommand(cmd, rs);
1015 1019
@@ -1017,6 +1021,7 @@ namespace OpenSim.Data.MySQL
1017 } 1021 }
1018 } 1022 }
1019 } 1023 }
1024 SaveSpawnPoints(rs);
1020 } 1025 }
1021 1026
1022 public List<LandData> LoadLandObjects(UUID regionUUID) 1027 public List<LandData> LoadLandObjects(UUID regionUUID)
@@ -1296,6 +1301,8 @@ namespace OpenSim.Data.MySQL
1296 newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; 1301 newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
1297 1302
1298 newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); 1303 newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
1304 newSettings.ParcelImageID = DBGuid.FromDB(row["parcel_tile_ID"]);
1305 newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]);
1299 1306
1300 return newSettings; 1307 return newSettings;
1301 } 1308 }
@@ -1626,7 +1633,8 @@ namespace OpenSim.Data.MySQL
1626 cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); 1633 cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime);
1627 cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); 1634 cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID);
1628 cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); 1635 cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID);
1629 1636 cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID);
1637 cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject);
1630 } 1638 }
1631 1639
1632 /// <summary> 1640 /// <summary>
@@ -1828,5 +1836,72 @@ namespace OpenSim.Data.MySQL
1828 } 1836 }
1829 } 1837 }
1830 } 1838 }
1839
1840 private void LoadSpawnPoints(RegionSettings rs)
1841 {
1842 rs.ClearSpawnPoints();
1843
1844 lock (m_dbLock)
1845 {
1846 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1847 {
1848 dbcon.Open();
1849
1850 using (MySqlCommand cmd = dbcon.CreateCommand())
1851 {
1852 cmd.CommandText = "select Yaw, Pitch, Distance from spawn_points where RegionID = ?RegionID";
1853 cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
1854
1855 using (IDataReader r = cmd.ExecuteReader())
1856 {
1857 while (r.Read())
1858 {
1859 SpawnPoint sp = new SpawnPoint();
1860
1861 sp.Yaw = (float)r["Yaw"];
1862 sp.Pitch = (float)r["Pitch"];
1863 sp.Distance = (float)r["Distance"];
1864
1865 rs.AddSpawnPoint(sp);
1866 }
1867 }
1868 }
1869 }
1870 }
1871 }
1872
1873 private void SaveSpawnPoints(RegionSettings rs)
1874 {
1875 lock (m_dbLock)
1876 {
1877 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
1878 {
1879 dbcon.Open();
1880
1881 using (MySqlCommand cmd = dbcon.CreateCommand())
1882 {
1883 cmd.CommandText = "delete from spawn_points where RegionID = ?RegionID";
1884 cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
1885
1886 cmd.ExecuteNonQuery();
1887
1888 cmd.Parameters.Clear();
1889
1890 cmd.CommandText = "insert into spawn_points (RegionID, Yaw, Pitch, Distance) values ( ?RegionID, ?Yaw, ?Pitch, ?Distance)";
1891
1892 foreach (SpawnPoint p in rs.SpawnPoints())
1893 {
1894 cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
1895 cmd.Parameters.AddWithValue("?Yaw", p.Yaw);
1896 cmd.Parameters.AddWithValue("?Pitch", p.Pitch);
1897 cmd.Parameters.AddWithValue("?Distance", p.Distance);
1898
1899 cmd.ExecuteNonQuery();
1900 cmd.Parameters.Clear();
1901 }
1902 }
1903 }
1904 }
1905 }
1831 } 1906 }
1832} 1907}
diff --git a/OpenSim/Data/MySQL/Resources/GridStore.migrations b/OpenSim/Data/MySQL/Resources/GridStore.migrations
index eda6dbb..98ba8c5 100644
--- a/OpenSim/Data/MySQL/Resources/GridStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/GridStore.migrations
@@ -94,3 +94,12 @@ BEGIN;
94alter table regions modify column regionName varchar(128) default NULL; 94alter table regions modify column regionName varchar(128) default NULL;
95 95
96COMMIT; 96COMMIT;
97
98:VERSION 9 # ------------
99
100BEGIN;
101
102alter table regions add column `parcelMapTexture` varchar(36) default NULL;
103
104COMMIT;
105
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index 987625b..f9b5737 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -841,4 +841,25 @@ alter table regionban ENGINE = MyISAM;
841alter table regionsettings ENGINE = MyISAM; 841alter table regionsettings ENGINE = MyISAM;
842alter table terrain ENGINE = MyISAM; 842alter table terrain ENGINE = MyISAM;
843 843
844COMMIT; \ No newline at end of file 844COMMIT;
845
846:VERSION 39 #--------------- Telehub support
847
848BEGIN;
849CREATE TABLE IF NOT EXISTS `spawn_points` (
850 `RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
851 `Yaw` float NOT NULL,
852 `Pitch` float NOT NULL,
853 `Distance` float NOT NULL,
854 KEY `RegionID` (`RegionID`)
855) ENGINE=Innodb;
856
857ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL;
858COMMIT;
859
860:VERSION 40 #---------------- Parcels for sale
861
862BEGIN;
863ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
864COMMIT;
865
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index 1b93176..1d806fc 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -685,7 +685,7 @@ namespace OpenSim.Data.Tests
685 SceneObjectGroup sog = GetMySOG("object1"); 685 SceneObjectGroup sog = GetMySOG("object1");
686 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); 686 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
687 687
688 Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, i, zero), Is.True); 688 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
689 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 689 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
690 Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))"); 690 Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))");
691 691
@@ -762,7 +762,7 @@ namespace OpenSim.Data.Tests
762 i.CreationDate = creationd; 762 i.CreationDate = creationd;
763 763
764 SceneObjectGroup sog = GetMySOG("object1"); 764 SceneObjectGroup sog = GetMySOG("object1");
765 Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, i, zero), Is.True); 765 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
766 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id); 766 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id);
767 767
768 Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))"); 768 Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))");
@@ -807,10 +807,10 @@ namespace OpenSim.Data.Tests
807 807
808 SceneObjectGroup sog = FindSOG("object1", region1); 808 SceneObjectGroup sog = FindSOG("object1", region1);
809 809
810 Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib1, zero), Is.True); 810 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True);
811 Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib2, zero), Is.True); 811 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True);
812 Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib3, zero), Is.True); 812 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True);
813 Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib4, zero), Is.True); 813 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True);
814 814
815 TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1); 815 TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1);
816 Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))"); 816 Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))");