private void Connect_Click(object sender, EventArgs e) { int selectedIndex = this.BotList.SelectedIndex; if (selectedIndex >= 0) { if (Operators.CompareString(this.Connect[selectedIndex].Text, "Connect", false) == 0) { this.BotInstances[selectedIndex].Proxy = this.Proxy; ConnectionManager arg_75_0 = this.BotInstances[selectedIndex]; ushort arg_75_1 = checked ((ushort)selectedIndex); List <LogBox> logBox = this.LogBox; List <LogBox> arg_62_0 = logBox; int index = selectedIndex; LogBox value = arg_62_0[index]; arg_75_0.Initialize(arg_75_1, ref value, Plugintab.BotInfos[selectedIndex]); logBox[index] = value; Plugintab.DeclareKey = selectedIndex; this.Connect[selectedIndex].Text = "Disconnect"; } else { this.BotInstances[selectedIndex].Disconnect(); this.Connect[selectedIndex].Text = "Connect"; } } }
private void ConnectAllThred() { int arg_0F_0 = 0; checked { int num = this.BotInstances.Count - 1; for (int i = arg_0F_0; i <= num; i++) { if (!this.BotInstances[i].Initialized) { this.BotInstances[i].Proxy = this.Proxy; ConnectionManager arg_6C_0 = this.BotInstances[i]; ushort arg_6C_1 = (ushort)i; List <LogBox> logBox = this.LogBox; List <LogBox> arg_58_0 = logBox; int index = i; LogBox value = arg_58_0[index]; arg_6C_0.Initialize(arg_6C_1, ref value, Plugintab.BotInfos[i]); logBox[index] = value; } if (i != this.BotList.Items.Count - 1) { Plugintab.DeclareKey++; } else { Plugintab.DeclareKey = 0; } Thread.Sleep(MainForm.Delay); } } }
public void Connect(ConnectInfo Infos, ProxyInfo Proxy = null) { this.g_iClientToken = new Random().Next(237600000, 237699999); this.BnetInfo = Infos; checked { if (Proxy == null) { this.WriteToLog("Connecting: " + this.BnetInfo.Realm, Color.Gray); base.Connect(this.BnetInfo.Realm, (ushort)this.BnetInfo.Port); } else { this.WriteToLog(this.BnetInfo.Realm, Color.Gray); base.Connect(this.BnetInfo.Realm, (ushort)this.BnetInfo.Port, Proxy.Address, Conversions.ToString((uint)Proxy.Port), Proxy.Username, Proxy.Password); } } }
private void BConnectAll_Click(object sender, EventArgs e) { int arg_0F_0 = 0; checked { int num = this.BotInstances.Count - 1; for (int i = arg_0F_0; i <= num; i++) { if (!this.BotInstances[i].Initialized) { this.BotInstances[i].Proxy = this.Proxy; ConnectionManager arg_69_0 = this.BotInstances[i]; ushort arg_69_1 = (ushort)i; List <LogBox> logBox = this.LogBox; List <LogBox> arg_55_0 = logBox; int index = i; LogBox value = arg_55_0[index]; arg_69_0.Initialize(arg_69_1, ref value, Plugintab.BotInfos[i]); logBox[index] = value; } } } }
public ChatSocket(ref LogBox LogWriter, ProxyInfo Proxy) : base(SockType.Chat) { base.Disconnection += new Sockets.DisconnectionEventHandler(this.OnDisconnect); base.Connection += new Sockets.ConnectionEventHandler(this.Chat_Connection); this.Log = LogWriter; }
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; }
public void Connect(byte[] StartupData, string UniqueUsername, IPAddress ServerIp, ProxyInfo Proxy = null) { this.g_sUniqueUsername = UniqueUsername; this.g_ServerIp = ServerIp; this.g_StartupData = StartupData; int num = 6112; checked { if (Proxy == null) { this.WriteToLog("Connecting: " + this.g_ServerIp, Color.Gray); base.Connect(this.g_ServerIp.ToString(), (ushort)num); } else { this.WriteToLog("Connecting W/ Proxy: " + this.g_ServerIp, Color.Gray); base.Connect(this.g_ServerIp.ToString(), (ushort)num, Proxy.Address, Conversions.ToString((uint)Proxy.Port), Proxy.Username, Proxy.Password); } } }