-
Notifications
You must be signed in to change notification settings - Fork 9
/
usermessages.proto
executable file
·303 lines (259 loc) · 7.27 KB
/
usermessages.proto
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
//====== Copyright (c) 2012, Valve Corporation, All rights reserved. ========//
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//===========================================================================//
//
// Purpose: The file defines our Google Protocol Buffers which are used in over
// the wire messages for the Source engine.
//
//=============================================================================
// We care more about speed than code size
option optimize_for = SPEED;
// We don't use the service generation functionality
option cc_generic_services = false;
//
// STYLE NOTES:
//
// Use CamelCase CMsgMyMessageName style names for messages.
//
// Use lowercase _ delimited names like my_steam_id for field names, this is non-standard for Steam,
// but plays nice with the Google formatted code generation.
//
// Try not to use required fields ever. Only do so if you are really really sure you'll never want them removed.
// Optional should be preffered as it will make versioning easier and cleaner in the future if someone refactors
// your message and wants to remove or rename fields.
//
// Use fixed64 for JobId_t, GID_t, or SteamID. This is appropriate for any field that is normally
// going to be larger than 2^56. Otherwise use int64 for 64 bit values that are frequently smaller
// than 2^56 as it will safe space on the wire in those cases.
//
// Similar to fixed64, use fixed32 for RTime32 or other 32 bit values that are frequently larger than
// 2^28. It will safe space in those cases, otherwise use int32 which will safe space for smaller values.
// An exception to this rule for RTime32 is if the value will frequently be zero rather than set to an actual
// time.
//
import "google/protobuf/descriptor.proto";
// for CMsgVector, etc.
import "netmessages.proto";
//=============================================================================
// Base User Messages
//=============================================================================
enum EBaseUserMessages
{
UM_AchievementEvent = 1;
UM_CloseCaption = 2;
UM_CloseCaptionDirect = 3; // Shares message def CUserMsg_CloseCaption
UM_CurrentTimescale = 4;
UM_DesiredTimescale = 5;
UM_Fade = 6;
UM_GameTitle = 7;
UM_Geiger = 8;
UM_HintText = 9;
UM_HudMsg = 10;
UM_HudText = 11;
UM_KeyHintText = 12;
UM_MessageText = 13;
UM_RequestState = 14;
UM_ResetHUD = 15;
UM_Rumble = 16;
UM_SayText = 17;
UM_SayText2 = 18;
UM_SayTextChannel = 19;
UM_Shake = 20;
UM_ShakeDir = 21;
UM_StatsCrawlMsg = 22;
UM_StatsSkipState = 23;
UM_TextMsg = 24;
UM_Tilt = 25;
UM_Train = 26;
UM_VGUIMenu = 27;
UM_VoiceMask = 28;
UM_VoiceSubtitle = 29;
UM_SendAudio = 30;
// Game specific user messages should start after this
UM_MAX_BASE = 63;
}
//=============================================================================
message CUserMsg_AchievementEvent
{
optional uint32 achievement = 1;
}
message CUserMsg_CloseCaption
{
optional fixed32 hash = 1;
optional float duration = 2;
optional bool from_player = 3;
}
message CUserMsg_CurrentTimescale
{
optional float current = 1;
}
message CUserMsg_DesiredTimescale
{
optional float desired = 1;
optional float duration = 2;
optional uint32 interpolator = 3;
optional float start_blend_time = 4;
}
message CUserMsg_Fade
{
optional uint32 duration = 1;
optional uint32 hold_time = 2;
optional uint32 flags = 3;
optional fixed32 color = 4;
}
message CUserMsg_Shake
{
optional uint32 command = 1;
optional float amplitude = 2;
optional float frequency = 3;
optional float duration = 4;
}
message CUserMsg_ShakeDir
{
optional CUserMsg_Shake shake = 1;
optional CMsgVector direction = 2;
}
message CUserMsg_Tilt
{
optional uint32 command = 1;
optional bool ease_in_out = 2;
optional CMsgVector angle = 3;
optional float duration = 4;
optional float time = 5;
}
message CUserMsg_SayText
{
optional uint32 client = 1;
optional string text = 2;
optional bool chat = 3;
}
message CUserMsg_SayText2
{
optional uint32 client = 1;
optional bool chat = 2;
optional string format = 3;
optional string prefix = 4;
optional string text = 5;
optional string location = 6;
}
message CUserMsg_HudMsg
{
optional uint32 channel = 1;
optional float x = 2;
optional float y = 3;
optional uint32 color1 = 4;
optional uint32 color2 = 5;
optional uint32 effect = 6;
optional float fade_in_time = 7;
optional float fade_out_time = 8;
optional float hold_time = 9;
optional float fx_time = 10;
optional string message = 11;
}
message CUserMsg_HudText
{
optional string message = 1;
}
message CUserMsg_TextMsg
{
optional uint32 dest = 1;
repeated string param = 2;
}
message CUserMsg_GameTitle
{
}
message CUserMsg_ResetHUD
{
}
message CUserMsg_SendAudio
{
///optional fixed32 hash = 1; // sound hash
optional bool stop = 2;
optional string name = 3; // sound name
}
message CUserMsg_VoiceMask
{
repeated int32 audible_players_mask = 1;
optional bool player_mod_enabled = 2;
}
message CUserMsg_RequestState
{
}
message CUserMsg_HintText
{
optional string message = 1;
}
message CUserMsg_KeyHintText
{
repeated string messages = 1;
}
message CUserMsg_StatsCrawlMsg
{
}
message CUserMsg_StatsSkipState
{
optional int32 num_skips = 1;
optional int32 num_players = 2;
}
message CUserMsg_VoiceSubtitle
{
optional int32 ent_index = 1;
optional int32 menu = 2;
optional int32 item = 3;
}
message CUserMsg_VGUIMenu
{
optional string name = 1;
optional bool show = 2;
message Keys
{
optional string name = 1;
optional string value = 2;
}
repeated Keys keys = 3;
}
message CUserMsg_Geiger
{
optional int32 range = 1;
}
message CUserMsg_Rumble
{
optional int32 index = 1;
optional int32 data = 2;
optional int32 flags = 3;
}
message CUserMsg_Train
{
optional int32 train = 1;
}
message CUserMsg_SayTextChannel
{
optional int32 player = 1;
optional int32 channel = 2;
optional string text = 3;
}
message CUserMsg_MessageText
{
optional uint32 color = 1;
optional string text = 2;
}