Browse Source

Update C# GRPC files

new_protocol
ThePerkinrex 5 years ago
parent
commit
60e36083bc
No known key found for this signature in database GPG Key ID: 1F45A7C4BFB41607
  1. 1944
      unity/Assets/Scripts/grpc/Game.cs
  2. 99
      unity/Assets/Scripts/grpc/GameGrpc.cs
  3. 416
      unity/Assets/Scripts/grpc/Lobby.cs
  4. 32
      unity/Assets/Scripts/grpc/LobbyGrpc.cs

1944
unity/Assets/Scripts/grpc/Game.cs

File diff suppressed because it is too large

99
unity/Assets/Scripts/grpc/GameGrpc.cs

@ -45,8 +45,18 @@ namespace Game {
return parser.ParseFrom(context.PayloadAsNewBuffer());
}
static readonly grpc::Marshaller<global::Game.CardKind> __Marshaller_game_CardKind = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.CardKind.Parser));
static readonly grpc::Marshaller<global::Game.Image> __Marshaller_game_Image = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.Image.Parser));
static readonly grpc::Marshaller<global::Game.CardId> __Marshaller_game_CardId = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.CardId.Parser));
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_google_protobuf_Empty = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Protobuf.WellKnownTypes.Empty.Parser));
static readonly grpc::Marshaller<global::Game.MessageStatus> __Marshaller_game_MessageStatus = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Game.MessageStatus.Parser));
static readonly grpc::Method<global::Game.CardKind, global::Game.Image> __Method_getCardImage = new grpc::Method<global::Game.CardKind, global::Game.Image>(
grpc::MethodType.Unary,
__ServiceName,
"getCardImage",
__Marshaller_game_CardKind,
__Marshaller_game_Image);
static readonly grpc::Method<global::Game.CardId, global::Google.Protobuf.WellKnownTypes.Empty> __Method_onClick = new grpc::Method<global::Game.CardId, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
@ -55,6 +65,13 @@ namespace Game {
__Marshaller_game_CardId,
__Marshaller_google_protobuf_Empty);
static readonly grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Game.MessageStatus> __Method_status = new grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Game.MessageStatus>(
grpc::MethodType.Unary,
__ServiceName,
"status",
__Marshaller_google_protobuf_Empty,
__Marshaller_game_MessageStatus);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
@ -65,17 +82,21 @@ namespace Game {
[grpc::BindServiceMethod(typeof(Game), "BindService")]
public abstract partial class GameBase
{
/// <summary>
/// TODO add status
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Game.Image> getCardImage(global::Game.CardKind request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> onClick(global::Game.CardId request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
public virtual global::System.Threading.Tasks.Task<global::Game.MessageStatus> status(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Game</summary>
@ -101,50 +122,54 @@ namespace Game {
{
}
/// <summary>
/// TODO add status
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Game.Image getCardImage(global::Game.CardKind request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return getCardImage(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::Game.Image getCardImage(global::Game.CardKind request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_getCardImage, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::Game.Image> getCardImageAsync(global::Game.CardKind request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return getCardImageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::Game.Image> getCardImageAsync(global::Game.CardKind request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_getCardImage, null, options, request);
}
public virtual global::Google.Protobuf.WellKnownTypes.Empty onClick(global::Game.CardId request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return onClick(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// TODO add status
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty onClick(global::Game.CardId request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_onClick, null, options, request);
}
/// <summary>
/// TODO add status
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> onClickAsync(global::Game.CardId request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return onClickAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// TODO add status
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> onClickAsync(global::Game.CardId request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_onClick, null, options, request);
}
public virtual global::Game.MessageStatus status(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return status(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::Game.MessageStatus status(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_status, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::Game.MessageStatus> statusAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return statusAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::Game.MessageStatus> statusAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_status, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override GameClient NewInstance(ClientBaseConfiguration configuration)
{
@ -157,7 +182,9 @@ namespace Game {
public static grpc::ServerServiceDefinition BindService(GameBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_onClick, serviceImpl.onClick).Build();
.AddMethod(__Method_getCardImage, serviceImpl.getCardImage)
.AddMethod(__Method_onClick, serviceImpl.onClick)
.AddMethod(__Method_status, serviceImpl.status).Build();
}
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
@ -166,7 +193,9 @@ namespace Game {
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, GameBase serviceImpl)
{
serviceBinder.AddMethod(__Method_getCardImage, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Game.CardKind, global::Game.Image>(serviceImpl.getCardImage));
serviceBinder.AddMethod(__Method_onClick, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Game.CardId, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.onClick));
serviceBinder.AddMethod(__Method_status, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Game.MessageStatus>(serviceImpl.status));
}
}

416
unity/Assets/Scripts/grpc/Lobby.cs

@ -28,28 +28,24 @@ namespace Lobby {
"bXAucHJvdG8aG2dvb2dsZS9wcm90b2J1Zi9lbXB0eS5wcm90bxoMY29tbW9u",
"LnByb3RvIh0KDEhhc05ld1N0YXR1cxINCgV2YWx1ZRgBIAEoCCJOChNMYXN0",
"U3RhdHVzVGltZXN0YW1wEigKBHRpbWUYASABKAsyGi5nb29nbGUucHJvdG9i",
"dWYuVGltZXN0YW1wEg0KBWxvYmJ5GAIgASgNIigKBkNhcmRJRBIOCgZnYW1l",
"SWQYASABKA0SDgoGY2FyZElkGAIgASgJIhgKBUltYWdlEg8KB2NvbnRlbnQY",
"ASABKAwiMwoEVm90ZRIOCgZwbGF5ZXIYASABKAkSDAoEZ2FtZRgCIAEoDRIN",
"CgVyZWFkeRgDIAEoCCIaCgpTaW5nbGVWb3RlEgwKBGdhbWUYAiABKA0iWgoL",
"TG9iYnlTdGF0dXMSGwoFbmFtZXMYASADKAsyDC5jb21tb24uTmFtZRIaCgV2",
"b3RlcxgCIAMoCzILLmxvYmJ5LlZvdGUSEgoKaXNTdGFydGluZxgDIAEoCDKE",
"AwoFTG9iYnkSKwoMZ2V0Q2FyZEltYWdlEg0ubG9iYnkuQ2FyZElEGgwubG9i",
"YnkuSW1hZ2USLwoFdXNlcnMSFi5nb29nbGUucHJvdG9idWYuRW1wdHkaDC5j",
"b21tb24uTmFtZTABEjEKBHZvdGUSES5sb2JieS5TaW5nbGVWb3RlGhYuZ29v",
"Z2xlLnByb3RvYnVmLkVtcHR5EjcKBXJlYWR5EhYuZ29vZ2xlLnByb3RvYnVm",
"LkVtcHR5GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Ej8KDGhhc05ld1N0YXR1",
"cxIaLmxvYmJ5Lkxhc3RTdGF0dXNUaW1lc3RhbXAaEy5sb2JieS5IYXNOZXdT",
"dGF0dXMSNwoJZ2V0U3RhdHVzEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhIu",
"bG9iYnkuTG9iYnlTdGF0dXMSNwoFbGVhdmUSFi5nb29nbGUucHJvdG9idWYu",
"RW1wdHkaFi5nb29nbGUucHJvdG9idWYuRW1wdHliBnByb3RvMw=="));
"dWYuVGltZXN0YW1wEg0KBWxvYmJ5GAIgASgNIjMKBFZvdGUSDgoGcGxheWVy",
"GAEgASgJEgwKBGdhbWUYAiABKA0SDQoFcmVhZHkYAyABKAgiGgoKU2luZ2xl",
"Vm90ZRIMCgRnYW1lGAIgASgNIloKC0xvYmJ5U3RhdHVzEhsKBW5hbWVzGAEg",
"AygLMgwuY29tbW9uLk5hbWUSGgoFdm90ZXMYAiADKAsyCy5sb2JieS5Wb3Rl",
"EhIKCmlzU3RhcnRpbmcYAyABKAgy1wIKBUxvYmJ5Ei8KBXVzZXJzEhYuZ29v",
"Z2xlLnByb3RvYnVmLkVtcHR5GgwuY29tbW9uLk5hbWUwARIxCgR2b3RlEhEu",
"bG9iYnkuU2luZ2xlVm90ZRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRI3CgVy",
"ZWFkeRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoWLmdvb2dsZS5wcm90b2J1",
"Zi5FbXB0eRI/CgxoYXNOZXdTdGF0dXMSGi5sb2JieS5MYXN0U3RhdHVzVGlt",
"ZXN0YW1wGhMubG9iYnkuSGFzTmV3U3RhdHVzEjcKCWdldFN0YXR1cxIWLmdv",
"b2dsZS5wcm90b2J1Zi5FbXB0eRoSLmxvYmJ5LkxvYmJ5U3RhdHVzEjcKBWxl",
"YXZlEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhYuZ29vZ2xlLnByb3RvYnVm",
"LkVtcHR5YgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Common.CommonReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.HasNewStatus), global::Lobby.HasNewStatus.Parser, new[]{ "Value" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.LastStatusTimestamp), global::Lobby.LastStatusTimestamp.Parser, new[]{ "Time", "Lobby" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.CardID), global::Lobby.CardID.Parser, new[]{ "GameId", "CardId" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.Image), global::Lobby.Image.Parser, new[]{ "Content" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.Vote), global::Lobby.Vote.Parser, new[]{ "Player", "Game", "Ready" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.SingleVote), global::Lobby.SingleVote.Parser, new[]{ "Game" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Lobby.LobbyStatus), global::Lobby.LobbyStatus.Parser, new[]{ "Names", "Votes", "IsStarting" }, null, null, null, null)
@ -448,386 +444,6 @@ namespace Lobby {
}
public sealed partial class CardID : pb::IMessage<CardID>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<CardID> _parser = new pb::MessageParser<CardID>(() => new CardID());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<CardID> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CardID() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CardID(CardID other) : this() {
gameId_ = other.gameId_;
cardId_ = other.cardId_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public CardID Clone() {
return new CardID(this);
}
/// <summary>Field number for the "gameId" field.</summary>
public const int GameIdFieldNumber = 1;
private uint gameId_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint GameId {
get { return gameId_; }
set {
gameId_ = value;
}
}
/// <summary>Field number for the "cardId" field.</summary>
public const int CardIdFieldNumber = 2;
private string cardId_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string CardId {
get { return cardId_; }
set {
cardId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as CardID);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(CardID other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (GameId != other.GameId) return false;
if (CardId != other.CardId) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (GameId != 0) hash ^= GameId.GetHashCode();
if (CardId.Length != 0) hash ^= CardId.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (GameId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(GameId);
}
if (CardId.Length != 0) {
output.WriteRawTag(18);
output.WriteString(CardId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (GameId != 0) {
output.WriteRawTag(8);
output.WriteUInt32(GameId);
}
if (CardId.Length != 0) {
output.WriteRawTag(18);
output.WriteString(CardId);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (GameId != 0) {
size += 1 + pb::CodedOutputStream.ComputeUInt32Size(GameId);
}
if (CardId.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(CardId);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(CardID other) {
if (other == null) {
return;
}
if (other.GameId != 0) {
GameId = other.GameId;
}
if (other.CardId.Length != 0) {
CardId = other.CardId;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
GameId = input.ReadUInt32();
break;
}
case 18: {
CardId = input.ReadString();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
GameId = input.ReadUInt32();
break;
}
case 18: {
CardId = input.ReadString();
break;
}
}
}
}
#endif
}
public sealed partial class Image : pb::IMessage<Image>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<Image> _parser = new pb::MessageParser<Image>(() => new Image());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Image> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Image() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Image(Image other) : this() {
content_ = other.content_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Image Clone() {
return new Image(this);
}
/// <summary>Field number for the "content" field.</summary>
public const int ContentFieldNumber = 1;
private pb::ByteString content_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString Content {
get { return content_; }
set {
content_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Image);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Image other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Content != other.Content) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Content.Length != 0) hash ^= Content.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Content.Length != 0) {
output.WriteRawTag(10);
output.WriteBytes(Content);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Content.Length != 0) {
output.WriteRawTag(10);
output.WriteBytes(Content);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Content.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Content);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Image other) {
if (other == null) {
return;
}
if (other.Content.Length != 0) {
Content = other.Content;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Content = input.ReadBytes();
break;
}
}
}
#endif
}
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Content = input.ReadBytes();
break;
}
}
}
}
#endif
}
public sealed partial class Vote : pb::IMessage<Vote>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
@ -840,7 +456,7 @@ namespace Lobby {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[4]; }
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1084,7 +700,7 @@ namespace Lobby {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[5]; }
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1256,7 +872,7 @@ namespace Lobby {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[6]; }
get { return global::Lobby.LobbyReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]

32
unity/Assets/Scripts/grpc/LobbyGrpc.cs

@ -45,8 +45,6 @@ namespace Lobby {
return parser.ParseFrom(context.PayloadAsNewBuffer());
}
static readonly grpc::Marshaller<global::Lobby.CardID> __Marshaller_lobby_CardID = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Lobby.CardID.Parser));
static readonly grpc::Marshaller<global::Lobby.Image> __Marshaller_lobby_Image = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Lobby.Image.Parser));
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_google_protobuf_Empty = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Protobuf.WellKnownTypes.Empty.Parser));
static readonly grpc::Marshaller<global::Common.Name> __Marshaller_common_Name = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Common.Name.Parser));
static readonly grpc::Marshaller<global::Lobby.SingleVote> __Marshaller_lobby_SingleVote = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Lobby.SingleVote.Parser));
@ -54,13 +52,6 @@ namespace Lobby {
static readonly grpc::Marshaller<global::Lobby.HasNewStatus> __Marshaller_lobby_HasNewStatus = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Lobby.HasNewStatus.Parser));
static readonly grpc::Marshaller<global::Lobby.LobbyStatus> __Marshaller_lobby_LobbyStatus = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Lobby.LobbyStatus.Parser));
static readonly grpc::Method<global::Lobby.CardID, global::Lobby.Image> __Method_getCardImage = new grpc::Method<global::Lobby.CardID, global::Lobby.Image>(
grpc::MethodType.Unary,
__ServiceName,
"getCardImage",
__Marshaller_lobby_CardID,
__Marshaller_lobby_Image);
static readonly grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Common.Name> __Method_users = new grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Common.Name>(
grpc::MethodType.ServerStreaming,
__ServiceName,
@ -113,11 +104,6 @@ namespace Lobby {
[grpc::BindServiceMethod(typeof(Lobby), "BindService")]
public abstract partial class LobbyBase
{
public virtual global::System.Threading.Tasks.Task<global::Lobby.Image> getCardImage(global::Lobby.CardID request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
public virtual global::System.Threading.Tasks.Task users(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::IServerStreamWriter<global::Common.Name> responseStream, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
@ -173,22 +159,6 @@ namespace Lobby {
{
}
public virtual global::Lobby.Image getCardImage(global::Lobby.CardID request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return getCardImage(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::Lobby.Image getCardImage(global::Lobby.CardID request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_getCardImage, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::Lobby.Image> getCardImageAsync(global::Lobby.CardID request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return getCardImageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::Lobby.Image> getCardImageAsync(global::Lobby.CardID request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_getCardImage, null, options, request);
}
public virtual grpc::AsyncServerStreamingCall<global::Common.Name> users(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return users(request, new grpc::CallOptions(headers, deadline, cancellationToken));
@ -289,7 +259,6 @@ namespace Lobby {
public static grpc::ServerServiceDefinition BindService(LobbyBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_getCardImage, serviceImpl.getCardImage)
.AddMethod(__Method_users, serviceImpl.users)
.AddMethod(__Method_vote, serviceImpl.vote)
.AddMethod(__Method_ready, serviceImpl.ready)
@ -304,7 +273,6 @@ namespace Lobby {
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, LobbyBase serviceImpl)
{
serviceBinder.AddMethod(__Method_getCardImage, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Lobby.CardID, global::Lobby.Image>(serviceImpl.getCardImage));
serviceBinder.AddMethod(__Method_users, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Common.Name>(serviceImpl.users));
serviceBinder.AddMethod(__Method_vote, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Lobby.SingleVote, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.vote));
serviceBinder.AddMethod(__Method_ready, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Protobuf.WellKnownTypes.Empty, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.ready));

Loading…
Cancel
Save