Example #1
0
 private static bool IsKeyValid(StreamMessage streamMessage, ClientRobot robot)
 {
     if (MessageValidator.IsRecharging(streamMessage))
     {
         RechargingService.WaitForRecharging(streamMessage, robot);
         streamMessage.ReadMessage("Accepted key", MaxLenths.Message);
         IsKeyValid(streamMessage, robot);
     }
     if (MessageValidator.IsTooLong(streamMessage, MaxLenths.Login))
     {
         return(false);
     }
     return(true);
 }
Example #2
0
        private static void ValidPassword(StreamMessage streamMessage, ClientRobot robot)
        {
            if (MessageValidator.IsRecharging(streamMessage))
            {
                RechargingService.WaitForRecharging(streamMessage, robot);
                streamMessage.ReadMessage("Accepted password", MaxLenths.Password);
                ValidPassword(streamMessage, robot);
            }
            if (PasswordIsValid(streamMessage))
            {
                return;
            }

            MessageService.SendSyntaxError(streamMessage, robot);
        }
Example #3
0
        private static void GetConfirm(StreamMessage streamMessage, ClientRobot robot)
        {
            if (MessageValidator.IsRecharging(streamMessage))
            {
                RechargingService.WaitForRecharging(streamMessage, robot);
                streamMessage.ReadMessage("Accepted confirm", MaxLenths.Confirm);
                GetConfirm(streamMessage, robot);
            }

            if (IsConfirmMessageValid(streamMessage))
            {
                return;
            }

            MessageService.SendSyntaxError(streamMessage, robot);
        }