Пример #1
0
        /// <summary>
        /// Cancels all running tasks & tells Agones to shut down the currently running game server.
        /// </summary>
        /// <returns>gRPC Status of the request</returns>
        public async Task <Status> ShutDownAsync()
        {
            try
            {
                await client.ShutdownAsync(new Empty(), deadline : DateTime.UtcNow.AddSeconds(RequestTimeoutSec));

                return(new Status(StatusCode.OK, "Shutdown request successful."));
            }
            catch (RpcException ex)
            {
                LogError(ex, "Unable to mark the GameServer to 'Shutdown' state.");
                return(ex.Status);
            }
        }
Пример #2
0
        /// <summary>
        /// Cancels all running tasks & tells Agones to shut down the currently running game server.
        /// </summary>
        /// <returns>gRPC Status of the request</returns>
        public async Task <Status> ShutDownAsync()
        {
            try
            {
                await client.ShutdownAsync(new Empty(), deadline : DateTime.UtcNow.AddSeconds(RequestTimeout));

                return(new Status(StatusCode.OK, "Shutdown request successful."));
            }
            catch (RpcException ex)
            {
                Console.Error.WriteLine(ex.Message);
                return(ex.Status);
            }
        }