public void GetServerStatusTest() { ResponseCache.Clear(); ServerStatus serverStatus = EveApi.GetServerStatus(); Assert.AreEqual(true, serverStatus.ServerOpen); Assert.AreEqual(28968, serverStatus.OnlinePlayers); }
public void ServerStatusPersist() { ResponseCache.Clear(); ServerStatus ss = EveApi.GetServerStatus(); ResponseCache.Save("ResponseCache.xml"); ResponseCache.Clear(); ResponseCache.Load("ResponseCache.xml"); ServerStatus cached = EveApi.GetServerStatus(); Assert.AreEqual(cached.CachedUntilLocal, ss.CachedUntilLocal); Assert.AreEqual(cached.ServerOpen, ss.ServerOpen); Assert.AreEqual(cached.OnlinePlayers, ss.OnlinePlayers); }
public static void ServerStatus() { ServerStatus serverStatus = EveApi.GetServerStatus(); if (serverStatus.ServerOpen) { Console.WriteLine("Tranquility is currently up"); Console.WriteLine("There are currently {0} players online", serverStatus.OnlinePlayers); } else { Console.WriteLine("Tranquility is currently down"); } }
//Outputs the current status of Tranquility private static void TranquilityStatus() { ServerStatus status = EveApi.GetServerStatus(); string message; if (status.ServerOpen) { message = String.Format("Tranquility is online and has {0} players logged in", status.OnlinePlayers); } else { message = "Tranquility is DOWN"; } connection.privmsg(CHANNEL, message); }
private static ServerStatus getServerStatus() { return(EveApi.GetServerStatus()); }