-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
5,054 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using Grpc.Net.Client; | ||
using Xunit; | ||
|
||
namespace OpenMatch.Tests | ||
{ | ||
public class BackendServiceClientTest | ||
{ | ||
[Fact] | ||
public void CanCreateBackendServiceClient() | ||
{ | ||
var channel = GrpcChannel.ForAddress("localhost:6000"); | ||
var omClient = new OpenMatch.BackendService.BackendServiceClient(channel); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
<PackageReference Include="xunit" Version="2.4.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
<PackageReference Include="coverlet.collector" Version="1.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../OpenMatch/OpenMatch.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2018 Google LLC | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
// Copyright 2019 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package openmatch; | ||
option go_package = "open-match.dev/open-match/pkg/pb"; | ||
option csharp_namespace = "OpenMatch"; | ||
|
||
import "api/messages.proto"; | ||
import "google/api/annotations.proto"; | ||
import "protoc-gen-swagger/options/annotations.proto"; | ||
|
||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { | ||
info: { | ||
title: "Backend" | ||
version: "1.0" | ||
contact: { | ||
name: "Open Match" | ||
url: "https://open-match.dev" | ||
email: "[email protected]" | ||
} | ||
license: { | ||
name: "Apache 2.0 License" | ||
url: "https://github.com/googleforgames/open-match/blob/master/LICENSE" | ||
} | ||
} | ||
external_docs: { | ||
url: "https://open-match.dev/site/docs/" | ||
description: "Open Match Documentation" | ||
} | ||
schemes: HTTP | ||
schemes: HTTPS | ||
consumes: "application/json" | ||
produces: "application/json" | ||
responses: { | ||
key: "404" | ||
value: { | ||
description: "Returned when the resource does not exist." | ||
schema: { json_schema: { type: STRING } } | ||
} | ||
} | ||
// TODO Add annotations for security_defintiions. | ||
// See | ||
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/a_bit_of_everything.proto | ||
}; | ||
|
||
// FunctionConfig specifies a MMF address and client type for Backend to establish connections with the MMF | ||
message FunctionConfig { | ||
string host = 1; | ||
int32 port = 2; | ||
Type type = 3; | ||
enum Type { | ||
GRPC = 0; | ||
REST = 1; | ||
} | ||
} | ||
|
||
message FetchMatchesRequest { | ||
// A configuration for the MatchFunction server of this FetchMatches call. | ||
FunctionConfig config = 1; | ||
|
||
// A MatchProfile that will be sent to the MatchFunction server of this FetchMatches call. | ||
MatchProfile profile = 2; | ||
} | ||
|
||
message FetchMatchesResponse { | ||
// A Match generated by the user-defined MMF with the specified MatchProfiles. | ||
// A valid Match response will contain at least one ticket. | ||
Match match = 1; | ||
} | ||
|
||
message ReleaseTicketsRequest{ | ||
// TicketIds is a list of string representing Open Match generated Ids to be re-enabled for MMF querying | ||
// because they are no longer awaiting assignment from a previous match result | ||
repeated string ticket_ids = 1; | ||
} | ||
|
||
message ReleaseTicketsResponse {} | ||
|
||
message AssignTicketsRequest { | ||
// TicketIds is a list of strings representing Open Match generated Ids which apply to an Assignment. | ||
repeated string ticket_ids = 1; | ||
|
||
// An Assignment specifies game connection related information to be associated with the TicketIds. | ||
Assignment assignment = 2; | ||
} | ||
|
||
message AssignTicketsResponse {} | ||
|
||
// The BackendService implements APIs to generate matches and handle ticket assignments. | ||
service BackendService { | ||
// FetchMatches triggers a MatchFunction with the specified MatchProfile and returns a set of match proposals that | ||
// match the description of that MatchProfile. | ||
// FetchMatches immediately returns an error if it encounters any execution failures. | ||
rpc FetchMatches(FetchMatchesRequest) returns (stream FetchMatchesResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/backendservice/matches:fetch" | ||
body: "*" | ||
}; | ||
} | ||
|
||
// AssignTickets overwrites the Assignment field of the input TicketIds. | ||
rpc AssignTickets(AssignTicketsRequest) returns (AssignTicketsResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/backendservice/tickets:assign" | ||
body: "*" | ||
}; | ||
} | ||
|
||
// ReleaseTickets removes the submitted tickets from the list that prevents tickets | ||
// that are awaiting assignment from appearing in MMF queries, effectively putting them back into | ||
// the matchmaking pool | ||
// | ||
// BETA FEATURE WARNING: This call and the associated Request and Response | ||
// messages are not finalized and still subject to possible change or removal. | ||
rpc ReleaseTickets(ReleaseTicketsRequest) returns (ReleaseTicketsResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/backendservice/tickets:release" | ||
body: "*" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Copyright 2019 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package openmatch; | ||
option go_package = "open-match.dev/open-match/pkg/pb"; | ||
option csharp_namespace = "OpenMatch"; | ||
|
||
import "api/messages.proto"; | ||
import "google/api/annotations.proto"; | ||
import "protoc-gen-swagger/options/annotations.proto"; | ||
|
||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { | ||
info: { | ||
title: "Evaluator" | ||
version: "1.0" | ||
contact: { | ||
name: "Open Match" | ||
url: "https://open-match.dev" | ||
email: "[email protected]" | ||
} | ||
license: { | ||
name: "Apache 2.0 License" | ||
url: "https://github.com/googleforgames/open-match/blob/master/LICENSE" | ||
} | ||
} | ||
external_docs: { | ||
url: "https://open-match.dev/site/docs/" | ||
description: "Open Match Documentation" | ||
} | ||
schemes: HTTP | ||
schemes: HTTPS | ||
consumes: "application/json" | ||
produces: "application/json" | ||
responses: { | ||
key: "404" | ||
value: { | ||
description: "Returned when the resource does not exist." | ||
schema: { json_schema: { type: STRING } } | ||
} | ||
} | ||
// TODO Add annotations for security_defintiions. | ||
// See | ||
// https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/proto/examplepb/a_bit_of_everything.proto | ||
}; | ||
|
||
message EvaluateRequest { | ||
// A Matches proposed by the Match Function representing a candidate of the final results. | ||
Match match = 1; | ||
} | ||
|
||
message EvaluateResponse { | ||
// A Match ID representing a shortlisted match returned by the evaluator as the final result. | ||
string match_id = 2; | ||
|
||
// Deprecated fields | ||
reserved 1; | ||
} | ||
|
||
// The Evaluator service implements APIs used to evaluate and shortlist matches proposed by MMFs. | ||
service Evaluator { | ||
// Evaluate evaluates a list of proposed matches based on quality, collision status, and etc, then shortlist the matches and returns the final results. | ||
rpc Evaluate(stream EvaluateRequest) returns (stream EvaluateResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/evaluator/matches:evaluate" | ||
body: "*" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2019 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
package openmatch; | ||
option go_package = "open-match.dev/open-match/pkg/pb"; | ||
option csharp_namespace = "OpenMatch"; | ||
|
||
// A DefaultEvaluationCriteria is used for a match's evaluation_input when using | ||
// the default evaluator. | ||
message DefaultEvaluationCriteria { | ||
double score = 1; | ||
} |
Oops, something went wrong.