public async void VerifyConnectionAsync() { List <string> connectionstesturls = new List <string> { $"{API_URL}wow/achievement/2144?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/boss/24723?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/item/18803?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/item/set/1060?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/pet/ability/640?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/pet/species/258?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/pet/stats/258?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/quest/13146?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/recipe/33994?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/spell/8056?locale={API_Locale}&apikey={API_Key}", $"{API_URL}wow/zone/4131?locale={API_Locale}&apikey={API_Key}" }; Random rnd = new Random(); string URL = connectionstesturls[rnd.Next(connectionstesturls.Count())]; Request request = new Request(User_Agent); Task <int> status = request.GetStatusAsync(URL); int x = await status; if (x.ToString().StartsWith("2")) { ConnectedEventArgs e = new ConnectedEventArgs { Key = API_Key, Locale = API_Locale, Region = API_Region, Status = x, URL = URL }; IsConnected = true; OnConnected(e); } }
protected virtual void OnConnected(ConnectedEventArgs e) { Connected?.Invoke(this, e); }