summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_gcmessages.h
blob: e5b1dcab54d13936ccbc3ce73a1d7f5035ab0b6c (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: This file defines all of our over-the-wire net protocols for the
//			Game Coordinator for Team Fortress.  Note that we never use types
//			with undefined length (like int).  Always use an explicit type 
//			(like int32).
//
//=============================================================================

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

#include "language.h"
#include "gcsdk/gcsystemmsgs.h"

// Protobuf headers interfere with the valve min/max/malloc overrides. so we need to do all
// this funky wrapping to make the include happy.
#include <tier0/valve_minmax_off.h>

#include "tf_gcmessages.pb.h"
#ifdef GC
#include "tf_gcmessages_interserver.pb.h" // These should not be exposed to clients/servers
#endif // #ifdef GC

#include <tier0/valve_minmax_on.h>

#pragma pack( push, 1 )

//-----------------------------------------------------------------------------
// Type IDs for TF GC classes. These are part of the client-GC protocol and
// should not change if it can be helped
//-----------------------------------------------------------------------------
enum EGCTFProtoObjectTypes
{
	k_EProtoObjectTypesGameBase			= 2000,

//	k_EProtoObjectHeroStandings			= k_EProtoObjectTypesGameBase + 1,
//	k_EProtoObjectGameAccountClient		= k_EProtoObjectTypesGameBase + 2,
	k_EProtoObjectTFParty				= k_EProtoObjectTypesGameBase + 3,
	k_EProtoObjectTFGameServerLobby		= k_EProtoObjectTypesGameBase + 4,
//	k_EProtoObjectBetaParticipation		= k_EProtoObjectTypesGameBase + 5,
	k_EProtoObjectTFPartyInvite			= k_EProtoObjectTypesGameBase + 6,
	k_EProtoObjectTFRatingData			= k_EProtoObjectTypesGameBase + 7,
};

//=============================================================================
// Duel

// k_EMsgGC_Duel_Request
struct MsgGC_Duel_Request_t
{
	uint64 m_ulInitiatorSteamID;
	uint64 m_ulTargetSteamID;
	uint8 m_usAsPlayerClass;
};

// k_EMsgGC_Duel_Response
struct MsgGC_Duel_Response_t
{
	uint64 m_ulInitiatorSteamID;
	uint64 m_ulTargetSteamID;
	bool m_bAccepted;
	uint8 m_usAsPlayerClass;
};

// k_EMsgGC_Duel_Results
struct MsgGC_Duel_Results_t
{
	uint64 m_ulInitiatorSteamID;
	uint64 m_ulTargetSteamID;
	uint64 m_ulWinnerSteamID;
	uint16 m_usScoreInitiator;
	uint16 m_usScoreTarget;
	uint8 m_usEndReason;
};

// k_EMsgGC_Duel_Status
enum EGCDuelStatus
{
	kDuel_Status_Invalid					= -1,
	kDuel_Status_AlreadyInDuel_Inititator,
	kDuel_Status_AlreadyInDuel_Target,
	kDuel_Status_DuelBanned_Initiator,
	kDuel_Status_DuelBanned_Target,
	kDuel_Status_MissingSession,				// could be gameserver session or target client session
	kDuel_Status_Cancelled,
};
struct MsgGC_Duel_Status_t
{
	uint8 m_usStatus;
	uint64 m_ulInitiatorSteamID;
	uint64 m_ulTargetSteamID;
};

//=============================================================================

// k_EMsgGC_MM_RequestMatch
struct MsgGC_MM_RequestMatch_t
{
	uint32 m_unRequiredGameServerFlags;
	// string with map name
};

// k_EMsgGC_MM_RequestMatchResponse
struct MsgGC_MM_RequestMatchResponse_t
{
	bool m_bServerFound;
	uint32 m_iServerAddress;
	uint16 m_iServerPort;
};

// k_EMsgGC_MM_ReserveSpot
struct MsgGC_MM_ReserveSpot_t
{
	uint64 m_ulSteamID;
};

// k_EMsgGC_MM_LoadMap
struct MsgGC_MM_LoadMap_t
{
	// string with map name
};

struct MsgGCChatMessage_t
{
	// string sChannelName
	// string sPersonaName
	int32 m_cMsgLen;
	// binary message
};

//=============================================================================

// do not re-order, stored in DB
enum
{
	kVoteKickBanPlayerReason_Other,
	kVoteKickBanPlayerReason_Cheating,
	kVoteKickBanPlayerReason_Idle,
	kVoteKickBanPlayerReason_Scamming,
};

uint32 GetKickBanPlayerReason( const char *pReasonString );

//=============================================================================

#pragma pack( pop )

// Normal:
#define MATCHMAKING_SPEWLEVEL4 4
#define MATCHMAKING_SPEWLEVEL3 4
#define MATCHMAKING_SPEWLEVEL2 2

// Use these defines to crank up the spew level
//#define MATCHMAKING_SPEWLEVEL4 1
//#define MATCHMAKING_SPEWLEVEL3 1
//#define MATCHMAKING_SPEWLEVEL2 1

#endif