mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* Applied a patch that: Added estate ban table to migration scripts and nhibernate mapping. Refactored property getters and setters for estate ban object to support NHibernate.
* Added estate ban table to migration scripts of all supported databases. * Added nhibernate mapping for EstateBans property of EstateSettings * Refactored property accessors for EstateBan object. * Added comments for EstateBan properties. * Ensured that NHibernate tests pass with NUnitGUI. * Ensured that nant test target passes. This fixes mantis #3210. Thank you, tlaukkan!
This commit is contained in:
@@ -31,10 +31,85 @@ namespace OpenSim.Framework
|
||||
{
|
||||
public class EstateBan
|
||||
{
|
||||
public uint estateID = 1;
|
||||
public UUID bannedUUID = UUID.Zero;
|
||||
public string bannedIP = string.Empty;
|
||||
public string bannedIPHostMask = string.Empty;
|
||||
public string bannedNameMask = string.Empty;
|
||||
private uint m_estateID = 1;
|
||||
/// <summary>
|
||||
/// ID of the estate this ban limits access to.
|
||||
/// </summary>
|
||||
public uint EstateID
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_estateID;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_estateID = value;
|
||||
}
|
||||
}
|
||||
|
||||
private UUID m_bannedUserID = UUID.Zero;
|
||||
/// <summary>
|
||||
/// ID of the banned user.
|
||||
/// </summary>
|
||||
public UUID BannedUserID
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bannedUserID;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bannedUserID = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string m_bannedHostAddress = string.Empty;
|
||||
/// <summary>
|
||||
/// IP address or domain name of the banned client.
|
||||
/// </summary>
|
||||
public string BannedHostAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bannedHostAddress;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bannedHostAddress = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string m_bannedHostIPMask = string.Empty;
|
||||
/// <summary>
|
||||
/// IP address mask for banning group of client hosts.
|
||||
/// </summary>
|
||||
public string BannedHostIPMask
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bannedHostIPMask;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bannedHostIPMask = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string m_bannedHostNameMask = string.Empty;
|
||||
/// <summary>
|
||||
/// Domain name mask for banning group of client hosts.
|
||||
/// </summary>
|
||||
public string BannedHostNameMask
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bannedHostNameMask;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bannedHostNameMask = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace OpenSim.Framework
|
||||
public bool IsBanned(UUID avatarID)
|
||||
{
|
||||
foreach (EstateBan ban in l_EstateBans)
|
||||
if (ban.bannedUUID == avatarID)
|
||||
if (ban.BannedUserID == avatarID)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (ban == null)
|
||||
return;
|
||||
if (!IsBanned(ban.bannedUUID))
|
||||
if (!IsBanned(ban.BannedUserID))
|
||||
l_EstateBans.Add(ban);
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace OpenSim.Framework
|
||||
public void RemoveBan(UUID avatarID)
|
||||
{
|
||||
foreach (EstateBan ban in new List<EstateBan>(l_EstateBans))
|
||||
if (ban.bannedUUID == avatarID)
|
||||
if (ban.BannedUserID == avatarID)
|
||||
l_EstateBans.Remove(ban);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user