aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authoronefang2021-08-26 06:21:19 +1000
committeronefang2021-08-26 06:21:19 +1000
commitcdfbb899f1112dab44d5490838765e9bd73bc60e (patch)
tree52cddd0b76e7ad8544a0ada533f91bb5fc402025 /OpenSim/Data
parentStill failing to reconnect for dbCount(), just set the fucking timeout to a y... (diff)
parentDon't strip (OWNER) out of script error report. (diff)
downloadopensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.zip
opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.gz
opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.bz2
opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.xz
Merge branch 'switch' into Domme.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/DBGuids.cs23
-rw-r--r--OpenSim/Data/IRegionData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs14
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs109
-rw-r--r--OpenSim/Data/MySQL/MySQLGroupsData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLRaw.cs197
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs15
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs33
-rw-r--r--OpenSim/Data/MySQL/MySQLUserProfilesData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLXAssetData.cs9
-rw-r--r--OpenSim/Data/MySQL/Resources/AgentPrefs.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/AssetStore.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/AuthStore.migrations4
-rw-r--r--OpenSim/Data/MySQL/Resources/Avatar.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/EstateStore.migrations19
-rw-r--r--OpenSim/Data/MySQL/Resources/FSAssetStore.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/FriendsStore.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/GridStore.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/GridUserStore.migrations7
-rw-r--r--OpenSim/Data/MySQL/Resources/HGTravelStore.migrations9
-rw-r--r--OpenSim/Data/MySQL/Resources/IM_Store.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/InventoryStore.migrations4
-rw-r--r--OpenSim/Data/MySQL/Resources/LogStore.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/MuteListStore.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/Presence.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations25
-rw-r--r--OpenSim/Data/MySQL/Resources/UserAccount.migrations2
-rw-r--r--OpenSim/Data/MySQL/Resources/XAssetStore.migrations4
-rw-r--r--OpenSim/Data/MySQL/Resources/XMute.migrations16
-rw-r--r--OpenSim/Data/MySQL/Resources/os_groups_Store.migrations22
-rw-r--r--OpenSim/Data/Null/NullGenericDataHandler.cs41
-rw-r--r--OpenSim/Data/Null/NullRegionData.cs24
-rw-r--r--OpenSim/Data/Null/NullSimulationData.cs2
-rw-r--r--OpenSim/Data/PGSQL/PGSQLEstateData.cs10
-rw-r--r--OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs49
-rw-r--r--OpenSim/Data/PGSQL/PGSQLGroupsData.cs4
-rw-r--r--OpenSim/Data/PGSQL/PGSQLRegionData.cs21
-rw-r--r--OpenSim/Data/PGSQL/PGSQLSimulationData.cs39
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs2
-rw-r--r--OpenSim/Data/PGSQL/Resources/EstateStore.migrations8
-rw-r--r--OpenSim/Data/PGSQL/Resources/RegionStore.migrations7
-rw-r--r--OpenSim/Data/SQLite/Resources/EstateStore.migrations8
-rw-r--r--OpenSim/Data/SQLite/Resources/MuteListStore.migrations16
-rw-r--r--OpenSim/Data/SQLite/SQLiteEstateData.cs13
-rw-r--r--OpenSim/Data/SQLite/SQLiteMuteListData.cs71
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs14
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserProfilesData.cs4
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs13
49 files changed, 516 insertions, 370 deletions
diff --git a/OpenSim/Data/DBGuids.cs b/OpenSim/Data/DBGuids.cs
index 1a2bf41..ed0e7ca 100644
--- a/OpenSim/Data/DBGuids.cs
+++ b/OpenSim/Data/DBGuids.cs
@@ -47,24 +47,25 @@ namespace OpenSim.Data
47 if ((id == null) || (id == DBNull.Value)) 47 if ((id == null) || (id == DBNull.Value))
48 return UUID.Zero; 48 return UUID.Zero;
49 49
50 if (id.GetType() == typeof(Guid)) 50 Type idtype = id.GetType();
51
52 if (idtype == typeof(Guid))
51 return new UUID((Guid)id); 53 return new UUID((Guid)id);
52 54
53 if (id.GetType() == typeof(byte[])) 55 if (id.GetType() == typeof(string))
54 { 56 {
55 if (((byte[])id).Length == 0) 57 Guid gg;
56 return UUID.Zero; 58 if (Guid.TryParse((string)id, out gg))
57 else if (((byte[])id).Length == 16) 59 return new UUID(gg);
58 return new UUID((byte[])id, 0); 60 return UUID.Zero;
59 } 61 }
60 else if (id.GetType() == typeof(string)) 62
63 if (idtype == typeof(byte[]))
61 { 64 {
62 if (((string)id).Length == 0) 65 if (((byte[])id).Length < 16)
63 return UUID.Zero; 66 return UUID.Zero;
64 else if (((string)id).Length == 36) 67 return new UUID((byte[])id, 0);
65 return new UUID((string)id);
66 } 68 }
67
68 throw new Exception("Failed to convert db value to UUID: " + id.ToString()); 69 throw new Exception("Failed to convert db value to UUID: " + id.ToString());
69 } 70 }
70 } 71 }
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index c8e38a4..218356a 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -71,6 +71,8 @@ namespace OpenSim.Data
71 { 71 {
72 RegionData Get(UUID regionID, UUID ScopeID); 72 RegionData Get(UUID regionID, UUID ScopeID);
73 List<RegionData> Get(string regionName, UUID ScopeID); 73 List<RegionData> Get(string regionName, UUID ScopeID);
74 RegionData GetSpecific(string regionName, UUID ScopeID);
75
74 RegionData Get(int x, int y, UUID ScopeID); 76 RegionData Get(int x, int y, UUID ScopeID);
75 List<RegionData> Get(int xStart, int yStart, int xEnd, int yEnd, UUID ScopeID); 77 List<RegionData> Get(int xStart, int yStart, int xEnd, int yEnd, UUID ScopeID);
76 78
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index eeedf02..2406ee6 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -285,7 +285,7 @@ namespace OpenSim.Data.MySQL
285 285
286 using (MySqlCommand cmd = dbcon.CreateCommand()) 286 using (MySqlCommand cmd = dbcon.CreateCommand())
287 { 287 {
288 cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; 288 cmd.CommandText = "select * from estateban where EstateID = ?EstateID";
289 cmd.Parameters.AddWithValue("?EstateID", es.EstateID); 289 cmd.Parameters.AddWithValue("?EstateID", es.EstateID);
290 290
291 using (IDataReader r = cmd.ExecuteReader()) 291 using (IDataReader r = cmd.ExecuteReader())
@@ -293,13 +293,11 @@ namespace OpenSim.Data.MySQL
293 while (r.Read()) 293 while (r.Read())
294 { 294 {
295 EstateBan eb = new EstateBan(); 295 EstateBan eb = new EstateBan();
296 296 eb.BannedUserID = DBGuid.FromDB(r["bannedUUID"]); ;
297 UUID uuid = new UUID();
298 UUID.TryParse(r["bannedUUID"].ToString(), out uuid);
299
300 eb.BannedUserID = uuid;
301 eb.BannedHostAddress = "0.0.0.0"; 297 eb.BannedHostAddress = "0.0.0.0";
302 eb.BannedHostIPMask = "0.0.0.0"; 298 eb.BannedHostIPMask = "0.0.0.0";
299 eb.BanningUserID = DBGuid.FromDB(r["banningUUID"]);
300 eb.BanTime = Convert.ToInt32(r["banTime"]);
303 es.AddBan(eb); 301 es.AddBan(eb);
304 } 302 }
305 } 303 }
@@ -323,12 +321,14 @@ namespace OpenSim.Data.MySQL
323 321
324 cmd.Parameters.Clear(); 322 cmd.Parameters.Clear();
325 323
326 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( ?EstateID, ?bannedUUID, '', '', '' )"; 324 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask, banningUUID, banTime) values ( ?EstateID, ?bannedUUID, '', '', '', ?banningUUID, ?banTime)";
327 325
328 foreach (EstateBan b in es.EstateBans) 326 foreach (EstateBan b in es.EstateBans)
329 { 327 {
330 cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); 328 cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
331 cmd.Parameters.AddWithValue("?bannedUUID", b.BannedUserID.ToString()); 329 cmd.Parameters.AddWithValue("?bannedUUID", b.BannedUserID.ToString());
330 cmd.Parameters.AddWithValue("?banningUUID", b.BanningUserID.ToString());
331 cmd.Parameters.AddWithValue("?banTime", b.BanTime);
332 332
333 cmd.ExecuteNonQuery(); 333 cmd.ExecuteNonQuery();
334 cmd.Parameters.Clear(); 334 cmd.Parameters.Clear();
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index 9bd3c0c..ce228b5 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -29,11 +29,9 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Data; 30using System.Data;
31using System.Reflection; 31using System.Reflection;
32using log4net; 32using System.Text;
33using MySql.Data.MySqlClient; 33using MySql.Data.MySqlClient;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces;
37 35
38namespace OpenSim.Data.MySQL 36namespace OpenSim.Data.MySQL
39{ 37{
@@ -118,8 +116,40 @@ namespace OpenSim.Data.MySQL
118 } 116 }
119 117
120 public virtual T[] Get(string field, string key) 118 public virtual T[] Get(string field, string key)
119 {
120 using (MySqlCommand cmd = new MySqlCommand())
121 {
122 cmd.Parameters.AddWithValue(field, key);
123 cmd.CommandText = string.Format("select * from {0} where `{1}` = ?{1}", m_Realm, field);
124 return DoQuery(cmd);
125 }
126 }
127
128 public virtual T[] Get(string field, string[] keys)
121 { 129 {
122 return Get(new string[] { field }, new string[] { key }); 130 int flen = keys.Length;
131 if(flen == 0)
132 return new T[0];
133
134 int flast = flen - 1;
135 StringBuilder sb = new StringBuilder(1024);
136 sb.AppendFormat("select * from {0} where {1} IN (?", m_Realm, field);
137 using (MySqlCommand cmd = new MySqlCommand())
138 {
139 for (int i = 0 ; i < flen ; i++)
140 {
141 string fname = field + i.ToString();
142 cmd.Parameters.AddWithValue(fname, keys[i]);
143
144 sb.Append(fname);
145 if(i < flast)
146 sb.Append(",?");
147 else
148 sb.Append(")");
149 }
150 cmd.CommandText = sb.ToString();
151 return DoQuery(cmd);
152 }
123 } 153 }
124 154
125 public virtual T[] Get(string[] fields, string[] keys) 155 public virtual T[] Get(string[] fields, string[] keys)
@@ -129,25 +159,27 @@ namespace OpenSim.Data.MySQL
129 159
130 public virtual T[] Get(string[] fields, string[] keys, string options) 160 public virtual T[] Get(string[] fields, string[] keys, string options)
131 { 161 {
132 if (fields.Length != keys.Length) 162 int flen = fields.Length;
163 if (flen == 0 || flen != keys.Length)
133 return new T[0]; 164 return new T[0];
134 165
135 List<string> terms = new List<string>(); 166 int flast = flen - 1;
167 StringBuilder sb = new StringBuilder(1024);
168 sb.AppendFormat("select * from {0} where ", m_Realm);
136 169
137 using (MySqlCommand cmd = new MySqlCommand()) 170 using (MySqlCommand cmd = new MySqlCommand())
138 { 171 {
139 for (int i = 0 ; i < fields.Length ; i++) 172 for (int i = 0 ; i < flen ; i++)
140 { 173 {
141 cmd.Parameters.AddWithValue(fields[i], keys[i]); 174 cmd.Parameters.AddWithValue(fields[i], keys[i]);
142 terms.Add("`" + fields[i] + "` = ?" + fields[i]); 175 if(i < flast)
176 sb.AppendFormat("`{0}` = ?{0} and ", fields[i]);
177 else
178 sb.AppendFormat("`{0}` = ?{0} ", fields[i]);
143 } 179 }
144 180
145 string where = String.Join(" and ", terms.ToArray()); 181 sb.Append(options);
146 182 cmd.CommandText = sb.ToString();
147 string query = String.Format("select * from {0} where {1} {2}",
148 m_Realm, where, options);
149
150 cmd.CommandText = query;
151 183
152 return DoQuery(cmd); 184 return DoQuery(cmd);
153 } 185 }
@@ -204,7 +236,7 @@ namespace OpenSim.Data.MySQL
204 if (m_Fields[name].FieldType == typeof(bool)) 236 if (m_Fields[name].FieldType == typeof(bool))
205 { 237 {
206 int v = Convert.ToInt32(reader[name]); 238 int v = Convert.ToInt32(reader[name]);
207 m_Fields[name].SetValue(row, v != 0 ? true : false); 239 m_Fields[name].SetValue(row, v != 0);
208 } 240 }
209 else if (m_Fields[name].FieldType == typeof(UUID)) 241 else if (m_Fields[name].FieldType == typeof(UUID))
210 { 242 {
@@ -323,25 +355,26 @@ namespace OpenSim.Data.MySQL
323// "[MYSQL GENERIC TABLE HANDLER]: Delete(string[] fields, string[] keys) invoked with {0}:{1}", 355// "[MYSQL GENERIC TABLE HANDLER]: Delete(string[] fields, string[] keys) invoked with {0}:{1}",
324// string.Join(",", fields), string.Join(",", keys)); 356// string.Join(",", fields), string.Join(",", keys));
325 357
326 if (fields.Length != keys.Length) 358 int flen = fields.Length;
359 if (flen == 0 || flen != keys.Length)
327 return false; 360 return false;
328 361
329 List<string> terms = new List<string>(); 362 int flast = flen - 1;
363 StringBuilder sb = new StringBuilder(1024);
364 sb.AppendFormat("delete from {0} where ", m_Realm);
330 365
331 using (MySqlCommand cmd = new MySqlCommand()) 366 using (MySqlCommand cmd = new MySqlCommand())
332 { 367 {
333 for (int i = 0 ; i < fields.Length ; i++) 368 for (int i = 0 ; i < flen ; i++)
334 { 369 {
335 cmd.Parameters.AddWithValue(fields[i], keys[i]); 370 cmd.Parameters.AddWithValue(fields[i], keys[i]);
336 terms.Add("`" + fields[i] + "` = ?" + fields[i]); 371 if(i < flast)
372 sb.AppendFormat("`{0}` = ?{0} and ", fields[i]);
373 else
374 sb.AppendFormat("`{0}` = ?{0}", fields[i]);
337 } 375 }
338 376
339 string where = String.Join(" and ", terms.ToArray()); 377 cmd.CommandText = sb.ToString();
340
341 string query = String.Format("delete from {0} where {1}", m_Realm, where);
342
343 cmd.CommandText = query;
344
345 return ExecuteNonQuery(cmd) > 0; 378 return ExecuteNonQuery(cmd) > 0;
346 } 379 }
347 } 380 }
@@ -353,27 +386,27 @@ namespace OpenSim.Data.MySQL
353 386
354 public long GetCount(string[] fields, string[] keys) 387 public long GetCount(string[] fields, string[] keys)
355 { 388 {
356 if (fields.Length != keys.Length) 389 int flen = fields.Length;
390 if (flen == 0 || flen != keys.Length)
357 return 0; 391 return 0;
358 392
359 List<string> terms = new List<string>(); 393 int flast = flen - 1;
394 StringBuilder sb = new StringBuilder(1024);
395 sb.AppendFormat("select count(*) from {0} where ", m_Realm);
360 396
361 using (MySqlCommand cmd = new MySqlCommand()) 397 using (MySqlCommand cmd = new MySqlCommand())
362 { 398 {
363 for (int i = 0; i < fields.Length; i++) 399 for (int i = 0 ; i < flen ; i++)
364 { 400 {
365 cmd.Parameters.AddWithValue(fields[i], keys[i]); 401 cmd.Parameters.AddWithValue(fields[i], keys[i]);
366 terms.Add("`" + fields[i] + "` = ?" + fields[i]); 402 if(i < flast)
403 sb.AppendFormat("`{0}` = ?{0} and ", fields[i]);
404 else
405 sb.AppendFormat("`{0}` = ?{0}", fields[i]);
367 } 406 }
368 407
369 string where = String.Join(" and ", terms.ToArray()); 408 cmd.CommandText = sb.ToString();
370 409 object result = DoQueryScalar(cmd);
371 string query = String.Format("select count(*) from {0} where {1}",
372 m_Realm, where);
373
374 cmd.CommandText = query;
375
376 Object result = DoQueryScalar(cmd);
377 410
378 return Convert.ToInt64(result); 411 return Convert.ToInt64(result);
379 } 412 }
@@ -403,7 +436,7 @@ namespace OpenSim.Data.MySQL
403 dbcon.Open(); 436 dbcon.Open();
404 cmd.Connection = dbcon; 437 cmd.Connection = dbcon;
405 438
406 Object ret = cmd.ExecuteScalar(); 439 object ret = cmd.ExecuteScalar();
407 cmd.Connection = null; 440 cmd.Connection = null;
408 dbcon.Close(); 441 dbcon.Close();
409 return ret; 442 return ret;
diff --git a/OpenSim/Data/MySQL/MySQLGroupsData.cs b/OpenSim/Data/MySQL/MySQLGroupsData.cs
index 4e73ee7..77cb2f4 100644
--- a/OpenSim/Data/MySQL/MySQLGroupsData.cs
+++ b/OpenSim/Data/MySQL/MySQLGroupsData.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Data.MySQL
90 else 90 else
91 pattern = string.Format("Name LIKE '%{0}%'", MySqlHelper.EscapeString(pattern)); 91 pattern = string.Format("Name LIKE '%{0}%'", MySqlHelper.EscapeString(pattern));
92 92
93 return m_Groups.Get(string.Format("ShowInList=1 AND ({0}) ORDER BY Name LIMIT 100", pattern)); 93 return m_Groups.Get(string.Format("ShowInList=1 AND ({0})", pattern));
94 } 94 }
95 95
96 public bool DeleteGroup(UUID groupID) 96 public bool DeleteGroup(UUID groupID)
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index b9114eb..23d9683 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -119,4 +119,4 @@ namespace OpenSim.Data.MySQL
119 return true; 119 return true;
120 } 120 }
121 } 121 }
122} \ No newline at end of file 122}
diff --git a/OpenSim/Data/MySQL/MySQLRaw.cs b/OpenSim/Data/MySQL/MySQLRaw.cs
deleted file mode 100644
index bb8c96c..0000000
--- a/OpenSim/Data/MySQL/MySQLRaw.cs
+++ /dev/null
@@ -1,197 +0,0 @@
1// https://dev.mysql.com/doc/connector-net/en/
2
3
4using System;
5using System.Collections;
6using System.Collections.Generic;
7using System.Data;
8using System.Reflection;
9using System.Text;
10using log4net;
11using MySql.Data.MySqlClient;
12
13namespace OpenSim.Data.MySQL
14{
15 public class MySQLRaw
16 {
17 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
18 private string m_connectString;
19
20 public MySQLRaw(string connect)
21 {
22 m_connectString = connect;
23 }
24
25 public int Count(string table)
26 {
27 return Count(table, "");
28 }
29 public int Count(string table, string wher)
30 {
31 string query = "SELECT Count(*) FROM " + table;
32 if ("" != wher)
33 query = query + " WHERE " + wher;
34 int result = -1;
35
36 object r = doScalarQuery(query);
37 if (r != null)
38 result = Convert.ToInt32(r);
39
40 return result;
41 }
42
43 public List< Hashtable > Join(string table, string select, string join, string wher, string order)
44 {
45 if ("" == select)
46 select = "*";
47 string query = "SELECT " + select + " FROM " + table;
48 if ("" != join)
49 query = query + " " + join;
50 if ("" != wher)
51 query = query + " WHERE " + wher;
52 if ("" != order)
53 query = query + " ORDER BY " + order;
54
55 using (MySqlConnection dbcon = new MySqlConnection(m_connectString))
56 {
57 dbcon.Open();
58 MySqlCommand cmd = new MySqlCommand(query, dbcon);
59 MySqlDataReader rdr = cmd.ExecuteReader();
60 List<string> names = new List<string>();
61 DataTable schema = rdr.GetSchemaTable();
62 List< Hashtable > list = new List< Hashtable >();
63
64 foreach (DataRow row in schema.Rows)
65 {
66 string tbl = "";
67 string nm = "";
68 string tp = "";
69 foreach (DataColumn col in schema.Columns)
70 {
71 if ("BaseTableName" == col.ColumnName) tbl = row[col].ToString();
72 if ("ColumnName" == col.ColumnName) nm = row[col].ToString();
73 if ("DataType" == col.ColumnName) tp = row[col].ToString();
74 }
75 names.Add(nm);
76 }
77
78 while (rdr.Read())
79 {
80 Hashtable r = new Hashtable();
81 foreach (string name in names)
82 {
83 r[name] = rdr[name];
84 }
85 list.Add(r);
86 }
87
88 rdr.Close();
89 dbcon.Close();
90 return list;
91 }
92 }
93
94 public List< Hashtable > Select(string table, string select, string wher, string order)
95 {
96 if ("" == select)
97 select = "*";
98 string query = "SELECT " + select + " FROM " + table;
99 if ("" != wher)
100 query = query + " WHERE " + wher;
101 if ("" != order)
102 query = query + " ORDER BY " + order;
103
104 using (MySqlConnection dbcon = new MySqlConnection(m_connectString))
105 {
106 dbcon.Open();
107 MySqlCommand cmd = new MySqlCommand(query, dbcon);
108 MySqlDataReader rdr = cmd.ExecuteReader();
109 List<string> names = new List<string>();
110 DataTable schema = rdr.GetSchemaTable();
111 List< Hashtable > list = new List< Hashtable >();
112
113 foreach (DataRow row in schema.Rows)
114 {
115 string tbl = "";
116 string nm = "";
117 string tp = "";
118 foreach (DataColumn col in schema.Columns)
119 {
120 if ("BaseTableName" == col.ColumnName) tbl = row[col].ToString();
121 if ("ColumnName" == col.ColumnName) nm = row[col].ToString();
122 if ("DataType" == col.ColumnName) tp = row[col].ToString();
123 }
124 names.Add(nm);
125 }
126
127 while (rdr.Read())
128 {
129 Hashtable r = new Hashtable();
130 foreach (string name in names)
131 {
132 r[name] = rdr[name];
133 }
134 list.Add(r);
135 }
136
137 rdr.Close();
138 dbcon.Close();
139 return list;
140 }
141 }
142
143 private object doScalarQuery(string query)
144 {
145 try
146 {
147 using (MySqlConnection dbcon = new MySqlConnection(m_connectString))
148 {
149 dbcon.Open();
150 MySqlCommand cmd = new MySqlCommand(query, dbcon);
151 Object ret = cmd.ExecuteScalar();
152 dbcon.Close();
153 return ret;
154 }
155 }
156 catch (MySqlException e)
157 {
158 m_log.ErrorFormat("[MYSQL RAW]: Problem connecting to the database {0}", e.Message);
159 return null;
160 }
161 }
162
163 private void doNonQuery(string query)
164 {
165 using (MySqlConnection dbcon = new MySqlConnection(m_connectString))
166 {
167 dbcon.Open();
168 MySqlCommand cmd = new MySqlCommand(query, dbcon);
169 cmd.ExecuteNonQuery();
170 dbcon.Close();
171 }
172 }
173
174 public void Insert(string table)
175 {
176 string query = "INSERT INTO " + table + " (name, age) VALUES('John Smith', '33')";
177 doNonQuery(query);
178 }
179
180 public void Update(string table, string wher)
181 {
182 string query = "UPDATE " + table + " SET name='Joe', age='22'";
183 if ("" != wher)
184 query = query + " WHERE " + wher;
185 doNonQuery(query);
186 }
187
188 public void Delete(string table, string wher)
189 {
190 string query = "DELETE FROM " + table;
191 if ("" != wher)
192 query = query + " WHERE " + wher;
193 doNonQuery(query);
194 }
195
196 }
197}
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 46df421..9115e93 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -81,17 +81,15 @@ namespace OpenSim.Data.MySQL
81 } 81 }
82 } 82 }
83 83
84 public RegionData Get(int posX, int posY, UUID scopeID) 84 public RegionData GetSpecific(string regionName, UUID scopeID)
85 { 85 {
86/* fixed size regions 86 string command = "select * from `" + m_Realm + "` where regionName = ?regionName";
87 string command = "select * from `"+m_Realm+"` where locX = ?posX and locY = ?posY";
88 if (scopeID != UUID.Zero) 87 if (scopeID != UUID.Zero)
89 command += " and ScopeID = ?scopeID"; 88 command += " and ScopeID = ?scopeID";
90 89
91 using (MySqlCommand cmd = new MySqlCommand(command)) 90 using (MySqlCommand cmd = new MySqlCommand(command))
92 { 91 {
93 cmd.Parameters.AddWithValue("?posX", posX.ToString()); 92 cmd.Parameters.AddWithValue("?regionName", regionName);
94 cmd.Parameters.AddWithValue("?posY", posY.ToString());
95 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 93 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
96 94
97 List<RegionData> ret = RunCommand(cmd); 95 List<RegionData> ret = RunCommand(cmd);
@@ -100,8 +98,11 @@ namespace OpenSim.Data.MySQL
100 98
101 return ret[0]; 99 return ret[0];
102 } 100 }
103*/ 101
104 // extend database search for maximum region size area 102 }
103
104 public RegionData Get(int posX, int posY, UUID scopeID)
105 {
105 string command = "select * from `" + m_Realm + "` where locX between ?startX and ?endX and locY between ?startY and ?endY"; 106 string command = "select * from `" + m_Realm + "` where locX between ?startX and ?endX and locY between ?startY and ?endY";
106 if (scopeID != UUID.Zero) 107 if (scopeID != UUID.Zero)
107 command += " and ScopeID = ?scopeID"; 108 command += " and ScopeID = ?scopeID";
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index e754522..3db30d8 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -189,7 +189,7 @@ namespace OpenSim.Data.MySQL
189 "AttachedPosY, AttachedPosZ, " + 189 "AttachedPosY, AttachedPosZ, " +
190 "PhysicsShapeType, Density, GravityModifier, " + 190 "PhysicsShapeType, Density, GravityModifier, " +
191 "Friction, Restitution, Vehicle, PhysInertia, DynAttrs, " + 191 "Friction, Restitution, Vehicle, PhysInertia, DynAttrs, " +
192 "RotationAxisLocks" + 192 "RotationAxisLocks, sopanims" +
193 ") values (" + "?UUID, " + 193 ") values (" + "?UUID, " +
194 "?CreationDate, ?Name, ?Text, " + 194 "?CreationDate, ?Name, ?Text, " +
195 "?Description, ?SitName, ?TouchName, " + 195 "?Description, ?SitName, ?TouchName, " +
@@ -226,7 +226,7 @@ namespace OpenSim.Data.MySQL
226 "?AttachedPosY, ?AttachedPosZ, " + 226 "?AttachedPosY, ?AttachedPosZ, " +
227 "?PhysicsShapeType, ?Density, ?GravityModifier, " + 227 "?PhysicsShapeType, ?Density, ?GravityModifier, " +
228 "?Friction, ?Restitution, ?Vehicle, ?PhysInertia, ?DynAttrs," + 228 "?Friction, ?Restitution, ?Vehicle, ?PhysInertia, ?DynAttrs," +
229 "?RotationAxisLocks)"; 229 "?RotationAxisLocks, ?sopanims)";
230 230
231 FillPrimCommand(cmd, prim, obj.UUID, regionUUID); 231 FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
232 232
@@ -598,7 +598,7 @@ namespace OpenSim.Data.MySQL
598 // Legacy entry point for when terrain was always a 256x256 hieghtmap 598 // Legacy entry point for when terrain was always a 256x256 hieghtmap
599 public void StoreTerrain(double[,] ter, UUID regionID) 599 public void StoreTerrain(double[,] ter, UUID regionID)
600 { 600 {
601 StoreTerrain(new HeightmapTerrainData(ter), regionID); 601 StoreTerrain(new TerrainData(ter), regionID);
602 } 602 }
603 603
604 public void StoreTerrain(TerrainData terrData, UUID regionID) 604 public void StoreTerrain(TerrainData terrData, UUID regionID)
@@ -1403,7 +1403,10 @@ namespace OpenSim.Data.MySQL
1403 1403
1404 prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString()); 1404 prim.Sound = DBGuid.FromDB(row["LoopedSound"].ToString());
1405 prim.SoundGain = (float)(double)row["LoopedSoundGain"]; 1405 prim.SoundGain = (float)(double)row["LoopedSoundGain"];
1406 prim.SoundFlags = 1; // If it's persisted at all, it's looped 1406 if (prim.Sound != UUID.Zero)
1407 prim.SoundFlags = 1; // If it's persisted at all, it's looped
1408 else
1409 prim.SoundFlags = 0;
1407 1410
1408 if (!(row["TextureAnimation"] is DBNull)) 1411 if (!(row["TextureAnimation"] is DBNull))
1409 prim.TextureAnimation = (byte[])row["TextureAnimation"]; 1412 prim.TextureAnimation = (byte[])row["TextureAnimation"];
@@ -1463,7 +1466,7 @@ namespace OpenSim.Data.MySQL
1463 if (!(row["DynAttrs"] is System.DBNull)) 1466 if (!(row["DynAttrs"] is System.DBNull))
1464 prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); 1467 prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
1465 else 1468 else
1466 prim.DynAttrs = new DAMap(); 1469 prim.DynAttrs = null;
1467 1470
1468 if (!(row["KeyframeMotion"] is DBNull)) 1471 if (!(row["KeyframeMotion"] is DBNull))
1469 { 1472 {
@@ -1499,6 +1502,19 @@ namespace OpenSim.Data.MySQL
1499 pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString()); 1502 pdata = PhysicsInertiaData.FromXml2(row["PhysInertia"].ToString());
1500 prim.PhysicsInertia = pdata; 1503 prim.PhysicsInertia = pdata;
1501 1504
1505 if (!(row["sopanims"] is DBNull))
1506 {
1507 Byte[] data = (byte[])row["sopanims"];
1508 if (data.Length > 0)
1509 prim.DeSerializeAnimations(data);
1510 else
1511 prim.Animations = null;
1512 }
1513 else
1514 {
1515 prim.Animations = null;
1516 }
1517
1502 return prim; 1518 return prim;
1503 } 1519 }
1504 1520
@@ -1867,7 +1883,7 @@ namespace OpenSim.Data.MySQL
1867 else 1883 else
1868 cmd.Parameters.AddWithValue("Vehicle", String.Empty); 1884 cmd.Parameters.AddWithValue("Vehicle", String.Empty);
1869 1885
1870 if (prim.DynAttrs.CountNamespaces > 0) 1886 if (prim.DynAttrs != null && prim.DynAttrs.CountNamespaces > 0)
1871 cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); 1887 cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml());
1872 else 1888 else
1873 cmd.Parameters.AddWithValue("DynAttrs", null); 1889 cmd.Parameters.AddWithValue("DynAttrs", null);
@@ -1878,6 +1894,11 @@ namespace OpenSim.Data.MySQL
1878 cmd.Parameters.AddWithValue("Friction", (double)prim.Friction); 1894 cmd.Parameters.AddWithValue("Friction", (double)prim.Friction);
1879 cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution); 1895 cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution);
1880 cmd.Parameters.AddWithValue("RotationAxisLocks", prim.RotationAxisLocks); 1896 cmd.Parameters.AddWithValue("RotationAxisLocks", prim.RotationAxisLocks);
1897
1898 if (prim.Animations!= null)
1899 cmd.Parameters.AddWithValue("sopanims", prim.SerializeAnimations());
1900 else
1901 cmd.Parameters.AddWithValue("sopanims", null);
1881 } 1902 }
1882 1903
1883 /// <summary> 1904 /// <summary>
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
index 16637c3..2669aca 100644
--- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
@@ -836,7 +836,7 @@ namespace OpenSim.Data.MySQL
836 836
837 const string queryB = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = ?Id"; 837 const string queryB = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = ?Id";
838 838
839 using (MySqlCommand cmd = new MySqlCommand(string.Format (queryB,"`userpicks`"), dbcon)) 839 using (MySqlCommand cmd = new MySqlCommand(queryB, dbcon))
840 { 840 {
841 cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); 841 cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
842 842
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index 9f9c9cf..5c92be9 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -58,11 +58,6 @@ namespace OpenSim.Data.MySQL
58 private bool m_enableCompression = false; 58 private bool m_enableCompression = false;
59 private string m_connectionString; 59 private string m_connectionString;
60 60
61 /// <summary>
62 /// We can reuse this for all hashing since all methods are single-threaded through m_dbBLock
63 /// </summary>
64 private HashAlgorithm hasher = new SHA256CryptoServiceProvider();
65
66 #region IPlugin Members 61 #region IPlugin Members
67 62
68 public string Version { get { return "1.0.0.0"; } } 63 public string Version { get { return "1.0.0.0"; } }
@@ -250,7 +245,9 @@ namespace OpenSim.Data.MySQL
250 } 245 }
251 } 246 }
252 247
253 byte[] hash = hasher.ComputeHash(asset.Data); 248 byte[] hash;
249 using (HashAlgorithm hasher = new SHA256CryptoServiceProvider())
250 hash = hasher.ComputeHash(asset.Data);
254 251
255// m_log.DebugFormat( 252// m_log.DebugFormat(
256// "[XASSET DB]: Compressed data size for {0} {1}, hash {2} is {3}", 253// "[XASSET DB]: Compressed data size for {0} {1}, hash {2} is {3}",
diff --git a/OpenSim/Data/MySQL/Resources/AgentPrefs.migrations b/OpenSim/Data/MySQL/Resources/AgentPrefs.migrations
index d41ae66..6d864aa 100644
--- a/OpenSim/Data/MySQL/Resources/AgentPrefs.migrations
+++ b/OpenSim/Data/MySQL/Resources/AgentPrefs.migrations
@@ -13,6 +13,6 @@ CREATE TABLE IF NOT EXISTS `AgentPrefs` (
13 `PermNextOwner` INT(6) NOT NULL DEFAULT 532480, 13 `PermNextOwner` INT(6) NOT NULL DEFAULT 532480,
14 UNIQUE KEY `PrincipalID` (`PrincipalID`), 14 UNIQUE KEY `PrincipalID` (`PrincipalID`),
15 PRIMARY KEY(`PrincipalID`) 15 PRIMARY KEY(`PrincipalID`)
16) ENGINE=MyISAM DEFAULT CHARSET=utf8; 16) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
17 17
18COMMIT; 18COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/AssetStore.migrations b/OpenSim/Data/MySQL/Resources/AssetStore.migrations
index 07f521b..dc0b084 100644
--- a/OpenSim/Data/MySQL/Resources/AssetStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/AssetStore.migrations
@@ -16,6 +16,6 @@ CREATE TABLE IF NOT EXISTS `assets` (
16 `asset_flags` int(11) NOT NULL DEFAULT '0', 16 `asset_flags` int(11) NOT NULL DEFAULT '0',
17 `CreatorID` varchar(128) NOT NULL DEFAULT '', 17 `CreatorID` varchar(128) NOT NULL DEFAULT '',
18 PRIMARY KEY (`id`) 18 PRIMARY KEY (`id`)
19) ENGINE=MyISAM DEFAULT CHARSET=utf8; 19) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
20 20
21COMMIT; 21COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/AuthStore.migrations b/OpenSim/Data/MySQL/Resources/AuthStore.migrations
index 8d24fbd..ee2fe17 100644
--- a/OpenSim/Data/MySQL/Resources/AuthStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/AuthStore.migrations
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS `auth` (
9 `webLoginKey` varchar(255) NOT NULL DEFAULT '', 9 `webLoginKey` varchar(255) NOT NULL DEFAULT '',
10 `accountType` varchar(32) NOT NULL DEFAULT 'UserAccount', 10 `accountType` varchar(32) NOT NULL DEFAULT 'UserAccount',
11 PRIMARY KEY (`UUID`) 11 PRIMARY KEY (`UUID`)
12) ENGINE=MyISAM DEFAULT CHARSET=utf8; 12) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
13 13
14CREATE TABLE IF NOT EXISTS `tokens` ( 14CREATE TABLE IF NOT EXISTS `tokens` (
15 `UUID` char(36) NOT NULL, 15 `UUID` char(36) NOT NULL,
@@ -19,6 +19,6 @@ CREATE TABLE IF NOT EXISTS `tokens` (
19 KEY `UUID` (`UUID`), 19 KEY `UUID` (`UUID`),
20 KEY `token` (`token`), 20 KEY `token` (`token`),
21 KEY `validity` (`validity`) 21 KEY `validity` (`validity`)
22) ENGINE=MyISAM DEFAULT CHARSET=utf8; 22) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
23 23
24COMMIT; 24COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/Avatar.migrations b/OpenSim/Data/MySQL/Resources/Avatar.migrations
index 66f75b2..9e11f41 100644
--- a/OpenSim/Data/MySQL/Resources/Avatar.migrations
+++ b/OpenSim/Data/MySQL/Resources/Avatar.migrations
@@ -8,6 +8,6 @@ CREATE TABLE IF NOT EXISTS `Avatars` (
8 `Value` text, 8 `Value` text,
9 PRIMARY KEY (`PrincipalID`,`Name`), 9 PRIMARY KEY (`PrincipalID`,`Name`),
10 KEY `PrincipalID` (`PrincipalID`) 10 KEY `PrincipalID` (`PrincipalID`)
11) ENGINE=MyISAM DEFAULT CHARSET=utf8; 11) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
12 12
13COMMIT; 13COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/EstateStore.migrations b/OpenSim/Data/MySQL/Resources/EstateStore.migrations
index 9c1ed83..87adcca 100644
--- a/OpenSim/Data/MySQL/Resources/EstateStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/EstateStore.migrations
@@ -6,20 +6,20 @@ CREATE TABLE IF NOT EXISTS `estate_groups` (
6 `EstateID` int(10) unsigned NOT NULL, 6 `EstateID` int(10) unsigned NOT NULL,
7 `uuid` char(36) NOT NULL, 7 `uuid` char(36) NOT NULL,
8 KEY `EstateID` (`EstateID`) 8 KEY `EstateID` (`EstateID`)
9) ENGINE=MyISAM DEFAULT CHARSET=utf8; 9) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
10 10
11CREATE TABLE IF NOT EXISTS `estate_managers` ( 11CREATE TABLE IF NOT EXISTS `estate_managers` (
12 `EstateID` int(10) unsigned NOT NULL, 12 `EstateID` int(10) unsigned NOT NULL,
13 `uuid` char(36) NOT NULL, 13 `uuid` char(36) NOT NULL,
14 KEY `EstateID` (`EstateID`) 14 KEY `EstateID` (`EstateID`)
15) ENGINE=MyISAM DEFAULT CHARSET=utf8; 15) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
16 16
17CREATE TABLE IF NOT EXISTS `estate_map` ( 17CREATE TABLE IF NOT EXISTS `estate_map` (
18 `RegionID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', 18 `RegionID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
19 `EstateID` int(11) NOT NULL, 19 `EstateID` int(11) NOT NULL,
20 PRIMARY KEY (`RegionID`), 20 PRIMARY KEY (`RegionID`),
21 KEY `EstateID` (`EstateID`) 21 KEY `EstateID` (`EstateID`)
22) ENGINE=MyISAM DEFAULT CHARSET=utf8; 22) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
23 23
24CREATE TABLE IF NOT EXISTS `estate_settings` ( 24CREATE TABLE IF NOT EXISTS `estate_settings` (
25 `EstateID` int(10) unsigned NOT NULL AUTO_INCREMENT, 25 `EstateID` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -50,13 +50,13 @@ CREATE TABLE IF NOT EXISTS `estate_settings` (
50 `AllowParcelChanges` tinyint(4) NOT NULL DEFAULT '1', 50 `AllowParcelChanges` tinyint(4) NOT NULL DEFAULT '1',
51 `AllowSetHome` tinyint(4) NOT NULL DEFAULT '1', 51 `AllowSetHome` tinyint(4) NOT NULL DEFAULT '1',
52 PRIMARY KEY (`EstateID`) 52 PRIMARY KEY (`EstateID`)
53) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=utf8; 53) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=utf8mb4;
54 54
55CREATE TABLE IF NOT EXISTS `estate_users` ( 55CREATE TABLE IF NOT EXISTS `estate_users` (
56 `EstateID` int(10) unsigned NOT NULL, 56 `EstateID` int(10) unsigned NOT NULL,
57 `uuid` char(36) NOT NULL, 57 `uuid` char(36) NOT NULL,
58 KEY `EstateID` (`EstateID`) 58 KEY `EstateID` (`EstateID`)
59) ENGINE=MyISAM DEFAULT CHARSET=utf8; 59) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
60 60
61CREATE TABLE IF NOT EXISTS `estateban` ( 61CREATE TABLE IF NOT EXISTS `estateban` (
62 `EstateID` int(10) unsigned NOT NULL, 62 `EstateID` int(10) unsigned NOT NULL,
@@ -65,7 +65,14 @@ CREATE TABLE IF NOT EXISTS `estateban` (
65 `bannedIpHostMask` varchar(16) NOT NULL, 65 `bannedIpHostMask` varchar(16) NOT NULL,
66 `bannedNameMask` varchar(64) DEFAULT NULL, 66 `bannedNameMask` varchar(64) DEFAULT NULL,
67 KEY `estateban_EstateID` (`EstateID`) 67 KEY `estateban_EstateID` (`EstateID`)
68) ENGINE=MyISAM DEFAULT CHARSET=utf8; 68) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
69 69
70COMMIT; 70COMMIT;
71 71
72:VERSION 35
73BEGIN;
74ALTER TABLE `estateban`
75 ADD COLUMN `banningUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
76 ADD COLUMN `banTime` int(11) NOT NULL DEFAULT 0;
77COMMIT;
78
diff --git a/OpenSim/Data/MySQL/Resources/FSAssetStore.migrations b/OpenSim/Data/MySQL/Resources/FSAssetStore.migrations
index 3f65d9e..c8f5f66 100644
--- a/OpenSim/Data/MySQL/Resources/FSAssetStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/FSAssetStore.migrations
@@ -13,6 +13,6 @@ CREATE TABLE IF NOT EXISTS `fsassets` (
13 `access_time` int(11) NOT NULL DEFAULT '0', 13 `access_time` int(11) NOT NULL DEFAULT '0',
14 `asset_flags` int(11) NOT NULL DEFAULT '0', 14 `asset_flags` int(11) NOT NULL DEFAULT '0',
15 PRIMARY KEY (`id`) 15 PRIMARY KEY (`id`)
16) ENGINE=MyISAM DEFAULT CHARSET=utf8; 16) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
17 17
18COMMIT; 18COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations
index 7dc7607..ccb1291 100644
--- a/OpenSim/Data/MySQL/Resources/FriendsStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/FriendsStore.migrations
@@ -9,6 +9,6 @@ CREATE TABLE IF NOT EXISTS `Friends` (
9 `Offered` varchar(32) NOT NULL DEFAULT '0', 9 `Offered` varchar(32) NOT NULL DEFAULT '0',
10 PRIMARY KEY (`PrincipalID`(36),`Friend`(36)), 10 PRIMARY KEY (`PrincipalID`(36),`Friend`(36)),
11 KEY `PrincipalID` (`PrincipalID`) 11 KEY `PrincipalID` (`PrincipalID`)
12) ENGINE=MyISAM DEFAULT CHARSET=utf8; 12) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
13 13
14COMMIT; 14COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/GridStore.migrations b/OpenSim/Data/MySQL/Resources/GridStore.migrations
index 4116235..d2775c1 100644
--- a/OpenSim/Data/MySQL/Resources/GridStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/GridStore.migrations
@@ -46,7 +46,7 @@ CREATE TABLE IF NOT EXISTS `regions` (
46 KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`), 46 KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`),
47 KEY `ScopeID` (`ScopeID`), 47 KEY `ScopeID` (`ScopeID`),
48 KEY `flags` (`flags`) 48 KEY `flags` (`flags`)
49) ENGINE=MyISAM DEFAULT CHARSET=utf8; 49) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
50 50
51COMMIT; 51COMMIT;
52 52
diff --git a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations
index dd73974..0cb7d07 100644
--- a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations
@@ -14,6 +14,11 @@ CREATE TABLE IF NOT EXISTS `GridUser` (
14 `Login` CHAR(16) NOT NULL DEFAULT '0', 14 `Login` CHAR(16) NOT NULL DEFAULT '0',
15 `Logout` CHAR(16) NOT NULL DEFAULT '0', 15 `Logout` CHAR(16) NOT NULL DEFAULT '0',
16 PRIMARY KEY (`UserID`) 16 PRIMARY KEY (`UserID`)
17) ENGINE=MyISAM DEFAULT CHARSET=utf8; 17) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
18
19COMMIT;
20
21:VERSION 2 # --------------------------
22BEGIN;
18 23
19COMMIT; 24COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations b/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations
index ed1fede..0766733 100644
--- a/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/HGTravelStore.migrations
@@ -12,6 +12,13 @@ CREATE TABLE IF NOT EXISTS `hg_traveling_data` (
12 `TMStamp` timestamp NOT NULL, 12 `TMStamp` timestamp NOT NULL,
13 PRIMARY KEY (`SessionID`), 13 PRIMARY KEY (`SessionID`),
14 KEY (`UserID`) 14 KEY (`UserID`)
15) ENGINE=MyISAM DEFAULT CHARSET=utf8; 15) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
16 16
17COMMIT; 17COMMIT;
18
19:VERSION 2 # --------------------------
20
21ALTER TABLE `hg_traveling_data` MODIFY `TMStamp` timestamp NOT NULL default CURRENT_TIMESTAMP;
22
23COMMIT;
24
diff --git a/OpenSim/Data/MySQL/Resources/IM_Store.migrations b/OpenSim/Data/MySQL/Resources/IM_Store.migrations
index e271fcc..8394bd9 100644
--- a/OpenSim/Data/MySQL/Resources/IM_Store.migrations
+++ b/OpenSim/Data/MySQL/Resources/IM_Store.migrations
@@ -11,6 +11,6 @@ CREATE TABLE IF NOT EXISTS `im_offline` (
11 PRIMARY KEY (`ID`), 11 PRIMARY KEY (`ID`),
12 KEY `PrincipalID` (`PrincipalID`), 12 KEY `PrincipalID` (`PrincipalID`),
13 KEY `FromID` (`FromID`) 13 KEY `FromID` (`FromID`)
14) ENGINE=MyISAM DEFAULT CHARSET=utf8; 14) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
15 15
16COMMIT; 16COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations
index 7283e41..808cdc9 100644
--- a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations
@@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS `inventoryitems` (
25 PRIMARY KEY (`inventoryID`), 25 PRIMARY KEY (`inventoryID`),
26 KEY `inventoryitems_avatarid` (`avatarID`), 26 KEY `inventoryitems_avatarid` (`avatarID`),
27 KEY `inventoryitems_parentFolderid` (`parentFolderID`) 27 KEY `inventoryitems_parentFolderid` (`parentFolderID`)
28) ENGINE=MyISAM DEFAULT CHARSET=utf8; 28) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
29 29
30CREATE TABLE IF NOT EXISTS `inventoryfolders` ( 30CREATE TABLE IF NOT EXISTS `inventoryfolders` (
31 `folderName` varchar(64) DEFAULT NULL, 31 `folderName` varchar(64) DEFAULT NULL,
@@ -37,6 +37,6 @@ CREATE TABLE IF NOT EXISTS `inventoryfolders` (
37 PRIMARY KEY (`folderID`), 37 PRIMARY KEY (`folderID`),
38 KEY `inventoryfolders_agentid` (`agentID`), 38 KEY `inventoryfolders_agentid` (`agentID`),
39 KEY `inventoryfolders_parentFolderid` (`parentFolderID`) 39 KEY `inventoryfolders_parentFolderid` (`parentFolderID`)
40) ENGINE=MyISAM DEFAULT CHARSET=utf8; 40) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
41 41
42COMMIT; 42COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/LogStore.migrations b/OpenSim/Data/MySQL/Resources/LogStore.migrations
index f2990cc..45959d0 100644
--- a/OpenSim/Data/MySQL/Resources/LogStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/LogStore.migrations
@@ -10,4 +10,4 @@ CREATE TABLE IF NOT EXISTS `logs` (
10 `priority` int(11) default NULL, 10 `priority` int(11) default NULL,
11 `message` text, 11 `message` text,
12 PRIMARY KEY (`logID`) 12 PRIMARY KEY (`logID`)
13) ENGINE=MyISAM DEFAULT CHARSET=utf8; 13) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
diff --git a/OpenSim/Data/MySQL/Resources/MuteListStore.migrations b/OpenSim/Data/MySQL/Resources/MuteListStore.migrations
index 164dc51..a84537e 100644
--- a/OpenSim/Data/MySQL/Resources/MuteListStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/MuteListStore.migrations
@@ -11,6 +11,6 @@ CREATE TABLE IF NOT EXISTS `MuteList` (
11 `Stamp` int(11) NOT NULL, 11 `Stamp` int(11) NOT NULL,
12 UNIQUE KEY `AgentID_2` (`AgentID`,`MuteID`,`MuteName`), 12 UNIQUE KEY `AgentID_2` (`AgentID`,`MuteID`,`MuteName`),
13 KEY `AgentID` (`AgentID`) 13 KEY `AgentID` (`AgentID`)
14) ENGINE=MyISAM DEFAULT CHARSET=utf8; 14) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
15 15
16COMMIT; 16COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/Presence.migrations b/OpenSim/Data/MySQL/Resources/Presence.migrations
index 4d14b9d..50437af 100644
--- a/OpenSim/Data/MySQL/Resources/Presence.migrations
+++ b/OpenSim/Data/MySQL/Resources/Presence.migrations
@@ -11,6 +11,6 @@ CREATE TABLE IF NOT EXISTS `Presence` (
11 UNIQUE KEY `SessionID` (`SessionID`), 11 UNIQUE KEY `SessionID` (`SessionID`),
12 KEY `UserID` (`UserID`), 12 KEY `UserID` (`UserID`),
13 KEY `RegionID` (`RegionID`) 13 KEY `RegionID` (`RegionID`)
14) ENGINE=MyISAM DEFAULT CHARSET=utf8; 14) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
15 15
16COMMIT; 16COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index fb7862a..014d227 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -204,7 +204,7 @@ CREATE TABLE IF NOT EXISTS `land` (
204 `ObscureMusic` tinyint(1) NOT NULL DEFAULT '0', 204 `ObscureMusic` tinyint(1) NOT NULL DEFAULT '0',
205 `ObscureMedia` tinyint(1) NOT NULL DEFAULT '0', 205 `ObscureMedia` tinyint(1) NOT NULL DEFAULT '0',
206 PRIMARY KEY (`UUID`) 206 PRIMARY KEY (`UUID`)
207) ENGINE=MyISAM DEFAULT CHARSET=utf8; 207) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
208 208
209CREATE TABLE IF NOT EXISTS `landaccesslist` ( 209CREATE TABLE IF NOT EXISTS `landaccesslist` (
210 `LandUUID` varchar(255) DEFAULT NULL, 210 `LandUUID` varchar(255) DEFAULT NULL,
@@ -218,7 +218,7 @@ CREATE TABLE IF NOT EXISTS `regionban` (
218 `bannedUUID` varchar(36) NOT NULL, 218 `bannedUUID` varchar(36) NOT NULL,
219 `bannedIp` varchar(16) NOT NULL, 219 `bannedIp` varchar(16) NOT NULL,
220 `bannedIpHostMask` varchar(16) NOT NULL 220 `bannedIpHostMask` varchar(16) NOT NULL
221) ENGINE=MyISAM DEFAULT CHARSET=utf8; 221) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
222 222
223CREATE TABLE IF NOT EXISTS `regionsettings` ( 223CREATE TABLE IF NOT EXISTS `regionsettings` (
224 `regionUUID` char(36) NOT NULL, 224 `regionUUID` char(36) NOT NULL,
@@ -265,7 +265,7 @@ CREATE TABLE IF NOT EXISTS `regionsettings` (
265 `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', 265 `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
266 `covenant_datetime` int(10) unsigned NOT NULL DEFAULT '0', 266 `covenant_datetime` int(10) unsigned NOT NULL DEFAULT '0',
267 PRIMARY KEY (`regionUUID`) 267 PRIMARY KEY (`regionUUID`)
268) ENGINE=MyISAM DEFAULT CHARSET=utf8; 268) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
269 269
270CREATE TABLE IF NOT EXISTS `regionwindlight` ( 270CREATE TABLE IF NOT EXISTS `regionwindlight` (
271 `region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000', 271 `region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
@@ -332,28 +332,28 @@ CREATE TABLE IF NOT EXISTS `regionwindlight` (
332 `cloud_scroll_y_lock` tinyint(1) unsigned NOT NULL DEFAULT '0', 332 `cloud_scroll_y_lock` tinyint(1) unsigned NOT NULL DEFAULT '0',
333 `draw_classic_clouds` tinyint(1) unsigned NOT NULL DEFAULT '1', 333 `draw_classic_clouds` tinyint(1) unsigned NOT NULL DEFAULT '1',
334 PRIMARY KEY (`region_id`) 334 PRIMARY KEY (`region_id`)
335) ENGINE=MyISAM DEFAULT CHARSET=utf8; 335) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
336 336
337CREATE TABLE IF NOT EXISTS `spawn_points` ( 337CREATE TABLE IF NOT EXISTS `spawn_points` (
338 `RegionID` varchar(36) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, 338 `RegionID` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8_unicode_ci NOT NULL,
339 `Yaw` float NOT NULL, 339 `Yaw` float NOT NULL,
340 `Pitch` float NOT NULL, 340 `Pitch` float NOT NULL,
341 `Distance` float NOT NULL, 341 `Distance` float NOT NULL,
342 KEY `RegionID` (`RegionID`) 342 KEY `RegionID` (`RegionID`)
343) ENGINE=MyISAM DEFAULT CHARSET=utf8; 343) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
344 344
345CREATE TABLE IF NOT EXISTS `regionenvironment` ( 345CREATE TABLE IF NOT EXISTS `regionenvironment` (
346 `region_id` varchar(36) NOT NULL, 346 `region_id` varchar(36) NOT NULL,
347 `llsd_settings` text NOT NULL, 347 `llsd_settings` text NOT NULL,
348 PRIMARY KEY (`region_id`) 348 PRIMARY KEY (`region_id`)
349) ENGINE=MyISAM DEFAULT CHARSET=utf8; 349) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
350 350
351CREATE TABLE IF NOT EXISTS `regionextra` ( 351CREATE TABLE IF NOT EXISTS `regionextra` (
352 `RegionID` char(36) NOT NULL, 352 `RegionID` char(36) NOT NULL,
353 `Name` varchar(32) NOT NULL, 353 `Name` varchar(32) NOT NULL,
354 `value` text, 354 `value` text,
355 PRIMARY KEY (`RegionID`,`Name`) 355 PRIMARY KEY (`RegionID`,`Name`)
356) ENGINE=MyISAM DEFAULT CHARSET=utf8; 356) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
357 357
358COMMIT; 358COMMIT;
359 359
@@ -387,7 +387,7 @@ CREATE TABLE IF NOT EXISTS `bakedterrain` (
387 `RegionUUID` varchar(255) DEFAULT NULL, 387 `RegionUUID` varchar(255) DEFAULT NULL,
388 `Revision` int(11) DEFAULT NULL, 388 `Revision` int(11) DEFAULT NULL,
389 `Heightfield` longblob 389 `Heightfield` longblob
390) ENGINE=MyISAM DEFAULT CHARSET=utf8; 390) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
391 391
392COMMIT; 392COMMIT;
393 393
@@ -467,3 +467,10 @@ COMMIT;
467BEGIN; 467BEGIN;
468ALTER TABLE `prims` ADD COLUMN `PhysInertia` TEXT default NULL; 468ALTER TABLE `prims` ADD COLUMN `PhysInertia` TEXT default NULL;
469COMMIT; 469COMMIT;
470
471:VERSION 58 #----- Add sop animations
472
473BEGIN;
474ALTER TABLE `prims` ADD COLUMN `sopanims` blob default NULL;
475COMMIT;
476
diff --git a/OpenSim/Data/MySQL/Resources/UserAccount.migrations b/OpenSim/Data/MySQL/Resources/UserAccount.migrations
index dcb375e..9679562 100644
--- a/OpenSim/Data/MySQL/Resources/UserAccount.migrations
+++ b/OpenSim/Data/MySQL/Resources/UserAccount.migrations
@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `UserAccounts` (
18 KEY `FirstName` (`FirstName`), 18 KEY `FirstName` (`FirstName`),
19 KEY `LastName` (`LastName`), 19 KEY `LastName` (`LastName`),
20 KEY `Name` (`FirstName`,`LastName`) 20 KEY `Name` (`FirstName`,`LastName`)
21) ENGINE=MyISAM DEFAULT CHARSET=utf8; 21) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
22 22
23COMMIT; 23COMMIT;
24 24
diff --git a/OpenSim/Data/MySQL/Resources/XAssetStore.migrations b/OpenSim/Data/MySQL/Resources/XAssetStore.migrations
index 7641a97..42ebd96 100644
--- a/OpenSim/Data/MySQL/Resources/XAssetStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/XAssetStore.migrations
@@ -16,13 +16,13 @@ CREATE TABLE IF NOT EXISTS `XAssetsMeta` (
16 `AssetFlags` int(11) NOT NULL, 16 `AssetFlags` int(11) NOT NULL,
17 `CreatorID` varchar(128) NOT NULL, 17 `CreatorID` varchar(128) NOT NULL,
18 PRIMARY KEY (`id`) 18 PRIMARY KEY (`id`)
19) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Version 1'; 19) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='Version 1';
20 20
21CREATE TABLE IF NOT EXISTS `XAssetsData` ( 21CREATE TABLE IF NOT EXISTS `XAssetsData` (
22 `Hash` binary(32) NOT NULL, 22 `Hash` binary(32) NOT NULL,
23 `Data` longblob NOT NULL, 23 `Data` longblob NOT NULL,
24 PRIMARY KEY (`hash`) 24 PRIMARY KEY (`hash`)
25) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Version 1'; 25) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='Version 1';
26 26
27COMMIT; 27COMMIT;
28 28
diff --git a/OpenSim/Data/MySQL/Resources/XMute.migrations b/OpenSim/Data/MySQL/Resources/XMute.migrations
deleted file mode 100644
index 084c67b..0000000
--- a/OpenSim/Data/MySQL/Resources/XMute.migrations
+++ /dev/null
@@ -1,16 +0,0 @@
1:VERSION 1
2
3BEGIN;
4
5CREATE TABLE IF NOT EXISTS `XMute` (
6 `AgentID` char(36) NOT NULL,
7 `MuteID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
8 `MuteName` varchar(64) NOT NULL DEFAULT '',
9 `MuteType` int(11) NOT NULL DEFAULT '1',
10 `MuteFlags` int(11) NOT NULL DEFAULT '0',
11 `Stamp` int(11) NOT NULL,
12 UNIQUE KEY `AgentID_2` (`AgentID`,`MuteID`,`MuteName`),
13 KEY `AgentID` (`AgentID`)
14) ENGINE=MyISAM DEFAULT CHARSET=utf8;
15
16COMMIT;
diff --git a/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations b/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations
index 0b605ab..e95b768 100644
--- a/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations
+++ b/OpenSim/Data/MySQL/Resources/os_groups_Store.migrations
@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `os_groups_groups` (
18 PRIMARY KEY (`GroupID`), 18 PRIMARY KEY (`GroupID`),
19 UNIQUE KEY `Name` (`Name`), 19 UNIQUE KEY `Name` (`Name`),
20 FULLTEXT KEY `Name_2` (`Name`) 20 FULLTEXT KEY `Name_2` (`Name`)
21) ENGINE=MyISAM DEFAULT CHARSET=utf8; 21) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
22 22
23 23
24CREATE TABLE IF NOT EXISTS `os_groups_membership` ( 24CREATE TABLE IF NOT EXISTS `os_groups_membership` (
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `os_groups_membership` (
31 `AccessToken` char(36) NOT NULL default '', 31 `AccessToken` char(36) NOT NULL default '',
32 PRIMARY KEY (`GroupID`,`PrincipalID`), 32 PRIMARY KEY (`GroupID`,`PrincipalID`),
33 KEY `PrincipalID` (`PrincipalID`) 33 KEY `PrincipalID` (`PrincipalID`)
34) ENGINE=MyISAM DEFAULT CHARSET=utf8; 34) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
35 35
36 36
37CREATE TABLE IF NOT EXISTS `os_groups_roles` ( 37CREATE TABLE IF NOT EXISTS `os_groups_roles` (
@@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `os_groups_roles` (
43 `Powers` bigint(20) unsigned NOT NULL default '0', 43 `Powers` bigint(20) unsigned NOT NULL default '0',
44 PRIMARY KEY (`GroupID`,`RoleID`), 44 PRIMARY KEY (`GroupID`,`RoleID`),
45 KEY `GroupID` (`GroupID`) 45 KEY `GroupID` (`GroupID`)
46) ENGINE=MyISAM DEFAULT CHARSET=utf8; 46) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
47 47
48 48
49CREATE TABLE IF NOT EXISTS `os_groups_rolemembership` ( 49CREATE TABLE IF NOT EXISTS `os_groups_rolemembership` (
@@ -52,7 +52,7 @@ CREATE TABLE IF NOT EXISTS `os_groups_rolemembership` (
52 `PrincipalID` VARCHAR(255) NOT NULL default '', 52 `PrincipalID` VARCHAR(255) NOT NULL default '',
53 PRIMARY KEY (`GroupID`,`RoleID`,`PrincipalID`), 53 PRIMARY KEY (`GroupID`,`RoleID`,`PrincipalID`),
54 KEY `PrincipalID` (`PrincipalID`) 54 KEY `PrincipalID` (`PrincipalID`)
55) ENGINE=MyISAM DEFAULT CHARSET=utf8; 55) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
56 56
57 57
58CREATE TABLE IF NOT EXISTS `os_groups_invites` ( 58CREATE TABLE IF NOT EXISTS `os_groups_invites` (
@@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS `os_groups_invites` (
63 `TMStamp` timestamp NOT NULL, 63 `TMStamp` timestamp NOT NULL,
64 PRIMARY KEY (`InviteID`), 64 PRIMARY KEY (`InviteID`),
65 UNIQUE KEY `PrincipalGroup` (`GroupID`,`PrincipalID`) 65 UNIQUE KEY `PrincipalGroup` (`GroupID`,`PrincipalID`)
66) ENGINE=MyISAM DEFAULT CHARSET=utf8; 66) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
67 67
68 68
69CREATE TABLE IF NOT EXISTS `os_groups_notices` ( 69CREATE TABLE IF NOT EXISTS `os_groups_notices` (
@@ -81,13 +81,13 @@ CREATE TABLE IF NOT EXISTS `os_groups_notices` (
81 PRIMARY KEY (`NoticeID`), 81 PRIMARY KEY (`NoticeID`),
82 KEY `GroupID` (`GroupID`), 82 KEY `GroupID` (`GroupID`),
83 KEY `TMStamp` (`TMStamp`) 83 KEY `TMStamp` (`TMStamp`)
84) ENGINE=MyISAM DEFAULT CHARSET=utf8; 84) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
85 85
86CREATE TABLE IF NOT EXISTS `os_groups_principals` ( 86CREATE TABLE IF NOT EXISTS `os_groups_principals` (
87 `PrincipalID` VARCHAR(255) NOT NULL default '', 87 `PrincipalID` VARCHAR(255) NOT NULL default '',
88 `ActiveGroupID` char(36) NOT NULL default '', 88 `ActiveGroupID` char(36) NOT NULL default '',
89 PRIMARY KEY (`PrincipalID`) 89 PRIMARY KEY (`PrincipalID`)
90) ENGINE=MyISAM DEFAULT CHARSET=utf8; 90) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
91 91
92COMMIT; 92COMMIT;
93 93
@@ -113,3 +113,11 @@ DROP TABLE `diva_groups_principals`;
113DELETE FROM `migrations` WHERE name='diva_im_Store'; 113DELETE FROM `migrations` WHERE name='diva_im_Store';
114 114
115COMMIT; 115COMMIT;
116
117:VERSION 3 # --------------------------
118
119ALTER TABLE `os_groups_invites`
120
121MODIFY `TMStamp` timestamp NOT NULL default CURRENT_TIMESTAMP;
122
123COMMIT;
diff --git a/OpenSim/Data/Null/NullGenericDataHandler.cs b/OpenSim/Data/Null/NullGenericDataHandler.cs
index dd9d190..0b6e49b 100644
--- a/OpenSim/Data/Null/NullGenericDataHandler.cs
+++ b/OpenSim/Data/Null/NullGenericDataHandler.cs
@@ -42,6 +42,47 @@ namespace OpenSim.Data.Null
42 /// </summary> 42 /// </summary>
43 public class NullGenericDataHandler 43 public class NullGenericDataHandler
44 { 44 {
45 protected List<T> Get<T>(string field, string val, List<T> inputEntities)
46 {
47 List<T> entities = inputEntities;
48
49 entities
50 = entities.Where(
51 e =>
52 {
53 FieldInfo fi = typeof(T).GetField(field);
54 if (fi == null)
55 throw new NotImplementedException(string.Format("No field {0} for val {1}", field, val));
56
57 return fi.GetValue(e).ToString() == val;
58 }
59 ).ToList();
60
61 return entities;
62 }
63
64 protected List<T> Get<T>(string field, string[] vals, List<T> inputEntities)
65 {
66 List<T> entities = new List<T>();
67
68 for (int i = 0; i < vals.Length; i++)
69 {
70 entities.AddRange (inputEntities.Where(
71 e =>
72 {
73 FieldInfo fi = typeof(T).GetField(field);
74 if (fi == null)
75 throw new NotImplementedException(string.Format("No field {0} for val {1}", field, vals[i]));
76
77 return fi.GetValue(e).ToString() == vals[i];
78 }
79 ).ToList()
80 );
81 }
82 return entities;
83 }
84
85
45 protected List<T> Get<T>(string[] fields, string[] vals, List<T> inputEntities) 86 protected List<T> Get<T>(string[] fields, string[] vals, List<T> inputEntities)
46 { 87 {
47 List<T> entities = inputEntities; 88 List<T> entities = inputEntities;
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs
index 595db2f..fd60480 100644
--- a/OpenSim/Data/Null/NullRegionData.cs
+++ b/OpenSim/Data/Null/NullRegionData.cs
@@ -68,12 +68,34 @@ namespace OpenSim.Data.Null
68 68
69 private delegate bool Matcher(string value); 69 private delegate bool Matcher(string value);
70 70
71 public RegionData GetSpecific(string regionName, UUID scopeID)
72 {
73 if (m_useStaticInstance && Instance != this)
74 return Instance.GetSpecific(regionName, scopeID);
75
76 string cleanName = regionName.ToLower();
77 Matcher queryMatch;
78 queryMatch = delegate (string s) { return s.Equals(cleanName); };
79
80 lock (m_regionData)
81 {
82 foreach (RegionData r in m_regionData.Values)
83 {
84 // m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanName, r.RegionName.ToLower());
85 if (queryMatch(r.RegionName.ToLower()))
86 return(r);
87 }
88 }
89
90 return null;
91 }
92
71 public List<RegionData> Get(string regionName, UUID scopeID) 93 public List<RegionData> Get(string regionName, UUID scopeID)
72 { 94 {
73 if (m_useStaticInstance && Instance != this) 95 if (m_useStaticInstance && Instance != this)
74 return Instance.Get(regionName, scopeID); 96 return Instance.Get(regionName, scopeID);
75 97
76// m_log.DebugFormat("[NULL REGION DATA]: Getting region {0}, scope {1}", regionName, scopeID); 98 // m_log.DebugFormat("[NULL REGION DATA]: Getting region {0}, scope {1}", regionName, scopeID);
77 99
78 string cleanName = regionName.ToLower(); 100 string cleanName = regionName.ToLower();
79 101
diff --git a/OpenSim/Data/Null/NullSimulationData.cs b/OpenSim/Data/Null/NullSimulationData.cs
index 7bb6da3..97e4b79 100644
--- a/OpenSim/Data/Null/NullSimulationData.cs
+++ b/OpenSim/Data/Null/NullSimulationData.cs
@@ -151,7 +151,7 @@ namespace OpenSim.Data.Null
151 // Legacy. Just don't do this. 151 // Legacy. Just don't do this.
152 public void StoreTerrain(double[,] ter, UUID regionID) 152 public void StoreTerrain(double[,] ter, UUID regionID)
153 { 153 {
154 TerrainData terrData = new HeightmapTerrainData(ter); 154 TerrainData terrData = new TerrainData(ter);
155 StoreTerrain(terrData, regionID); 155 StoreTerrain(terrData, regionID);
156 } 156 }
157 157
diff --git a/OpenSim/Data/PGSQL/PGSQLEstateData.cs b/OpenSim/Data/PGSQL/PGSQLEstateData.cs
index 9489d6c..16e56fa 100644
--- a/OpenSim/Data/PGSQL/PGSQLEstateData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLEstateData.cs
@@ -286,7 +286,7 @@ namespace OpenSim.Data.PGSQL
286 { 286 {
287 es.ClearBans(); 287 es.ClearBans();
288 288
289 string sql = "select \"bannedUUID\" from estateban where \"EstateID\" = :EstateID"; 289 string sql = "select * from estateban where \"EstateID\" = :EstateID";
290 290
291 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 291 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
292 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 292 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
@@ -302,6 +302,8 @@ namespace OpenSim.Data.PGSQL
302 EstateBan eb = new EstateBan(); 302 EstateBan eb = new EstateBan();
303 303
304 eb.BannedUserID = new UUID((Guid)reader["bannedUUID"]); //uuid; 304 eb.BannedUserID = new UUID((Guid)reader["bannedUUID"]); //uuid;
305 eb.BanningUserID = new UUID((Guid)reader["banningUUID"]); //uuid;
306 eb.BanTime = Convert.ToInt32(reader["banTime"]);
305 eb.BannedHostAddress = "0.0.0.0"; 307 eb.BannedHostAddress = "0.0.0.0";
306 eb.BannedHostIPMask = "0.0.0.0"; 308 eb.BannedHostIPMask = "0.0.0.0";
307 es.AddBan(eb); 309 es.AddBan(eb);
@@ -346,11 +348,15 @@ namespace OpenSim.Data.PGSQL
346 cmd.ExecuteNonQuery(); 348 cmd.ExecuteNonQuery();
347 349
348 //Insert after 350 //Insert after
349 cmd.CommandText = "insert into estateban (\"EstateID\", \"bannedUUID\",\"bannedIp\", \"bannedIpHostMask\", \"bannedNameMask\") values ( :EstateID, :bannedUUID, '','','' )"; 351 cmd.CommandText = "insert into estateban (\"EstateID\", \"bannedUUID\",\"bannedIp\", \"bannedIpHostMask\", \"bannedNameMask\", \"banningUUID\",\"banTime\" ) values ( :EstateID, :bannedUUID, '','','', :banningUUID, :banTime )";
350 cmd.Parameters.AddWithValue("bannedUUID", Guid.Empty); 352 cmd.Parameters.AddWithValue("bannedUUID", Guid.Empty);
351 foreach (EstateBan b in es.EstateBans) 353 foreach (EstateBan b in es.EstateBans)
352 { 354 {
355 cmd.Parameters["EstateID"].Value = b.EstateID;
353 cmd.Parameters["bannedUUID"].Value = b.BannedUserID.Guid; 356 cmd.Parameters["bannedUUID"].Value = b.BannedUserID.Guid;
357 cmd.Parameters["banningUUID"].Value = b.BanningUserID.Guid;
358 cmd.Parameters["banTime"].Value = b.BanTime;
359
354 cmd.ExecuteNonQuery(); 360 cmd.ExecuteNonQuery();
355 } 361 }
356 } 362 }
diff --git a/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs b/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs
index 5b24720..a89183b 100644
--- a/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs
+++ b/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs
@@ -180,7 +180,54 @@ namespace OpenSim.Data.PGSQL
180 180
181 public virtual T[] Get(string field, string key) 181 public virtual T[] Get(string field, string key)
182 { 182 {
183 return Get(new string[] { field }, new string[] { key }); 183 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
184 using (NpgsqlCommand cmd = new NpgsqlCommand())
185 {
186 if ( m_FieldTypes.ContainsKey(field) )
187 cmd.Parameters.Add(m_database.CreateParameter(field, key, m_FieldTypes[field]));
188 else
189 cmd.Parameters.Add(m_database.CreateParameter(field, key));
190
191 string query = String.Format("SELECT * FROM {0} WHERE \"{1}\" = :{1}", m_Realm, field, field);
192
193 cmd.Connection = conn;
194 cmd.CommandText = query;
195 conn.Open();
196 return DoQuery(cmd);
197 }
198 }
199
200 public virtual T[] Get(string field, string[] keys)
201 {
202
203 int flen = keys.Length;
204 if(flen == 0)
205 return new T[0];
206
207 int flast = flen - 1;
208 StringBuilder sb = new StringBuilder(1024);
209 sb.AppendFormat("select * from {0} where {1} IN ('", m_Realm, field);
210
211 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
212 using (NpgsqlCommand cmd = new NpgsqlCommand())
213 {
214
215 for (int i = 0 ; i < flen ; i++)
216 {
217 sb.Append(keys[i]);
218 if(i < flast)
219 sb.Append("','");
220 else
221 sb.Append("')");
222 }
223
224 string query = sb.ToString();
225
226 cmd.Connection = conn;
227 cmd.CommandText = query;
228 conn.Open();
229 return DoQuery(cmd);
230 }
184 } 231 }
185 232
186 public virtual T[] Get(string[] fields, string[] keys) 233 public virtual T[] Get(string[] fields, string[] keys)
diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
index f398256..04e2f69 100644
--- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
@@ -86,13 +86,13 @@ namespace OpenSim.Data.PGSQL
86 86
87 if (string.IsNullOrEmpty(pattern)) // True for where clause 87 if (string.IsNullOrEmpty(pattern)) // True for where clause
88 { 88 {
89 pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100"; 89 pattern = "1";
90 90
91 return m_Groups.Get(pattern); 91 return m_Groups.Get(pattern);
92 } 92 }
93 else 93 else
94 { 94 {
95 pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100"; 95 pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%')";
96 96
97 return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); 97 return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern));
98 } 98 }
diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs
index 1272e37..a58fc8a 100644
--- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs
@@ -114,6 +114,27 @@ namespace OpenSim.Data.PGSQL
114 } 114 }
115 } 115 }
116 116
117 public RegionData GetSpecific(string regionName, UUID scopeID)
118 {
119 string sql = "select * from " + m_Realm + " where lower(\"regionName\") = lower(:regionName) ";
120 if (scopeID != UUID.Zero)
121 sql += " and \"ScopeID\" = :scopeID";
122
123 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
124 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
125 {
126 cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName));
127 if (scopeID != UUID.Zero)
128 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
129 conn.Open();
130 List<RegionData> ret = RunCommand(cmd);
131 if (ret.Count == 0)
132 return null;
133
134 return ret[0];
135 }
136 }
137
117 public RegionData Get(int posX, int posY, UUID scopeID) 138 public RegionData Get(int posX, int posY, UUID scopeID)
118 { 139 {
119 // extend database search for maximum region size area 140 // extend database search for maximum region size area
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index f4af40b..99ceb91 100644
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -353,7 +353,7 @@ namespace OpenSim.Data.PGSQL
353 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution, 353 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution,
354 ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID, 354 ""PassCollisions"" = :PassCollisions, ""RotationAxisLocks"" = :RotationAxisLocks, ""RezzerID"" = :RezzerID,
355 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches, 355 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
356 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, 356 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, ""Vehicle"" = :Vehicle,
357 ""PhysInertia"" = :PhysInertia 357 ""PhysInertia"" = :PhysInertia
358 WHERE ""UUID"" = :UUID ; 358 WHERE ""UUID"" = :UUID ;
359 359
@@ -368,7 +368,7 @@ namespace OpenSim.Data.PGSQL
368 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"", 368 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
369 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", 369 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
370 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"", 370 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
371 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""PhysInertia"" 371 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""Vehicle"", ""PhysInertia""
372 ) Select 372 ) Select
373 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, 373 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
374 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, 374 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
@@ -379,7 +379,7 @@ namespace OpenSim.Data.PGSQL
379 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ, 379 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
380 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, 380 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
381 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs, 381 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
382 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :PhysInertia 382 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :Vehicle, :PhysInertia
383 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID); 383 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
384 "; 384 ";
385 385
@@ -610,7 +610,7 @@ namespace OpenSim.Data.PGSQL
610 // Legacy entry point for when terrain was always a 256x256 heightmap 610 // Legacy entry point for when terrain was always a 256x256 heightmap
611 public void StoreTerrain(double[,] terrain, UUID regionID) 611 public void StoreTerrain(double[,] terrain, UUID regionID)
612 { 612 {
613 StoreTerrain(new HeightmapTerrainData(terrain), regionID); 613 StoreTerrain(new TerrainData(terrain), regionID);
614 } 614 }
615 615
616 /// <summary> 616 /// <summary>
@@ -1742,7 +1742,10 @@ namespace OpenSim.Data.PGSQL
1742 1742
1743 prim.Sound = new UUID((Guid)primRow["LoopedSound"]); 1743 prim.Sound = new UUID((Guid)primRow["LoopedSound"]);
1744 prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]); 1744 prim.SoundGain = Convert.ToSingle(primRow["LoopedSoundGain"]);
1745 prim.SoundFlags = 1; // If it's persisted at all, it's looped 1745 if (prim.Sound != UUID.Zero)
1746 prim.SoundFlags = 1; // If it's persisted at all, it's looped
1747 else
1748 prim.SoundFlags = 0;
1746 1749
1747 if (!(primRow["TextureAnimation"] is DBNull)) 1750 if (!(primRow["TextureAnimation"] is DBNull))
1748 prim.TextureAnimation = (Byte[])primRow["TextureAnimation"]; 1751 prim.TextureAnimation = (Byte[])primRow["TextureAnimation"];
@@ -1797,7 +1800,7 @@ namespace OpenSim.Data.PGSQL
1797 if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "") 1800 if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "")
1798 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); 1801 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
1799 else 1802 else
1800 prim.DynAttrs = new DAMap(); 1803 prim.DynAttrs = null;
1801 1804
1802 prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]); 1805 prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]);
1803 prim.Density = Convert.ToSingle(primRow["Density"]); 1806 prim.Density = Convert.ToSingle(primRow["Density"]);
@@ -1805,8 +1808,15 @@ namespace OpenSim.Data.PGSQL
1805 prim.Friction = Convert.ToSingle(primRow["Friction"]); 1808 prim.Friction = Convert.ToSingle(primRow["Friction"]);
1806 prim.Restitution = Convert.ToSingle(primRow["Restitution"]); 1809 prim.Restitution = Convert.ToSingle(primRow["Restitution"]);
1807 prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]); 1810 prim.RotationAxisLocks = Convert.ToByte(primRow["RotationAxisLocks"]);
1808 1811
1809 1812 SOPVehicle vehicle = null;
1813 if (!(primRow["Vehicle"] is System.DBNull))
1814 {
1815 vehicle = SOPVehicle.FromXml2(primRow["Vehicle"].ToString());
1816 if (vehicle != null)
1817 prim.VehicleParams = vehicle;
1818 }
1819
1810 PhysicsInertiaData pdata = null; 1820 PhysicsInertiaData pdata = null;
1811 if (!(primRow["PhysInertia"] is System.DBNull)) 1821 if (!(primRow["PhysInertia"] is System.DBNull))
1812 pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString()); 1822 pdata = PhysicsInertiaData.FromXml2(primRow["PhysInertia"].ToString());
@@ -2214,8 +2224,7 @@ namespace OpenSim.Data.PGSQL
2214 2224
2215 parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches)); 2225 parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches));
2216 parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions)); 2226 parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions));
2217 2227
2218
2219 if (prim.PassTouches) 2228 if (prim.PassTouches)
2220 parameters.Add(_Database.CreateParameter("PassTouches", true)); 2229 parameters.Add(_Database.CreateParameter("PassTouches", true));
2221 else 2230 else
@@ -2228,14 +2237,18 @@ namespace OpenSim.Data.PGSQL
2228 2237
2229 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); 2238 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
2230 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); 2239 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
2231 2240
2241 if (prim.VehicleParams != null)
2242 parameters.Add(_Database.CreateParameter("Vehicle", prim.VehicleParams.ToXml2()));
2243 else
2244 parameters.Add(_Database.CreateParameter("Vehicle", String.Empty));
2245
2232 if (prim.PhysicsInertia != null) 2246 if (prim.PhysicsInertia != null)
2233 parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2())); 2247 parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2()));
2234 else 2248 else
2235 parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty)); 2249 parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty));
2236 2250
2237 2251 if (prim.DynAttrs != null && prim.DynAttrs.CountNamespaces > 0)
2238 if (prim.DynAttrs.CountNamespaces > 0)
2239 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); 2252 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
2240 else 2253 else
2241 parameters.Add(_Database.CreateParameter("DynAttrs", null)); 2254 parameters.Add(_Database.CreateParameter("DynAttrs", null));
diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
index 75a51e2..5800de9 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
@@ -845,7 +845,7 @@ namespace OpenSim.Data.PGSQL
845 845
846 query = "SELECT \"profileImage\", \"profileFirstImage\" FROM \"userprofile\" WHERE \"useruuid\" = :Id"; 846 query = "SELECT \"profileImage\", \"profileFirstImage\" FROM \"userprofile\" WHERE \"useruuid\" = :Id";
847 847
848 using (NpgsqlCommand cmd = new NpgsqlCommand(string.Format(query, "\"userpicks\""), dbcon)) 848 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon))
849 { 849 {
850 cmd.Parameters.Add(m_database.CreateParameter("Id", avatarId)); 850 cmd.Parameters.Add(m_database.CreateParameter("Id", avatarId));
851 851
diff --git a/OpenSim/Data/PGSQL/Resources/EstateStore.migrations b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
index 5b450aa..d0730bb 100644
--- a/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
@@ -125,3 +125,11 @@ CREATE SEQUENCE IF NOT EXISTS "public"."estate_settings_id"
125 CACHE 1; 125 CACHE 1;
126 126
127COMMIT; 127COMMIT;
128
129:VERSION 14
130BEGIN TRANSACTION;
131
132ALTER TABLE "public"."estateban"
133 ADD COLUMN "banningUUID" uuid NOT NULL,
134 ADD COLUMN "banTime" int4 NOT NULL DEFAULT 0;
135COMMIT;
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
index fcefb6b..58e84f7 100644
--- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
@@ -1225,3 +1225,10 @@ ALTER TABLE "public"."prims"
1225 ELSE NULL 1225 ELSE NULL
1226 END; 1226 END;
1227COMMIT; 1227COMMIT;
1228
1229:VERSION 48 #---- field Vehicle to table prims
1230
1231BEGIN TRANSACTION;
1232
1233ALTER TABLE prims ADD "Vehicle" TEXT;
1234COMMIT;
diff --git a/OpenSim/Data/SQLite/Resources/EstateStore.migrations b/OpenSim/Data/SQLite/Resources/EstateStore.migrations
index 37fa1d9..b165b7b 100644
--- a/OpenSim/Data/SQLite/Resources/EstateStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/EstateStore.migrations
@@ -63,7 +63,15 @@ CREATE TABLE IF NOT EXISTS estateban (
63 bannedIpHostMask varchar(16) NOT NULL, 63 bannedIpHostMask varchar(16) NOT NULL,
64 bannedNameMask varchar(64) default NULL 64 bannedNameMask varchar(64) default NULL
65); 65);
66
66CREATE INDEX estate_ban_estate_id on estateban(EstateID); 67CREATE INDEX estate_ban_estate_id on estateban(EstateID);
67 68
68COMMIT; 69COMMIT;
69 70
71:VERSION 11
72BEGIN;
73ALTER TABLE `estateban` ADD COLUMN `banningUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
74ALTER TABLE `estateban` ADD COLUMN `banTime` integer NOT NULL DEFAULT 0;
75COMMIT;
76
77
diff --git a/OpenSim/Data/SQLite/Resources/MuteListStore.migrations b/OpenSim/Data/SQLite/Resources/MuteListStore.migrations
new file mode 100644
index 0000000..f981ded
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/MuteListStore.migrations
@@ -0,0 +1,16 @@
1:VERSION 1
2
3BEGIN TRANSACTION;
4
5CREATE TABLE MuteList (
6 AgentID char(36) NOT NULL,
7 MuteID char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
8 MuteName varchar(64) NOT NULL DEFAULT '',
9 MuteType int(11) NOT NULL DEFAULT '1',
10 MuteFlags int(11) NOT NULL DEFAULT '0',
11 Stamp int(11) NOT NULL,
12 UNIQUE (AgentID, MuteID, MuteName),
13 PRIMARY KEY(AgentID)
14);
15
16COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
index 0fcab21..5e55323 100644
--- a/OpenSim/Data/SQLite/SQLiteEstateData.cs
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -278,7 +278,7 @@ namespace OpenSim.Data.SQLite
278 278
279 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 279 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
280 { 280 {
281 cmd.CommandText = "select bannedUUID from estateban where EstateID = :EstateID"; 281 cmd.CommandText = "select * from estateban where EstateID = :EstateID";
282 cmd.Parameters.AddWithValue(":EstateID", es.EstateID); 282 cmd.Parameters.AddWithValue(":EstateID", es.EstateID);
283 283
284 r = cmd.ExecuteReader(); 284 r = cmd.ExecuteReader();
@@ -288,12 +288,11 @@ namespace OpenSim.Data.SQLite
288 { 288 {
289 EstateBan eb = new EstateBan(); 289 EstateBan eb = new EstateBan();
290 290
291 UUID uuid = new UUID(); 291 eb.BannedUserID = DBGuid.FromDB(r["bannedUUID"]); ;
292 UUID.TryParse(r["bannedUUID"].ToString(), out uuid);
293
294 eb.BannedUserID = uuid;
295 eb.BannedHostAddress = "0.0.0.0"; 292 eb.BannedHostAddress = "0.0.0.0";
296 eb.BannedHostIPMask = "0.0.0.0"; 293 eb.BannedHostIPMask = "0.0.0.0";
294 eb.BanningUserID = DBGuid.FromDB(r["banningUUID"]);
295 eb.BanTime = Convert.ToInt32(r["banTime"]);
297 es.AddBan(eb); 296 es.AddBan(eb);
298 } 297 }
299 r.Close(); 298 r.Close();
@@ -310,12 +309,14 @@ namespace OpenSim.Data.SQLite
310 309
311 cmd.Parameters.Clear(); 310 cmd.Parameters.Clear();
312 311
313 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( :EstateID, :bannedUUID, '', '', '' )"; 312 cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask, banningUUID, banTime) values ( :EstateID, :bannedUUID, '', '', '', :banningUUID, :banTime )";
314 313
315 foreach (EstateBan b in es.EstateBans) 314 foreach (EstateBan b in es.EstateBans)
316 { 315 {
317 cmd.Parameters.AddWithValue(":EstateID", es.EstateID.ToString()); 316 cmd.Parameters.AddWithValue(":EstateID", es.EstateID.ToString());
318 cmd.Parameters.AddWithValue(":bannedUUID", b.BannedUserID.ToString()); 317 cmd.Parameters.AddWithValue(":bannedUUID", b.BannedUserID.ToString());
318 cmd.Parameters.AddWithValue(":banningUUID", b.BanningUserID.ToString());
319 cmd.Parameters.AddWithValue(":banTime", b.BanTime);
319 320
320 cmd.ExecuteNonQuery(); 321 cmd.ExecuteNonQuery();
321 cmd.Parameters.Clear(); 322 cmd.Parameters.Clear();
diff --git a/OpenSim/Data/SQLite/SQLiteMuteListData.cs b/OpenSim/Data/SQLite/SQLiteMuteListData.cs
new file mode 100644
index 0000000..80fd019
--- /dev/null
+++ b/OpenSim/Data/SQLite/SQLiteMuteListData.cs
@@ -0,0 +1,71 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Data;
32using OpenMetaverse;
33using OpenSim.Framework;
34#if CSharpSqlite
35 using Community.CsharpSqlite.Sqlite;
36#else
37 using Mono.Data.Sqlite;
38#endif
39
40namespace OpenSim.Data.SQLite
41{
42 public class SQLiteMuteListData : SQLiteGenericTableHandler<MuteData>, IMuteListData
43 {
44 public SQLiteMuteListData(string connectionString)
45 : base(connectionString, "MuteList", "MuteListStore")
46 {
47 }
48
49 public MuteData[] Get(UUID agentID)
50 {
51 MuteData[] data = base.Get("AgentID", agentID.ToString());
52 return data;
53 }
54
55 public bool Delete(UUID agentID, UUID muteID, string muteName)
56 {
57 using (SqliteCommand cmd = new SqliteCommand())
58 {
59 cmd.CommandText = "delete from MuteList where `AgentID` = :AgentID and `MuteID` = :MuteID and `MuteName` = :MuteName";
60
61 cmd.Parameters.AddWithValue(":AgentID", agentID.ToString());
62 cmd.Parameters.AddWithValue(":MuteID", muteID.ToString());
63 cmd.Parameters.AddWithValue(":MuteName", muteName);
64
65 if (ExecuteNonQuery(cmd, m_Connection) > 0)
66 return true;
67 return false;
68 }
69 }
70 }
71} \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 19880de..1403a8f 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -823,7 +823,7 @@ namespace OpenSim.Data.SQLite
823 // Legacy entry point for when terrain was always a 256x256 hieghtmap 823 // Legacy entry point for when terrain was always a 256x256 hieghtmap
824 public void StoreTerrain(double[,] ter, UUID regionID) 824 public void StoreTerrain(double[,] ter, UUID regionID)
825 { 825 {
826 StoreTerrain(new HeightmapTerrainData(ter), regionID); 826 StoreTerrain(new TerrainData(ter), regionID);
827 } 827 }
828 828
829 /// <summary> 829 /// <summary>
@@ -835,8 +835,7 @@ namespace OpenSim.Data.SQLite
835 { 835 {
836 lock (ds) 836 lock (ds)
837 { 837 {
838 using ( 838 using (SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID", m_conn))
839 SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID", m_conn))
840 { 839 {
841 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); 840 cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
842 cmd.ExecuteNonQuery(); 841 cmd.ExecuteNonQuery();
@@ -1743,7 +1742,10 @@ namespace OpenSim.Data.SQLite
1743 1742
1744 prim.Sound = new UUID(row["LoopedSound"].ToString()); 1743 prim.Sound = new UUID(row["LoopedSound"].ToString());
1745 prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]); 1744 prim.SoundGain = Convert.ToSingle(row["LoopedSoundGain"]);
1746 prim.SoundFlags = 1; // If it's persisted at all, it's looped 1745 if (prim.Sound != UUID.Zero)
1746 prim.SoundFlags = 1; // If it's persisted at all, it's looped
1747 else
1748 prim.SoundFlags = 0;
1747 1749
1748 if (!row.IsNull("TextureAnimation")) 1750 if (!row.IsNull("TextureAnimation"))
1749 prim.TextureAnimation = Convert.FromBase64String(row["TextureAnimation"].ToString()); 1751 prim.TextureAnimation = Convert.FromBase64String(row["TextureAnimation"].ToString());
@@ -1809,7 +1811,7 @@ namespace OpenSim.Data.SQLite
1809 } 1811 }
1810 else 1812 else
1811 { 1813 {
1812 prim.DynAttrs = new DAMap(); 1814 prim.DynAttrs = null;
1813 } 1815 }
1814 1816
1815 prim.PhysicsShapeType = Convert.ToByte(row["PhysicsShapeType"]); 1817 prim.PhysicsShapeType = Convert.ToByte(row["PhysicsShapeType"]);
@@ -2247,7 +2249,7 @@ namespace OpenSim.Data.SQLite
2247 row["AttachedPosY"] = prim.AttachedPos.Y; 2249 row["AttachedPosY"] = prim.AttachedPos.Y;
2248 row["AttachedPosZ"] = prim.AttachedPos.Z; 2250 row["AttachedPosZ"] = prim.AttachedPos.Z;
2249 2251
2250 if (prim.DynAttrs.CountNamespaces > 0) 2252 if (prim.DynAttrs!= null && prim.DynAttrs.CountNamespaces > 0)
2251 row["DynAttrs"] = prim.DynAttrs.ToXml(); 2253 row["DynAttrs"] = prim.DynAttrs.ToXml();
2252 else 2254 else
2253 row["DynAttrs"] = null; 2255 row["DynAttrs"] = null;
diff --git a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
index 13aac79..2f22d54 100644
--- a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
@@ -926,7 +926,7 @@ namespace OpenSim.Data.SQLite
926 { 926 {
927 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 927 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
928 { 928 {
929 cmd.CommandText = query; 929 cmd.CommandText = string.Format(query, "\"classifieds\"");
930 cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); 930 cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
931 931
932 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 932 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
@@ -940,7 +940,7 @@ namespace OpenSim.Data.SQLite
940 940
941 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 941 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
942 { 942 {
943 cmd.CommandText = query; 943 cmd.CommandText = string.Format(query, "\"userpicks\"");
944 cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); 944 cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
945 945
946 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 946 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index 4f81594..ead624a 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -648,11 +648,13 @@ namespace OpenSim.Data.Tests
648 [Test] 648 [Test]
649 public void T020_PrimInventoryEmpty() 649 public void T020_PrimInventoryEmpty()
650 { 650 {
651/*
651 TestHelpers.InMethod(); 652 TestHelpers.InMethod();
652 653
653 SceneObjectGroup sog = GetMySOG("object1"); 654 SceneObjectGroup sog = GetMySOG("object1");
654 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 655 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
655 Assert.That(t, Is.Null); 656 Assert.That(t, Is.Null);
657*/
656 } 658 }
657 659
658 // TODO: Is there any point to call StorePrimInventory on a list, rather than on the prim itself? 660 // TODO: Is there any point to call StorePrimInventory on a list, rather than on the prim itself?
@@ -672,6 +674,7 @@ namespace OpenSim.Data.Tests
672 [Test] 674 [Test]
673 public void T021_PrimInventoryBasic() 675 public void T021_PrimInventoryBasic()
674 { 676 {
677/*
675 TestHelpers.InMethod(); 678 TestHelpers.InMethod();
676 679
677 SceneObjectGroup sog = GetMySOG("object1"); 680 SceneObjectGroup sog = GetMySOG("object1");
@@ -707,11 +710,13 @@ namespace OpenSim.Data.Tests
707 sog = FindSOG("object1", region1); 710 sog = FindSOG("object1", region1);
708 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 711 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
709 Assert.That(t, Is.Null); 712 Assert.That(t, Is.Null);
713*/
710 } 714 }
711 715
712 [Test] 716 [Test]
713 public void T025_PrimInventoryPersistency() 717 public void T025_PrimInventoryPersistency()
714 { 718 {
719/*
715 TestHelpers.InMethod(); 720 TestHelpers.InMethod();
716 721
717 InventoryItemBase i = new InventoryItemBase(); 722 InventoryItemBase i = new InventoryItemBase();
@@ -779,12 +784,14 @@ namespace OpenSim.Data.Tests
779// Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 16), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))"); 784// Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 16), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))");
780 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); 785 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))");
781 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); 786 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))");
787*/
782 } 788 }
783 789/*
784 [Test] 790 [Test]
785 [ExpectedException(typeof(ArgumentException))] 791 [ExpectedException(typeof(ArgumentException))]
786 public void T026_PrimInventoryMany() 792 public void T026_PrimInventoryMany()
787 { 793 {
794
788 TestHelpers.InMethod(); 795 TestHelpers.InMethod();
789 796
790 UUID i1,i2,i3,i4; 797 UUID i1,i2,i3,i4;
@@ -812,8 +819,9 @@ namespace OpenSim.Data.Tests
812 Assert.That(t3.Name, Is.EqualTo(ib3.Name), "Assert.That(t3.Name, Is.EqualTo(ib3.Name))"); 819 Assert.That(t3.Name, Is.EqualTo(ib3.Name), "Assert.That(t3.Name, Is.EqualTo(ib3.Name))");
813 TaskInventoryItem t4 = sog.GetInventoryItem(sog.RootPart.LocalId, i4); 820 TaskInventoryItem t4 = sog.GetInventoryItem(sog.RootPart.LocalId, i4);
814 Assert.That(t4, Is.Null); 821 Assert.That(t4, Is.Null);
815 }
816 822
823 }
824*/
817 [Test] 825 [Test]
818 public void T052_RemoveObject() 826 public void T052_RemoveObject()
819 { 827 {
@@ -1078,7 +1086,6 @@ namespace OpenSim.Data.Tests
1078 sop.Shape = PrimitiveBaseShape.Default; 1086 sop.Shape = PrimitiveBaseShape.Default;
1079 1087
1080 SceneObjectGroup sog = new SceneObjectGroup(sop); 1088 SceneObjectGroup sog = new SceneObjectGroup(sop);
1081// sog.SetScene(scene);
1082 1089
1083 return sog; 1090 return sog;
1084 } 1091 }