Browse Source

Update iamge message to add card_kind

new_protocol
ThePerkinrex 5 years ago
parent
commit
9c899deb54
No known key found for this signature in database GPG Key ID: FD81DE6D75E20917
  1. 1
      protobuf/game.proto
  2. 1
      server/src/server/game.rs
  3. 2
      server/src/server/protos/game.rs
  4. 74
      unity/Assets/Scripts/grpc/Game.cs

1
protobuf/game.proto

@ -20,6 +20,7 @@ message CardKind {
message Image { message Image {
bytes face = 1; bytes face = 1;
bytes back = 2; bytes back = 2;
string kind = 3;
} }
message CardIndex { message CardIndex {

1
server/src/server/game.rs

@ -129,6 +129,7 @@ pub(super) async fn get_card_image(
Data::ReturnCardImage(Image { Data::ReturnCardImage(Image {
face: face_buf, face: face_buf,
back: back_buf, back: back_buf,
kind: card_kind.kind,
}), }),
) )
.await?; .await?;

2
server/src/server/protos/game.rs

@ -17,6 +17,8 @@ pub struct Image {
pub face: ::prost::alloc::vec::Vec<u8>, pub face: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="2")] #[prost(bytes="vec", tag="2")]
pub back: ::prost::alloc::vec::Vec<u8>, pub back: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag="3")]
pub kind: ::prost::alloc::string::String,
} }
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct CardIndex { pub struct CardIndex {

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

@ -25,29 +25,29 @@ namespace Game {
byte[] descriptorData = global::System.Convert.FromBase64String( byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat( string.Concat(
"CgpnYW1lLnByb3RvEgRnYW1lGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJv", "CgpnYW1lLnByb3RvEgRnYW1lGhtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJv",
"dG8aDGNvbW1vbi5wcm90byIYCghDYXJkS2luZBIMCgRraW5kGAEgASgJIiMK", "dG8aDGNvbW1vbi5wcm90byIYCghDYXJkS2luZBIMCgRraW5kGAEgASgJIjEK",
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25QaWxlcxgBIAEoCzIWLmdhbWUuR2FtZVN0YXR1cy5QaWxlcxIr",
"AiADKAsyFi5nYW1lLkdhbWVTdGF0dXMuUGlsZXMSGwoFbmFtZXMYAyADKAsy", "CgtwbGF5ZXJQaWxlcxgCIAMoCzIWLmdhbWUuR2FtZVN0YXR1cy5QaWxlcxIb",
"DC5jb21tb24uTmFtZRITCgtjdXJyZW50VHVybhgEIAEoDRo1CgRDYXJkEhwK", "CgVuYW1lcxgDIAMoCzIMLmNvbW1vbi5OYW1lEhMKC2N1cnJlbnRUdXJuGAQg",
"BGtpbmQYASABKAsyDi5nYW1lLkNhcmRLaW5kEg8KB3Zpc2libGUYAiABKAga", "ASgNGjUKBENhcmQSHAoEa2luZBgBIAEoCzIOLmdhbWUuQ2FyZEtpbmQSDwoH",
"LAoEUGlsZRIkCgVjYXJkcxgBIAMoCzIVLmdhbWUuR2FtZVN0YXR1cy5DYXJk", "dmlzaWJsZRgCIAEoCBosCgRQaWxlEiQKBWNhcmRzGAEgAygLMhUuZ2FtZS5H",
"Gn4KBVBpbGVzEjAKBXBpbGVzGAEgAygLMiEuZ2FtZS5HYW1lU3RhdHVzLlBp", "YW1lU3RhdHVzLkNhcmQafgoFUGlsZXMSMAoFcGlsZXMYASADKAsyIS5nYW1l",
"bGVzLlBpbGVzRW50cnkaQwoKUGlsZXNFbnRyeRILCgNrZXkYASABKAkSJAoF", "LkdhbWVTdGF0dXMuUGlsZXMuUGlsZXNFbnRyeRpDCgpQaWxlc0VudHJ5EgsK",
"dmFsdWUYAiABKAsyFS5nYW1lLkdhbWVTdGF0dXMuUGlsZToCOAFiBnByb3Rv", "A2tleRgBIAEoCRIkCgV2YWx1ZRgCIAEoCzIVLmdhbWUuR2FtZVN0YXR1cy5Q",
"Mw==")); "aWxlOgI4AWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Common.CommonReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Common.CommonReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Game.CardKind), global::Game.CardKind.Parser, new[]{ "Kind" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Game.CardKind), global::Game.CardKind.Parser, new[]{ "Kind" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Game.Image), global::Game.Image.Parser, new[]{ "Face", "Back" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Game.Image), global::Game.Image.Parser, new[]{ "Face", "Back", "Kind" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Game.CardIndex), global::Game.CardIndex.Parser, new[]{ "Index", "Top", "Bottom" }, new[]{ "Pos" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Game.CardIndex), global::Game.CardIndex.Parser, new[]{ "Index", "Top", "Bottom" }, new[]{ "Pos" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Game.PileKind), global::Game.PileKind.Parser, new[]{ "Owned", "Common" }, new[]{ "Kind" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Game.PileKind), global::Game.PileKind.Parser, new[]{ "Owned", "Common" }, new[]{ "Kind" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Game.CardId), global::Game.CardId.Parser, new[]{ "PileKind", "PileName", "CardIndex" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Game.CardId), global::Game.CardId.Parser, new[]{ "PileKind", "PileName", "CardIndex" }, null, null, null, null),
@ -263,6 +263,7 @@ namespace Game {
public Image(Image other) : this() { public Image(Image other) : this() {
face_ = other.face_; face_ = other.face_;
back_ = other.back_; back_ = other.back_;
kind_ = other.kind_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
} }
@ -293,6 +294,17 @@ namespace Game {
} }
} }
/// <summary>Field number for the "kind" field.</summary>
public const int KindFieldNumber = 3;
private string kind_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Kind {
get { return kind_; }
set {
kind_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as Image); return Equals(other as Image);
@ -308,6 +320,7 @@ namespace Game {
} }
if (Face != other.Face) return false; if (Face != other.Face) return false;
if (Back != other.Back) return false; if (Back != other.Back) return false;
if (Kind != other.Kind) return false;
return Equals(_unknownFields, other._unknownFields); return Equals(_unknownFields, other._unknownFields);
} }
@ -316,6 +329,7 @@ namespace Game {
int hash = 1; int hash = 1;
if (Face.Length != 0) hash ^= Face.GetHashCode(); if (Face.Length != 0) hash ^= Face.GetHashCode();
if (Back.Length != 0) hash ^= Back.GetHashCode(); if (Back.Length != 0) hash ^= Back.GetHashCode();
if (Kind.Length != 0) hash ^= Kind.GetHashCode();
if (_unknownFields != null) { if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode(); hash ^= _unknownFields.GetHashCode();
} }
@ -340,6 +354,10 @@ namespace Game {
output.WriteRawTag(18); output.WriteRawTag(18);
output.WriteBytes(Back); output.WriteBytes(Back);
} }
if (Kind.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Kind);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
@ -357,6 +375,10 @@ namespace Game {
output.WriteRawTag(18); output.WriteRawTag(18);
output.WriteBytes(Back); output.WriteBytes(Back);
} }
if (Kind.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Kind);
}
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(ref output); _unknownFields.WriteTo(ref output);
} }
@ -372,6 +394,9 @@ namespace Game {
if (Back.Length != 0) { if (Back.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Back); size += 1 + pb::CodedOutputStream.ComputeBytesSize(Back);
} }
if (Kind.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Kind);
}
if (_unknownFields != null) { if (_unknownFields != null) {
size += _unknownFields.CalculateSize(); size += _unknownFields.CalculateSize();
} }
@ -389,6 +414,9 @@ namespace Game {
if (other.Back.Length != 0) { if (other.Back.Length != 0) {
Back = other.Back; Back = other.Back;
} }
if (other.Kind.Length != 0) {
Kind = other.Kind;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
} }
@ -411,6 +439,10 @@ namespace Game {
Back = input.ReadBytes(); Back = input.ReadBytes();
break; break;
} }
case 26: {
Kind = input.ReadString();
break;
}
} }
} }
#endif #endif
@ -433,6 +465,10 @@ namespace Game {
Back = input.ReadBytes(); Back = input.ReadBytes();
break; break;
} }
case 26: {
Kind = input.ReadString();
break;
}
} }
} }
} }

Loading…
Cancel
Save