agones.dev/agones@v1.54.0/sdks/nodejs/lib/alpha/alpha_grpc_pb.js (about)

     1  // Copyright 2024 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  // This code was autogenerated. Do not edit directly.
    16  // GENERATED CODE -- DO NOT EDIT!
    17  
    18  // Original file comments:
    19  // Copyright 2020 Google LLC All Rights Reserved.
    20  //
    21  // Licensed under the Apache License, Version 2.0 (the "License");
    22  // you may not use this file except in compliance with the License.
    23  // You may obtain a copy of the License at
    24  //
    25  //     http://www.apache.org/licenses/LICENSE-2.0
    26  //
    27  // Unless required by applicable law or agreed to in writing, software
    28  // distributed under the License is distributed on an "AS IS" BASIS,
    29  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    30  // See the License for the specific language governing permissions and
    31  // limitations under the License.
    32  //
    33  'use strict';
    34  var alpha_pb = require('./alpha_pb.js');
    35  var google_api_annotations_pb = require('./google/api/annotations_pb.js');
    36  var protoc$gen$openapiv2_options_annotations_pb = require('./protoc-gen-openapiv2/options/annotations_pb.js');
    37  
    38  function serialize_agones_dev_sdk_alpha_Bool(arg) {
    39    if (!(arg instanceof alpha_pb.Bool)) {
    40      throw new Error('Expected argument of type agones.dev.sdk.alpha.Bool');
    41    }
    42    return Buffer.from(arg.serializeBinary());
    43  }
    44  
    45  function deserialize_agones_dev_sdk_alpha_Bool(buffer_arg) {
    46    return alpha_pb.Bool.deserializeBinary(new Uint8Array(buffer_arg));
    47  }
    48  
    49  function serialize_agones_dev_sdk_alpha_Count(arg) {
    50    if (!(arg instanceof alpha_pb.Count)) {
    51      throw new Error('Expected argument of type agones.dev.sdk.alpha.Count');
    52    }
    53    return Buffer.from(arg.serializeBinary());
    54  }
    55  
    56  function deserialize_agones_dev_sdk_alpha_Count(buffer_arg) {
    57    return alpha_pb.Count.deserializeBinary(new Uint8Array(buffer_arg));
    58  }
    59  
    60  function serialize_agones_dev_sdk_alpha_Empty(arg) {
    61    if (!(arg instanceof alpha_pb.Empty)) {
    62      throw new Error('Expected argument of type agones.dev.sdk.alpha.Empty');
    63    }
    64    return Buffer.from(arg.serializeBinary());
    65  }
    66  
    67  function deserialize_agones_dev_sdk_alpha_Empty(buffer_arg) {
    68    return alpha_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg));
    69  }
    70  
    71  function serialize_agones_dev_sdk_alpha_PlayerID(arg) {
    72    if (!(arg instanceof alpha_pb.PlayerID)) {
    73      throw new Error('Expected argument of type agones.dev.sdk.alpha.PlayerID');
    74    }
    75    return Buffer.from(arg.serializeBinary());
    76  }
    77  
    78  function deserialize_agones_dev_sdk_alpha_PlayerID(buffer_arg) {
    79    return alpha_pb.PlayerID.deserializeBinary(new Uint8Array(buffer_arg));
    80  }
    81  
    82  function serialize_agones_dev_sdk_alpha_PlayerIDList(arg) {
    83    if (!(arg instanceof alpha_pb.PlayerIDList)) {
    84      throw new Error('Expected argument of type agones.dev.sdk.alpha.PlayerIDList');
    85    }
    86    return Buffer.from(arg.serializeBinary());
    87  }
    88  
    89  function deserialize_agones_dev_sdk_alpha_PlayerIDList(buffer_arg) {
    90    return alpha_pb.PlayerIDList.deserializeBinary(new Uint8Array(buffer_arg));
    91  }
    92  
    93  
    94  // SDK service to be used in the GameServer SDK to the Pod Sidecar.
    95  var SDKService = exports['agones.dev.sdk.alpha.SDK'] = {
    96    // PlayerConnect increases the SDK’s stored player count by one, and appends this playerID to GameServer.Status.Players.IDs.
    97  //
    98  // GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
    99  // unless there is already an update pending, in which case the update joins that batch operation.
   100  //
   101  // PlayerConnect returns true and adds the playerID to the list of playerIDs if this playerID was not already in the
   102  // list of connected playerIDs.
   103  //
   104  // If the playerID exists within the list of connected playerIDs, PlayerConnect will return false, and the list of
   105  // connected playerIDs will be left unchanged.
   106  //
   107  // An error will be returned if the playerID was not already in the list of connected playerIDs but the player capacity for
   108  // the server has been reached. The playerID will not be added to the list of playerIDs.
   109  //
   110  // Warning: Do not use this method if you are manually managing GameServer.Status.Players.IDs and GameServer.Status.Players.Count
   111  // through the Kubernetes API, as indeterminate results will occur.
   112  playerConnect: {
   113      path: '/agones.dev.sdk.alpha.SDK/PlayerConnect',
   114      requestStream: false,
   115      responseStream: false,
   116      requestType: alpha_pb.PlayerID,
   117      responseType: alpha_pb.Bool,
   118      requestSerialize: serialize_agones_dev_sdk_alpha_PlayerID,
   119      requestDeserialize: deserialize_agones_dev_sdk_alpha_PlayerID,
   120      responseSerialize: serialize_agones_dev_sdk_alpha_Bool,
   121      responseDeserialize: deserialize_agones_dev_sdk_alpha_Bool,
   122    },
   123    // Decreases the SDK’s stored player count by one, and removes the playerID from GameServer.Status.Players.IDs.
   124  //
   125  // GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
   126  // unless there is already an update pending, in which case the update joins that batch operation.
   127  //
   128  // PlayerDisconnect will return true and remove the supplied playerID from the list of connected playerIDs if the
   129  // playerID value exists within the list.
   130  //
   131  // If the playerID was not in the list of connected playerIDs, the call will return false, and the connected playerID list
   132  // will be left unchanged.
   133  //
   134  // Warning: Do not use this method if you are manually managing GameServer.status.players.IDs and GameServer.status.players.Count
   135  // through the Kubernetes API, as indeterminate results will occur.
   136  playerDisconnect: {
   137      path: '/agones.dev.sdk.alpha.SDK/PlayerDisconnect',
   138      requestStream: false,
   139      responseStream: false,
   140      requestType: alpha_pb.PlayerID,
   141      responseType: alpha_pb.Bool,
   142      requestSerialize: serialize_agones_dev_sdk_alpha_PlayerID,
   143      requestDeserialize: deserialize_agones_dev_sdk_alpha_PlayerID,
   144      responseSerialize: serialize_agones_dev_sdk_alpha_Bool,
   145      responseDeserialize: deserialize_agones_dev_sdk_alpha_Bool,
   146    },
   147    // Update the GameServer.Status.Players.Capacity value with a new capacity.
   148  setPlayerCapacity: {
   149      path: '/agones.dev.sdk.alpha.SDK/SetPlayerCapacity',
   150      requestStream: false,
   151      responseStream: false,
   152      requestType: alpha_pb.Count,
   153      responseType: alpha_pb.Empty,
   154      requestSerialize: serialize_agones_dev_sdk_alpha_Count,
   155      requestDeserialize: deserialize_agones_dev_sdk_alpha_Count,
   156      responseSerialize: serialize_agones_dev_sdk_alpha_Empty,
   157      responseDeserialize: deserialize_agones_dev_sdk_alpha_Empty,
   158    },
   159    // Retrieves the current player capacity. This is always accurate from what has been set through this SDK,
   160  // even if the value has yet to be updated on the GameServer status resource.
   161  //
   162  // If GameServer.Status.Players.Capacity is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
   163  getPlayerCapacity: {
   164      path: '/agones.dev.sdk.alpha.SDK/GetPlayerCapacity',
   165      requestStream: false,
   166      responseStream: false,
   167      requestType: alpha_pb.Empty,
   168      responseType: alpha_pb.Count,
   169      requestSerialize: serialize_agones_dev_sdk_alpha_Empty,
   170      requestDeserialize: deserialize_agones_dev_sdk_alpha_Empty,
   171      responseSerialize: serialize_agones_dev_sdk_alpha_Count,
   172      responseDeserialize: deserialize_agones_dev_sdk_alpha_Count,
   173    },
   174    // Retrieves the current player count. This is always accurate from what has been set through this SDK,
   175  // even if the value has yet to be updated on the GameServer status resource.
   176  //
   177  // If GameServer.Status.Players.Count is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
   178  getPlayerCount: {
   179      path: '/agones.dev.sdk.alpha.SDK/GetPlayerCount',
   180      requestStream: false,
   181      responseStream: false,
   182      requestType: alpha_pb.Empty,
   183      responseType: alpha_pb.Count,
   184      requestSerialize: serialize_agones_dev_sdk_alpha_Empty,
   185      requestDeserialize: deserialize_agones_dev_sdk_alpha_Empty,
   186      responseSerialize: serialize_agones_dev_sdk_alpha_Count,
   187      responseDeserialize: deserialize_agones_dev_sdk_alpha_Count,
   188    },
   189    // Returns if the playerID is currently connected to the GameServer. This is always accurate from what has been set through this SDK,
   190  // even if the value has yet to be updated on the GameServer status resource.
   191  //
   192  // If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to determine connected status.
   193  isPlayerConnected: {
   194      path: '/agones.dev.sdk.alpha.SDK/IsPlayerConnected',
   195      requestStream: false,
   196      responseStream: false,
   197      requestType: alpha_pb.PlayerID,
   198      responseType: alpha_pb.Bool,
   199      requestSerialize: serialize_agones_dev_sdk_alpha_PlayerID,
   200      requestDeserialize: deserialize_agones_dev_sdk_alpha_PlayerID,
   201      responseSerialize: serialize_agones_dev_sdk_alpha_Bool,
   202      responseDeserialize: deserialize_agones_dev_sdk_alpha_Bool,
   203    },
   204    // Returns the list of the currently connected player ids. This is always accurate from what has been set through this SDK,
   205  // even if the value has yet to be updated on the GameServer status resource.
   206  //
   207  // If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
   208  getConnectedPlayers: {
   209      path: '/agones.dev.sdk.alpha.SDK/GetConnectedPlayers',
   210      requestStream: false,
   211      responseStream: false,
   212      requestType: alpha_pb.Empty,
   213      responseType: alpha_pb.PlayerIDList,
   214      requestSerialize: serialize_agones_dev_sdk_alpha_Empty,
   215      requestDeserialize: deserialize_agones_dev_sdk_alpha_Empty,
   216      responseSerialize: serialize_agones_dev_sdk_alpha_PlayerIDList,
   217      responseDeserialize: deserialize_agones_dev_sdk_alpha_PlayerIDList,
   218    },
   219  };
   220