mirror of
https://github.com/googleforgames/open-match.git
synced 2025-03-27 08:20:47 +00:00
82 lines
2.6 KiB
Protocol Buffer
82 lines
2.6 KiB
Protocol Buffer
// 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-openapiv2/options/annotations.proto";
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
|
info: {
|
|
title: "Match Function"
|
|
version: "1.0"
|
|
contact: {
|
|
name: "Open Match"
|
|
url: "https://open-match.dev"
|
|
email: "open-match-discuss@googlegroups.com"
|
|
}
|
|
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 RunRequest {
|
|
// A MatchProfile defines constraints of Tickets in a Match and shapes the Match proposed by the MatchFunction.
|
|
MatchProfile profile = 1;
|
|
}
|
|
|
|
message RunResponse {
|
|
// A Proposal represents a Match candidate that satifies the constraints defined in the input Profile.
|
|
// A valid Proposal response will contain at least one ticket.
|
|
Match proposal = 1;
|
|
}
|
|
|
|
// The MatchFunction service implements APIs to run user-defined matchmaking logics.
|
|
service MatchFunction {
|
|
// DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.
|
|
// Run pulls Tickets that satisfy Profile constraints from QueryService,
|
|
// runs matchmaking logic against them, then constructs and streams back
|
|
// match candidates to the Backend service.
|
|
rpc Run(RunRequest) returns (stream RunResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/matchfunction:run"
|
|
body: "*"
|
|
};
|
|
}
|
|
}
|