diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 13 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 69 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 7 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullSimulationData.cs | 13 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 13 |
5 files changed, 115 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index 47fb6d7..5bb6ec9 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -2207,5 +2207,18 @@ VALUES | |||
2207 | { | 2207 | { |
2208 | return new UUID[0]; | 2208 | return new UUID[0]; |
2209 | } | 2209 | } |
2210 | |||
2211 | public void SaveExtra(UUID regionID, string name, string value) | ||
2212 | { | ||
2213 | } | ||
2214 | |||
2215 | public void RemoveExtra(UUID regionID, string name) | ||
2216 | { | ||
2217 | } | ||
2218 | |||
2219 | public Dictionary<string, string> GetExtra(UUID regionID) | ||
2220 | { | ||
2221 | return null; | ||
2222 | } | ||
2210 | } | 2223 | } |
2211 | } | 2224 | } |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 29bd6b6..4d7c0c9 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -2094,5 +2094,74 @@ namespace OpenSim.Data.MySQL | |||
2094 | } | 2094 | } |
2095 | } | 2095 | } |
2096 | } | 2096 | } |
2097 | |||
2098 | public void SaveExtra(UUID regionID, string name, string val) | ||
2099 | { | ||
2100 | lock (m_dbLock) | ||
2101 | { | ||
2102 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
2103 | { | ||
2104 | dbcon.Open(); | ||
2105 | |||
2106 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
2107 | { | ||
2108 | cmd.CommandText = "replace into regionextra values (?RegionID, ?Name, ?value)"; | ||
2109 | cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); | ||
2110 | cmd.Parameters.AddWithValue("?Name", name); | ||
2111 | cmd.Parameters.AddWithValue("?value", val); | ||
2112 | |||
2113 | cmd.ExecuteNonQuery(); | ||
2114 | } | ||
2115 | } | ||
2116 | } | ||
2117 | } | ||
2118 | |||
2119 | public void RemoveExtra(UUID regionID, string name) | ||
2120 | { | ||
2121 | lock (m_dbLock) | ||
2122 | { | ||
2123 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
2124 | { | ||
2125 | dbcon.Open(); | ||
2126 | |||
2127 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
2128 | { | ||
2129 | cmd.CommandText = "delete from regionextra where RegionID=?RegionID and Name=?Name"; | ||
2130 | cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); | ||
2131 | cmd.Parameters.AddWithValue("?Name", name); | ||
2132 | |||
2133 | cmd.ExecuteNonQuery(); | ||
2134 | } | ||
2135 | } | ||
2136 | } | ||
2137 | } | ||
2138 | |||
2139 | public Dictionary<string, string> GetExtra(UUID regionID) | ||
2140 | { | ||
2141 | Dictionary<string, string> ret = new Dictionary<string, string>(); | ||
2142 | |||
2143 | lock (m_dbLock) | ||
2144 | { | ||
2145 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
2146 | { | ||
2147 | dbcon.Open(); | ||
2148 | |||
2149 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
2150 | { | ||
2151 | cmd.CommandText = "select * from regionextra where RegionID=?RegionID"; | ||
2152 | cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); | ||
2153 | using (IDataReader r = cmd.ExecuteReader()) | ||
2154 | { | ||
2155 | while (r.Read()) | ||
2156 | { | ||
2157 | ret[r["Name"].ToString()] = r["value"].ToString(); | ||
2158 | } | ||
2159 | } | ||
2160 | } | ||
2161 | } | ||
2162 | } | ||
2163 | |||
2164 | return ret; | ||
2165 | } | ||
2097 | } | 2166 | } |
2098 | } | 2167 | } |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index db0d0ec..c4b0832 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -895,3 +895,10 @@ CREATE TABLE `regionenvironment` ( | |||
895 | 895 | ||
896 | COMMIT; | 896 | COMMIT; |
897 | 897 | ||
898 | :VERSION 45 | ||
899 | |||
900 | BEGIN; | ||
901 | |||
902 | CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); | ||
903 | |||
904 | COMMIT; | ||
diff --git a/OpenSim/Data/Null/NullSimulationData.cs b/OpenSim/Data/Null/NullSimulationData.cs index a39ef0b..e7e5c41 100644 --- a/OpenSim/Data/Null/NullSimulationData.cs +++ b/OpenSim/Data/Null/NullSimulationData.cs | |||
@@ -156,5 +156,18 @@ namespace OpenSim.Data.Null | |||
156 | { | 156 | { |
157 | return new UUID[0]; | 157 | return new UUID[0]; |
158 | } | 158 | } |
159 | |||
160 | public void SaveExtra(UUID regionID, string name, string value) | ||
161 | { | ||
162 | } | ||
163 | |||
164 | public void RemoveExtra(UUID regionID, string name) | ||
165 | { | ||
166 | } | ||
167 | |||
168 | public Dictionary<string, string> GetExtra(UUID regionID) | ||
169 | { | ||
170 | return null; | ||
171 | } | ||
159 | } | 172 | } |
160 | } | 173 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 9175a8f..431709f 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -2894,5 +2894,18 @@ namespace OpenSim.Data.SQLite | |||
2894 | { | 2894 | { |
2895 | return new UUID[0]; | 2895 | return new UUID[0]; |
2896 | } | 2896 | } |
2897 | |||
2898 | public void SaveExtra(UUID regionID, string name, string value) | ||
2899 | { | ||
2900 | } | ||
2901 | |||
2902 | public void RemoveExtra(UUID regionID, string name) | ||
2903 | { | ||
2904 | } | ||
2905 | |||
2906 | public Dictionary<string, string> GetExtra(UUID regionID) | ||
2907 | { | ||
2908 | return null; | ||
2909 | } | ||
2897 | } | 2910 | } |
2898 | } | 2911 | } |