Skip to content

Commit

Permalink
Merge pull request #836 from csandr/SteamUserCallback
Browse files Browse the repository at this point in the history
Add email address callback
  • Loading branch information
yaakov-h authored May 5, 2020
2 parents fe43159 + 60ab814 commit 007393c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
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

0 comments on commit 007393c

Please sign in to comment.