Example #1
0
        public static PluginServices.AvailablePlugin[] FindPlugins(string strPath, string strInterface)
        {
            ArrayList arrayList = new ArrayList();

            string[] fileSystemEntries = Directory.GetFileSystemEntries(strPath, "*.dll");
            int      arg_1C_0          = 0;

            checked
            {
                int num = fileSystemEntries.Length - 1;
                for (int i = arg_1C_0; i <= num; i++)
                {
                    try
                    {
                        Assembly objDLL = Assembly.LoadFrom(fileSystemEntries[i]);
                        PluginServices.ExamineAssembly(objDLL, strInterface, arrayList);
                    }
                    catch (Exception expr_33)
                    {
                        ProjectData.SetProjectError(expr_33);
                        ProjectData.ClearProjectError();
                    }
                }
                PluginServices.AvailablePlugin[] array = new PluginServices.AvailablePlugin[arrayList.Count];
                if (arrayList.Count != 0)
                {
                    arrayList.CopyTo(array);
                    return(array);
                }
                return(null);
            }
        }
Example #2
0
        public static object CreateInstance(PluginServices.AvailablePlugin Plugin)
        {
            object objectValue;

            try
            {
                Assembly assembly = Assembly.LoadFrom(Plugin.AssemblyPath);
                objectValue = RuntimeHelpers.GetObjectValue(assembly.CreateInstance(Plugin.ClassName));
            }
            catch (Exception expr_22)
            {
                ProjectData.SetProjectError(expr_22);
                Exception ex = expr_22;
                Interaction.MsgBox(ex.Message, MsgBoxStyle.OkOnly, null);
                object result = null;
                ProjectData.ClearProjectError();
                return(result);
            }
            return(objectValue);
        }
Example #3
0
        public Plugintab(PluginServices.AvailablePlugin SelectedPlugin, string Realm, List <string> CdKeys, List <string> Accounts, string Proxy)
        {
            this.BConnect      = new Button();
            this.BConnectDelay = new System.Windows.Forms.Timer();
            this.BConnectAll   = new Button();
            this.BotList       = new ListBox();
            this.Closebutton   = new Button();
            this.Box           = new Panel();
            this.Optionz       = new List <ContextMenuStrip>();
            this.Connect       = new List <ToolStripButton>();
            this.ConnectAll    = new List <ToolStripButton>();
            this.LogBox        = new List <LogBox>();
            this.BotInstances  = new List <ConnectionManager>();
            this.RawcdKeys     = new List <string>();
            this.Generateform();
            this.Realm          = Realm.ToLower();
            this.SelectedPlugin = SelectedPlugin;
            string text = "";

            if (Operators.CompareString(Realm, "useast.battle.net", false) == 0)
            {
                text += "East";
            }
            else if (Operators.CompareString(Realm, "uswest.battle.net", false) == 0)
            {
                text += "West";
            }
            else if (Operators.CompareString(Realm, "asia.battle.net", false) == 0)
            {
                text += "Asia";
            }
            else if (Operators.CompareString(Realm, "europe.battle.net", false) == 0)
            {
                text += "Europe";
            }
            this.Text        = text;
            this.BackColor   = Color.FromArgb(43, 43, 43);
            this.BorderStyle = BorderStyle.FixedSingle;
            if (Operators.CompareString(Proxy, "", false) != 0)
            {
                this.Proxy         = new ProxyInfo();
                this.Proxy.Address = Proxy.Split(new char[]
                {
                    ':'
                })[0];
                this.Proxy.Port = Conversions.ToUShort(Proxy.Split(new char[]
                {
                    '/'
                })[0].Split(new char[]
                {
                    ':'
                })[1]);
                this.Proxy.Username = Proxy.Split(new char[]
                {
                    '/'
                })[1];
                this.Proxy.Password = Proxy.Split(new char[]
                {
                    '/'
                })[2];
            }
            this.RawcdKeys = CdKeys;
            this.GenerateBotInfos(CdKeys, Accounts);
            foreach (var connect in Plugintab.BotInfos)
            {
                ToolStripButton toolStripButton  = new ToolStripButton("Connect");
                ToolStripButton toolStripButton2 = new ToolStripButton("Connect All");
                this.Connect.Add(toolStripButton);
                this.ConnectAll.Add(toolStripButton2);
                ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
                contextMenuStrip.TopLevel        = false;
                contextMenuStrip.Parent          = this;
                contextMenuStrip.BackColor       = Color.FromArgb(43, 43, 43);
                contextMenuStrip.ForeColor       = Color.Gray;
                contextMenuStrip.ShowImageMargin = false;
                contextMenuStrip.Items.Add(toolStripButton);
                contextMenuStrip.Items.Add(toolStripButton2);
                this.Optionz.Add(contextMenuStrip);
                LogBox logBox = new LogBox();
                logBox.Parent      = this;
                logBox.Visible     = false;
                logBox.BackColor   = Color.FromArgb(43, 43, 43);
                logBox.BorderStyle = BorderStyle.None;
                logBox.ReadOnly    = true;
                Control arg_30A_0 = logBox;
                Point   point     = new Point(1, 1);
                arg_30A_0.Location = point;
                Control arg_328_0 = logBox;
                point          = new Point(550, 262);
                arg_328_0.Size = (Size)point;
                this.LogBox.Add(logBox);
                MyProject.Forms.MainForm.Panel4.Controls.Add(logBox);
                IPluginModule pluginModule = (IPluginModule)PluginServices.CreateInstance(SelectedPlugin);
                this.BotInstances.Add((ConnectionManager)pluginModule);
                this.BotList.Items.Add(connect.BnetUserName);
            }
            this.BotList.SelectedIndex = 0;
        }