Example #1
0
        private static void ActivateFullMaintenance(object sender, EventArgs e)
        {
            Timer.Stop();
            Timer2.Stop();
            Timer3.Elapsed += DisableMaintenance;
            Timer3.Interval = Time;
            Timer3.Start();
            ForegroundColor = ConsoleColor.Yellow;
            Say("Full Maintenance has been started!");
            ResetColor();
            if (Time >= 7000)
            {
                Say();
                Error("Please type in a valid time!");
                Error("20min = 1200, 10min = 600");
                Say();
                StartMaintenance();
            }

            MemoryThread.Stop();
            Parallel.ForEach(ResourcesManager.GetInMemoryLevels(), p =>
            {
                new OutOfSyncMessage(p.GetClient()).Send();
                ResourcesManager.DropClient(p.GetClient().GetSocketHandle());
            });
            var clans = DatabaseManager.Single().Save(ResourcesManager.GetInMemoryAlliances());

            clans.Wait();
            MemoryThread.Start();
        }
 public override void Start()
 {
     _thread = new MemoryThread("Sekiro", Defs.PointerByName("GameState"), 1, EventName());
     _thread.ValueChanged += (sender, args) => {
         try {
             SetValue(args.Bytes[0]);
         } catch {
             // ignored
         }
     };
     _thread.Start();
 }
Example #3
0
        public static void Main(string[] args)
        {
            Thread T = new Thread(() =>
            {
                UCSControl.WelcomeMessage();
                CheckThread.Start();
                MemoryThread.Start();
                NetworkThread.Start();
                ParserThread.Start();
            }); T.Start();

            T.Priority = ThreadPriority.Highest;
        }
 public override void Start()
 {
     _thread = new MemoryThread("Sekiro", Defs.PointerByName("IGT"), 4, EventName(), EMemoryThreadPriority.High);
     _thread.ValueChanged += (sender, args) => {
         try {
             var ms = BitConverter.ToInt32(args.Bytes, 0);
             var t  = TimeSpan.FromMilliseconds(ms);
             SetValue($"{t.Hours:D2}h:{t.Minutes:D2}m:{t.Seconds:D2}s:{t.Milliseconds:D3}ms");
         } catch {
             // ignored
         }
     };
     _thread.Start();
 }
 public override void Start()
 {
     _thread = new MemoryThread("Sekiro", Defs.PointerByName("PlayerPosition"), 12, EventName());
     _thread.ValueChanged += (sender, args) => {
         try {
             var posX  = BitConverter.ToSingle(args.Bytes, 0);
             var posY  = BitConverter.ToSingle(args.Bytes, 4);
             var posZ  = BitConverter.ToSingle(args.Bytes, 8);
             var vect3 = new Vector3(posX, posY, posZ);
             SetValue(new Vector3(posX, posY, posZ));
         } catch {
             // ignored
         }
     };
     _thread.Start();
 }
 public override void Start()
 {
     _thread = new MemoryThread("Sekiro", Defs.PointerByName("LastCommutedIdol"), 4, EventName());
     _thread.ValueChanged += (sender, args) => {
         try {
             var idol = Defs.IdolById(BitConverter.ToInt32(args.Bytes, 0));
             if (idol == null)
             {
                 return;
             }
             SetValue(idol);
         } catch {
             // Ignored
         }
     };
     _thread.Start();
 }
        public override void Start()
        {
            _thread = new MemoryThread("Sekiro", Defs.PointerByName("PlayerStats"), 32, EventName());
            _thread.ValueChanged += (sender, args) => {
                try {
                    var curHealth  = BitConverter.ToInt32(args.Bytes, 0);
                    var maxHealth  = BitConverter.ToInt32(args.Bytes, 4);
                    var curPosture = BitConverter.ToInt32(args.Bytes, 24);
                    var maxPosture = BitConverter.ToInt32(args.Bytes, 28);

                    SetValue(new Player()
                    {
                        CurrentHealth  = curHealth,
                        MaximumHealth  = maxHealth,
                        CurrentPosture = curPosture,
                        MaximumPosture = maxPosture
                    });
                } catch {
                    // ignored
                }
            };
            _thread.Start();
        }