/[RomCheater]/trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.PluginFramework/Core/ConfigPlugin.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 101 by william, Thu May 10 09:53:16 2012 UTC revision 150 by william, Sun May 27 23:59:22 2012 UTC
# Line 1  Line 1 
1  ´╗┐using System;  ´╗┐#define DISABLE_VERBOSE_LOGGING_FOR_PERFORMANCE_BOOST // when defined will disable verbose logging for performance speed-up
2    using System;
3  using System.Collections.Generic;  using System.Collections.Generic;
4  using System.Linq;  using System.Linq;
5  using System.Text;  using System.Text;
# Line 26  namespace RomCheater.PluginFramework.Cor Line 27  namespace RomCheater.PluginFramework.Cor
27          }          }
28          private void init()          private void init()
29          {          {
30                loggerflags flags = logger.GetLoggingFlags();
31    
32    #if DISABLE_VERBOSE_LOGGING_FOR_PERFORMANCE_BOOST
33                ushort performance_flags = flags.Value;
34                if (flags.HasFlag(loggerflags.VERBOSE_DEBUG))
35                {
36                    performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_DEBUG.Value);
37                }
38                if (flags.HasFlag(loggerflags.VERBOSE_ERROR))
39                {
40                    performance_flags = (ushort)(performance_flags &~ loggerflags.VERBOSE_ERROR.Value);
41                }
42    #endif
43                logger.SetLoggingFlags(performance_flags);
44    
45              List<ProcContainer> proc_list = new List<ProcContainer>();              List<ProcContainer> proc_list = new List<ProcContainer>();
46              foreach (Process proc in Process.GetProcesses())              foreach (Process proc in Process.GetProcesses())
47              {              {
# Line 72  namespace RomCheater.PluginFramework.Cor Line 88  namespace RomCheater.PluginFramework.Cor
88              Predicate<ProcContainer> predicate = new Predicate<ProcContainer>(IsNotValidProcess);              Predicate<ProcContainer> predicate = new Predicate<ProcContainer>(IsNotValidProcess);
89              proc_list.RemoveAll(predicate);              proc_list.RemoveAll(predicate);
90              ValidProcessesForPlugin = proc_list;              ValidProcessesForPlugin = proc_list;
91                logger.SetLoggingFlags(flags); // reset flags
92          }          }
93    
94          protected abstract bool IsNotValidProcess(ProcContainer p);          protected abstract bool IsNotValidProcess(ProcContainer p);

Legend:
Removed from v.101  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.22