public override async Task <bool> OutOfGameTask()
        {
            if (!Equals(Coordination.PartyJoinTimer, DateTime.MinValue))
            {
                Coordination.PartyJoinTimer = DateTime.MinValue;
            }

            if (await Party.StartGameWhenPartyReady())
            {
                return(true);
            }

            if (Settings.Misc.AvoidUnknownPlayers && await Party.LeavePartyUnknownPlayersInGame())
            {
                return(true);
            }

            if (await Party.WaitForPlayersToLeaveGame())
            {
                return(true);
            }

            if (AutoFollow.CurrentParty.Any(b => b.IsLoadingWorld))
            {
                Log.Info("Waiting for bots to finish loading...");
                await Coroutine.Sleep(500);

                return(true);
            }

            if (Player.IsFollower)
            {
                if (await Party.AcceptPartyInvite())
                {
                    return(true);
                }

                if (await Party.RequestPartyInvite())
                {
                    return(true);
                }
            }

            //if (AutoFollow.CurrentParty.Any(b => !b.IsInParty))
            //{
            //    Log.Info("Waiting for bots to join party...");
            //    return true;
            //}

            //var forcedWaitUntil = ChangeMonitor.LastBotStartedTime + TimeSpan.FromSeconds(10);
            //if (DateTime.UtcNow < forcedWaitUntil)
            //{
            //    Log.Info("Waiting after bot has just started. Remaining={0}s", forcedWaitUntil.Subtract(DateTime.UtcNow).TotalSeconds);
            //    await Coroutine.Sleep(1000);
            //    return true;
            //}

            // Allow DB to run normal out of game hook to start a new game
            return(false);
        }
        public override async Task <bool> OutOfGameTask()
        {
            //if (await Party.LeaveWhenInWrongGame())
            //    return Repeat(PartyObjective.LeavingGame);

            //if (await Party.StartGameWhenPartyReady())
            //    return Repeat(PartyObjective.JoiningGame);

            if (await Party.JoinGameInProgress())
            {
                return(Repeat(PartyObjective.JoiningGame));
            }

            if (await Party.QuickJoinLeader())
            {
                return(Repeat(PartyObjective.JoiningGame));
            }

            if (await Party.AcceptPartyInvite())
            {
                return(Repeat(PartyObjective.JoiningParty));
            }

            if (await Party.RequestPartyInvite())
            {
                return(Repeat(PartyObjective.JoiningParty));
            }

            Log.Verbose("Waiting... (Out of Game)");
            await Coroutine.Sleep(500);

            return(true);
        }
Exemple #3
0
        public void Party_AcceptInvite_Accepted()
        {
            Mock <IPartyInvite> partyInvite = new Mock <IPartyInvite>();

            partyInvite.Setup(e => e.Group).Returns(group.Object);
            partyInvite.Setup(e => e.PartyLeader).Returns(performer.Object);
            partyInvite.Setup(e => e.Invited).Returns(invited.Object);
            invites.Add(partyInvite.Object);

            IResult result = party.AcceptPartyInvite(invited.Object);

            Assert.AreEqual(0, invites.Count);
            Assert.AreEqual(group.Object, groups[invited.Object]);
            group.Verify(e => e.AddMember(invited.Object), Times.Once);
            Assert.AreEqual("You join performer's party.", result.ResultMessage);
            Assert.IsTrue(result.AllowAnotherCommand);
        }
Exemple #4
0
        public override async Task <bool> OutOfGameTask()
        {
            if (await base.OutOfGameTask())
            {
                return(true);
            }

            if (await Party.LeaveWhenInWrongGame())
            {
                return(true);
            }

            if (await Party.StartGameWhenPartyReady())
            {
                return(true);
            }

            if (await Party.JoinGameOrLeaveParty())
            {
                return(true);
            }

            if (await Party.QuickJoinLeader())
            {
                return(true);
            }

            if (await Party.AcceptPartyInvite())
            {
                return(true);
            }

            if (await Party.RequestPartyInvite())
            {
                return(true);
            }

            Log.Verbose("Waiting... (Out of Game)");
            await Coroutine.Sleep(500);

            return(true);
        }