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); }
private static void ValidUserName(StreamMessage streamMessage, ClientRobot robot) { if (MessageValidator.IsRecharging(streamMessage)) { return; } if (UserNameIsValid(streamMessage)) { return; } MessageService.SendSyntaxError(streamMessage, robot); }
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); }
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); }