From 60ab81483accfe79f895fb370de81acfba528944 Mon Sep 17 00:00:00 2001 From: csandr Date: Tue, 21 Apr 2020 13:00:49 +0300 Subject: [PATCH] Add email address callback --- .../Steam/Handlers/SteamUser/Callbacks.cs | 21 +++++++++++++++++++ .../Steam/Handlers/SteamUser/SteamUser.cs | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/Callbacks.cs b/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/Callbacks.cs index 0a9486b2b..c47157cca 100644 --- a/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/Callbacks.cs +++ b/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/Callbacks.cs @@ -293,6 +293,27 @@ internal AccountInfoCallback( CMsgClientAccountInfo msg ) } } + /// + /// This callback is received when email information is recieved from the network. + /// + public sealed class EmailAddrInfoCallback : CallbackMsg + { + /// + /// Gets the email address of this account. + /// + public string EmailAddress { get; private set; } + /// + /// Gets a value indicating validated email or not. + /// + public bool IsValidated { get; private set; } + + internal EmailAddrInfoCallback(CMsgClientEmailAddrInfo msg) + { + EmailAddress = msg.email_address; + IsValidated = msg.email_is_validated; + } + } + /// /// This callback is received when wallet info is recieved from the network. /// diff --git a/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/SteamUser.cs b/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/SteamUser.cs index 2714b5e04..af0ae9536 100644 --- a/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/SteamUser.cs +++ b/SteamKit2/SteamKit2/Steam/Handlers/SteamUser/SteamUser.cs @@ -266,6 +266,7 @@ internal SteamUser() { EMsg.ClientSessionToken, HandleSessionToken }, { EMsg.ClientUpdateMachineAuth, HandleUpdateMachineAuth }, { EMsg.ClientAccountInfo, HandleAccountInfo }, + { EMsg.ClientEmailAddrInfo, HandleEmailAddrInfo }, { EMsg.ClientWalletInfoUpdate, HandleWalletInfo }, { EMsg.ClientRequestWebAPIAuthenticateUserNonceResponse, HandleWebAPIUserNonce }, { EMsg.ClientMarketingMessageUpdate2, HandleMarketingMessageUpdate }, @@ -570,6 +571,12 @@ void HandleAccountInfo( IPacketMsg packetMsg ) var callback = new AccountInfoCallback( accInfo.Body ); this.Client.PostCallback( callback ); } + void HandleEmailAddrInfo(IPacketMsg packetMsg) + { + var emailAddrInfo = new ClientMsgProtobuf(packetMsg); + var callback = new EmailAddrInfoCallback(emailAddrInfo.Body); + this.Client.PostCallback(callback); + } void HandleWalletInfo( IPacketMsg packetMsg ) { var walletInfo = new ClientMsgProtobuf( packetMsg );