コード例 #1
0
        /// <summary>
        /// execute all pending commands - create the equivalent local commands and invoke its' execute method
        /// </summary>
        /// <param name="sendingInstruction"></param>
        /// <param name="sessionStage"></param>
        /// <param name="res"></param>
        internal override void Execute(SendingInstruction sendingInstruction, SessionStage sessionStage, IResultValue res)
        {
            MGDataCollection mgDataTab = MGDataCollection.Instance;

            // loop on all MGData
            for (int i = 0; i < mgDataTab.getSize(); i++)
            {
                MGData mgd = mgDataTab.getMGData(i);
                if (mgd != null && !mgd.IsAborting)
                {
                    CommandsTable commands = mgd.CmdsToServer;

                    // go over all commands
                    while (commands.getSize() > 0)
                    {
                        // extract command from CmdsToServer
                        IClientCommand          command             = commands.ExtractCommand(0);
                        LocalRunTimeCommandBase localRunTimeCommand = _localRunTimeCommandFactory.CreateLocalRunTimeCommand(command);
                        localRunTimeCommand.Execute();
                    }

                    Debug.Assert(mgd.CmdsToClient.getSize() == 0, "Not all commands were executed");
                }
            }
        }
コード例 #2
0
        private void EnsureSessionInStage(SessionStage retrospectiveStage)
        {
            using IServiceScope scope = this.App.CreateTestServiceScope();
            var dbContext = scope.ServiceProvider.GetRequiredService <IPokerTimeDbContext>();

            Assume.That(() => dbContext.Sessions.AsNoTracking().FindBySessionId(this.SessionId, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult(),
                        Has.Property(nameof(Session.CurrentStage)).EqualTo(retrospectiveStage).Retry(),
                        $"Session {this.SessionId} is not in stage {retrospectiveStage} required for this test. Are the tests running in the correct order?");
        }
コード例 #3
0
 public SessionStatus(
     string sessionId,
     string title,
     SessionStage sessionStage,
     int symbolSetId,
     UserStoryModel?currentUserStory
     )
 {
     this.SessionId   = sessionId;
     this.Title       = title;
     this.SymbolSetId = symbolSetId;
     this.Stage       = sessionStage;
     this.UserStory   = currentUserStory;
 }
コード例 #4
0
        public SharedLoginRequest93Payload(ushort clientVersion, int teamId, uint guildCard, [NotNull] string userName, [NotNull] string password, [NotNull] ClientVerificationData clientData, SessionStage stage = SessionStage.PreShip)
            : this()
        {
            if (string.IsNullOrWhiteSpace(userName))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(userName));
            }
            if (string.IsNullOrWhiteSpace(password))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(password));
            }
            if (userName.Length > 15)
            {
                throw new ArgumentException($"{nameof(userName)} had a length of {userName.Length} but maximum length supported is 15.", nameof(userName));
            }
            if (password.Length > 15)
            {
                throw new ArgumentException($"{nameof(password)} had a length of {password.Length} but maximum length supported is 15.", nameof(userName));
            }
            if (clientVersion == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(clientVersion));
            }
            if (clientData == null)
            {
                throw new ArgumentNullException(nameof(clientData));
            }

            ClientVersion = clientVersion;
            TeamId        = teamId;
            UserName      = userName;
            Password      = password;
            ClientData    = clientData;
            GuildCardId   = guildCard;

            //This is odd, not sure what this is or why we have to do it but Teth checks this sometimes
            unk2 = Enumerable.Repeat((byte)stage, 6).ToArray();
        }
コード例 #5
0
 public SharedLoginRequest93Payload(ushort clientVersion, int teamId, [NotNull] string userName, [NotNull] string password, [NotNull] ClientVerificationData clientData, SessionStage stage = SessionStage.PreShip)
     : this(clientVersion, teamId, 0, userName, password, clientData, stage)
 {
 }
コード例 #6
0
 private static SessionStatus GetSessionStatusInStage(SessionStage sessionStage) => new SessionStatus(
     TestContext.CurrentContext.Random.GetString(),
     TestContext.CurrentContext.Random.GetString(),
     sessionStage,
     TestContext.CurrentContext.Random.Next(),
     new UserStoryModel());
コード例 #7
0
 public bool SessionStatus_ShowUserStoriesOverview(SessionStage sessionStage) => GetSessionStatusInStage(sessionStage).ShowUserStoriesOverview;
コード例 #8
0
 public bool SessionStatus_CanViewEstimations(SessionStage sessionStage) => GetSessionStatusInStage(sessionStage).CanViewEstimations;
コード例 #9
0
 public bool SessionStatus_CanChooseCards(SessionStage sessionStage) => GetSessionStatusInStage(sessionStage).CanChooseCards;
コード例 #10
0
 public bool SessionStatus_CanViewOwnCards(SessionStage sessionStage) => GetSessionStatusInStage(sessionStage).CanViewOwnCards;
コード例 #11
0
ファイル: CommandsProcessorBase.cs プロジェクト: rinavin/RCJS
 /// <summary>build the xml request; send it to the runtime-engine; receive a response</summary>
 /// <param name="sendingInstruction">instruction what to send during execution - NO_TASKS_OR_COMMANDS / ONLY_COMMANDS / TASKS_AND_COMMANDS.</param>
 /// <param name="sessionStage">HANDSHAKE / INITIAL / NORMAL.</param>
 /// <param name="res">result ot be  read after parsing the response from the server.</param>
 internal abstract void Execute(SendingInstruction sendingInstruction, SessionStage sessionStage, IResultValue res);
コード例 #12
0
 private static Session GetRetrospectiveInStage(SessionStage sessionStage)
 {
     return(new Session {
         CurrentStage = sessionStage
     });
 }