diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/gcsdk/gcwebapikey.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'public/gcsdk/gcwebapikey.h')
| -rw-r--r-- | public/gcsdk/gcwebapikey.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/public/gcsdk/gcwebapikey.h b/public/gcsdk/gcwebapikey.h new file mode 100644 index 0000000..286b31b --- /dev/null +++ b/public/gcsdk/gcwebapikey.h @@ -0,0 +1,45 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: header for Web API key +// +//============================================================================= + +#ifndef GCWEBAPIKEY_H +#define GCWEBAPIKEY_H +#ifdef _WIN32 +#pragma once +#endif + +using GCSDK::CGCMsgBase; +using GCSDK::WebAPIKey_t; +using GCSDK::EWebAPIKeyStatus; + +class CMsgWebAPIKey; + +class CWebAPIKey +{ +public: + CWebAPIKey() { Clear(); } + + void Clear(); + bool BIsValid() const { return (m_unAccountID != 0 || m_unPublisherGroupID != 0) && m_eStatus == GCSDK::k_EWebAPIKeyValid; } + bool BIsAccountKey() const { return m_unAccountID != 0; } + bool BIsPublisherKey() const { return m_unPublisherGroupID != 0; } + uint32 GetAccountID() const { return m_unAccountID; } + uint32 GetPublisherGroupID() const { return m_unPublisherGroupID; } + uint32 GetID() const { return m_unWebAPIKeyID; } + const char *GetDomain() const { return m_sDomain; } + EWebAPIKeyStatus GetStatus() const { return m_eStatus; } + + void SerializeIntoProtoBuf( CMsgWebAPIKey & apiKey ) const; + void DeserializeFromProtoBuf( const CMsgWebAPIKey & apiKey ); + +private: + EWebAPIKeyStatus m_eStatus; + uint32 m_unAccountID; // set if key is for an account, 0 otherwise + uint32 m_unPublisherGroupID; // set if key is for a publisher, 0 otherwise + uint32 m_unWebAPIKeyID; + CUtlString m_sDomain; +}; + +#endif // GCWEBAPIKEY_H |