internal static void ReconnectClient(ClientSocket cs, bool newCdKey = false, bool newProxy = false) { if (GeneratedSettings.BotActive == false) { return; } //always use new proxy, probably safer/more reliable for all clients to load newProxy = true; DisconnectClient(cs); //if key was marked as bad get a new one no matter what if (cs.CDKeyBlacklisted) { newCdKey = true; cs.CDKeyBlacklisted = false; } if (newCdKey) { if (!CDKeys.CycleCDKey(cs)) { cs.Active = false; Debug.Print("CDKeys are out"); return; } } if (newProxy) { if (!Proxies.CycleProxy(cs)) { cs.Active = false; Debug.Print("Proxies are out"); Chat.Add(Color.Red, "Proxies are out" + Environment.NewLine); return; } } RelayConnectClient(cs); //cs.ConnectClient(); /r// semaphore }
private static bool CreateNewClient() { ClientSocket cs = new ClientSocket(); if (!Proxies.CycleProxy(cs)) { Chat.Add(Color.Yellow, "Proxy is null" + Environment.NewLine); return(false); } //exit method due to no more proxies being available //set cdkey if (!CDKeys.CycleCDKey(cs)) { Chat.Add(Color.Yellow, "CDKey is null" + Environment.NewLine); return(false); } cs.Active = true; _clientSockets.Add(cs); return(true); }