Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: implementation of CWebAPIKey
  4. //
  5. //=============================================================================
  6. #include "stdafx.h"
  7. #include "gcsdk/msgprotobuf.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. //-----------------------------------------------------------------------------
  11. // Purpose: Clears key settings
  12. //-----------------------------------------------------------------------------
  13. void CWebAPIKey::Clear()
  14. {
  15. m_unAccountID = 0;
  16. m_unPublisherGroupID = 0;
  17. }
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Serializes the request into a message object (for proxying between
  20. // back-end Steam servers).
  21. //-----------------------------------------------------------------------------
  22. void CWebAPIKey::SerializeIntoProtoBuf( CMsgWebAPIKey & apiKey ) const
  23. {
  24. apiKey.set_status( m_eStatus );
  25. apiKey.set_account_id( m_unAccountID );
  26. apiKey.set_publisher_group_id( m_unPublisherGroupID );
  27. apiKey.set_key_id( m_unWebAPIKeyID );
  28. apiKey.set_domain( m_sDomain.Get() );
  29. }
  30. //-----------------------------------------------------------------------------
  31. // Purpose: Deserializes the response from a message object (for proxying between
  32. // back-end Steam servers).
  33. //-----------------------------------------------------------------------------
  34. void CWebAPIKey::DeserializeFromProtoBuf( const CMsgWebAPIKey & apiKey )
  35. {
  36. m_eStatus = (EWebAPIKeyStatus)apiKey.status();
  37. m_unAccountID = apiKey.account_id();
  38. m_unPublisherGroupID = apiKey.publisher_group_id();
  39. m_unWebAPIKeyID = apiKey.key_id();
  40. m_sDomain = apiKey.domain().c_str();
  41. }