Skip to content

Commit b8d2057

Browse files
committed
Merge branch 'release/1.2.0'
2 parents f2d0ca8 + 754f1e5 commit b8d2057

File tree

11 files changed

+854
-414
lines changed

11 files changed

+854
-414
lines changed

src/OpenMatch.Tests/BackendServiceClientTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class BackendServiceClientTest
99
[Fact]
1010
public void CanCreateBackendServiceClient()
1111
{
12-
var channel = GrpcChannel.ForAddress("localhost:6000");
12+
var channel = GrpcChannel.ForAddress("https://localhost:6000");
1313
var omClient = new OpenMatch.BackendService.BackendServiceClient(channel);
1414
}
1515
}

src/OpenMatch/OpenMatch.csproj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<PackageId>OpenMatch.Api</PackageId>
66
<Title>OpenMatch Api</Title>
7-
<Version>1.1.1</Version>
7+
<Version>1.2.0</Version>
88
<PackageDescription>C# API for OpenMatch</PackageDescription>
99
<Authors>Yoann Potinet</Authors>
1010
<Company>FrozenStorm Interactive</Company>
@@ -23,16 +23,18 @@
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<Protobuf Access="public" Include="proto/api/**/*.proto" GrpcServices="Both" ProtoRoot="proto;proto/third_party" />
27-
26+
<Protobuf Access="public" Include="proto/api/**/*.proto" GrpcServices="Both" ProtoRoot="proto" AdditionalImportDirs="proto/third_party" />
2827
<Protobuf Access="internal" Include="proto/third_party/google/**/*.proto" GrpcServices="Both" ProtoRoot="proto/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/google" />
29-
<Protobuf Access="internal" Include="proto/third_party/protoc-gen-swagger/**/*.proto" GrpcServices="Both" ProtoRoot="proto/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/protoc-gen-swagger" />
28+
<Protobuf Access="internal" Include="proto/third_party/protoc-gen-openapiv2/**/*.proto" GrpcServices="Both" ProtoRoot="proto/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/protoc-gen-openapiv2" />
3029
</ItemGroup>
3130

3231
<ItemGroup>
33-
<PackageReference Include="Grpc.Net.Client" Version="2.29.0" />
34-
<PackageReference Include="Google.Protobuf" Version="3.15.0" />
35-
<PackageReference Include="Grpc.Tools" Version="2.29.0" />
32+
<PackageReference Include="Grpc.Net.Client" Version="2.38.0" />
33+
<PackageReference Include="Google.Protobuf" Version="3.17.0" />
34+
<PackageReference Include="Grpc.Tools" Version="2.38.0">
35+
<PrivateAssets>all</PrivateAssets>
36+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
37+
</PackageReference>
3638
</ItemGroup>
3739

3840
</Project>

src/OpenMatch/proto/api/backend.proto

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ option csharp_namespace = "OpenMatch";
1919

2020
import "api/messages.proto";
2121
import "google/api/annotations.proto";
22-
import "protoc-gen-swagger/options/annotations.proto";
22+
import "protoc-gen-openapiv2/options/annotations.proto";
2323

24-
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
24+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
2525
info: {
2626
title: "Backend"
2727
version: "1.0"
@@ -93,7 +93,7 @@ message ReleaseAllTicketsRequest{}
9393
message ReleaseAllTicketsResponse {}
9494

9595
// AssignmentGroup contains an Assignment and the Tickets to which it should be applied.
96-
message AssignmentGroup{
96+
message AssignmentGroup {
9797
// TicketIds is a list of strings representing Open Match generated Ids which apply to an Assignment.
9898
repeated string ticket_ids = 1;
9999

@@ -146,7 +146,6 @@ service BackendService {
146146

147147
// ReleaseTickets moves tickets from the pending state, to the active state.
148148
// This enables them to be returned by query, and find different matches.
149-
//
150149
// BETA FEATURE WARNING: This call and the associated Request and Response
151150
// messages are not finalized and still subject to possible change or removal.
152151
rpc ReleaseTickets(ReleaseTicketsRequest) returns (ReleaseTicketsResponse) {
@@ -159,7 +158,6 @@ service BackendService {
159158
// ReleaseAllTickets moves all tickets from the pending state, to the active
160159
// state. This enables them to be returned by query, and find different
161160
// matches.
162-
//
163161
// BETA FEATURE WARNING: This call and the associated Request and Response
164162
// messages are not finalized and still subject to possible change or removal.
165163
rpc ReleaseAllTickets(ReleaseAllTicketsRequest) returns (ReleaseAllTicketsResponse) {

src/OpenMatch/proto/api/evaluator.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ option csharp_namespace = "OpenMatch";
1919

2020
import "api/messages.proto";
2121
import "google/api/annotations.proto";
22-
import "protoc-gen-swagger/options/annotations.proto";
22+
import "protoc-gen-openapiv2/options/annotations.proto";
2323

24-
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
24+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
2525
info: {
2626
title: "Evaluator"
2727
version: "1.0"
@@ -52,7 +52,7 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
5252
}
5353
// TODO Add annotations for security_defintiions.
5454
// See
55-
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/a_bit_of_everything.proto
55+
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/internal/proto/examplepb/a_bit_of_everything.proto
5656
};
5757

5858
message EvaluateRequest {

src/OpenMatch/proto/api/frontend.proto

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ option csharp_namespace = "OpenMatch";
1919

2020
import "api/messages.proto";
2121
import "google/api/annotations.proto";
22-
import "protoc-gen-swagger/options/annotations.proto";
22+
import "protoc-gen-openapiv2/options/annotations.proto";
2323
import "google/protobuf/empty.proto";
2424

25-
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
25+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
2626
info: {
2727
title: "Frontend"
2828
version: "1.0"
@@ -53,7 +53,7 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
5353
}
5454
// TODO Add annotations for security_defintiions.
5555
// See
56-
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/a_bit_of_everything.proto
56+
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/internal/proto/examplepb/a_bit_of_everything.proto
5757
};
5858

5959
message CreateTicketRequest {
@@ -81,6 +81,47 @@ message WatchAssignmentsResponse {
8181
Assignment assignment = 1;
8282
}
8383

84+
// BETA FEATURE WARNING: This Request message is not finalized and still subject
85+
// to possible change or removal.
86+
message AcknowledgeBackfillRequest {
87+
// An existing ID of Backfill to acknowledge.
88+
string backfill_id = 1;
89+
90+
// An updated Assignment of the requested Backfill.
91+
Assignment assignment = 2;
92+
}
93+
94+
// BETA FEATURE WARNING: This Request message is not finalized and still subject
95+
// to possible change or removal.
96+
message CreateBackfillRequest {
97+
// An empty Backfill object.
98+
Backfill backfill = 1;
99+
}
100+
101+
// BETA FEATURE WARNING: This Request message is not finalized and still subject
102+
// to possible change or removal.
103+
message DeleteBackfillRequest {
104+
// An existing ID of Backfill to delete.
105+
string backfill_id = 1;
106+
}
107+
108+
// BETA FEATURE WARNING: This Request message is not finalized and still subject
109+
// to possible change or removal.
110+
message GetBackfillRequest {
111+
// An existing ID of Backfill to retrieve.
112+
string backfill_id = 1;
113+
}
114+
115+
// UpdateBackfillRequest - update searchFields, extensions and set assignment.
116+
//
117+
// BETA FEATURE WARNING: This Request message is not finalized and still subject
118+
// to possible change or removal.
119+
message UpdateBackfillRequest {
120+
// A Backfill object with ID set and fields to update.
121+
Backfill backfill = 1;
122+
}
123+
124+
84125
// The FrontendService implements APIs to manage and query status of a Tickets.
85126
service FrontendService {
86127
// CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.
@@ -117,4 +158,55 @@ service FrontendService {
117158
get: "/v1/frontendservice/tickets/{ticket_id}/assignments"
118159
};
119160
}
161+
162+
// AcknowledgeBackfill is used to notify OpenMatch about GameServer connection info
163+
// This triggers an assignment process.
164+
// BETA FEATURE WARNING: This call and the associated Request and Response
165+
// messages are not finalized and still subject to possible change or removal.
166+
rpc AcknowledgeBackfill(AcknowledgeBackfillRequest) returns (Backfill) {
167+
option (google.api.http) = {
168+
post: "/v1/frontendservice/backfills/{backfill_id}/acknowledge"
169+
body: "*"
170+
};
171+
}
172+
173+
// CreateBackfill creates a new Backfill object.
174+
// BETA FEATURE WARNING: This call and the associated Request and Response
175+
// messages are not finalized and still subject to possible change or removal.
176+
rpc CreateBackfill(CreateBackfillRequest) returns (Backfill) {
177+
option (google.api.http) = {
178+
post: "/v1/frontendservice/backfills"
179+
body: "*"
180+
};
181+
}
182+
183+
// DeleteBackfill receives a backfill ID and deletes its resource.
184+
// Any tickets waiting for this backfill will be returned to the active pool, no longer pending.
185+
// BETA FEATURE WARNING: This call and the associated Request and Response
186+
// messages are not finalized and still subject to possible change or removal.
187+
rpc DeleteBackfill(DeleteBackfillRequest) returns (google.protobuf.Empty) {
188+
option (google.api.http) = {
189+
delete: "/v1/frontendservice/backfills/{backfill_id}"
190+
};
191+
}
192+
193+
// GetBackfill returns a backfill object by its ID.
194+
// BETA FEATURE WARNING: This call and the associated Request and Response
195+
// messages are not finalized and still subject to possible change or removal.
196+
rpc GetBackfill(GetBackfillRequest) returns (Backfill) {
197+
option (google.api.http) = {
198+
get: "/v1/frontendservice/backfills/{backfill_id}"
199+
};
200+
}
201+
202+
// UpdateBackfill updates search_fields and extensions for the backfill with the provided id.
203+
// Any tickets waiting for this backfill will be returned to the active pool, no longer pending.
204+
// BETA FEATURE WARNING: This call and the associated Request and Response
205+
// messages are not finalized and still subject to possible change or removal.
206+
rpc UpdateBackfill(UpdateBackfillRequest) returns (Backfill) {
207+
option (google.api.http) = {
208+
patch: "/v1/frontendservice/backfills"
209+
body: "*"
210+
};
211+
}
120212
}

src/OpenMatch/proto/api/matchfunction.proto

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ option csharp_namespace = "OpenMatch";
1919

2020
import "api/messages.proto";
2121
import "google/api/annotations.proto";
22-
import "protoc-gen-swagger/options/annotations.proto";
22+
import "protoc-gen-openapiv2/options/annotations.proto";
2323

24-
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
24+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
2525
info: {
2626
title: "Match Function"
2727
version: "1.0"
@@ -69,8 +69,9 @@ message RunResponse {
6969
// The MatchFunction service implements APIs to run user-defined matchmaking logics.
7070
service MatchFunction {
7171
// DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.
72-
// Run pulls Tickets that satisfy Profile constraints from QueryService, runs matchmaking logics against them, then
73-
// constructs and streams back match candidates to the Backend service.
72+
// Run pulls Tickets that satisfy Profile constraints from QueryService,
73+
// runs matchmaking logic against them, then constructs and streams back
74+
// match candidates to the Backend service.
7475
rpc Run(RunRequest) returns (stream RunResponse) {
7576
option (google.api.http) = {
7677
post: "/v1/matchfunction:run"

src/OpenMatch/proto/api/messages.proto

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ message DoubleRangeFilter {
103103

104104
// Minimum value.
105105
double min = 3;
106+
107+
enum Exclude {
108+
// No bounds should be excluded when evaluating the filter, i.e.: MIN <= x <= MAX
109+
NONE = 0;
110+
111+
// Only the minimum bound should be excluded when evaluating the filter, i.e.: MIN < x <= MAX
112+
MIN = 1;
113+
114+
// Only the maximum bound should be excluded when evaluating the filter, i.e.: MIN <= x < MAX
115+
MAX = 2;
116+
117+
// Both bounds should be excluded when evaluating the filter, i.e.: MIN < x < MAX
118+
BOTH = 3;
119+
}
120+
121+
// Defines the bounds to apply when filtering tickets by their search_fields.double_args value.
122+
// BETA FEATURE WARNING: This field and the associated values are
123+
// not finalized and still subject to possible change or removal.
124+
Exclude exclude = 4;
106125
}
107126

108127
// Filters strings exactly equaling a value.
@@ -201,6 +220,45 @@ message Match {
201220
// Optional, depending on the requirements of the connected systems.
202221
map<string, google.protobuf.Any> extensions = 7;
203222

223+
// Backfill request which contains additional information to the match
224+
// and contains an association to a GameServer.
225+
// BETA FEATURE WARNING: This field is not finalized and still subject
226+
// to possible change or removal.
227+
Backfill backfill = 8;
228+
229+
// AllocateGameServer signalise Director that Backfill is new and it should
230+
// allocate a GameServer, this Backfill would be assigned.
231+
// BETA FEATURE WARNING: This field is not finalized and still subject
232+
// to possible change or removal.
233+
bool allocate_gameserver = 9;
234+
204235
// Deprecated fields.
205236
reserved 5, 6;
206237
}
238+
239+
// Represents a backfill entity which is used to fill partially full matches.
240+
//
241+
// BETA FEATURE WARNING: This call and the associated Request and Response
242+
// messages are not finalized and still subject to possible change or removal.
243+
message Backfill {
244+
// Id represents an auto-generated Id issued by Open Match.
245+
string id = 1;
246+
247+
// Search fields are the fields which Open Match is aware of, and can be used
248+
// when specifying filters.
249+
SearchFields search_fields = 2;
250+
251+
// Customized information not inspected by Open Match, to be used by
252+
// the Match Function, evaluator, and components making calls to Open Match.
253+
// Optional, depending on the requirements of the connected systems.
254+
map<string, google.protobuf.Any> extensions = 3;
255+
256+
// Create time is the time the Ticket was created. It is populated by Open
257+
// Match at the time of Ticket creation.
258+
google.protobuf.Timestamp create_time = 4;
259+
260+
// Generation gets incremented on GameServers update operations.
261+
// Prevents the MMF from overriding a newer version from the game server.
262+
// Do NOT read or write to this field, it is for internal tracking, and changing the value will cause bugs.
263+
int64 generation = 5;
264+
}

src/OpenMatch/proto/api/query.proto

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ option csharp_namespace = "OpenMatch";
1919

2020
import "api/messages.proto";
2121
import "google/api/annotations.proto";
22-
import "protoc-gen-swagger/options/annotations.proto";
22+
import "protoc-gen-openapiv2/options/annotations.proto";
2323

24-
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
24+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
2525
info: {
2626
title: "MM Logic (Data Layer)"
2727
version: "1.0"
@@ -52,7 +52,7 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
5252
}
5353
// TODO Add annotations for security_defintiions.
5454
// See
55-
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/a_bit_of_everything.proto
55+
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/internal/proto/examplepb/a_bit_of_everything.proto
5656
};
5757

5858
message QueryTicketsRequest {
@@ -75,6 +75,20 @@ message QueryTicketIdsResponse {
7575
repeated string ids = 1;
7676
}
7777

78+
// BETA FEATURE WARNING: This Request messages are not finalized and
79+
// still subject to possible change or removal.
80+
message QueryBackfillsRequest {
81+
// The Pool representing the set of Filters to be queried.
82+
Pool pool = 1;
83+
}
84+
85+
// BETA FEATURE WARNING: This Request messages are not finalized and
86+
// still subject to possible change or removal.
87+
message QueryBackfillsResponse {
88+
// Backfills that meet all the filtering criteria requested by the pool.
89+
repeated Backfill backfills = 1;
90+
}
91+
7892
// The QueryService service implements helper APIs for Match Function to query Tickets from state storage.
7993
service QueryService {
8094
// QueryTickets gets a list of Tickets that match all Filters of the input Pool.
@@ -98,4 +112,14 @@ service QueryService {
98112
body: "*"
99113
};
100114
}
115+
116+
// QueryBackfills gets a list of Backfills.
117+
// BETA FEATURE WARNING: This call and the associated Request and Response
118+
// messages are not finalized and still subject to possible change or removal.
119+
rpc QueryBackfills(QueryBackfillsRequest) returns (stream QueryBackfillsResponse) {
120+
option (google.api.http) = {
121+
post: "/v1/queryservice/backfills:query"
122+
body: "*"
123+
};
124+
}
101125
}

0 commit comments

Comments
 (0)