-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommand.pb.go
More file actions
398 lines (348 loc) · 11.1 KB
/
command.pb.go
File metadata and controls
398 lines (348 loc) · 11.1 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
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc (unknown)
// source: command.proto
package generated
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Supported parameter types for commands.
type ParamType int32
const (
ParamType_PARAM_STRING ParamType = 0
ParamType_PARAM_INT ParamType = 1
ParamType_PARAM_FLOAT ParamType = 2
ParamType_PARAM_BOOL ParamType = 3
ParamType_PARAM_VARARGS ParamType = 4
ParamType_PARAM_ENUM ParamType = 5
)
// Enum value maps for ParamType.
var (
ParamType_name = map[int32]string{
0: "PARAM_STRING",
1: "PARAM_INT",
2: "PARAM_FLOAT",
3: "PARAM_BOOL",
4: "PARAM_VARARGS",
5: "PARAM_ENUM",
}
ParamType_value = map[string]int32{
"PARAM_STRING": 0,
"PARAM_INT": 1,
"PARAM_FLOAT": 2,
"PARAM_BOOL": 3,
"PARAM_VARARGS": 4,
"PARAM_ENUM": 5,
}
)
func (x ParamType) Enum() *ParamType {
p := new(ParamType)
*p = x
return p
}
func (x ParamType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ParamType) Descriptor() protoreflect.EnumDescriptor {
return file_command_proto_enumTypes[0].Descriptor()
}
func (ParamType) Type() protoreflect.EnumType {
return &file_command_proto_enumTypes[0]
}
func (x ParamType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ParamType.Descriptor instead.
func (ParamType) EnumDescriptor() ([]byte, []int) {
return file_command_proto_rawDescGZIP(), []int{0}
}
// Parameter specification for a command.
type ParamSpec struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Type ParamType `protobuf:"varint,2,opt,name=type,proto3,enum=df.plugin.ParamType" json:"type,omitempty"`
Optional bool `protobuf:"varint,3,opt,name=optional,proto3" json:"optional,omitempty"`
// Optional suffix as supported by Go cmd tags (e.g., units)
Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"`
// Optional list of enum values to present in the client UI.
// When set, the parameter is shown as an enum selector regardless of ParamType.
EnumValues []string `protobuf:"bytes,5,rep,name=enum_values,json=enumValues,proto3" json:"enum_values,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ParamSpec) Reset() {
*x = ParamSpec{}
mi := &file_command_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ParamSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ParamSpec) ProtoMessage() {}
func (x *ParamSpec) ProtoReflect() protoreflect.Message {
mi := &file_command_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ParamSpec.ProtoReflect.Descriptor instead.
func (*ParamSpec) Descriptor() ([]byte, []int) {
return file_command_proto_rawDescGZIP(), []int{0}
}
func (x *ParamSpec) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ParamSpec) GetType() ParamType {
if x != nil {
return x.Type
}
return ParamType_PARAM_STRING
}
func (x *ParamSpec) GetOptional() bool {
if x != nil {
return x.Optional
}
return false
}
func (x *ParamSpec) GetSuffix() string {
if x != nil {
return x.Suffix
}
return ""
}
func (x *ParamSpec) GetEnumValues() []string {
if x != nil {
return x.EnumValues
}
return nil
}
// Command specification announced by a plugin during handshake.
type CommandSpec struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"`
Params []*ParamSpec `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CommandSpec) Reset() {
*x = CommandSpec{}
mi := &file_command_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CommandSpec) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommandSpec) ProtoMessage() {}
func (x *CommandSpec) ProtoReflect() protoreflect.Message {
mi := &file_command_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CommandSpec.ProtoReflect.Descriptor instead.
func (*CommandSpec) Descriptor() ([]byte, []int) {
return file_command_proto_rawDescGZIP(), []int{1}
}
func (x *CommandSpec) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CommandSpec) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *CommandSpec) GetAliases() []string {
if x != nil {
return x.Aliases
}
return nil
}
func (x *CommandSpec) GetParams() []*ParamSpec {
if x != nil {
return x.Params
}
return nil
}
// Player command execution event.
type CommandEvent struct {
state protoimpl.MessageState `protogen:"open.v1"`
PlayerUuid string `protobuf:"bytes,1,opt,name=player_uuid,json=playerUuid,proto3" json:"player_uuid,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Raw string `protobuf:"bytes,3,opt,name=raw,proto3" json:"raw,omitempty"` // Full command string like "/tp 100 64 200"
Command string `protobuf:"bytes,4,opt,name=command,proto3" json:"command,omitempty"` // Just the command name like "tp"
Args []string `protobuf:"bytes,5,rep,name=args,proto3" json:"args,omitempty"` // Parsed arguments like ["100", "64", "200"]
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CommandEvent) Reset() {
*x = CommandEvent{}
mi := &file_command_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CommandEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CommandEvent) ProtoMessage() {}
func (x *CommandEvent) ProtoReflect() protoreflect.Message {
mi := &file_command_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CommandEvent.ProtoReflect.Descriptor instead.
func (*CommandEvent) Descriptor() ([]byte, []int) {
return file_command_proto_rawDescGZIP(), []int{2}
}
func (x *CommandEvent) GetPlayerUuid() string {
if x != nil {
return x.PlayerUuid
}
return ""
}
func (x *CommandEvent) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *CommandEvent) GetRaw() string {
if x != nil {
return x.Raw
}
return ""
}
func (x *CommandEvent) GetCommand() string {
if x != nil {
return x.Command
}
return ""
}
func (x *CommandEvent) GetArgs() []string {
if x != nil {
return x.Args
}
return nil
}
var File_command_proto protoreflect.FileDescriptor
const file_command_proto_rawDesc = "" +
"\n" +
"\rcommand.proto\x12\tdf.plugin\"\x9e\x01\n" +
"\tParamSpec\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12(\n" +
"\x04type\x18\x02 \x01(\x0e2\x14.df.plugin.ParamTypeR\x04type\x12\x1a\n" +
"\boptional\x18\x03 \x01(\bR\boptional\x12\x16\n" +
"\x06suffix\x18\x04 \x01(\tR\x06suffix\x12\x1f\n" +
"\venum_values\x18\x05 \x03(\tR\n" +
"enumValues\"\x8b\x01\n" +
"\vCommandSpec\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12 \n" +
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x18\n" +
"\aaliases\x18\x03 \x03(\tR\aaliases\x12,\n" +
"\x06params\x18\x04 \x03(\v2\x14.df.plugin.ParamSpecR\x06params\"\x83\x01\n" +
"\fCommandEvent\x12\x1f\n" +
"\vplayer_uuid\x18\x01 \x01(\tR\n" +
"playerUuid\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x10\n" +
"\x03raw\x18\x03 \x01(\tR\x03raw\x12\x18\n" +
"\acommand\x18\x04 \x01(\tR\acommand\x12\x12\n" +
"\x04args\x18\x05 \x03(\tR\x04args*p\n" +
"\tParamType\x12\x10\n" +
"\fPARAM_STRING\x10\x00\x12\r\n" +
"\tPARAM_INT\x10\x01\x12\x0f\n" +
"\vPARAM_FLOAT\x10\x02\x12\x0e\n" +
"\n" +
"PARAM_BOOL\x10\x03\x12\x11\n" +
"\rPARAM_VARARGS\x10\x04\x12\x0e\n" +
"\n" +
"PARAM_ENUM\x10\x05B\x8b\x01\n" +
"\rcom.df.pluginB\fCommandProtoP\x01Z'github.com/secmc/plugin/proto/generated\xa2\x02\x03DPX\xaa\x02\tDf.Plugin\xca\x02\tDf\\Plugin\xe2\x02\x15Df\\Plugin\\GPBMetadata\xea\x02\n" +
"Df::Pluginb\x06proto3"
var (
file_command_proto_rawDescOnce sync.Once
file_command_proto_rawDescData []byte
)
func file_command_proto_rawDescGZIP() []byte {
file_command_proto_rawDescOnce.Do(func() {
file_command_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_command_proto_rawDesc), len(file_command_proto_rawDesc)))
})
return file_command_proto_rawDescData
}
var file_command_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_command_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_command_proto_goTypes = []any{
(ParamType)(0), // 0: df.plugin.ParamType
(*ParamSpec)(nil), // 1: df.plugin.ParamSpec
(*CommandSpec)(nil), // 2: df.plugin.CommandSpec
(*CommandEvent)(nil), // 3: df.plugin.CommandEvent
}
var file_command_proto_depIdxs = []int32{
0, // 0: df.plugin.ParamSpec.type:type_name -> df.plugin.ParamType
1, // 1: df.plugin.CommandSpec.params:type_name -> df.plugin.ParamSpec
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_command_proto_init() }
func file_command_proto_init() {
if File_command_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_command_proto_rawDesc), len(file_command_proto_rawDesc)),
NumEnums: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_command_proto_goTypes,
DependencyIndexes: file_command_proto_depIdxs,
EnumInfos: file_command_proto_enumTypes,
MessageInfos: file_command_proto_msgTypes,
}.Build()
File_command_proto = out.File
file_command_proto_goTypes = nil
file_command_proto_depIdxs = nil
}