forked from googleforgames/open-match
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackend.pb.go
348 lines (318 loc) · 13.8 KB
/
backend.pb.go
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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: api/protobuf-spec/backend.proto
package pb
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("api/protobuf-spec/backend.proto", fileDescriptor_92161ae1f6f50f7a) }
var fileDescriptor_92161ae1f6f50f7a = []byte{
// 240 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x3f, 0x4b, 0x04, 0x31,
0x10, 0x47, 0xfd, 0x03, 0x0a, 0xd9, 0xc6, 0x0b, 0xd8, 0x5c, 0xa3, 0xd8, 0xdf, 0x46, 0x14, 0x51,
0x0b, 0x15, 0xef, 0x04, 0x1b, 0x45, 0xb1, 0xb4, 0x4b, 0x72, 0x73, 0x7b, 0xd1, 0x24, 0x13, 0x32,
0xb3, 0x5f, 0xcf, 0xcf, 0x26, 0xbb, 0x01, 0x5d, 0x71, 0x41, 0x6c, 0x1f, 0xef, 0xf1, 0x9b, 0x10,
0x71, 0xa0, 0x93, 0x53, 0x29, 0x23, 0xa3, 0x69, 0x57, 0x33, 0x4a, 0x60, 0x95, 0xd1, 0xf6, 0x1d,
0xe2, 0xb2, 0xee, 0xa9, 0xdc, 0xd6, 0xc9, 0x4d, 0x0f, 0x7f, 0x5b, 0x01, 0x88, 0x74, 0x03, 0x54,
0xb4, 0x93, 0x8f, 0x2d, 0xb1, 0x3b, 0x2f, 0xa1, 0xbc, 0x12, 0xd5, 0x22, 0x83, 0x66, 0x78, 0xd4,
0x6c, 0xd7, 0x72, 0xbf, 0xfe, 0x72, 0x7b, 0xf0, 0x64, 0xde, 0xc0, 0xf2, 0x74, 0x1c, 0x1f, 0x6d,
0xc8, 0x1b, 0x51, 0x3d, 0x38, 0xe2, 0x1e, 0x02, 0xfd, 0x37, 0x3f, 0xde, 0x94, 0x17, 0xa2, 0xba,
0x03, 0x0f, 0x7f, 0xec, 0xef, 0x7d, 0xe3, 0x17, 0xa0, 0xd6, 0x77, 0xd3, 0xd7, 0x62, 0x52, 0x2e,
0xbf, 0x25, 0x72, 0x4d, 0x0c, 0x10, 0xf9, 0xc7, 0x01, 0x03, 0x3c, 0xda, 0x5f, 0x8a, 0x49, 0x59,
0x1e, 0xf6, 0x43, 0x11, 0x89, 0x21, 0x8f, 0xa5, 0xf3, 0xf3, 0xd7, 0xb3, 0xc6, 0xf1, 0xba, 0x35,
0xb5, 0xc5, 0xa0, 0xee, 0x11, 0x1b, 0x0f, 0x0b, 0x8f, 0xed, 0xf2, 0xd9, 0x6b, 0x5e, 0x61, 0x0e,
0x0a, 0x13, 0xc4, 0x59, 0xe8, 0x5e, 0xa0, 0x5c, 0x64, 0xc8, 0x51, 0x7b, 0x95, 0x8c, 0xd9, 0xe9,
0x3f, 0xe0, 0xf4, 0x33, 0x00, 0x00, 0xff, 0xff, 0x33, 0x3a, 0x1e, 0x0d, 0xca, 0x01, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// BackendClient is the client API for Backend service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BackendClient interface {
// Run MMF once. Return a matchobject that fits this profile.
// INPUT: MatchObject message with these fields populated:
// - id
// - properties
// - [optional] roster, any fields you fill are available to your MMF.
// - [optional] pools, any fields you fill are available to your MMF.
// OUTPUT: MatchObject message with these fields populated:
// - id
// - properties
// - error. Empty if no error was encountered
// - rosters, if you choose to fill them in your MMF. (Recommended)
// - pools, if you used the MMLogicAPI in your MMF. (Recommended, and provides stats)
CreateMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*MatchObject, error)
// Continually run MMF and stream MatchObjects that fit this profile until
// the backend client closes the connection. Same inputs/outputs as CreateMatch.
ListMatches(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (Backend_ListMatchesClient, error)
// Delete a MatchObject from state storage manually. (MatchObjects in state
// storage will also automatically expire after a while, defined in the config)
// INPUT: MatchObject message with the 'id' field populated.
// (All other fields are ignored.)
DeleteMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*Result, error)
// Write the connection info for the list of players in the
// Assignments.messages.Rosters to state storage. The Frontend API is
// responsible for sending anything sent here to the game clients.
// Sending a player to this function kicks off a process that removes
// the player from future matchmaking functions by adding them to the
// 'deindexed' player list and then deleting their player ID from state storage
// indexes.
// INPUT: Assignments message with these fields populated:
// - assignment, anything you write to this string is sent to Frontend API
// - rosters. You can send any number of rosters, containing any number of
// player messages. All players from all rosters will be sent the assignment.
// The only field in the Roster's Player messages used by CreateAssignments is
// the id field. All other fields in the Player messages are silently ignored.
CreateAssignments(ctx context.Context, in *Assignments, opts ...grpc.CallOption) (*Result, error)
// Remove DGS connection info from state storage for players.
// INPUT: Roster message with the 'players' field populated.
// The only field in the Roster's Player messages used by
// DeleteAssignments is the 'id' field. All others are silently ignored. If
// you need to delete multiple rosters, make multiple calls.
DeleteAssignments(ctx context.Context, in *Roster, opts ...grpc.CallOption) (*Result, error)
}
type backendClient struct {
cc *grpc.ClientConn
}
func NewBackendClient(cc *grpc.ClientConn) BackendClient {
return &backendClient{cc}
}
func (c *backendClient) CreateMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*MatchObject, error) {
out := new(MatchObject)
err := c.cc.Invoke(ctx, "/api.Backend/CreateMatch", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) ListMatches(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (Backend_ListMatchesClient, error) {
stream, err := c.cc.NewStream(ctx, &_Backend_serviceDesc.Streams[0], "/api.Backend/ListMatches", opts...)
if err != nil {
return nil, err
}
x := &backendListMatchesClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Backend_ListMatchesClient interface {
Recv() (*MatchObject, error)
grpc.ClientStream
}
type backendListMatchesClient struct {
grpc.ClientStream
}
func (x *backendListMatchesClient) Recv() (*MatchObject, error) {
m := new(MatchObject)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *backendClient) DeleteMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*Result, error) {
out := new(Result)
err := c.cc.Invoke(ctx, "/api.Backend/DeleteMatch", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) CreateAssignments(ctx context.Context, in *Assignments, opts ...grpc.CallOption) (*Result, error) {
out := new(Result)
err := c.cc.Invoke(ctx, "/api.Backend/CreateAssignments", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendClient) DeleteAssignments(ctx context.Context, in *Roster, opts ...grpc.CallOption) (*Result, error) {
out := new(Result)
err := c.cc.Invoke(ctx, "/api.Backend/DeleteAssignments", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BackendServer is the server API for Backend service.
type BackendServer interface {
// Run MMF once. Return a matchobject that fits this profile.
// INPUT: MatchObject message with these fields populated:
// - id
// - properties
// - [optional] roster, any fields you fill are available to your MMF.
// - [optional] pools, any fields you fill are available to your MMF.
// OUTPUT: MatchObject message with these fields populated:
// - id
// - properties
// - error. Empty if no error was encountered
// - rosters, if you choose to fill them in your MMF. (Recommended)
// - pools, if you used the MMLogicAPI in your MMF. (Recommended, and provides stats)
CreateMatch(context.Context, *MatchObject) (*MatchObject, error)
// Continually run MMF and stream MatchObjects that fit this profile until
// the backend client closes the connection. Same inputs/outputs as CreateMatch.
ListMatches(*MatchObject, Backend_ListMatchesServer) error
// Delete a MatchObject from state storage manually. (MatchObjects in state
// storage will also automatically expire after a while, defined in the config)
// INPUT: MatchObject message with the 'id' field populated.
// (All other fields are ignored.)
DeleteMatch(context.Context, *MatchObject) (*Result, error)
// Write the connection info for the list of players in the
// Assignments.messages.Rosters to state storage. The Frontend API is
// responsible for sending anything sent here to the game clients.
// Sending a player to this function kicks off a process that removes
// the player from future matchmaking functions by adding them to the
// 'deindexed' player list and then deleting their player ID from state storage
// indexes.
// INPUT: Assignments message with these fields populated:
// - assignment, anything you write to this string is sent to Frontend API
// - rosters. You can send any number of rosters, containing any number of
// player messages. All players from all rosters will be sent the assignment.
// The only field in the Roster's Player messages used by CreateAssignments is
// the id field. All other fields in the Player messages are silently ignored.
CreateAssignments(context.Context, *Assignments) (*Result, error)
// Remove DGS connection info from state storage for players.
// INPUT: Roster message with the 'players' field populated.
// The only field in the Roster's Player messages used by
// DeleteAssignments is the 'id' field. All others are silently ignored. If
// you need to delete multiple rosters, make multiple calls.
DeleteAssignments(context.Context, *Roster) (*Result, error)
}
func RegisterBackendServer(s *grpc.Server, srv BackendServer) {
s.RegisterService(&_Backend_serviceDesc, srv)
}
func _Backend_CreateMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MatchObject)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).CreateMatch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.Backend/CreateMatch",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).CreateMatch(ctx, req.(*MatchObject))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_ListMatches_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(MatchObject)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(BackendServer).ListMatches(m, &backendListMatchesServer{stream})
}
type Backend_ListMatchesServer interface {
Send(*MatchObject) error
grpc.ServerStream
}
type backendListMatchesServer struct {
grpc.ServerStream
}
func (x *backendListMatchesServer) Send(m *MatchObject) error {
return x.ServerStream.SendMsg(m)
}
func _Backend_DeleteMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MatchObject)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).DeleteMatch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.Backend/DeleteMatch",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).DeleteMatch(ctx, req.(*MatchObject))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_CreateAssignments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Assignments)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).CreateAssignments(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.Backend/CreateAssignments",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).CreateAssignments(ctx, req.(*Assignments))
}
return interceptor(ctx, in, info, handler)
}
func _Backend_DeleteAssignments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Roster)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServer).DeleteAssignments(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.Backend/DeleteAssignments",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServer).DeleteAssignments(ctx, req.(*Roster))
}
return interceptor(ctx, in, info, handler)
}
var _Backend_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.Backend",
HandlerType: (*BackendServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateMatch",
Handler: _Backend_CreateMatch_Handler,
},
{
MethodName: "DeleteMatch",
Handler: _Backend_DeleteMatch_Handler,
},
{
MethodName: "CreateAssignments",
Handler: _Backend_CreateAssignments_Handler,
},
{
MethodName: "DeleteAssignments",
Handler: _Backend_DeleteAssignments_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "ListMatches",
Handler: _Backend_ListMatches_Handler,
ServerStreams: true,
},
},
Metadata: "api/protobuf-spec/backend.proto",
}