예제 #1
0
        private async Task StartBattle(ProposedBattle bat)
        {
            var battle = new MatchMakerBattle(server, bat, PickMap(bat.QueueType));
            await server.AddBattle(battle);

            // also join in lobby
            foreach (var usr in bat.Players)
            {
                await server.ForceJoinBattle(usr.Name, battle);
            }

            if (!await battle.StartGame())
            {
                await server.RemoveBattle(battle);
            }
        }
예제 #2
0
        private async Task StartBattle(ProposedBattle bat)
        {
            await server.UserLogSay($"Match starting with players: {bat.Players.Select(x => x.Name).StringJoin()}.");

            var battle = new MatchMakerBattle(server, bat, PickMap(bat));
            await server.AddBattle(battle);

            // also join in lobby
            foreach (var usr in bat.Players)
            {
                await server.ForceJoinBattle(usr.Name, battle);
            }

            if (!await battle.StartGame())
            {
                await server.RemoveBattle(battle);
            }
        }
예제 #3
0
        private async Task StartBattle(ProposedBattle bat)
        {
            var battle = new MatchMakerBattle(server, bat, PickMap(bat.QueueType));

            server.Battles[battle.BattleID] = battle;

            // also join in lobby
            await server.Broadcast(server.ConnectedUsers.Keys, new BattleAdded()
            {
                Header = battle.GetHeader()
            });

            foreach (var usr in bat.Players)
            {
                await server.ForceJoinBattle(usr.Name, battle);
            }

            if (!await battle.StartGame())
            {
                await server.RemoveBattle(battle);
            }
        }
        private async Task StartBattle(ProposedBattle bat)
        {
            var battle = new MatchMakerBattle(server, bat);
            server.Battles[battle.BattleID] = battle;

            // also join in lobby
            await server.Broadcast(server.ConnectedUsers.Keys, new BattleAdded() { Header = battle.GetHeader() });
            foreach (var usr in bat.Players) await server.ForceJoinBattle(usr.Name, battle);

            await battle.StartGame();
        }