Skip to content

Commit

Permalink
Merge branch 'release/0.9.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
intelligide committed Apr 1, 2020
2 parents f9e71b0 + 8f28e67 commit 6e769e7
Show file tree
Hide file tree
Showing 46 changed files with 5,054 additions and 18 deletions.
15 changes: 15 additions & 0 deletions OpenMatch.csharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{97E4CF46-77B
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenMatch", "src\OpenMatch\OpenMatch.csproj", "{71820FC5-013B-4C8E-BDD3-637C5B0C3C22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenMatch.Tests", "src\OpenMatch.Tests\OpenMatch.Tests.csproj", "{4BBCE81C-FF66-465E-9EDF-C563B5D59191}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -32,8 +34,21 @@ Global
{71820FC5-013B-4C8E-BDD3-637C5B0C3C22}.Release|x64.Build.0 = Release|Any CPU
{71820FC5-013B-4C8E-BDD3-637C5B0C3C22}.Release|x86.ActiveCfg = Release|Any CPU
{71820FC5-013B-4C8E-BDD3-637C5B0C3C22}.Release|x86.Build.0 = Release|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Debug|x64.ActiveCfg = Debug|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Debug|x64.Build.0 = Debug|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Debug|x86.ActiveCfg = Debug|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Debug|x86.Build.0 = Debug|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Release|Any CPU.Build.0 = Release|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Release|x64.ActiveCfg = Release|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Release|x64.Build.0 = Release|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Release|x86.ActiveCfg = Release|Any CPU
{4BBCE81C-FF66-465E-9EDF-C563B5D59191}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{71820FC5-013B-4C8E-BDD3-637C5B0C3C22} = {97E4CF46-77B6-4CD6-9DB4-F1BE44D4819C}
{4BBCE81C-FF66-465E-9EDF-C563B5D59191} = {97E4CF46-77B6-4CD6-9DB4-F1BE44D4819C}
EndGlobalSection
EndGlobal
15 changes: 11 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
trigger:
- master
- develop
- release/*

pool:
vmImage: 'windows-latest'
Expand All @@ -10,19 +12,24 @@ variables:

steps:
- task: DotNetCoreCLI@2
name: Restore
inputs:
command: 'restore'
projects: |
$(solution)
- task: DotNetCoreCLI@2
name: Build
inputs:
command: 'build'
projects: |
$(solution)
arguments: -c $(buildConfiguration)

# - task: VSTest@2
# inputs:
# platform: '$(buildPlatform)'
# configuration: '$(buildConfiguration)'
- task: DotNetCoreCLI@2
name: Test
inputs:
command: 'test'
projects: |
$(solution)
arguments: -c $(buildConfiguration)
16 changes: 16 additions & 0 deletions src/OpenMatch.Tests/BackendServiceClientTest.cs
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);
}
}
}
20 changes: 20 additions & 0 deletions src/OpenMatch.Tests/OpenMatch.Tests.csproj
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>
18 changes: 4 additions & 14 deletions src/OpenMatch/OpenMatch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<OpenMatchVersion>0.9.0</OpenMatchVersion>

<PackageId>OpenMatch.Api</PackageId>
<Title>OpenMatch Api</Title>
<Version>0.9.1</Version>
<Version>0.9.2</Version>
<PackageDescription>C# API for OpenMatch</PackageDescription>
<Authors>FrozenStorm Interactive</Authors>
<PackageLicenseFile>License</PackageLicenseFile>
Expand All @@ -21,10 +19,10 @@
</ItemGroup>

<ItemGroup>
<Protobuf Access="public" Include="$(IntermediateOutputPath)/open-match-$(OpenMatchVersion)/api/**/*.proto" GrpcServices="Both" ProtoRoot="$(IntermediateOutputPath)/open-match-$(OpenMatchVersion); $(IntermediateOutputPath)/open-match-$(OpenMatchVersion)/third_party" />
<Protobuf Access="public" Include="proto/api/**/*.proto" GrpcServices="Both" ProtoRoot="proto;proto/third_party" />

<Protobuf Access="internal" Include="$(IntermediateOutputPath)/open-match-$(OpenMatchVersion)/third_party/google/**/*.proto" GrpcServices="Both" ProtoRoot="$(IntermediateOutputPath)/open-match-$(OpenMatchVersion)/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/google" />
<Protobuf Access="internal" Include="$(IntermediateOutputPath)/open-match-$(OpenMatchVersion)/third_party/protoc-gen-swagger/**/*.proto" GrpcServices="Both" ProtoRoot="$(IntermediateOutputPath)/open-match-$(OpenMatchVersion)/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/protoc-gen-swagger" />
<Protobuf Access="internal" Include="proto/third_party/google/**/*.proto" GrpcServices="Both" ProtoRoot="proto/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/google" />
<Protobuf Access="internal" Include="proto/third_party/protoc-gen-swagger/**/*.proto" GrpcServices="Both" ProtoRoot="proto/third_party" OutputDir="$(IntermediateOutputPath)/ThirdParty/protoc-gen-swagger" />
</ItemGroup>

<ItemGroup>
Expand All @@ -33,12 +31,4 @@
<PackageReference Include="Grpc.Tools" Version="2.27.0" />
</ItemGroup>

<Target Name="DownloadSourcesFiles" BeforeTargets="UnzipSourcesFiles;Build" Condition="!Exists('$(IntermediateOutputPath)/om-sources-$(OpenMatchVersion).zip')">
<DownloadFile SourceUrl="https://github.com/googleforgames/open-match/archive/v$(OpenMatchVersion).zip" DestinationFileName="om-sources-$(OpenMatchVersion).zip" DestinationFolder="$(IntermediateOutputPath)" />
</Target>

<Target Name="UnzipSourcesFiles" AfterTargets="DownloadSourcesFiles" BeforeTargets="Build;Protobuf_BeforeCompile" Condition="!Exists('$(IntermediateOutputPath)/open-match-$(OpenMatchVersion)')">
<Unzip SourceFiles="$(IntermediateOutputPath)/om-sources-$(OpenMatchVersion).zip" DestinationFolder="$(IntermediateOutputPath)" OverwriteReadOnlyFiles="true" />
</Target>

</Project>
13 changes: 13 additions & 0 deletions src/OpenMatch/proto/api/LICENSE
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.
133 changes: 133 additions & 0 deletions src/OpenMatch/proto/api/backend.proto
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: "*"
};
}
}
80 changes: 80 additions & 0 deletions src/OpenMatch/proto/api/evaluator.proto
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: "*"
};
}
}
24 changes: 24 additions & 0 deletions src/OpenMatch/proto/api/extensions.proto
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;
}
Loading

0 comments on commit 6e769e7

Please sign in to comment.