From 80dcc13af2b33a5621bac49f15cbf6a97d2d8e16 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 23 Oct 2012 16:02:31 +0100 Subject: refactoring IWorldCommListenerInfo.GetRegexBitfield() method to be a field with a private setter --- .../Scripting/WorldComm/WorldCommModule.cs | 20 ++++++++------------ OpenSim/Region/Framework/Interfaces/IWorldComm.cs | 3 +-- 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index cf0eb2a..401ff6c 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -711,8 +711,8 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm continue; } if (li.GetName().Length > 0 && ( - ((li.GetRegexBitfield() & OS_LISTEN_REGEX_NAME) != OS_LISTEN_REGEX_NAME && !li.GetName().Equals(name)) || - ((li.GetRegexBitfield() & OS_LISTEN_REGEX_NAME) == OS_LISTEN_REGEX_NAME && !Regex.IsMatch(name, li.GetName())) + ((li.RegexBitfield & OS_LISTEN_REGEX_NAME) != OS_LISTEN_REGEX_NAME && !li.GetName().Equals(name)) || + ((li.RegexBitfield & OS_LISTEN_REGEX_NAME) == OS_LISTEN_REGEX_NAME && !Regex.IsMatch(name, li.GetName())) )) { continue; @@ -722,8 +722,8 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm continue; } if (li.GetMessage().Length > 0 && ( - ((li.GetRegexBitfield() & OS_LISTEN_REGEX_MESSAGE) != OS_LISTEN_REGEX_MESSAGE && !li.GetMessage().Equals(msg)) || - ((li.GetRegexBitfield() & OS_LISTEN_REGEX_MESSAGE) == OS_LISTEN_REGEX_MESSAGE && !Regex.IsMatch(msg, li.GetMessage())) + ((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) != OS_LISTEN_REGEX_MESSAGE && !li.GetMessage().Equals(msg)) || + ((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) == OS_LISTEN_REGEX_MESSAGE && !Regex.IsMatch(msg, li.GetMessage())) )) { continue; @@ -791,7 +791,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm private UUID m_id; // ID to filter messages from private string m_name; // Object name to filter messages from private string m_message; // The message - private int m_regexBitfield; // The regex bitfield public ListenerInfo(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, UUID id, string message) { @@ -828,7 +827,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm m_name = name; m_id = id; m_message = message; - m_regexBitfield = regexBitfield; + RegexBitfield = regexBitfield; } public Object[] GetSerializationData() @@ -841,7 +840,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm data[3] = m_name; data[4] = m_id; data[5] = m_message; - data[6] = m_regexBitfield; + data[6] = RegexBitfield; return data; } @@ -852,7 +851,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm linfo.m_active = (bool)data[0]; if (data.Length >= 7) { - linfo.m_regexBitfield = (int)data[6]; + linfo.RegexBitfield = (int)data[6]; } return linfo; @@ -913,9 +912,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm return m_id; } - public int GetRegexBitfield() - { - return m_regexBitfield; - } + public int RegexBitfield { get; private set; } } } diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index 66b3f3a..d76a0d7 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs @@ -51,8 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces /// 1 corresponds to IWorldCommListenerInfo::GetName() /// 2 corresponds to IWorldCommListenerInfo::GetMessage() /// - /// - int GetRegexBitfield(); + int RegexBitfield { get; } } public interface IWorldComm -- cgit v1.1