예제 #1
0
        public void ClearMatch()
        {
            foreach (TrackedPlayer player in GetPlayers())
            {
                player.Score      = 0;
                player.Kills      = new List <KillEvent>();
                player.ValidKills = new List <KillEvent>();
                player.Deaths     = new List <KillEvent>();
                player.Exp        = new List <ExpEvent>();
                player.Streak     = 0;
                player.Streaks    = new List <int>();
                player.Characters = new List <Character>();
                player.Wins       = 0;
            }

            _Players.Clear();

            _MatchTicks = 0;

            SetState(MatchState.UNSTARTED);
            _MatchEvents.EmitTimerEvent(0);

            _MatchStart = DateTime.UtcNow;
            _MatchEnd   = null;

            _AdminMessages.Clear();
            _MatchMessages.Clear();

            _AdminMessages.Log($"Match cleared at {DateTime.UtcNow}");
        }
예제 #2
0
파일: LogCommand.cs 프로젝트: Varunda/flash
 public void Clear(string which)
 {
     if (which.ToLower() == "admin")
     {
         _AdminMessages.Clear();
         _Logger.LogInformation($"Cleared admin logs");
     }
     else if (which.ToLower() == "match")
     {
         _MatchMessages.Clear();
         _Logger.LogInformation($"Cleared match logs");
     }
     else
     {
         _Logger.LogError($"Unknown message broadcast server '{which}'");
     }
 }