Beispiel #1
0
        public async Task OnlineAsync()
        {
            var serverStatus = await _gunzRepository.GetServerStatusAsync();

            int onlinePlayerCount = 0;

            foreach (var status in serverStatus)
            {
                onlinePlayerCount += status.CurPlayer;
            }

            await ReplyAsync($"There are currently { onlinePlayerCount } players online!");
        }
Beispiel #2
0
        public async Task OnlineAsync()
        {
            LogMessage();

            if (_appConfiguration.DatabaseType != DatabaseTypes.MICROSOFT_SQL_SERVER)
            {
                return;
            }

            await Context.Channel.TriggerTypingAsync();

            var serverStatus = await _gunzRepository.GetServerStatusAsync();

            int onlinePlayerCount = 0;

            foreach (var status in serverStatus)
            {
                onlinePlayerCount += status.CurrPlayer;
            }

            await ReplyAsync(string.Format(Strings.PLAYERS_ONLINE, onlinePlayerCount));
        }