summaryrefslogtreecommitdiff
path: root/game/shared/econ/econ_game_account_server.h
blob: 01c1cc4163b1f3575e200f8c8af337231be05fee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Holds the CEconGameServerAccount object
//
// $NoKeywords: $
//=============================================================================//

#ifndef ECON_GAME_SERVER_ACCOUNT_H
#define ECON_GAME_SERVER_ACCOUNT_H
#ifdef _WIN32
#pragma once
#endif

enum eGameServerOrigin
{
	kGSAOrigin_Player		= 0,
	kGSAOrigin_Support		= 1,
	kGSAOrigin_AutoRegister	= 2, // for valve-owned servers
};

enum eGameServerScoreStanding
{
	kGSStanding_Good,
	kGSStanding_Bad,
};

enum eGameServerScoreStandingTrend
{
	kGSStandingTrend_Up,
	kGSStandingTrend_SteadyUp,
	kGSStandingTrend_Steady,
	kGSStandingTrend_SteadyDown,
	kGSStandingTrend_Down,
};

#ifdef GC
#include "gcsdk/schemasharedobject.h"

//---------------------------------------------------------------------------------
// Purpose: 
//---------------------------------------------------------------------------------
class CEconGameServerAccount : public GCSDK::CSchemaSharedObject< CSchGameServerAccount, k_EEconTypeGameServerAccount >
{
#ifdef GC_DLL
	DECLARE_CLASS_MEMPOOL( CEconGameServerAccount );
#endif

public:
	CEconGameServerAccount() {}
	CEconGameServerAccount( uint32 unAccountID ) 
	{
		Obj().m_unAccountID = unAccountID;
	}
};

void GameServerAccount_GenerateIdentityToken( char* pIdentityToken, uint32 unMaxChars );
#endif // GC

inline const char *GameServerAccount_GetStandingString( eGameServerScoreStanding standing )
{
	const char *pStanding = "Good";
	switch ( standing )
	{
	case kGSStanding_Good:
		pStanding = "Good";
		break;
	case kGSStanding_Bad:
		pStanding = "Bad";
		break;
	} // switch
	return pStanding;
}

inline const char *GameServerAccount_GetStandingTrendString( eGameServerScoreStandingTrend trend )
{
	const char *pStandingTrend = "Steady";
	switch ( trend )
	{
	case kGSStandingTrend_Up:
		pStandingTrend = "Upward Fast";
		break;
	case kGSStandingTrend_SteadyUp:
		pStandingTrend = "Slightly Upward";
		break;
	case kGSStandingTrend_Steady:
		pStandingTrend = "Steady";
		break;
	case kGSStandingTrend_SteadyDown:
		pStandingTrend = "Slightly Downward";
		break;
	case kGSStandingTrend_Down:
		pStandingTrend = "Downward Fast";
		break;
	} // switch
	return pStandingTrend;
}

//---------------------------------------------------------------------------------
// Purpose: Selective account-level data for game servers
//---------------------------------------------------------------------------------
class CEconGameAccountForGameServers : public GCSDK::CProtoBufSharedObject < CSOEconGameAccountForGameServers, k_EEconTypeGameAccountForGameServers >
{
#ifdef GC
	DECLARE_CLASS_MEMPOOL( CEconGameAccountForGameServers );
public:
	virtual bool BIsDatabaseBacked() const { return false; }
#endif
};

#endif //ECON_GAME_SERVER_ACCOUNT_H