public async Task GetPlayers(IHttpContext context) { Authenticator.VerifyAuth(context); var players = await Dispatcher.RunOnMainThread(() => PlayersModel.GetPlayers()); await context.SendResponse(HttpStatusCode.OK, players); }
public static StatusPayload FromServer() { var payload = new StatusPayload() { playerCount = PlayersModel.GetPlayers().Count, lastSave = SettingsModel.LastSave?.ToString("s", System.Globalization.CultureInfo.InvariantCulture), gameStatus = SettingsModel.GameStatus.ToString() }; return(payload); }