Esempio n. 1
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, RoomServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_CreateRoom, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomCreateReq, global::ULZAsset.ProtoMod.RoomService.Room>(serviceImpl.CreateRoom));
     serviceBinder.AddMethod(__Method_GetRoomList, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomCreateReq, global::ULZAsset.ProtoMod.RoomService.Room>(serviceImpl.GetRoomList));
     serviceBinder.AddMethod(__Method_GetRoomInfo, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomReq, global::ULZAsset.ProtoMod.RoomService.Room>(serviceImpl.GetRoomInfo));
     serviceBinder.AddMethod(__Method_UpdateRoom, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomCreateReq, global::ULZAsset.ProtoMod.RoomService.Room>(serviceImpl.UpdateRoom));
     serviceBinder.AddMethod(__Method_UpdateCard, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomUpdateCardReq, global::ULZAsset.ProtoMod.Empty>(serviceImpl.UpdateCard));
     serviceBinder.AddMethod(__Method_BroadcastInfo, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomReq, global::ULZAsset.ProtoMod.RoomService.RoomBroadcastInfo>(serviceImpl.BroadcastInfo));
     serviceBinder.AddMethod(__Method_ServerBroadcast, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomReq, global::ULZAsset.ProtoMod.RoomService.RoomMsg>(serviceImpl.ServerBroadcast));
     serviceBinder.AddMethod(__Method_SendMessage, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomMsg, global::ULZAsset.ProtoMod.Empty>(serviceImpl.SendMessage));
     serviceBinder.AddMethod(__Method_QuitRoom, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomReq, global::ULZAsset.ProtoMod.Empty>(serviceImpl.QuitRoom));
     serviceBinder.AddMethod(__Method_QuickPair, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomCreateReq, global::ULZAsset.ProtoMod.RoomService.Room>(serviceImpl.QuickPair));
     serviceBinder.AddMethod(__Method_JoinRoom, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::ULZAsset.ProtoMod.RoomService.RoomReq, global::ULZAsset.ProtoMod.RoomService.Room>(serviceImpl.JoinRoom));
 }
Esempio n. 2
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(RoomServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_CreateRoom, serviceImpl.CreateRoom)
            .AddMethod(__Method_GetRoomList, serviceImpl.GetRoomList)
            .AddMethod(__Method_GetRoomInfo, serviceImpl.GetRoomInfo)
            .AddMethod(__Method_UpdateRoom, serviceImpl.UpdateRoom)
            .AddMethod(__Method_UpdateCard, serviceImpl.UpdateCard)
            .AddMethod(__Method_BroadcastInfo, serviceImpl.BroadcastInfo)
            .AddMethod(__Method_ServerBroadcast, serviceImpl.ServerBroadcast)
            .AddMethod(__Method_SendMessage, serviceImpl.SendMessage)
            .AddMethod(__Method_QuitRoom, serviceImpl.QuitRoom)
            .AddMethod(__Method_QuickPair, serviceImpl.QuickPair)
            .AddMethod(__Method_JoinRoom, serviceImpl.JoinRoom).Build());
 }