aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLEstateData.cs8
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs8
-rw-r--r--OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml11
-rw-r--r--OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql10
-rw-r--r--OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql9
-rw-r--r--OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql10
-rw-r--r--OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql10
-rw-r--r--OpenSim/Data/SQLite/SQLiteEstateData.cs8
-rw-r--r--OpenSim/Data/Tests/BasicEstateTest.cs8
-rw-r--r--OpenSim/Framework/EstateBan.cs85
-rw-r--r--OpenSim/Framework/EstateSettings.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs14
13 files changed, 158 insertions, 33 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLEstateData.cs b/OpenSim/Data/MSSQL/MSSQLEstateData.cs
index 4d5c116..3002fe3 100644
--- a/OpenSim/Data/MSSQL/MSSQLEstateData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLEstateData.cs
@@ -332,9 +332,9 @@ namespace OpenSim.Data.MSSQL
332// UUID uuid; 332// UUID uuid;
333// UUID.TryParse(reader["bannedUUID"].ToString(), out uuid); 333// UUID.TryParse(reader["bannedUUID"].ToString(), out uuid);
334 334
335 eb.bannedUUID = new UUID((Guid)reader["bannedUUID"]); //uuid; 335 eb.BannedUserID = new UUID((Guid)reader["bannedUUID"]); //uuid;
336 eb.bannedIP = "0.0.0.0"; 336 eb.BannedHostAddress = "0.0.0.0";
337 eb.bannedIPHostMask = "0.0.0.0"; 337 eb.BannedHostIPMask = "0.0.0.0";
338 es.AddBan(eb); 338 es.AddBan(eb);
339 } 339 }
340 } 340 }
@@ -386,7 +386,7 @@ namespace OpenSim.Data.MSSQL
386 { 386 {
387 cmd.Parameters.Add(_Database.CreateParameter("@EstateID", es.EstateID)); 387 cmd.Parameters.Add(_Database.CreateParameter("@EstateID", es.EstateID));
388 388
389 cmd.Parameters.Add(_Database.CreateParameter("@bannedUUID", b.bannedUUID)); 389 cmd.Parameters.Add(_Database.CreateParameter("@bannedUUID", b.BannedUserID));
390 390
391 cmd.ExecuteNonQuery(); 391 cmd.ExecuteNonQuery();
392 392
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index 0db624d..133ee7a 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -314,9 +314,9 @@ namespace OpenSim.Data.MySQL
314 UUID uuid = new UUID(); 314 UUID uuid = new UUID();
315 UUID.TryParse(r["bannedUUID"].ToString(), out uuid); 315 UUID.TryParse(r["bannedUUID"].ToString(), out uuid);
316 316
317 eb.bannedUUID = uuid; 317 eb.BannedUserID = uuid;
318 eb.bannedIP = "0.0.0.0"; 318 eb.BannedHostAddress = "0.0.0.0";
319 eb.bannedIPHostMask = "0.0.0.0"; 319 eb.BannedHostIPMask = "0.0.0.0";
320 es.AddBan(eb); 320 es.AddBan(eb);
321 } 321 }
322 r.Close(); 322 r.Close();
@@ -340,7 +340,7 @@ namespace OpenSim.Data.MySQL
340 foreach (EstateBan b in es.EstateBans) 340 foreach (EstateBan b in es.EstateBans)
341 { 341 {
342 cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); 342 cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
343 cmd.Parameters.AddWithValue("?bannedUUID", b.bannedUUID.ToString()); 343 cmd.Parameters.AddWithValue("?bannedUUID", b.BannedUserID.ToString());
344 344
345 cmd.ExecuteNonQuery(); 345 cmd.ExecuteNonQuery();
346 cmd.Parameters.Clear(); 346 cmd.Parameters.Clear();
diff --git a/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml b/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml
index d8c8975..d300b93 100644
--- a/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/EstateSettings.hbm.xml
@@ -52,6 +52,17 @@
52 <index column="ArrayIndex" /> 52 <index column="ArrayIndex" />
53 <element column="GroupID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" /> 53 <element column="GroupID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate" />
54 </array> 54 </array>
55
56 <array name="EstateBans" table="EstateBans" cascade="all">
57 <key column="EstateID" />
58 <index column="ArrayIndex" />
59 <composite-element class="OpenSim.Framework.EstateBan, OpenSim.Framework">
60 <property name="BannedUserID" column="BannedUserID" type="OpenSim.Data.NHibernate.UUIDUserType, OpenSim.Data.NHibernate"/>
61 <property name="BannedHostAddress" column="BannedHostAddress" type="String" length="16"/>
62 <property name="BannedHostIPMask" column="BannedHostIPMask" type="String" length="16"/>
63 <property name="BannedHostNameMask" column="BannedHostNameMask" type="String" length="16"/>
64 </composite-element>
65 </array>
55 66
56 </class> 67 </class>
57</hibernate-mapping> 68</hibernate-mapping>
diff --git a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql
index b852cbc..dd579f9 100644
--- a/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MsSql2005Dialect/001_EstateStore.sql
@@ -59,4 +59,14 @@ CREATE TABLE EstateGroups (
59 GroupID NVARCHAR(36) NOT NULL, 59 GroupID NVARCHAR(36) NOT NULL,
60 ArrayIndex INT NOT NULL, 60 ArrayIndex INT NOT NULL,
61 PRIMARY KEY (EstateID,ArrayIndex) 61 PRIMARY KEY (EstateID,ArrayIndex)
62);
63
64CREATE TABLE EstateBans (
65 EstateID INT NOT NULL,
66 ArrayIndex INT NOT NULL,
67 BannedUserID NVARCHAR(36) NOT NULL,
68 BannedHostAddress NVARCHAR(16) NOT NULL,
69 BannedHostIPMask NVARCHAR(16) NOT NULL,
70 BannedHostNameMask NVARCHAR(16) NOT NULL,
71 PRIMARY KEY (EstateID,ArrayIndex)
62); \ No newline at end of file 72); \ No newline at end of file
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql
index 69635d8..e9ae07e 100644
--- a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_EstateStore.sql
@@ -60,3 +60,12 @@ CREATE TABLE EstateGroups (
60 PRIMARY KEY (EstateID,ArrayIndex) 60 PRIMARY KEY (EstateID,ArrayIndex)
61) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; 61) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
62 62
63CREATE TABLE EstateBans (
64 EstateID INT NOT NULL,
65 ArrayIndex INT NOT NULL,
66 BannedUserID VARCHAR(36) NOT NULL,
67 BannedHostAddress VARCHAR(16) NOT NULL,
68 BannedHostIPMask VARCHAR(16) NOT NULL,
69 BannedHostNameMask VARCHAR(16) NOT NULL,
70 PRIMARY KEY (EstateID,ArrayIndex)
71) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
diff --git a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql
index d13a4d3..3f47930 100644
--- a/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/PostgreSQLDialect/001_EstateStore.sql
@@ -59,4 +59,14 @@ CREATE TABLE EstateGroups (
59 GroupID VARCHAR(36) NOT NULL, 59 GroupID VARCHAR(36) NOT NULL,
60 ArrayIndex INT NOT NULL, 60 ArrayIndex INT NOT NULL,
61 PRIMARY KEY (EstateID,ArrayIndex) 61 PRIMARY KEY (EstateID,ArrayIndex)
62);
63
64CREATE TABLE EstateBans (
65 EstateID INT NOT NULL,
66 ArrayIndex INT NOT NULL,
67 BannedUserID VARCHAR(36) NOT NULL,
68 BannedHostAddress VARCHAR(16) NOT NULL,
69 BannedHostIPMask VARCHAR(16) NOT NULL,
70 BannedHostNameMask VARCHAR(16) NOT NULL,
71 PRIMARY KEY (EstateID,ArrayIndex)
62); \ No newline at end of file 72); \ No newline at end of file
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql
index 6e67630..afe702f 100644
--- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_EstateStore.sql
@@ -59,3 +59,13 @@ CREATE TABLE EstateGroups (
59 ArrayIndex INT NOT NULL, 59 ArrayIndex INT NOT NULL,
60 PRIMARY KEY (EstateID,ArrayIndex) 60 PRIMARY KEY (EstateID,ArrayIndex)
61); 61);
62
63CREATE TABLE EstateBans (
64 EstateID INT NOT NULL,
65 ArrayIndex INT NOT NULL,
66 BannedUserID VARCHAR(36) NOT NULL,
67 BannedHostAddress VARCHAR(16) NOT NULL,
68 BannedHostIPMask VARCHAR(16) NOT NULL,
69 BannedHostNameMask VARCHAR(16) NOT NULL,
70 PRIMARY KEY (EstateID,ArrayIndex)
71);
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
index 3fb33c2..dea5624 100644
--- a/OpenSim/Data/SQLite/SQLiteEstateData.cs
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -258,9 +258,9 @@ namespace OpenSim.Data.SQLite
258 UUID uuid = new UUID(); 258 UUID uuid = new UUID();
259 UUID.TryParse(r["bannedUUID"].ToString(), out uuid); 259 UUID.TryParse(r["bannedUUID"].ToString(), out uuid);
260 260
261 eb.bannedUUID = uuid; 261 eb.BannedUserID = uuid;
262 eb.bannedIP = "0.0.0.0"; 262 eb.BannedHostAddress = "0.0.0.0";
263 eb.bannedIPHostMask = "0.0.0.0"; 263 eb.BannedHostIPMask = "0.0.0.0";
264 es.AddBan(eb); 264 es.AddBan(eb);
265 } 265 }
266 r.Close(); 266 r.Close();
@@ -282,7 +282,7 @@ namespace OpenSim.Data.SQLite
282 foreach (EstateBan b in es.EstateBans) 282 foreach (EstateBan b in es.EstateBans)
283 { 283 {
284 cmd.Parameters.Add(":EstateID", es.EstateID.ToString()); 284 cmd.Parameters.Add(":EstateID", es.EstateID.ToString());
285 cmd.Parameters.Add(":bannedUUID", b.bannedUUID.ToString()); 285 cmd.Parameters.Add(":bannedUUID", b.BannedUserID.ToString());
286 286
287 cmd.ExecuteNonQuery(); 287 cmd.ExecuteNonQuery();
288 cmd.Parameters.Clear(); 288 cmd.Parameters.Clear();
diff --git a/OpenSim/Data/Tests/BasicEstateTest.cs b/OpenSim/Data/Tests/BasicEstateTest.cs
index b37a392..f94ac46 100644
--- a/OpenSim/Data/Tests/BasicEstateTest.cs
+++ b/OpenSim/Data/Tests/BasicEstateTest.cs
@@ -223,10 +223,10 @@ namespace OpenSim.Data.Tests
223 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID); 223 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);
224 224
225 EstateBan estateBan1 = new EstateBan(); 225 EstateBan estateBan1 = new EstateBan();
226 estateBan1.bannedUUID = DataTestUtil.UUID_MIN; 226 estateBan1.BannedUserID = DataTestUtil.UUID_MIN;
227 227
228 EstateBan estateBan2 = new EstateBan(); 228 EstateBan estateBan2 = new EstateBan();
229 estateBan2.bannedUUID = DataTestUtil.UUID_MAX; 229 estateBan2.BannedUserID = DataTestUtil.UUID_MAX;
230 230
231 originalSettings.EstateBans = new EstateBan[] { estateBan1, estateBan2 }; 231 originalSettings.EstateBans = new EstateBan[] { estateBan1, estateBan2 };
232 232
@@ -237,9 +237,9 @@ namespace OpenSim.Data.Tests
237 EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID); 237 EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);
238 238
239 Assert.AreEqual(2, loadedSettings.EstateBans.Length); 239 Assert.AreEqual(2, loadedSettings.EstateBans.Length);
240 Assert.AreEqual(DataTestUtil.UUID_MIN, loadedSettings.EstateBans[0].bannedUUID); 240 Assert.AreEqual(DataTestUtil.UUID_MIN, loadedSettings.EstateBans[0].BannedUserID);
241 241
242 Assert.AreEqual(DataTestUtil.UUID_MAX, loadedSettings.EstateBans[1].bannedUUID); 242 Assert.AreEqual(DataTestUtil.UUID_MAX, loadedSettings.EstateBans[1].BannedUserID);
243 243
244 } 244 }
245 245
diff --git a/OpenSim/Framework/EstateBan.cs b/OpenSim/Framework/EstateBan.cs
index 5c3aa42..64d32e8 100644
--- a/OpenSim/Framework/EstateBan.cs
+++ b/OpenSim/Framework/EstateBan.cs
@@ -31,10 +31,85 @@ namespace OpenSim.Framework
31{ 31{
32 public class EstateBan 32 public class EstateBan
33 { 33 {
34 public uint estateID = 1; 34 private uint m_estateID = 1;
35 public UUID bannedUUID = UUID.Zero; 35 /// <summary>
36 public string bannedIP = string.Empty; 36 /// ID of the estate this ban limits access to.
37 public string bannedIPHostMask = string.Empty; 37 /// </summary>
38 public string bannedNameMask = string.Empty; 38 public uint EstateID
39 {
40 get
41 {
42 return m_estateID;
43 }
44 set
45 {
46 m_estateID = value;
47 }
48 }
49
50 private UUID m_bannedUserID = UUID.Zero;
51 /// <summary>
52 /// ID of the banned user.
53 /// </summary>
54 public UUID BannedUserID
55 {
56 get
57 {
58 return m_bannedUserID;
59 }
60 set
61 {
62 m_bannedUserID = value;
63 }
64 }
65
66 private string m_bannedHostAddress = string.Empty;
67 /// <summary>
68 /// IP address or domain name of the banned client.
69 /// </summary>
70 public string BannedHostAddress
71 {
72 get
73 {
74 return m_bannedHostAddress;
75 }
76 set
77 {
78 m_bannedHostAddress = value;
79 }
80 }
81
82 private string m_bannedHostIPMask = string.Empty;
83 /// <summary>
84 /// IP address mask for banning group of client hosts.
85 /// </summary>
86 public string BannedHostIPMask
87 {
88 get
89 {
90 return m_bannedHostIPMask;
91 }
92 set
93 {
94 m_bannedHostIPMask = value;
95 }
96 }
97
98 private string m_bannedHostNameMask = string.Empty;
99 /// <summary>
100 /// Domain name mask for banning group of client hosts.
101 /// </summary>
102 public string BannedHostNameMask
103 {
104 get
105 {
106 return m_bannedHostNameMask;
107 }
108 set
109 {
110 m_bannedHostNameMask = value;
111 }
112 }
113
39 } 114 }
40} 115}
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index 81f85cd..b84d1d7 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -333,7 +333,7 @@ namespace OpenSim.Framework
333 public bool IsBanned(UUID avatarID) 333 public bool IsBanned(UUID avatarID)
334 { 334 {
335 foreach (EstateBan ban in l_EstateBans) 335 foreach (EstateBan ban in l_EstateBans)
336 if (ban.bannedUUID == avatarID) 336 if (ban.BannedUserID == avatarID)
337 return true; 337 return true;
338 return false; 338 return false;
339 } 339 }
@@ -342,7 +342,7 @@ namespace OpenSim.Framework
342 { 342 {
343 if (ban == null) 343 if (ban == null)
344 return; 344 return;
345 if (!IsBanned(ban.bannedUUID)) 345 if (!IsBanned(ban.BannedUserID))
346 l_EstateBans.Add(ban); 346 l_EstateBans.Add(ban);
347 } 347 }
348 348
@@ -354,7 +354,7 @@ namespace OpenSim.Framework
354 public void RemoveBan(UUID avatarID) 354 public void RemoveBan(UUID avatarID)
355 { 355 {
356 foreach (EstateBan ban in new List<EstateBan>(l_EstateBans)) 356 foreach (EstateBan ban in new List<EstateBan>(l_EstateBans))
357 if (ban.bannedUUID == avatarID) 357 if (ban.BannedUserID == avatarID)
358 l_EstateBans.Remove(ban); 358 l_EstateBans.Remove(ban);
359 } 359 }
360 360
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 34ad0f1..c715949 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2992,9 +2992,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2992 { 2992 {
2993 if (bl[i] == null) 2993 if (bl[i] == null)
2994 continue; 2994 continue;
2995 if (bl[i].bannedUUID == UUID.Zero) 2995 if (bl[i].BannedUserID == UUID.Zero)
2996 continue; 2996 continue;
2997 BannedUsers.Add(bl[i].bannedUUID); 2997 BannedUsers.Add(bl[i].BannedUserID);
2998 } 2998 }
2999 2999
3000 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 3000 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index b567047..7a200d4 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
241 241
242 for (int i = 0; i < banlistcheck.Length; i++) 242 for (int i = 0; i < banlistcheck.Length; i++)
243 { 243 {
244 if (user == banlistcheck[i].bannedUUID) 244 if (user == banlistcheck[i].BannedUserID)
245 { 245 {
246 alreadyInList = true; 246 alreadyInList = true;
247 break; 247 break;
@@ -253,10 +253,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
253 253
254 EstateBan item = new EstateBan(); 254 EstateBan item = new EstateBan();
255 255
256 item.bannedUUID = user; 256 item.BannedUserID = user;
257 item.estateID = m_scene.RegionInfo.EstateSettings.EstateID; 257 item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID;
258 item.bannedIP = "0.0.0.0"; 258 item.BannedHostAddress = "0.0.0.0";
259 item.bannedIPHostMask = "0.0.0.0"; 259 item.BannedHostIPMask = "0.0.0.0";
260 260
261 m_scene.RegionInfo.EstateSettings.AddBan(item); 261 m_scene.RegionInfo.EstateSettings.AddBan(item);
262 m_scene.RegionInfo.EstateSettings.Save(); 262 m_scene.RegionInfo.EstateSettings.Save();
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
294 294
295 for (int i = 0; i < banlistcheck.Length; i++) 295 for (int i = 0; i < banlistcheck.Length; i++)
296 { 296 {
297 if (user == banlistcheck[i].bannedUUID) 297 if (user == banlistcheck[i].BannedUserID)
298 { 298 {
299 alreadyInList = true; 299 alreadyInList = true;
300 listitem = banlistcheck[i]; 300 listitem = banlistcheck[i];
@@ -304,7 +304,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
304 } 304 }
305 if (alreadyInList && listitem != null) 305 if (alreadyInList && listitem != null)
306 { 306 {
307 m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.bannedUUID); 307 m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
308 m_scene.RegionInfo.EstateSettings.Save(); 308 m_scene.RegionInfo.EstateSettings.Save();
309 } 309 }
310 else 310 else