public static string GetServerStatus() { var response = Web.BaseRequest("https://api.eveonline.com/Server/ServerStatus.xml.aspx"); var serializer = new System.Xml.Serialization.XmlSerializer(typeof(eveapi)); var rdr = new System.IO.StringReader(response); var responseObj = (eveapi)serializer.Deserialize(rdr); try { switch (Convert.ToBoolean(responseObj.result.serverOpen)) { case false: return("Down"); case true: return("Up"); default: return("Buggered if I know"); } } catch { return("Probably Down"); } }
private RedisQObject PollRedisQ() { string msg = string.Empty; try { msg = Web.BaseRequest(_uri); return(Web.BaseRequest(_uri).Deserialize <RedisQObject>()); } catch (Exception ex) { File.WriteAllText(string.Concat(Directory.GetCurrentDirectory(), @"\logs\Killbot_", Program.NowString, ".log"), string.Concat(ex.Message, "\n\n", ex.StackTrace) ); File.WriteAllText(string.Concat(Directory.GetCurrentDirectory(), @"\logs\Killbot_RedisQResponse_", Program.NowString, ".log"), msg ); return(PollRedisQ()); } }
public Program() { start = (ResponseRoot)Web.BaseRequest(string.Concat(baseStartUrl, Properties.Settings.Default.Token)).Deserialize(typeof(ResponseRoot)); }