Ejemplo n.º 1
0
        public async Task GetPlayers(IHttpContext context)
        {
            Authenticator.VerifyAuth(context);

            var players = await Dispatcher.RunOnMainThread(() => PlayersModel.GetPlayers());

            await context.SendResponse(HttpStatusCode.OK, players);
        }
Ejemplo n.º 2
0
        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);
        }