Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

refactoring IWorldCommListenerInfo.GetRegexBitfield() method to be a …

…field with a private setter
  • Loading branch information...
commit 80dcc13af2b33a5621bac49f15cbf6a97d2d8e16 1 parent e977761
SignpostMarv authored October 23, 2012 justincc committed October 26, 2012
20  OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -711,8 +711,8 @@ public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UU
711 711
                         continue;
712 712
                     }
713 713
                     if (li.GetName().Length > 0 && (
714  
-                        ((li.GetRegexBitfield() & OS_LISTEN_REGEX_NAME) != OS_LISTEN_REGEX_NAME && !li.GetName().Equals(name)) ||
715  
-                        ((li.GetRegexBitfield() & OS_LISTEN_REGEX_NAME) == OS_LISTEN_REGEX_NAME && !Regex.IsMatch(name, li.GetName()))
  714
+                        ((li.RegexBitfield & OS_LISTEN_REGEX_NAME) != OS_LISTEN_REGEX_NAME && !li.GetName().Equals(name)) ||
  715
+                        ((li.RegexBitfield & OS_LISTEN_REGEX_NAME) == OS_LISTEN_REGEX_NAME && !Regex.IsMatch(name, li.GetName()))
716 716
                     ))
717 717
                     {
718 718
                         continue;
@@ -722,8 +722,8 @@ public List<ListenerInfo> GetListeners(UUID itemID, int channel, string name, UU
722 722
                         continue;
723 723
                     }
724 724
                     if (li.GetMessage().Length > 0 && (
725  
-                        ((li.GetRegexBitfield() & OS_LISTEN_REGEX_MESSAGE) != OS_LISTEN_REGEX_MESSAGE && !li.GetMessage().Equals(msg)) ||
726  
-                        ((li.GetRegexBitfield() & OS_LISTEN_REGEX_MESSAGE) == OS_LISTEN_REGEX_MESSAGE && !Regex.IsMatch(msg, li.GetMessage()))
  725
+                        ((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) != OS_LISTEN_REGEX_MESSAGE && !li.GetMessage().Equals(msg)) ||
  726
+                        ((li.RegexBitfield & OS_LISTEN_REGEX_MESSAGE) == OS_LISTEN_REGEX_MESSAGE && !Regex.IsMatch(msg, li.GetMessage()))
727 727
                     ))
728 728
                     {
729 729
                         continue;
@@ -791,7 +791,6 @@ public class ListenerInfo : IWorldCommListenerInfo
791 791
         private UUID m_id; // ID to filter messages from
792 792
         private string m_name; // Object name to filter messages from
793 793
         private string m_message; // The message
794  
-        private int m_regexBitfield; // The regex bitfield
795 794
 
796 795
         public ListenerInfo(int handle, uint localID, UUID ItemID, UUID hostID, int channel, string name, UUID id, string message)
797 796
         {
@@ -828,7 +827,7 @@ private void Initialise(int handle, uint localID, UUID ItemID, UUID hostID, int
828 827
             m_name = name;
829 828
             m_id = id;
830 829
             m_message = message;
831  
-            m_regexBitfield = regexBitfield;
  830
+            RegexBitfield = regexBitfield;
832 831
         }
833 832
 
834 833
         public Object[] GetSerializationData()
@@ -841,7 +840,7 @@ public Object[] GetSerializationData()
841 840
             data[3] = m_name;
842 841
             data[4] = m_id;
843 842
             data[5] = m_message;
844  
-            data[6] = m_regexBitfield;
  843
+            data[6] = RegexBitfield;
845 844
 
846 845
             return data;
847 846
         }
@@ -852,7 +851,7 @@ public static ListenerInfo FromData(uint localID, UUID ItemID, UUID hostID, Obje
852 851
             linfo.m_active = (bool)data[0];
853 852
             if (data.Length >= 7)
854 853
             {
855  
-                linfo.m_regexBitfield = (int)data[6];
  854
+                linfo.RegexBitfield = (int)data[6];
856 855
             }
857 856
 
858 857
             return linfo;
@@ -913,9 +912,6 @@ public UUID GetID()
913 912
             return m_id;
914 913
         }
915 914
 
916  
-        public int GetRegexBitfield()
917  
-        {
918  
-            return m_regexBitfield;
919  
-        }
  915
+        public int RegexBitfield { get; private set; }
920 916
     }
921 917
 }
3  OpenSim/Region/Framework/Interfaces/IWorldComm.cs
@@ -51,8 +51,7 @@ public interface IWorldCommListenerInfo
51 51
         /// 1 corresponds to IWorldCommListenerInfo::GetName()
52 52
         /// 2 corresponds to IWorldCommListenerInfo::GetMessage()
53 53
         /// </summary>
54  
-        /// <returns></returns>
55  
-        int GetRegexBitfield();
  54
+        int RegexBitfield { get; }
56 55
     }
57 56
 
58 57
     public interface IWorldComm

0 notes on commit 80dcc13

Please sign in to comment.
Something went wrong with that request. Please try again.