Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email address callback #836

Merged
merged 1 commit into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions SteamKit2/SteamKit2/Steam/Handlers/SteamUser/Callbacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,27 @@ internal AccountInfoCallback( CMsgClientAccountInfo msg )
}
}

/// <summary>
/// This callback is received when email information is recieved from the network.
/// </summary>
public sealed class EmailAddrInfoCallback : CallbackMsg
{
/// <summary>
/// Gets the email address of this account.
/// </summary>
public string EmailAddress { get; private set; }
/// <summary>
/// Gets a value indicating validated email or not.
/// </summary>
public bool IsValidated { get; private set; }

internal EmailAddrInfoCallback(CMsgClientEmailAddrInfo msg)
{
EmailAddress = msg.email_address;
IsValidated = msg.email_is_validated;
}
}

/// <summary>
/// This callback is received when wallet info is recieved from the network.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions SteamKit2/SteamKit2/Steam/Handlers/SteamUser/SteamUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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<CMsgClientEmailAddrInfo>(packetMsg);
var callback = new EmailAddrInfoCallback(emailAddrInfo.Body);
this.Client.PostCallback(callback);
}
void HandleWalletInfo( IPacketMsg packetMsg )
{
var walletInfo = new ClientMsgProtobuf<CMsgClientWalletInfoUpdate>( packetMsg );
Expand Down