summaryrefslogtreecommitdiff
path: root/game/shared/econ/econ_gcmessages.h
blob: c5e5d7a5ffa9073c95c7c645de260fda31c59251 (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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: This file defines all of our over-the-wire net protocols for the
//			Game Coordinator for the item system.  Note that we never use types
//			with undefined length (like int).  Always use an explicit type 
//			(like int32).
//
//=============================================================================

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

#include "econ_gcmessages.pb.h"

#pragma pack( push, 1 )


// generic zero-length message struct
struct MsgGCEmpty_t
{

};

// k_EMsgGCSetItemPosition 
struct MsgGCSetItemPosition_t
{
	uint64 m_unItemID;
	uint32 m_unNewPosition;
};

// k_EMsgGCCraft
struct MsgGCCraft_t
{
	int16	m_nRecipeDefIndex;
	uint16	m_nItemCount;
	// list of m_nItemCount uint64 item IDs
};

// k_EMsgGCDelete
struct MsgGCDelete_t
{
	uint64 m_unItemID;
};

// k_EMsgGCCraftResponse
struct MsgGCStandardResponse_t
{
	int16			m_nResponseIndex;
	uint32	m_eResponse;
};

// k_EMsgGCVerifyCacheSubscription
struct MsgGCVerifyCacheSubscription_t
{
	uint64 m_ulSteamID;
};

// k_EMsgGCNameItem
struct MsgGCNameItem_t
{
	uint64 m_unToolItemID;		// the Nametag item
	uint64 m_unSubjectItemID;	// the item to be renamed
	bool m_bDescription;
	// Varchar: Item name
};

// k_EMsgGCNameBaseItem
struct MsgGCNameBaseItem_t
{
	uint64 m_unToolItemID;				// the Nametag item
	uint32 m_unBaseItemDefinitionID;	// the base item definition to be renamed
	bool m_bDescription;
	// Varchar: Item name
};

// k_EMsgGCUnlockCrate
struct MsgGCUnlockCrate_t
{
	uint64 m_unToolItemID;		// the crate key
	uint64 m_unSubjectItemID;	// the crate to be decoded
};

// k_EMsgGCPaintItem
struct MsgGCPaintItem_t
{
	uint64 m_unToolItemID;		// the Paint Can item
	uint64 m_unSubjectItemID;	// the item to be painted
};

// k_EMsgGCGiftWrapItem
struct MsgGCGiftWrapItem_t
{
	uint64 m_unToolItemID;		// the Gift Wrap item
	uint64 m_unSubjectItemID;	// the item to be wrapped
};

// k_EMsgGCDeliverGift
struct MsgGCDeliverGift_t
{
	uint64 m_unGiftID;
	uint64 m_ulGiverSteamID;
	uint64 m_ulTargetSteamID;
};

// k_EMsgGCUnwrapGiftRequest
struct MsgGCUnwrapGiftRequest_t
{
	uint64 m_unItemID;
};

// k_EMsgGCMOTDRequest
struct MsgGCMOTDRequest_t
{
	RTime32		m_nLastMOTDRequest;	// Time at which the client last asked for MOTDs. GC will send back all MOTDs posted since.
	int16	m_eLanguage;
};

// k_EMsgGCMOTDRequestResponse
struct MsgGCMOTDRequestResponse_t
{
	int16		m_nEntries;
};

// k_EMsgGCCustomizeItemTexture
struct MsgGCCustomizeItemTexture_t
{
	uint64 m_unToolItemID;		// the tool
	uint64 m_unSubjectItemID;	// the item wants the texture
	uint64 m_unImageUGCHandle;	// cloud ID of image file (UGCHandle_t)
};

// k_EMsgGCSetItemStyle
struct MsgGCSetItemStyle_t
{
	uint64 m_unItemID;
	uint8 m_iStyle;
};

// k_EMsgGCItemPreviewCheckStatus
struct MsgGCCheckItemPreviewStatus_t
{
	uint32 m_unItemDefIndex;
};

// k_EMsgGCItemPreviewCheckStatusResponse
struct MsgGCItemPreviewCheckStatusResponse_t
{
	uint32 m_unItemDefIndex;
	uint32 m_eResponse;
	RTime32 m_timePreviewTime;
};

// k_EMsgGCItemPreviewRequest
struct MsgGCItemPreviewRequest_t
{
	uint32 m_unItemDefIndex;
};

// k_EMsgGCItemPreviewRequestResponse
struct MsgGCItemPreviewRequestResponse_t
{
	uint32 m_unItemDefIndex;
	uint32	m_eResponse;
};

// k_EMsgGCItemPreviewExpire
struct MsgGCItemPreviewExpire_t
{

};

// k_EMsgGCItemPreviewExpireNotification
struct MsgGCItemPreviewExpireNotification_t
{
	uint32 m_unItemDefIndex;
};

//-----------------------------------------------------------------------------

// k_EMsgGCUseItemResponse
enum EGCMsgUseItemResponse
{
	k_EGCMsgUseItemResponse_ItemUsed				 = 0,
	k_EGCMsgUseItemResponse_GiftNoOtherPlayers		 = 1,
	k_EGCMsgUseItemResponse_ServerError				 = 2,
	k_EGCMsgUseItemResponse_MiniGameAlreadyStarted	 = 3,
	k_EGCMsgUseItemResponse_ItemUsed_ItemsGranted	 = 4,
	k_EGCMsgUseItemResponse_CannotBeUsedByAccount	 = 5,
	k_EGCMsgUseItemResponse_ForceSizeInt			 = 0x7FFFFFFF
};

// k_EMsgGCUseItemResponse
struct MsgGCUseItemResponse_t
{
	uint32 m_eResponse;
};

// k_EMsgGCSpawnItem
struct MsgGCSpawnItem_t
{
	uint64 m_ulInitiatorSteamID;
	uint32 m_unItemDefinitionID;
	// other data dynamically added:
	// string of initiator name
};

// k_EMsgGCRespawnPostLoadoutChange
struct MsgGCRespawnPostLoadoutChange_t
{
	uint64 m_ulInitiatorSteamID;
};

// k_EMsgGCRemoveItemName
struct MsgGCRemoveItemName_t
{
	uint64 m_unItemID;
	bool m_bDescription;
};

//-----------------------------------------------------------------------------
// Trading

// k_EMsgGCTrading_InitiateTradeRequest
struct MsgGCTrading_InitiateTradeRequest_t
{
	uint32 m_unTradeRequestID;
	uint64 m_ulOtherSteamID;
	// @note player A's name as string when sent to party B
};

enum EGCMsgInitiateTradeResponse
{
	k_EGCMsgInitiateTradeResponse_Accepted				  = 0,
	k_EGCMsgInitiateTradeResponse_Declined				  = 1,
	k_EGCMsgInitiateTradeResponse_VAC_Banned_Initiator	  = 2,
	k_EGCMsgInitiateTradeResponse_VAC_Banned_Target		  = 3,
	k_EGCMsgInitiateTradeResponse_Target_Already_Trading  = 4,
	k_EGCMsgInitiateTradeResponse_Disabled				  = 5,
	k_EGCMsgInitiateTradeResponse_NotLoggedIn			  = 6,
	k_EGCMsgInitiateTradeResponse_Cancel				  = 7,
	k_EGCMsgInitiateTradeResponse_TooSoon				  = 8,
	k_EGCMsgInitiateTradeResponse_TooSoonPenalty		  = 9,
	k_EGCMsgInitiateTradeResponse_Trade_Banned_Initiator  = 10,
	k_EGCMsgInitiateTradeResponse_Trade_Banned_Target	  = 11,
	k_EGCMsgInitiateTradeResponse_Free_Account_Initiator_DEPRECATED  = 12,			// free accounts can initiate trades now
	k_EGCMsgInitiateTradeResponse_Shared_Account_Initiator= 13,
	k_EGCMsgInitiateTradeResponse_Service_Unavailable	  = 14,
	k_EGCMsgInitiateTradeResponse_Target_Blocked		  = 15,
	k_EGCMsgInitiateTradeResponse_NeedVerifiedEmail		  = 16,
	k_EGCMsgInitiateTradeResponse_NeedSteamGuard		  = 17,
	k_EGCMsgInitiateTradeResponse_SteamGuardDuration	  = 18,
	k_EGCMsgInitiateTradeResponse_TheyCannotTrade		  = 19,
	k_EGCMsgInitiateTradeResponse_Recent_Password_Reset	  = 20,
	k_EGCMsgInitiateTradeResponse_Using_New_Device		  = 21,
	k_EGCMsgInitiateTradeResponse_Sent_Invalid_Cookie	  = 22,

	k_EGCMsgInitiateTradeResponse_Count,
	k_EGCMsgInitiateTradeResponse_ForceSizeInt			  = 0x7FFFFFFF
};

// k_EMsgGCTrading_InitiateTradeResponse
struct MsgGCTrading_InitiateTradeResponse_t
{
	uint32	m_eResponse;
	uint32 m_unTradeRequestID;
};

// k_EMsgGCTrading_StartSession
struct MsgGCTrading_StartSession_t
{
	uint32 m_unSessionVersion;
	uint64 m_ulSteamIDPartyA;
	uint64 m_ulSteamIDPartyB;
	// @note strings from player names will be added to the message
};

// k_EMsgGCTrading_CancelSession
struct MsgGCTrading_CancelSession_t
{
};

// k_EMsgGCUsedClaimCodeItem
struct MsgGCUsedClaimCodeItem_t
{
	// string of URL
};

//-----------------------------------------------------------------------------
// ServerBrowser messages

enum EGCMsgServerBrowser
{
	k_EGCMsgServerBrowser_FromServerBrowser = 0,
	k_EGCMsgServerBrowser_FromAutoAskDialog = 1,
};

// k_EMsgGCServerBrowser_FavoriteServer
// k_EMsgGCServerBrowser_BlacklistServer
struct MsgGCServerBrowser_Server_t
{
	uint32 m_unIP;
	int m_usPort;
	uint8 m_ubSource;		// 0=serverbrowser, 1=auto-ask dialog
};

//-----------------------------------------------------------------------------
// Public facing loot lists.

// k_EMsgGC_RevolvingLootList
struct MsgGC_RevolvingLootList_t
{
	uint8		m_usListID; // Id of this list.
	// Var Data:
	// Serialized Lootlist KV
};


// k_EMsgGCLookupAccount 
struct MsgGCLookupAccount_t
{
	uint16	m_uiFindType;

	// Var Data
	// string containing Persona / URL / etc
};

// k_EMsgGCLookupAccountName 
struct MsgGCLookupAccountName_t
{
	uint32 m_unAccountID;
};

// k_EMsgGCLookupAccountNameResponse
struct MsgGCLookupAccountNameResponse_t
{
	uint32 m_unAccountID;
	// string containing persona name
};

#pragma pack( pop )

#endif