} = 0x00000102;                                              //newserv

        /// <summary>
        /// Creates a successful auth response with code <see cref="AuthenticationResponseCode"/> OK.
        /// </summary>
        /// <param name="guildCard">The guild card of the account.</param>
        /// <param name="teamId">The team id the account is asscoiated with.</param>
        /// <param name="securityData">The security data (?)</param>
        public SharedLoginResponsePayload(uint guildCard, int teamId, SecurityData securityData)
            : this()
        {
            GuildCard    = guildCard;
            TeamId       = teamId;
            SecurityData = securityData ?? throw new ArgumentNullException(nameof(securityData));
            ResponseCode = AuthenticationResponseCode.LOGIN_93BB_OK;
        }
        /// <summary>
        /// Creates a failed auth` response with a code other than <see cref="AuthenticationResponseCode"/> OK.
        /// </summary>
        /// <param name="responseCode">The response code to send.</param>
        public SharedLoginResponsePayload(AuthenticationResponseCode responseCode)
            : this()
        {
            if (!Enum.IsDefined(typeof(AuthenticationResponseCode), responseCode))
            {
                throw new InvalidEnumArgumentException(nameof(responseCode), (int)responseCode, typeof(AuthenticationResponseCode));
            }
            if (responseCode == AuthenticationResponseCode.LOGIN_93BB_OK)
            {
                throw new ArgumentException($"Cannot create failure response with Code: {responseCode}", nameof(responseCode));
            }

            ResponseCode = responseCode;
            SecurityData = new SecurityData();
        }
Exemplo n.º 3
0
 public ClientVerificationData(long hardwareInformation, SecurityData securityData)
     : this()
 {
     HardwareInformation = hardwareInformation;
     SecurityData        = securityData ?? throw new ArgumentNullException(nameof(securityData));
 }