예제 #1
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(NetworkServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_PingService, serviceImpl.PingService)
            .AddMethod(__Method_Subscribe, serviceImpl.Subscribe)
            .AddMethod(__Method_GameStateUpdate, serviceImpl.GameStateUpdate)
            .AddMethod(__Method_ClientStateUpdate, serviceImpl.ClientStateUpdate).Build());
 }
예제 #2
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, NetworkServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_createGame, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::CreateGameRequest, global::GameUpdate>(serviceImpl.createGame));
     serviceBinder.AddMethod(__Method_connectToGame, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::ConnectRequest, global::GameUpdate>(serviceImpl.connectToGame));
     serviceBinder.AddMethod(__Method_startGame, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::StartGameRequest, global::Acknowledgement>(serviceImpl.startGame));
     serviceBinder.AddMethod(__Method_submitMove, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Move, global::Acknowledgement>(serviceImpl.submitMove));
     serviceBinder.AddMethod(__Method_disprove, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::DisproveRequest, global::Acknowledgement>(serviceImpl.disprove));
     serviceBinder.AddMethod(__Method_requestHistory, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::HistoryRequest, global::GameHistory>(serviceImpl.requestHistory));
     serviceBinder.AddMethod(__Method_accuse, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::Accusation, global::Acknowledgement>(serviceImpl.accuse));
 }
예제 #3
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(NetworkServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_createGame, serviceImpl.createGame)
            .AddMethod(__Method_connectToGame, serviceImpl.connectToGame)
            .AddMethod(__Method_startGame, serviceImpl.startGame)
            .AddMethod(__Method_submitMove, serviceImpl.submitMove)
            .AddMethod(__Method_disprove, serviceImpl.disprove)
            .AddMethod(__Method_requestHistory, serviceImpl.requestHistory)
            .AddMethod(__Method_accuse, serviceImpl.accuse).Build());
 }