Exemplo n.º 1
0
        private void ForceBanSync()
        {
            var serverModels = _serverGetter.Get();

            foreach (var serverModel in serverModels)
            {
                _serverAdminCommandSender.Send(serverModel.WebAdminBaseUrl, UserName, PlayerId, "sh_forcebansync", false);
            }
        }
Exemplo n.º 2
0
        private void NotifyCameraAdders(IGame game, IBkaData bkaData, HttpRequestBase httpRequestBase)
        {
            var bka                    = bkaData.Bka;
            var mapName                = game.MapName;
            var when                   = game.Created.ToShortDateString();
            var minutes                = Convert.ToInt32(game.DurationInSeconds / 60);
            var message                = $@"{bka} has uploaded a new camera for ""{mapName} {when} [{minutes}m]""";
            var gameRecordings         = _gameRecordingsGetter.Get(game.ServerName, game.StartTimeSeconds);
            var gameRecordingPlayerIds = gameRecordings.Select(x => x.PlayerId).ToList();

            if (gameRecordingPlayerIds.Count > 1)
            {
                if (ScheduledTaskRegistry.BotTask.B != null)
                {
                    var playerSteamIds = gameRecordingPlayerIds.Select(_playerIdAdapter.Adapt).ToList();
                    var cameraCount    = playerSteamIds.Count;
                    var url            = Url.Action("Watch", "Replay", new { serverName = game.ServerName, startTimeSeconds = game.StartTimeSeconds }, httpRequestBase.Url.Scheme);
                    message = $@"{message} ({cameraCount} total cameras now)!";
                    var steamMessage = $@"{message} {url} -- If you don't want these Replay notifications, please give that feedback to Wyzcrak ( https://steamcommunity.com/id/wyzcrak ).";
                    playerSteamIds.Where(x => !ReplayNotificationOptOutNs2Ids.Contains(x.AccountID)).ForEach(playerSteamId => { ScheduledTaskRegistry.BotTask.AddDailySteamMessage(new ScheduledTaskRegistry.DailySteamMessage(DateTime.Now, playerSteamId, steamMessage)); });
                }
            }

            var serverModels = _serverGetter.Get();

            foreach (var serverModel in serverModels)
            {
                _serverAdminCommandSender.Send(serverModel.WebAdminBaseUrl, UserName, PlayerId, $"sh_printallconsoles REPLAY {message} -- M > TGNS Portal > Replay", false);
            }
        }
Exemplo n.º 3
0
        public ActionResult Kick()
        {
            var serverModels = _serverGetter.Get();

            foreach (var serverModel in serverModels)
            {
                var serverCurrentInfoDictionary = _serverCurrentInfoDictionaryGetter.Get(serverModel);
                var serverCurrentInfo           = _serverCurrentInfoAdapter.Adapt(serverCurrentInfoDictionary);
                if (serverCurrentInfo.Players.Any(x => x.PlayerId.Equals(PlayerId)))
                {
                    _serverAdminCommandSender.Send(serverModel.WebAdminBaseUrl, UserName, PlayerId, $"sh_portalkick {PlayerId} Crashed", false);
                }
            }
            return(View("Kicked"));
        }
Exemplo n.º 4
0
 public bool Cycle(string userName, long playerId, string serverAdminUrl)
 {
     return(_serverAdminCommandSender.Send(serverAdminUrl, userName, playerId, "changemap ns2_veil", true));
 }