Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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)
 {
 }