public frmOverlay() { InitializeComponent(); this.BackColor = System.Drawing.Color.Black; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = Program.GetRandomString(); this.Name = Program.GetRandomString(); this.TransparencyKey = System.Drawing.Color.Black; this.TopMost = true; this.Icon = CreateIcon(); this.ShowIcon = false; this.ShowInTaskbar = false; this.UpdateWhenIdle = false; int initialStyle = WinAPI.GetWindowLong(this.Handle, -20); WinAPI.SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20); WinAPI.SetWindowPos(this.Handle, WinAPI.HWND_TOPMOST, 0, 0, 0, 0, WinAPI.TOPMOST_FLAGS); OnResize(null); drawUpdater = new DrawUpdater(this); tickUpdater = new TickUpdater(this); //drawTick.Interval = (int)(1000f / 60f); //drawTick.Tick += drawTick_Tick; InitDevice(); this.Paint += frmOverlay_Paint; drawUpdater.Start(); tickUpdater.Start(); }
static void Main(string[] args) { //Only code specific to the Console UI should go in here. For example, the console color settings, etc. Console.WriteLine("Console Client for MC {0} to {1} - v{2} - By ORelio & Contributors", MCLowestVersion, MCHighestVersion, Version); CommandHandler = new CommandHandler(); CommandHandler.addCommand("connect", new Connect()); CommandHandler.addCommand("exit", new Exit()); CommandHandler.addCommand("quit", new Exit()); CommandHandler.addCommand("help", new Help(CommandHandler)); bool keyboardDebug = (args.Length >= 1) && (args[0] == "--keyboard-debug"); PrepareConsole(keyboardDebug); string login = ""; string pass = ""; string usr = ""; if (Settings.ConsoleTitle != "") { Console.Title = Settings.ExpandVars(Settings.ConsoleTitle); } if (Settings.SessionCaching == CacheType.Disk) { SessionCache.InitializeDiskCache(); } if ((Settings.SessionCaching == CacheType.None || !SessionCache.Contains(login.ToLower()))) { KeyValuePair <string, string> loginPass = new PromptSingleLoginRetriever().GetUserAndPass(); login = loginPass.Key; usr = login; pass = loginPass.Value; } string rootDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); List <IPlugin> plugins = PluginLoader.LoadPlugins(rootDir + "/plugins"); TickUpdater tickUpdater = new TickUpdater(); ClientPool = new ClientPool(); ClientPool.CreateAndConnectClient(usr, pass); for (int i = 0; i < 8; i++) { //ClientPool.CreateAndConnectClient(usr + i.ToString(), pass); } //ClientPool.createClient().InitializeClient(usr + "1", pass); tickUpdater.addClientPool(ClientPool); tickUpdater.plugins.AddRange(plugins); tickUpdater.start(); commandHandler = new Thread(new ThreadStart(ConsoleInputHandler)); commandHandler.Name = "MCC Command prompt"; commandHandler.Start(); }