Exemplo n.º 1
0
        private void initializeCore()
        {
            bool     backup   = OPT.GetBool("data.backup");
            int      codepage = OPT.GetInt("data.encoding");
            Encoding encoding = Encoding.GetEncoding(codepage);

            core = new Core(backup, encoding);
            hook_core_events();
        }
Exemplo n.º 2
0
        public LogViewer(Logs.Manager lManager)
        {
            InitializeComponent();

            this.lManager = lManager;

            interval = OPT.GetInt("log.display.refresh");

            configureViewer();

            generate_type_list();
        }
Exemplo n.º 3
0
        private void CS_RequestSendType(Client client, PacketStream stream)
        {
            if (debug)
            {
                Console.WriteLine("Client [{0}] requested send.type", client.Id);
            }

            PacketStream outStream = new PacketStream(0x0040);

            outStream.WriteInt32(OPT.GetInt("send.type"));
            ClientManager.Instance.Send(client, outStream);
        }
Exemplo n.º 4
0
        private void initializeCore()
        {
            bool     backup   = OPT.GetBool("data.backup");
            int      codepage = OPT.GetInt("data.encoding");
            Encoding encoding = Encoding.GetEncoding(codepage);

            core = new Core(backup, encoding);
            core.CurrentMaxDetermined   += Core_CurrentMaxDetermined;
            core.CurrentProgressChanged += Core_CurrentProgressChanged;
            core.CurrentProgressReset   += Core_CurrentProgressReset;
            core.MessageOccured         += Core_MessageOccured;
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            OPT.LoadSettings();
            DesCipher = new XDes(OPT.GetString("des.key"));

            clientList = new Dictionary <int, Client>();

            Console.WriteLine("Indexing legacy file names...");
            OPT.LoadLegacyFiles();
            Console.WriteLine("\t- {0} legacy files indexed!", OPT.LegacyCount);

            Console.WriteLine("Indexing delete file names...");
            OPT.LoadDeleteFiles();
            Console.WriteLine("\t- {0} delete files indexed!", OPT.DeleteCount);

            IndexManager.Build(false);

            Console.Write("Checking for tmp directory...");
            if (!Directory.Exists(tmpPath))
            {
                Directory.CreateDirectory(tmpPath);
            }
            Console.Write("[OK]\n\t- Cleaning up temp files...");

            int cleanedCount = 0;

            foreach (string filePath in Directory.GetFiles(tmpPath))
            {
                File.Delete(filePath);
                cleanedCount++;
            }
            Console.WriteLine("[OK] ({0} files cleared!)", cleanedCount);

            Console.Write("Initializing client listener... ");
            if (ClientManager.Instance.Start())
            {
                Console.WriteLine("[OK]");
            }

            Console.Write("Initializing Index Rebuild Service...");
            int rebuildInterval = OPT.GetInt("rebuild.interval") * 1000;

            indexTimer = new Timer(indexTick, null, rebuildInterval, rebuildInterval);
            Console.WriteLine("[OK]");

            Console.Write("Initializing OTP Reset Service...");
            otpTimer = new Timer(otpTick, null, 0, 300000);
            Console.WriteLine("[OK]");

            Console.ReadLine();
        }
Exemplo n.º 6
0
        public Item()
        {
            InitializeComponent();
            imageList           = new ImageList();
            imageList.ImageSize = new Size(34, 34);
            bool     backup   = OPT.GetBool("data.backup");
            int      codepage = OPT.GetInt("data.encoding");
            Encoding encoding = Encoding.GetEncoding(codepage);

            Core = new Core(backup, encoding);
            spr  = new SPR();
            loadCore();
            itemList.LargeImageList = imageList;
            setEnums();
        }
Exemplo n.º 7
0
        private void CS_RequestSendType(Client client, PacketStream stream)
        {
            if (debug)
            {
                Output.Write(new Message()
                {
                    Text = string.Format("Client [{0}] requested send.type", client.Id), AddBreak = true
                });
            }

            PacketStream outStream = new PacketStream(0x0040);

            outStream.WriteInt32(OPT.GetInt("send.type"));
            ClientManager.Instance.Send(client, outStream);
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            string processName_1 = "launcher";
            string processName_2 = "client";

            Console.Write("Loading configuration info from config.opt...");
            OPT.Read();
            Console.WriteLine("[OK]");

            Console.Write("Checking for open Launcher...");

            if (Process.GetProcessesByName(processName_1).Length > 0)
            {
                foreach (var process in Process.GetProcessesByName(processName_1))
                {
                    process.Kill();
                }
            }

            if (Process.GetProcessesByName(processName_2).Length > 0)
            {
                foreach (var process in Process.GetProcessesByName(processName_2))
                {
                    process.Kill();
                }
            }

            Console.Write("[OK]\nConnecting to the Portal Server...");
            try
            {
                if (ServerManager.Instance.Start(OPT.GetString("ip"), OPT.GetInt("port")))
                {
                    Console.Write("[OK]\nRequesting communication key...");
                    ServerPackets.Instance.US_RequestDesKey();
                }
                else
                {
                    Console.WriteLine("[FAIL]");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Errors:\n\t{0}", ex.ToString());
            }

            Console.ReadLine();
        }
Exemplo n.º 9
0
        private async void GUI_Shown(object sender, EventArgs e)
        {
            OPT.LoadSettings();
            DesCipher = new XDes(OPT.GetString("des.key"));

            Statistics.SetIO();
            Statistics.StartUptime();

            clientList = new Dictionary <int, Client>();

            Output.Write(new Structures.Message()
            {
                Text = "Indexing legacy file names..."
            });
            OPT.LoadLegacyIndex();
            Output.Write(new Structures.Message()
            {
                Text = string.Format("[OK]\n\t- {0} legacy files indexed!", OPT.LegacyCount), AddBreak = true
            });

            Output.Write(new Structures.Message()
            {
                Text = "Indexing delete file names..."
            });
            OPT.LoadDeleteFiles();
            Output.Write(new Structures.Message()
            {
                Text = string.Format("[OK]\n\t- {0} delete files indexed!", OPT.DeleteCount), AddBreak = true
            });

            await Task.Run(() => { IndexManager.Build(false); });

            Output.Write(new Structures.Message()
            {
                Text = "Checking for tmp directory..."
            });
            if (!Directory.Exists(tmpPath))
            {
                Directory.CreateDirectory(tmpPath);
            }
            Output.Write(new Structures.Message()
            {
                Text = "[OK]", AddBreak = true
            });

            clearTmp();

            Output.Write(new Structures.Message()
            {
                Text = string.Format("Initializing client listener...{0}", (ClientManager.Instance.Start()) ? "[OK]" : "[FAIL]"), AddBreak = true
            });

            Output.Write(new Structures.Message()
            {
                Text = "Initializing Index Rebuild Service..."
            });
            int rebuildInterval = OPT.GetInt("rebuild.interval") * 1000;

            indexTimer = new Timer()
            {
                Enabled = true, Interval = rebuildInterval
            };
            indexTimer.Tick += indexTick;
            indexTimer.Start();
            Output.Write(new Structures.Message()
            {
                Text = "[OK]", AddBreak = true
            });

            Output.Write(new Structures.Message()
            {
                Text = "Initializing OTP Reset Service..."
            });
            otpTimer = new Timer()
            {
                Enabled = true, Interval = 300000
            };
            otpTimer.Tick += otpTick;
            Output.Write(new Structures.Message()
            {
                Text = "[OK]", AddBreak = true
            });

            Output.Write(new Structures.Message()
            {
                Text = "Initializing Statistics Update Service..."
            });
            Statistics.StartUpdating();
            Output.Write(new Structures.Message()
            {
                Text = "[OK]", AddBreak = true
            });

            toolTip.SetToolTip(setWTBtn, "Sets the Updates folder last write time to the current time");
        }