Exemple #1
0
        public async Task QueueDebug(CommandContext ctx, int amount = 4)
        {
            if (ctx.Guild.Id != 572662006692315136)
            {
                await ctx.RespondAsync("Command is not usable within this guild");

                return;
            }
            if (!ctx.Member.Id.ToString().Contains("107967155928088576") && !ctx.Member.Id.ToString().Contains("66318815247466496"))
            {
                await ctx.RespondAsync("You are not authorized to use this");

                return;
            }
            if (MatchmakingModule.CurrentGameState == MatchmakingModule.MatchmakingState.Idle)
            {
                await ctx.RespondAsync("There is no existing queue to join. Use `>startqueue` to start your own queue.");

                return;
            }

            ulong[] ids =
            {
                277360174371438592,
                66318815247466496,
                337684398294040577,
                107967155928088576,
                219353394115117056
            };

            for (int i = 0; i < MathF.Min(ids.Length, amount); i++)
            {
                await MatchmakingModule.JoinQueue(ctx, ctx.Guild.Members[ids[i]]);
            }
        }
Exemple #2
0
        public async Task Play(CommandContext ctx, string extra = "")
        {
            if (ctx.Guild.Id != 572662006692315136)
            {
                await ctx.RespondAsync("Command is not usable within this guild");

                return;
            }
            if (!(await MatchmakingModule.DoesPlayerHaveSteamIDRegistered(ctx, ctx.Member)))
            {
                await ctx.RespondAsync("You must have your Steam ID registered to play! Use `>register id` to add your Steam ID. (NEEDS to be a SteamID64. Find your Steam ID here: https://steamidfinder.com/)");

                return;
            }

            if (MatchmakingModule.CurrentGameState != MatchmakingModule.MatchmakingState.Idle)
            {
                if (MatchmakingModule.CurrentGameState == MatchmakingModule.MatchmakingState.GameInProgress || MatchmakingModule.CurrentGameState == MatchmakingModule.MatchmakingState.GameSetup)
                {
                    await ctx.RespondAsync("A match is currently being played, please wait until the match concludes.");
                }
                else if (MatchmakingModule.CurrentGameState == MatchmakingModule.MatchmakingState.Queueing)
                {
                    await ctx.RespondAsync("A queue already exists. Use `>queue` to join the game.");
                }
                else if (MatchmakingModule.CurrentGameState == MatchmakingModule.MatchmakingState.DisplayingResults)
                {
                    await ctx.RespondAsync("The results for the previous game are being calculated. Please wait for it to finish before starting a new queue.");
                }
                return;
            }

            MatchmakingModule.CurrentGameState = MatchmakingModule.MatchmakingState.Queueing;
            MatchmakingModule.PlayersInQueue.Clear();

            MatchmakingModule.CaptainPick = extra.ToLower() == "pick";

            await MatchmakingModule.ChangeNameIfRelevant(ctx.Member);

            await MatchmakingModule.JoinQueue(ctx, ctx.Member);

            new Task(async() => { await MatchmakingModule.TimeOut(ctx); }).Start();
        }
Exemple #3
0
        public async Task Queue(CommandContext ctx)
        {
            if (ctx.Guild.Id != 572662006692315136)
            {
                await ctx.RespondAsync("Command is not usable within this guild");

                return;
            }
            if (!(await MatchmakingModule.DoesPlayerHaveSteamIDRegistered(ctx, ctx.Member)))
            {
                await ctx.RespondAsync("You must have your Steam ID registered to play! Use `>register [id]` to add your Steam ID. (NEEDS to be a SteamID64. Find your Steam ID here: https://steamidfinder.com/)");

                return;
            }

            if (MatchmakingModule.CurrentGameState == MatchmakingModule.MatchmakingState.Idle)
            {
                await ctx.RespondAsync("There is no existing queue to join. Use `>startqueue` to start your own queue.");

                return;
            }
            else if (MatchmakingModule.CurrentGameState != MatchmakingModule.MatchmakingState.Queueing)
            {
                await ctx.RespondAsync("A game is already being played, you cannot join this queue.");

                return;
            }

            if (MatchmakingModule.Bets.ContainsKey(ctx.Member.Id.ToString()))
            {
                await ctx.RespondAsync("Your bet of " + MatchmakingModule.Bets[ctx.Member.Id.ToString()] + " SquidCoin has been removed.");

                MatchmakingModule.Bets.Remove(ctx.Member.Id.ToString());
            }

            await MatchmakingModule.ChangeNameIfRelevant(ctx.Member);

            await MatchmakingModule.JoinQueue(ctx, ctx.Member);
        }