diff options
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLSimulationData.cs')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 83 |
1 files changed, 78 insertions, 5 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index d6b1561..d9dfe86 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -675,7 +675,7 @@ VALUES | |||
675 | cmd.ExecuteNonQuery(); | 675 | cmd.ExecuteNonQuery(); |
676 | } | 676 | } |
677 | 677 | ||
678 | sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags]) VALUES (@LandUUID,@AccessUUID,@Flags)"; | 678 | sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags],[Expires]) VALUES (@LandUUID,@AccessUUID,@Flags,@Expires)"; |
679 | 679 | ||
680 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | 680 | using (SqlConnection conn = new SqlConnection(m_connectionString)) |
681 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | 681 | using (SqlCommand cmd = new SqlCommand(sql, conn)) |
@@ -1215,6 +1215,8 @@ VALUES | |||
1215 | //Store new values | 1215 | //Store new values |
1216 | StoreNewRegionSettings(regionSettings); | 1216 | StoreNewRegionSettings(regionSettings); |
1217 | 1217 | ||
1218 | LoadSpawnPoints(regionSettings); | ||
1219 | |||
1218 | return regionSettings; | 1220 | return regionSettings; |
1219 | } | 1221 | } |
1220 | 1222 | ||
@@ -1252,7 +1254,7 @@ VALUES | |||
1252 | ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se | 1254 | ,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se |
1253 | ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit | 1255 | ,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit |
1254 | ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position | 1256 | ,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position |
1255 | ,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id | 1257 | ,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id, [map_tile_id] = @TerrainImageID, [telehubobject] = @telehubobject, [parcel_tile_id] = @ParcelImageID |
1256 | WHERE [regionUUID] = @regionUUID"; | 1258 | WHERE [regionUUID] = @regionUUID"; |
1257 | 1259 | ||
1258 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | 1260 | using (SqlConnection conn = new SqlConnection(m_connectionString)) |
@@ -1263,6 +1265,7 @@ VALUES | |||
1263 | cmd.ExecuteNonQuery(); | 1265 | cmd.ExecuteNonQuery(); |
1264 | } | 1266 | } |
1265 | } | 1267 | } |
1268 | SaveSpawnPoints(regionSettings); | ||
1266 | } | 1269 | } |
1267 | 1270 | ||
1268 | public void Shutdown() | 1271 | public void Shutdown() |
@@ -1383,6 +1386,11 @@ VALUES | |||
1383 | newSettings.LoadedCreationID = ""; | 1386 | newSettings.LoadedCreationID = ""; |
1384 | else | 1387 | else |
1385 | newSettings.LoadedCreationID = (String)row["loaded_creation_id"]; | 1388 | newSettings.LoadedCreationID = (String)row["loaded_creation_id"]; |
1389 | |||
1390 | newSettings.TerrainImageID = new UUID((string)row["map_tile_ID"]); | ||
1391 | newSettings.ParcelImageID = new UUID((Guid)row["parcel_tile_ID"]); | ||
1392 | newSettings.TelehubObject = new UUID((Guid)row["TelehubObject"]); | ||
1393 | |||
1386 | return newSettings; | 1394 | return newSettings; |
1387 | } | 1395 | } |
1388 | 1396 | ||
@@ -1454,6 +1462,13 @@ VALUES | |||
1454 | } | 1462 | } |
1455 | 1463 | ||
1456 | newData.ParcelAccessList = new List<LandAccessEntry>(); | 1464 | newData.ParcelAccessList = new List<LandAccessEntry>(); |
1465 | newData.MediaDescription = (string)row["MediaDescription"]; | ||
1466 | newData.MediaType = (string)row["MediaType"]; | ||
1467 | newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]); | ||
1468 | newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]); | ||
1469 | newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); | ||
1470 | newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); | ||
1471 | newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); | ||
1457 | 1472 | ||
1458 | return newData; | 1473 | return newData; |
1459 | } | 1474 | } |
@@ -1468,7 +1483,7 @@ VALUES | |||
1468 | LandAccessEntry entry = new LandAccessEntry(); | 1483 | LandAccessEntry entry = new LandAccessEntry(); |
1469 | entry.AgentID = new UUID((Guid)row["AccessUUID"]); | 1484 | entry.AgentID = new UUID((Guid)row["AccessUUID"]); |
1470 | entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]); | 1485 | entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]); |
1471 | entry.Expires = 0; | 1486 | entry.Expires = Convert.ToInt32(row["Expires"]); |
1472 | return entry; | 1487 | return entry; |
1473 | } | 1488 | } |
1474 | 1489 | ||
@@ -1497,7 +1512,8 @@ VALUES | |||
1497 | prim.TouchName = (string)primRow["TouchName"]; | 1512 | prim.TouchName = (string)primRow["TouchName"]; |
1498 | // permissions | 1513 | // permissions |
1499 | prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]); | 1514 | prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]); |
1500 | prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); | 1515 | //prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); |
1516 | prim.CreatorIdentification = (string)primRow["CreatorID"]; | ||
1501 | prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); | 1517 | prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); |
1502 | prim.GroupID = new UUID((Guid)primRow["GroupID"]); | 1518 | prim.GroupID = new UUID((Guid)primRow["GroupID"]); |
1503 | prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]); | 1519 | prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]); |
@@ -1691,7 +1707,8 @@ VALUES | |||
1691 | taskItem.Name = (string)inventoryRow["name"]; | 1707 | taskItem.Name = (string)inventoryRow["name"]; |
1692 | taskItem.Description = (string)inventoryRow["description"]; | 1708 | taskItem.Description = (string)inventoryRow["description"]; |
1693 | taskItem.CreationDate = Convert.ToUInt32(inventoryRow["creationDate"]); | 1709 | taskItem.CreationDate = Convert.ToUInt32(inventoryRow["creationDate"]); |
1694 | taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]); | 1710 | //taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]); |
1711 | taskItem.CreatorIdentification = (string)inventoryRow["creatorID"]; | ||
1695 | taskItem.OwnerID = new UUID((Guid)inventoryRow["ownerID"]); | 1712 | taskItem.OwnerID = new UUID((Guid)inventoryRow["ownerID"]); |
1696 | taskItem.LastOwnerID = new UUID((Guid)inventoryRow["lastOwnerID"]); | 1713 | taskItem.LastOwnerID = new UUID((Guid)inventoryRow["lastOwnerID"]); |
1697 | taskItem.GroupID = new UUID((Guid)inventoryRow["groupID"]); | 1714 | taskItem.GroupID = new UUID((Guid)inventoryRow["groupID"]); |
@@ -1792,6 +1809,9 @@ VALUES | |||
1792 | parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime)); | 1809 | parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime)); |
1793 | parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime)); | 1810 | parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime)); |
1794 | parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID)); | 1811 | parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID)); |
1812 | parameters.Add(_Database.CreateParameter("TerrainImageID", settings.TerrainImageID)); | ||
1813 | parameters.Add(_Database.CreateParameter("ParcelImageID", settings.ParcelImageID)); | ||
1814 | parameters.Add(_Database.CreateParameter("TelehubObject", settings.TelehubObject)); | ||
1795 | 1815 | ||
1796 | return parameters.ToArray(); | 1816 | return parameters.ToArray(); |
1797 | } | 1817 | } |
@@ -1859,6 +1879,7 @@ VALUES | |||
1859 | parameters.Add(_Database.CreateParameter("LandUUID", parcelID)); | 1879 | parameters.Add(_Database.CreateParameter("LandUUID", parcelID)); |
1860 | parameters.Add(_Database.CreateParameter("AccessUUID", parcelAccessEntry.AgentID)); | 1880 | parameters.Add(_Database.CreateParameter("AccessUUID", parcelAccessEntry.AgentID)); |
1861 | parameters.Add(_Database.CreateParameter("Flags", parcelAccessEntry.Flags)); | 1881 | parameters.Add(_Database.CreateParameter("Flags", parcelAccessEntry.Flags)); |
1882 | parameters.Add(_Database.CreateParameter("Expires", parcelAccessEntry.Expires)); | ||
1862 | 1883 | ||
1863 | return parameters.ToArray(); | 1884 | return parameters.ToArray(); |
1864 | } | 1885 | } |
@@ -2063,5 +2084,57 @@ VALUES | |||
2063 | #endregion | 2084 | #endregion |
2064 | 2085 | ||
2065 | #endregion | 2086 | #endregion |
2087 | |||
2088 | private void LoadSpawnPoints(RegionSettings rs) | ||
2089 | { | ||
2090 | rs.ClearSpawnPoints(); | ||
2091 | |||
2092 | string sql = "SELECT Yaw, Pitch, Distance FROM spawn_points WHERE RegionUUID = @RegionUUID"; | ||
2093 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | ||
2094 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | ||
2095 | { | ||
2096 | cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID.ToString())); | ||
2097 | conn.Open(); | ||
2098 | using (SqlDataReader reader = cmd.ExecuteReader()) | ||
2099 | { | ||
2100 | if (reader.Read()) | ||
2101 | { | ||
2102 | SpawnPoint sp = new SpawnPoint(); | ||
2103 | |||
2104 | sp.Yaw = (float)reader["Yaw"]; | ||
2105 | sp.Pitch = (float)reader["Pitch"]; | ||
2106 | sp.Distance = (float)reader["Distance"]; | ||
2107 | |||
2108 | rs.AddSpawnPoint(sp); | ||
2109 | } | ||
2110 | } | ||
2111 | } | ||
2112 | } | ||
2113 | |||
2114 | private void SaveSpawnPoints(RegionSettings rs) | ||
2115 | { | ||
2116 | string sql = "DELETE FROM spawn_points WHERE RegionUUID = @RegionUUID"; | ||
2117 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | ||
2118 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | ||
2119 | { | ||
2120 | cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID)); | ||
2121 | conn.Open(); | ||
2122 | cmd.ExecuteNonQuery(); | ||
2123 | } | ||
2124 | foreach (SpawnPoint p in rs.SpawnPoints()) | ||
2125 | { | ||
2126 | sql = "INSERT INTO spawn_points (RegionUUID, Yaw, Pitch, Distance) VALUES (@RegionUUID, @Yaw, @Pitch, @Distance)"; | ||
2127 | using (SqlConnection conn = new SqlConnection(m_connectionString)) | ||
2128 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | ||
2129 | { | ||
2130 | cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID)); | ||
2131 | cmd.Parameters.Add(_Database.CreateParameter("@Yaw", p.Yaw)); | ||
2132 | cmd.Parameters.Add(_Database.CreateParameter("@Pitch", p.Pitch)); | ||
2133 | cmd.Parameters.Add(_Database.CreateParameter("@Distance", p.Distance)); | ||
2134 | conn.Open(); | ||
2135 | cmd.ExecuteNonQuery(); | ||
2136 | } | ||
2137 | } | ||
2138 | } | ||
2066 | } | 2139 | } |
2067 | } | 2140 | } |