Ejemplo n.º 1
0
 internal void UpdateTcProtect()
 {
     try
     {
         this.TcProtectInterval = HackShieldService.TcProtect_GetInterval();
     }
     catch (Exception ex)
     {
         Log <HackShieldService> .Logger.Error(ex);
     }
     try
     {
         IntPtr ptr = HackShieldService.TcProtect_GetSeDataMD5();
         string s   = Marshal.PtrToStringAnsi(ptr);
         this.TcProtectMd5 = Encoding.ASCII.GetBytes(s);
     }
     catch (Exception ex2)
     {
         Log <HackShieldService> .Logger.Error(ex2);
     }
     try
     {
         IntPtr intPtr;
         IntPtr source = HackShieldService.TcProtect_GetXmlData(out intPtr);
         int    num    = intPtr.ToInt32();
         this.TcProtectEncoded = new byte[num];
         Marshal.Copy(source, this.TcProtectEncoded, 0, num);
     }
     catch (Exception ex3)
     {
         Log <HackShieldService> .Logger.Error(ex3);
     }
 }
Ejemplo n.º 2
0
        public static Service StartService(string ip, string portstr)
        {
            HackShieldService hackShieldService = new HackShieldService();

            ServiceInvoker.StartService(ip, portstr, hackShieldService);
            HackShieldService.StartReporting(hackShieldService);
            return(hackShieldService);
        }
Ejemplo n.º 3
0
        private static void StartReporting(HackShieldService serv)
        {
            if (!FeatureMatrix.IsEnable("ServiceReporter"))
            {
                return;
            }
            int interval = ServiceReporterSettings.GetInterval("HackShieldService", 60);

            ServiceReporter.Instance.Initialize("HackShieldService");
            ServiceReporter.Instance.AddGathering("Stat", new ServiceReporter.GatheringDelegate <int>(serv.OnGatheringStat));
            ServiceReporter.Instance.Start(interval * 1000);
        }
Ejemplo n.º 4
0
 public HackShieldClient(HackShieldService service, IEntity entity, AntiCpXSvr.SafeClientHandle clientHandle)
 {
     this.Service        = service;
     this.Entity         = entity;
     this.Entity.Closed += delegate(object sender, EventArgs e)
     {
         if (!this.Handle.IsClosed)
         {
             this.Handle.Dispose();
         }
     };
     this.Handle = clientHandle;
 }