Skip to content

Commit 39d9f65

Browse files
authored
Update API References in prepare for v0.10.0 release (googleforgames#156)
* Update API References in prepare for v0.10.0 release * update * update * update
1 parent b500a08 commit 39d9f65

File tree

6 files changed

+170
-76
lines changed

6 files changed

+170
-76
lines changed

site/content/en/docs/Guides/Matchmaker/director.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,29 @@ rpc AssignTickets(AssignTicketsRequest) returns (AssignTicketsResponse) {
9191
};
9292
```
9393

94-
The API takes a list of TicketIDs to make the Assignment and an Assignment object.
94+
The API takes a list of `AssignmentGroups` to make the Assignment and returns the AssignmentFailures if any.
9595

9696
#### Assignment
9797

98-
Here is the proto for the Assignment:
98+
Here are the protos for the Assignment:
9999

100100
```proto
101-
message Assignment {
102-
string connection = 1;
103-
map<string, google.protobuf.Any> extensions = 4;
101+
message AssignmentGroup{
102+
// TicketIds is a list of strings representing Open Match generated Ids which apply to an Assignment.
103+
repeated string ticket_ids = 1;
104+
105+
// An Assignment specifies game connection related information to be associated with the TicketIds.
106+
Assignment assignment = 2;
107+
}
108+
109+
message AssignmentFailure {
110+
enum Cause {
111+
UNKNOWN = 0;
112+
TICKET_NOT_FOUND = 1;
113+
}
114+
115+
string ticket_id = 1;
116+
Cause cause = 2;
104117
}
105118
```
106119

site/content/en/docs/Guides/Matchmaker/frontend.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Here are the key interactions the Game Frontend has with Open Match:
1919
The Game Frontend adds a new matchmaking request to Open Match by creating a Ticket using the following API on Open Match Frontend:
2020

2121
```proto
22-
rpc CreateTicket(CreateTicketRequest) returns (CreateTicketResponse) {
22+
rpc CreateTicket(CreateTicketRequest) returns (Ticket) {
2323
option (google.api.http) = {
2424
post: "/v1/frontendservice/tickets"
2525
body: "*"
@@ -33,10 +33,25 @@ A Ticket represents a single matchmaking request in Open Match. It can represent
3333

3434
```proto
3535
message Ticket {
36+
// Id represents an auto-generated Id issued by Open Match.
3637
string id = 1;
38+
39+
// An Assignment represents a game server assignment associated with a Ticket.
40+
// Open Match does not require or inspect any fields on Assignment.
3741
Assignment assignment = 3;
42+
43+
// Search fields are the fields which Open Match is aware of, and can be used
44+
// when specifying filters.
3845
SearchFields search_fields = 4;
46+
47+
// Customized information not inspected by Open Match, to be used by the match
48+
// making function, evaluator, and components making calls to Open Match.
49+
// Optional, depending on the requirements of the connected systems.
3950
map<string, google.protobuf.Any> extensions = 5;
51+
52+
// Create time represents the time at which this Ticket was created. It is
53+
// populated by Open Match at the time of Ticket creation.
54+
google.protobuf.Timestamp create_time = 6;
4055
}
4156
```
4257

@@ -73,7 +88,7 @@ Open Match does not guarantee persistent storage and hence should not be used as
7388
Once the player Assignment has been stored & communicated to the Game Client, the Game Frontend may delete the Ticket from Open Match. Here is the API exposed on Open Match Frontend to delete a Ticket:
7489

7590
```proto
76-
rpc DeleteTicket(DeleteTicketRequest) returns (DeleteTicketResponse) {
91+
rpc DeleteTicket(DeleteTicketRequest) returns (google.protobuf.Empty) {
7792
option (google.api.http) = {
7893
delete: "/v1/frontendservice/tickets/{ticket_id}"
7994
};

site/content/en/docs/Guides/api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ func main() {
6565
},
6666
},
6767
}
68-
resp, err := feClient.CreateTicket(sent)
68+
ticket, err := feClient.CreateTicket(sent)
6969
if err != nil {
7070
log.Errorf("feClient.CreateTicket failed with %v", err)
7171
}
7272
73-
fmt.Println("Open Match assigned id %s to the ticket", resp.GetTicket().GetId())
73+
fmt.Println("Open Match assigned id %s to the ticket", ticket.GetId())
7474
}
7575
```
7676

@@ -117,12 +117,12 @@ func main() {
117117
log.Errorf("ioutil.ReadAll(resp.Body) failed with %v; want success", err)
118118
}
119119
// Unmarshal the response to a Go struct
120-
var received *pb.CreateTicketResponse
120+
var received *pb.Ticket
121121
if err := jsonpb.UnmarshalString(string(buf), received); err != nil {
122122
log.Errorf("jsonpb.UnmarshalString(%s, &msg) failed with %v; want success", buf, err)
123123
}
124124
125-
fmt.Println("Open Match assigned id %s to the ticket", received.GetTicket().GetId())
125+
fmt.Println("Open Match assigned id %s to the ticket", received.GetId())
126126
}
127127
```
128128

site/content/en/docs/Guides/best_practices.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ server := grpc.NewServer(
4141

4242
## Enable the client-side load balancer for your gRPC client
4343
You need to add the a load balancer config to your gRPC client to enable Open Match's horizontal scaling feature. Here are the two steps to turn on this setting and make it compatible with Kubernetes' environment.
44+
4445
1. Changing the Kubernetes' services of your customized components into `HeadlessService`s, if any. e.g.:
46+
4547
```yaml
4648
# https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
4749
spec:
@@ -52,7 +54,9 @@ You need to add the a load balancer config to your gRPC client to enable Open Ma
5254
clusterIP: None
5355
type: ClusterIP
5456
```
57+
5558
2. Using gRPC's DNS resolver when creating your clients and enable the client side load balancer:
59+
5660
```go
5761
import (
5862
"google.golang.org/grpc/resolver"

0 commit comments

Comments
 (0)