Esempio n. 1
0
        private Func <Task>[] GetMatchPlan(ISoldatClientCommands client, string currentMapName)
        {
            return(new Func <Task>[]
            {
                Do(() => client.SetMap(currentMapName)),

                Wait(TimeSpan.FromSeconds(10)),
                Do(() => client.Say("Warm-up session - check you server and team!")),
                Wait(_warmupLength - TimeSpan.FromSeconds(30)),

                Do(() => client.Say("Warm-up session ends in 30 seconds!")),
                Wait(TimeSpan.FromSeconds(20)),
                Countdown(client, 10),

                Do(() => client.SetMap(currentMapName)),
                Wait(TimeSpan.FromSeconds(10)),
                Do(() => client.Say("Tournament match, Round 1 - This is not a drill!")),
                Wait(_matchLength),

                Do(() => client.SetMap(currentMapName)),
                Wait(TimeSpan.FromSeconds(3)),
                Do(() => client.SwapTeams()),
                Wait(TimeSpan.FromSeconds(2)),
                Do(() => client.Say("Tournament match, Round 2, Teams Swapped - This is not a drill!")),
                Wait(_matchLength),
            });
        }
Esempio n. 2
0
 private Func <Task> Countdown(ISoldatClientCommands client, int n)
 {
     return(async() =>
     {
         for (int i = n; i > 0; --i)
         {
             client.Say($"{i}...");
             await Task.Delay(TimeSpan.FromSeconds(1));
         }
     });
 }
Esempio n. 3
0
        public void Start(ISoldatClientCommands client)
        {
            /*
             *  ctf_Ash
             *  ctf_Kampf
             *  ctf_Equinox
             *  ctf_Chernobyl
             *  ctf_Rotten
             *  ctf_Cobra
             *  ctf_IronNuts
             *  ctf_Viet
             */
            var plan = GetMatchPlan(client, "ctf_Equinox");

            Task.Run(() => Runner(plan));
        }