예제 #1
0
        private void Awake()
        {
            //Verify the set version string.
            if (String.IsNullOrWhiteSpace(VersionString))
            {
                throw new InvalidOperationException($"{nameof(VersionString)} cannot be null or empty.");
            }

            SessionVerificationData = ClientVerificationData.FromVersionString(VersionString).SecurityData;
            SessionId = 0;
        }
예제 #2
0
        public SharedLoginRequest93Payload(ushort clientVersion, int teamId, uint guildCard, [NotNull] string userName, [NotNull] string password, [NotNull] ClientVerificationData clientData, ServerType serverType = ServerType.PreShip)
        {
            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)serverType, 6).ToArray();
        }
예제 #3
0
 public SharedLoginRequest93Payload(ushort clientVersion, int teamId, [NotNull] string userName, [NotNull] string password, [NotNull] ClientVerificationData clientData, ServerType serverType = ServerType.PreShip)
     : this(clientVersion, teamId, 0, userName, password, clientData, serverType)
 {
 }