-
Notifications
You must be signed in to change notification settings - Fork 236
Expand file tree
/
Copy pathnet.proto
More file actions
437 lines (374 loc) · 9.65 KB
/
net.proto
File metadata and controls
437 lines (374 loc) · 9.65 KB
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
syntax = "proto3";
option optimize_for = LITE_RUNTIME;
message Announce {
enum Types {
PING = 0;
PONG = 1;
}
Types type = 1;
repeated uint64 ids = 2;
message Other_Peers {
uint64 id = 1;
uint32 ip = 2;
uint32 udp_port = 3;
uint32 appid = 4;
}
uint32 tcp_port = 3;
repeated Other_Peers peers = 4;
uint32 appid = 5;
}
message Lobby {
uint64 room_id = 1;
uint64 owner = 2;
map<string, bytes> values = 3;
message Member {
uint64 id = 1;
map<string, bytes> values = 2;
}
repeated Member members = 4;
message Gameserver {
uint64 id = 1;
uint32 ip = 2;
uint32 port = 3;
uint32 num_update = 4;
}
Gameserver gameserver = 5;
uint32 member_limit = 6;
uint32 type = 7; //ELobbyType
bool joinable = 8;
uint32 appid = 9;
bool deleted = 32;
uint64 time_deleted = 33;
}
message Lobby_Messages {
uint64 id = 1;
enum Types {
JOIN = 0;
LEAVE = 1;
CHANGE_OWNER = 2;
MEMBER_DATA = 3;
CHAT_MESSAGE = 4;
DATA_REQUEST = 5;
}
Types type = 2;
uint64 idata = 3;
bytes bdata = 4;
map<string, bytes> map = 5;
}
message Low_Level {
enum Types {
HEARTBEAT = 0;
CONNECT = 1;
DISCONNECT = 2;
}
Types type = 1;
}
message Network_pb {
uint32 channel = 1;
bytes data = 2;
enum Types {
DATA = 0;
NEW_CONNECTION = 1;
}
Types type = 3;
bool processed = 128;
uint64 time_processed = 129;
}
message Network_Old {
enum Types {
CONNECTION_REQUEST_IP = 0;
CONNECTION_REQUEST_STEAMID = 1;
CONNECTION_ACCEPTED = 2;
CONNECTION_END = 3;
DATA = 4;
}
Types type = 1;
uint64 connection_id = 2;
uint64 connection_id_from = 3;
uint32 port = 4;
bytes data = 5;
}
message Networking_Sockets {
enum Types {
CONNECTION_REQUEST = 0;
CONNECTION_ACCEPTED = 2;
CONNECTION_END = 3;
DATA = 4;
}
Types type = 1;
int32 virtual_port = 2;
int32 real_port = 6;
uint64 connection_id = 3;
uint64 connection_id_from = 4;
bytes data = 5;
uint64 message_number = 7;
uint32 lane = 8;
}
message Networking_Messages {
enum Types {
CONNECTION_NEW = 0;
CONNECTION_ACCEPT = 1;
CONNECTION_END = 2;
DATA = 3;
}
Types type = 1;
uint32 channel = 2;
uint32 id_from = 3;
bytes data = 5;
}
message Gameserver {
message PlayerInfo {
string name = 1;
uint32 score = 2;
float playtime = 3;
}
uint64 id = 1;
bytes game_description = 2;
bytes mod_dir = 3;
bool dedicated_server = 4;
uint32 max_player_count = 5;
uint32 bot_player_count = 6;
bytes server_name = 7;
bytes map_name = 8;
bool password_protected = 9;
uint32 spectator_port = 10;
bytes spectator_server_name = 11;
map<string, bytes> values = 12;
bytes tags = 13;
bytes gamedata = 14;
bytes region = 15;
bytes product = 16;
bool secure = 17;
uint32 num_players = 18;
uint32 version = 19;
bytes game_dir = 20;
uint32 ip = 32;
uint32 port = 33;
uint32 query_port = 34;
uint32 appid = 35;
bytes version_name = 36;
uint32 protocol_version = 37;
bool offline = 48;
uint32 type = 49;
repeated PlayerInfo players = 50;
}
message Friend {
uint64 id = 1;
bytes name = 2;
map<string, bytes> rich_presence = 3;
uint32 appid = 4;
uint64 lobby_id = 5;
bytes avatar = 6;
}
message Auth_Ticket {
uint32 number = 1;
enum Types {
CANCEL = 0;
}
Types type = 2;
}
message Friend_Messages {
enum Types {
LOBBY_INVITE = 0;
GAME_INVITE = 1;
}
Types type = 1;
oneof invite_data {
uint64 lobby_id = 2;
bytes connect_str = 3;
}
}
message Steam_Messages {
enum Types {
FRIEND_CHAT = 0;
}
Types type = 1;
oneof message_data {
bytes message = 2;
}
}
message StatInfo {
enum Stat_Type {
STAT_TYPE_INT = 0;
STAT_TYPE_FLOAT = 1;
STAT_TYPE_AVGRATE = 2;
}
message AvgStatInfo {
float count_this_session = 1;
double session_length = 2;
}
Stat_Type stat_type = 1;
oneof stat_value {
float value_float = 2;
int32 value_int = 3;
}
optional AvgStatInfo value_avg = 4; // only set when type != INT
}
message GameServerStats_Messages {
// --- basic definitions
message AchievementInfo {
bool achieved = 1;
}
// --- requests & responses objects
// this is used when updating stats, from server or user, bi-directional
message AllStats {
map<string, StatInfo> user_stats = 1;
map<string, AchievementInfo> user_achievements = 2;
}
// sent from server as a request, response sent by the user
message InitialAllStats {
uint64 steam_api_call = 1;
// optional because the server send doesn't send any data, just steam api call id
optional AllStats all_data = 2;
}
message AchievementRequest {
string name = 1;
}
message AchievementResponse {
string name = 1;
AchievementInfo info = 2;
}
// Request_: from Steam_GameServerStats
// Response_: from Steam_User_Stats
enum Types {
Request_AllUserStats = 0;
Response_AllUserStats = 1;
UpdateUserStatsFromServer = 2; // sent by Steam_GameServerStats
UpdateUserStatsFromUser = 3; // sent by Steam_User_Stats
Request_UserAchievement = 4;
Response_UserAchievement = 5;
}
Types type = 1;
oneof data_messages {
InitialAllStats initial_user_stats = 2;
AllStats update_user_stats = 3;
AchievementRequest achievement_request = 4;
AchievementResponse achievement_response = 5;
}
}
message Leaderboards_Messages {
message LeaderboardInfo {
string board_name = 1;
int32 sort_method = 2;
int32 display_type = 3;
}
message UserScoreEntry {
int32 score = 1;
repeated int32 score_details = 2;
}
enum Types {
UpdateUserScore = 0; // notify others on the network that our score was updated
UpdateUserScoreMutual = 1; // notify others on the network that our score was updated, and request theirs
RequestUserScore = 2; // request score data from a single user
}
Types type = 1;
uint32 appid = 2;
LeaderboardInfo leaderboard_info = 3;
oneof data_messages {
UserScoreEntry user_score_entry = 4;
}
}
message Steam_User_Stats_Data {
map<string, StatInfo> user_stats = 1;
}
message Steam_User_Stats_Messages {
enum Types {
REQUEST_USERSTATS = 0;
RESPONSE_USERSTATS = 1;
}
Types type = 1;
optional Steam_User_Stats_Data steam_user_stats_data = 2;
}
message GameServer_Items_Messages {
message Attribute {
uint32 def = 1;
float value = 2;
bytes value_bytes = 3;
}
message EquipState {
uint32 class_id = 1;
uint32 slot_id = 2;
}
message Item {
uint64 id = 1;
uint32 def = 2;
uint32 level = 3;
int32 quality = 4;
uint32 inv_pos = 5;
uint32 quantity = 6;
repeated Attribute attributes = 7;
uint32 flags = 8;
uint32 origin = 9;
string custom_name = 10;
string custom_desc = 11;
uint64 original_id = 12;
bool in_use = 13;
uint32 style = 14;
repeated EquipState equip_states = 15;
}
message InventoryRequest {
uint64 steam_api_call = 1;
}
message InventoryResponse {
uint64 steam_api_call = 1;
repeated Item items = 2;
}
message ItemUpdate {
uint64 id = 1;
optional uint32 inv_pos = 2;
optional uint32 style = 3;
optional bool has_equip_states = 4;
repeated EquipState equip_states = 5;
}
message ItemDeletion {
uint64 item_id = 1;
}
enum Types {
Request_Inventory = 0;
Response_Inventory = 1;
Request_UpdateItem = 2;
Request_DeleteItem = 3;
Request_Respawn = 4;
}
Types type = 1;
bool is_gc = 2;
oneof data_messages {
InventoryRequest inventory_request = 3;
InventoryResponse inventory_response = 4;
ItemUpdate item_update = 5;
ItemDeletion item_deletion = 6;
}
}
message Common_Message {
uint64 source_id = 1; // SteamID64 of the sender
uint64 dest_id = 2; // SteamID64 of the target receiver
oneof messages {
Announce announce = 3;
Low_Level low_level = 4;
Lobby lobby = 5;
Lobby_Messages lobby_messages = 6;
Network_pb network = 7;
Gameserver gameserver = 8;
Friend friend = 9;
Auth_Ticket auth_ticket = 10;
Friend_Messages friend_messages = 11;
Network_Old network_old = 12;
Networking_Sockets networking_sockets = 13;
Steam_Messages steam_messages = 14;
Networking_Messages networking_messages = 15;
GameServerStats_Messages gameserver_stats_messages = 16;
Leaderboards_Messages leaderboards_messages = 17;
Steam_User_Stats_Messages steam_user_stats_messages = 18;
GameServer_Items_Messages gameserver_items_messages = 19;
}
uint32 source_ip = 128;
uint32 source_port = 129;
}
//Non networking related protobufs
message SteamAppTicket_pb {
uint32 ticket_version_no = 1;
uint32 crc_encryptedticket = 2;
uint32 cb_encrypteduserdata = 3;
uint32 cb_encrypted_appownershipticket = 4;
bytes encrypted_ticket = 5;
}