agones.dev/agones@v1.54.0/sdks/csharp/proto/sdk/alpha/alpha.proto (about)

     1  // Copyright 2020 Google LLC All Rights Reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package agones.dev.sdk.alpha;
    18  option go_package = "./alpha";
    19  
    20  import "google/api/annotations.proto";
    21  
    22  
    23  
    24  
    25  
    26  
    27  
    28  
    29  
    30  
    31  // SDK service to be used in the GameServer SDK to the Pod Sidecar.
    32  service SDK {
    33      // PlayerConnect increases the SDK’s stored player count by one, and appends this playerID to GameServer.Status.Players.IDs.
    34      //
    35      // GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
    36      // unless there is already an update pending, in which case the update joins that batch operation.
    37      //
    38      // PlayerConnect returns true and adds the playerID to the list of playerIDs if this playerID was not already in the
    39      // list of connected playerIDs.
    40      //
    41      // If the playerID exists within the list of connected playerIDs, PlayerConnect will return false, and the list of
    42      // connected playerIDs will be left unchanged.
    43      //
    44      // An error will be returned if the playerID was not already in the list of connected playerIDs but the player capacity for
    45      // the server has been reached. The playerID will not be added to the list of playerIDs.
    46      //
    47      // Warning: Do not use this method if you are manually managing GameServer.Status.Players.IDs and GameServer.Status.Players.Count
    48      // through the Kubernetes API, as indeterminate results will occur.
    49      rpc PlayerConnect (PlayerID) returns (Bool) {
    50          option (google.api.http) = {
    51              post: "/alpha/player/connect"
    52              body: "*"
    53          };
    54      }
    55  
    56      // Decreases the SDK’s stored player count by one, and removes the playerID from GameServer.Status.Players.IDs.
    57      //
    58      // GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
    59      // unless there is already an update pending, in which case the update joins that batch operation.
    60      //
    61      // PlayerDisconnect will return true and remove the supplied playerID from the list of connected playerIDs if the
    62      // playerID value exists within the list.
    63      //
    64      // If the playerID was not in the list of connected playerIDs, the call will return false, and the connected playerID list
    65      // will be left unchanged.
    66      //
    67      // Warning: Do not use this method if you are manually managing GameServer.status.players.IDs and GameServer.status.players.Count
    68      // through the Kubernetes API, as indeterminate results will occur.
    69      rpc PlayerDisconnect (PlayerID) returns (Bool) {
    70          option (google.api.http) = {
    71              post: "/alpha/player/disconnect"
    72              body: "*"
    73          };
    74      }
    75  
    76      // Update the GameServer.Status.Players.Capacity value with a new capacity.
    77      rpc SetPlayerCapacity (Count) returns (Empty) {
    78          option (google.api.http) = {
    79              put: "/alpha/player/capacity"
    80              body: "*"
    81          };
    82      }
    83  
    84      // Retrieves the current player capacity. This is always accurate from what has been set through this SDK,
    85      // even if the value has yet to be updated on the GameServer status resource.
    86      //
    87      // If GameServer.Status.Players.Capacity is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
    88      rpc GetPlayerCapacity (Empty) returns (Count) {
    89          option (google.api.http) = {
    90              get: "/alpha/player/capacity"
    91          };
    92      }
    93  
    94      // Retrieves the current player count. This is always accurate from what has been set through this SDK,
    95      // even if the value has yet to be updated on the GameServer status resource.
    96      //
    97      // If GameServer.Status.Players.Count is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
    98      rpc GetPlayerCount (Empty) returns (Count) {
    99          option (google.api.http) = {
   100              get: "/alpha/player/count"
   101          };
   102      }
   103  
   104      // Returns if the playerID is currently connected to the GameServer. This is always accurate from what has been set through this SDK,
   105      // even if the value has yet to be updated on the GameServer status resource.
   106      //
   107      // If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to determine connected status.
   108      rpc IsPlayerConnected (PlayerID) returns (Bool) {
   109          option (google.api.http) = {
   110              get: "/alpha/player/connected/{playerID}"
   111          };
   112      }
   113  
   114      // Returns the list of the currently connected player ids. This is always accurate from what has been set through this SDK,
   115      // even if the value has yet to be updated on the GameServer status resource.
   116      //
   117      // If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
   118      rpc GetConnectedPlayers(Empty) returns (PlayerIDList) {
   119          option (google.api.http) = {
   120              get: "/alpha/player/connected"
   121          };
   122      }
   123  }
   124  
   125  // I am Empty
   126  message Empty {
   127  }
   128  
   129  // Store a count variable.
   130  message Count {
   131      int64 count = 1;
   132  }
   133  
   134  // Store a boolean result
   135  message Bool {
   136      bool bool = 1;
   137  }
   138  
   139  // The unique identifier for a given player.
   140  message PlayerID {
   141      string playerID = 1;
   142  }
   143  
   144  // List of Player IDs
   145  message PlayerIDList {
   146      repeated string list = 1;
   147  }