Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactoring IWorldCommListenerInfo.GetRegexBitfield() method to be a …

…field with a private setter
  • Loading branch information...
commit 80dcc13af2b33a5621bac49f15cbf6a97d2d8e16 1 parent e977761
@SignpostMarv SignpostMarv authored justincc committed
View
20 OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -711,8 +711,8 @@ public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UU
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 @@ public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UU
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 @@ public class ListenerInfo : IWorldCommListenerInfo
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 @@ private void Initialise(int handle, uint localID, UUID ItemID, UUID hostID, int
m_name = name;
m_id = id;
m_message = message;
- m_regexBitfield = regexBitfield;
+ RegexBitfield = regexBitfield;
}
public Object[] GetSerializationData()
@@ -841,7 +840,7 @@ public Object[] GetSerializationData()
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 @@ public static ListenerInfo FromData(uint localID, UUID ItemID, UUID hostID, Obje
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 @@ public UUID GetID()
return m_id;
}
- public int GetRegexBitfield()
- {
- return m_regexBitfield;
- }
+ public int RegexBitfield { get; private set; }
}
}
View
3  OpenSim/Region/Framework/Interfaces/IWorldComm.cs
@@ -51,8 +51,7 @@ public interface IWorldCommListenerInfo
/// 1 corresponds to IWorldCommListenerInfo::GetName()
/// 2 corresponds to IWorldCommListenerInfo::GetMessage()
/// </summary>
- /// <returns></returns>
- int GetRegexBitfield();
+ int RegexBitfield { get; }
}
public interface IWorldComm
Please sign in to comment.
Something went wrong with that request. Please try again.