陈真 4 年 前
コミット
e98b2c4ee0
9 ファイル変更1585 行追加307 行削除
  1. 1053 0
      cs/Front.cs
  2. 6 6
      cs/Lobby.cs
  3. 6 6
      cs/Room.cs
  4. 352 64
      cs/Sync.cs
  5. 109 224
      cs/User.cs
  6. 6 6
      cs/Userinfo.cs
  7. 49 0
      protos/front.proto
  8. 1 1
      protos/sync.proto
  9. 3 0
      protos/user.proto

ファイルの差分が大きいため隠しています
+ 1053 - 0
cs/Front.cs


+ 6 - 6
cs/Lobby.cs

@@ -24,7 +24,7 @@ namespace Protos {
           string.Concat(
             "Cgtsb2JieS5wcm90bxIGcHJvdG9zGg51c2VyaW5mby5wcm90byIzCg1Mb2Ji",
             "eUpvaW5QdXNoEiIKCFVzZXJJbmZvGAEgASgLMhAucHJvdG9zLlVzZXJJbmZv",
-            "IiAKDkxvYmJ5TGVhdmVQdXNoEg4KBlVzZXJJRBgBIAEoBWIGcHJvdG8z"));
+            "IiAKDkxvYmJ5TGVhdmVQdXNoEg4KBlVzZXJJRBgBIAEoDWIGcHJvdG8z"));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { global::Protos.UserinfoReflection.Descriptor, },
           new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
@@ -199,9 +199,9 @@ namespace Protos {
 
     /// <summary>Field number for the "UserID" field.</summary>
     public const int UserIDFieldNumber = 1;
-    private int userID_;
+    private uint userID_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public int UserID {
+    public uint UserID {
       get { return userID_; }
       set {
         userID_ = value;
@@ -241,7 +241,7 @@ namespace Protos {
     public void WriteTo(pb::CodedOutputStream output) {
       if (UserID != 0) {
         output.WriteRawTag(8);
-        output.WriteInt32(UserID);
+        output.WriteUInt32(UserID);
       }
     }
 
@@ -249,7 +249,7 @@ namespace Protos {
     public int CalculateSize() {
       int size = 0;
       if (UserID != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeInt32Size(UserID);
+        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UserID);
       }
       return size;
     }
@@ -273,7 +273,7 @@ namespace Protos {
             input.SkipLastField();
             break;
           case 8: {
-            UserID = input.ReadInt32();
+            UserID = input.ReadUInt32();
             break;
           }
         }

+ 6 - 6
cs/Room.cs

@@ -25,7 +25,7 @@ namespace Protos {
             "Cgpyb29tLnByb3RvEgZwcm90b3MaDnVzZXJpbmZvLnByb3RvIhMKEVJvb21D",
             "cmVhdGVSZXF1ZXN0IhQKElJvb21DcmVhdGVSZXNwb25zZSIyCgxSb29tSm9p",
             "blB1c2gSIgoIVXNlckluZm8YASABKAsyEC5wcm90b3MuVXNlckluZm8iHwoN",
-            "Um9vbUxlYXZlUHVzaBIOCgZVc2VySUQYASABKAUiEQoPUm9vbURpc21pc3NQ",
+            "Um9vbUxlYXZlUHVzaBIOCgZVc2VySUQYASABKA0iEQoPUm9vbURpc21pc3NQ",
             "dXNoYgZwcm90bzM="));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { global::Protos.UserinfoReflection.Descriptor, },
@@ -376,9 +376,9 @@ namespace Protos {
 
     /// <summary>Field number for the "UserID" field.</summary>
     public const int UserIDFieldNumber = 1;
-    private int userID_;
+    private uint userID_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public int UserID {
+    public uint UserID {
       get { return userID_; }
       set {
         userID_ = value;
@@ -418,7 +418,7 @@ namespace Protos {
     public void WriteTo(pb::CodedOutputStream output) {
       if (UserID != 0) {
         output.WriteRawTag(8);
-        output.WriteInt32(UserID);
+        output.WriteUInt32(UserID);
       }
     }
 
@@ -426,7 +426,7 @@ namespace Protos {
     public int CalculateSize() {
       int size = 0;
       if (UserID != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeInt32Size(UserID);
+        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UserID);
       }
       return size;
     }
@@ -450,7 +450,7 @@ namespace Protos {
             input.SkipLastField();
             break;
           case 8: {
-            UserID = input.ReadInt32();
+            UserID = input.ReadUInt32();
             break;
           }
         }

+ 352 - 64
cs/Sync.cs

@@ -23,27 +23,35 @@ namespace Protos {
       byte[] descriptorData = global::System.Convert.FromBase64String(
           string.Concat(
             "CgpzeW5jLnByb3RvEgZwcm90b3MaDnVzZXJpbmZvLnByb3RvIhAKDlJlc3Rv",
-            "cmVSZXF1ZXN0IqQBCg9SZXN0b3JlUmVzcG9uc2USHwoFVXNlcnMYASADKAsy",
-            "EC5wcm90b3MuVXNlckluZm8SDAoEU3RlcBgCIAEoAxIzCgZWYWx1ZXMYAyAD",
-            "KAsyIy5wcm90b3MuUmVzdG9yZVJlc3BvbnNlLlZhbHVlc0VudHJ5Gi0KC1Zh",
-            "bHVlc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoCOAEiewoL",
-            "U3luY1JlcXVlc3QSDAoEU3RlcBgBIAEoAxIvCgZWYWx1ZXMYAiADKAsyHy5w",
-            "cm90b3MuU3luY1JlcXVlc3QuVmFsdWVzRW50cnkaLQoLVmFsdWVzRW50cnkS",
-            "CwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgMOgI4ASKNAQoMU3luY1Jlc3Bv",
-            "bnNlEg4KBlN0YXR1cxgBIAEoCBIMCgRTdGVwGAIgASgDEjAKBlZhbHVlcxgD",
-            "IAMoCzIgLnByb3Rvcy5TeW5jUmVzcG9uc2UuVmFsdWVzRW50cnkaLQoLVmFs",
-            "dWVzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgMOgI4ASJ1CghT",
-            "eW5jUHVzaBIMCgRTdGVwGAEgASgDEiwKBlZhbHVlcxgCIAMoCzIcLnByb3Rv",
-            "cy5TeW5jUHVzaC5WYWx1ZXNFbnRyeRotCgtWYWx1ZXNFbnRyeRILCgNrZXkY",
-            "ASABKAkSDQoFdmFsdWUYAiABKAw6AjgBYgZwcm90bzM="));
+            "cmVSZXF1ZXN0IqEBCg9SZXN0b3JlUmVzcG9uc2USHwoFVXNlcnMYASADKAsy",
+            "EC5wcm90b3MuVXNlckluZm8SDAoEU3RlcBgCIAEoBBIxCgVzdGF0ZRgDIAMo",
+            "CzIiLnByb3Rvcy5SZXN0b3JlUmVzcG9uc2UuU3RhdGVFbnRyeRosCgpTdGF0",
+            "ZUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoDDoCOAEiewoLU3lu",
+            "Y1JlcXVlc3QSDAoEU3RlcBgBIAEoBBIvCgZWYWx1ZXMYAiADKAsyHy5wcm90",
+            "b3MuU3luY1JlcXVlc3QuVmFsdWVzRW50cnkaLQoLVmFsdWVzRW50cnkSCwoD",
+            "a2V5GAEgASgJEg0KBXZhbHVlGAIgASgMOgI4ASKNAQoMU3luY1Jlc3BvbnNl",
+            "Eg4KBlN0YXR1cxgBIAEoCBIMCgRTdGVwGAIgASgEEjAKBlZhbHVlcxgDIAMo",
+            "CzIgLnByb3Rvcy5TeW5jUmVzcG9uc2UuVmFsdWVzRW50cnkaLQoLVmFsdWVz",
+            "RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgMOgI4ASJ1CghTeW5j",
+            "UHVzaBIMCgRTdGVwGAEgASgEEiwKBlZhbHVlcxgCIAMoCzIcLnByb3Rvcy5T",
+            "eW5jUHVzaC5WYWx1ZXNFbnRyeRotCgtWYWx1ZXNFbnRyeRILCgNrZXkYASAB",
+            "KAkSDQoFdmFsdWUYAiABKAw6AjgBInkKCk1hc3RlclB1c2gSDAoEU3RlcBgB",
+            "IAEoBBIuCgZWYWx1ZXMYAiADKAsyHi5wcm90b3MuTWFzdGVyUHVzaC5WYWx1",
+            "ZXNFbnRyeRotCgtWYWx1ZXNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUY",
+            "AiABKAw6AjgBIn0KDE1hc3Rlck5vdGlmeRIMCgRTdGVwGAEgASgEEjAKBlZh",
+            "bHVlcxgCIAMoCzIgLnByb3Rvcy5NYXN0ZXJOb3RpZnkuVmFsdWVzRW50cnka",
+            "LQoLVmFsdWVzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgMOgI4",
+            "AWIGcHJvdG8z"));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { global::Protos.UserinfoReflection.Descriptor, },
           new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.RestoreRequest), global::Protos.RestoreRequest.Parser, null, null, null, null),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.RestoreResponse), global::Protos.RestoreResponse.Parser, new[]{ "Users", "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.RestoreResponse), global::Protos.RestoreResponse.Parser, new[]{ "Users", "Step", "State" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.SyncRequest), global::Protos.SyncRequest.Parser, new[]{ "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.SyncResponse), global::Protos.SyncResponse.Parser, new[]{ "Status", "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.SyncPush), global::Protos.SyncPush.Parser, new[]{ "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.SyncPush), global::Protos.SyncPush.Parser, new[]{ "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.MasterPush), global::Protos.MasterPush.Parser, new[]{ "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.MasterNotify), global::Protos.MasterNotify.Parser, new[]{ "Step", "Values" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
           }));
     }
     #endregion
@@ -171,7 +179,7 @@ namespace Protos {
     public RestoreResponse(RestoreResponse other) : this() {
       users_ = other.users_.Clone();
       step_ = other.step_;
-      values_ = other.values_.Clone();
+      state_ = other.state_.Clone();
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -191,23 +199,23 @@ namespace Protos {
 
     /// <summary>Field number for the "Step" field.</summary>
     public const int StepFieldNumber = 2;
-    private long step_;
+    private ulong step_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public long Step {
+    public ulong Step {
       get { return step_; }
       set {
         step_ = value;
       }
     }
 
-    /// <summary>Field number for the "Values" field.</summary>
-    public const int ValuesFieldNumber = 3;
-    private static readonly pbc::MapField<string, pb::ByteString>.Codec _map_values_codec
+    /// <summary>Field number for the "state" field.</summary>
+    public const int StateFieldNumber = 3;
+    private static readonly pbc::MapField<string, pb::ByteString>.Codec _map_state_codec
         = new pbc::MapField<string, pb::ByteString>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForBytes(18), 26);
-    private readonly pbc::MapField<string, pb::ByteString> values_ = new pbc::MapField<string, pb::ByteString>();
+    private readonly pbc::MapField<string, pb::ByteString> state_ = new pbc::MapField<string, pb::ByteString>();
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public pbc::MapField<string, pb::ByteString> Values {
-      get { return values_; }
+    public pbc::MapField<string, pb::ByteString> State {
+      get { return state_; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -225,7 +233,7 @@ namespace Protos {
       }
       if(!users_.Equals(other.users_)) return false;
       if (Step != other.Step) return false;
-      if (!Values.Equals(other.Values)) return false;
+      if (!State.Equals(other.State)) return false;
       return true;
     }
 
@@ -233,8 +241,8 @@ namespace Protos {
     public override int GetHashCode() {
       int hash = 1;
       hash ^= users_.GetHashCode();
-      if (Step != 0L) hash ^= Step.GetHashCode();
-      hash ^= Values.GetHashCode();
+      if (Step != 0UL) hash ^= Step.GetHashCode();
+      hash ^= State.GetHashCode();
       return hash;
     }
 
@@ -246,21 +254,21 @@ namespace Protos {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public void WriteTo(pb::CodedOutputStream output) {
       users_.WriteTo(output, _repeated_users_codec);
-      if (Step != 0L) {
+      if (Step != 0UL) {
         output.WriteRawTag(16);
-        output.WriteInt64(Step);
+        output.WriteUInt64(Step);
       }
-      values_.WriteTo(output, _map_values_codec);
+      state_.WriteTo(output, _map_state_codec);
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public int CalculateSize() {
       int size = 0;
       size += users_.CalculateSize(_repeated_users_codec);
-      if (Step != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Step);
+      if (Step != 0UL) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Step);
       }
-      size += values_.CalculateSize(_map_values_codec);
+      size += state_.CalculateSize(_map_state_codec);
       return size;
     }
 
@@ -270,10 +278,10 @@ namespace Protos {
         return;
       }
       users_.Add(other.users_);
-      if (other.Step != 0L) {
+      if (other.Step != 0UL) {
         Step = other.Step;
       }
-      values_.Add(other.values_);
+      state_.Add(other.state_);
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -289,11 +297,11 @@ namespace Protos {
             break;
           }
           case 16: {
-            Step = input.ReadInt64();
+            Step = input.ReadUInt64();
             break;
           }
           case 26: {
-            values_.AddEntriesFrom(input, _map_values_codec);
+            state_.AddEntriesFrom(input, _map_state_codec);
             break;
           }
         }
@@ -340,9 +348,9 @@ namespace Protos {
 
     /// <summary>Field number for the "Step" field.</summary>
     public const int StepFieldNumber = 1;
-    private long step_;
+    private ulong step_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public long Step {
+    public ulong Step {
       get { return step_; }
       set {
         step_ = value;
@@ -380,7 +388,7 @@ namespace Protos {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override int GetHashCode() {
       int hash = 1;
-      if (Step != 0L) hash ^= Step.GetHashCode();
+      if (Step != 0UL) hash ^= Step.GetHashCode();
       hash ^= Values.GetHashCode();
       return hash;
     }
@@ -392,9 +400,9 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public void WriteTo(pb::CodedOutputStream output) {
-      if (Step != 0L) {
+      if (Step != 0UL) {
         output.WriteRawTag(8);
-        output.WriteInt64(Step);
+        output.WriteUInt64(Step);
       }
       values_.WriteTo(output, _map_values_codec);
     }
@@ -402,8 +410,8 @@ namespace Protos {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public int CalculateSize() {
       int size = 0;
-      if (Step != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Step);
+      if (Step != 0UL) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Step);
       }
       size += values_.CalculateSize(_map_values_codec);
       return size;
@@ -414,7 +422,7 @@ namespace Protos {
       if (other == null) {
         return;
       }
-      if (other.Step != 0L) {
+      if (other.Step != 0UL) {
         Step = other.Step;
       }
       values_.Add(other.values_);
@@ -429,7 +437,7 @@ namespace Protos {
             input.SkipLastField();
             break;
           case 8: {
-            Step = input.ReadInt64();
+            Step = input.ReadUInt64();
             break;
           }
           case 18: {
@@ -492,12 +500,12 @@ namespace Protos {
 
     /// <summary>Field number for the "Step" field.</summary>
     public const int StepFieldNumber = 2;
-    private long step_;
+    private ulong step_;
     /// <summary>
     /// status=false时才有值
     /// </summary>
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public long Step {
+    public ulong Step {
       get { return step_; }
       set {
         step_ = value;
@@ -540,7 +548,7 @@ namespace Protos {
     public override int GetHashCode() {
       int hash = 1;
       if (Status != false) hash ^= Status.GetHashCode();
-      if (Step != 0L) hash ^= Step.GetHashCode();
+      if (Step != 0UL) hash ^= Step.GetHashCode();
       hash ^= Values.GetHashCode();
       return hash;
     }
@@ -556,9 +564,9 @@ namespace Protos {
         output.WriteRawTag(8);
         output.WriteBool(Status);
       }
-      if (Step != 0L) {
+      if (Step != 0UL) {
         output.WriteRawTag(16);
-        output.WriteInt64(Step);
+        output.WriteUInt64(Step);
       }
       values_.WriteTo(output, _map_values_codec);
     }
@@ -569,8 +577,8 @@ namespace Protos {
       if (Status != false) {
         size += 1 + 1;
       }
-      if (Step != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Step);
+      if (Step != 0UL) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Step);
       }
       size += values_.CalculateSize(_map_values_codec);
       return size;
@@ -584,7 +592,7 @@ namespace Protos {
       if (other.Status != false) {
         Status = other.Status;
       }
-      if (other.Step != 0L) {
+      if (other.Step != 0UL) {
         Step = other.Step;
       }
       values_.Add(other.values_);
@@ -603,7 +611,7 @@ namespace Protos {
             break;
           }
           case 16: {
-            Step = input.ReadInt64();
+            Step = input.ReadUInt64();
             break;
           }
           case 26: {
@@ -654,9 +662,9 @@ namespace Protos {
 
     /// <summary>Field number for the "Step" field.</summary>
     public const int StepFieldNumber = 1;
-    private long step_;
+    private ulong step_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public long Step {
+    public ulong Step {
       get { return step_; }
       set {
         step_ = value;
@@ -694,7 +702,7 @@ namespace Protos {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override int GetHashCode() {
       int hash = 1;
-      if (Step != 0L) hash ^= Step.GetHashCode();
+      if (Step != 0UL) hash ^= Step.GetHashCode();
       hash ^= Values.GetHashCode();
       return hash;
     }
@@ -706,9 +714,9 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public void WriteTo(pb::CodedOutputStream output) {
-      if (Step != 0L) {
+      if (Step != 0UL) {
         output.WriteRawTag(8);
-        output.WriteInt64(Step);
+        output.WriteUInt64(Step);
       }
       values_.WriteTo(output, _map_values_codec);
     }
@@ -716,8 +724,8 @@ namespace Protos {
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public int CalculateSize() {
       int size = 0;
-      if (Step != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(Step);
+      if (Step != 0UL) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Step);
       }
       size += values_.CalculateSize(_map_values_codec);
       return size;
@@ -728,7 +736,287 @@ namespace Protos {
       if (other == null) {
         return;
       }
-      if (other.Step != 0L) {
+      if (other.Step != 0UL) {
+        Step = other.Step;
+      }
+      values_.Add(other.values_);
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public void MergeFrom(pb::CodedInputStream input) {
+      uint tag;
+      while ((tag = input.ReadTag()) != 0) {
+        switch(tag) {
+          default:
+            input.SkipLastField();
+            break;
+          case 8: {
+            Step = input.ReadUInt64();
+            break;
+          }
+          case 18: {
+            values_.AddEntriesFrom(input, _map_values_codec);
+            break;
+          }
+        }
+      }
+    }
+
+  }
+
+  /// <summary>
+  /// 服务器合并用户操作给master
+  /// </summary>
+  public sealed partial class MasterPush : pb::IMessage<MasterPush> {
+    private static readonly pb::MessageParser<MasterPush> _parser = new pb::MessageParser<MasterPush>(() => new MasterPush());
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public static pb::MessageParser<MasterPush> Parser { get { return _parser; } }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public static pbr::MessageDescriptor Descriptor {
+      get { return global::Protos.SyncReflection.Descriptor.MessageTypes[5]; }
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    pbr::MessageDescriptor pb::IMessage.Descriptor {
+      get { return Descriptor; }
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public MasterPush() {
+      OnConstruction();
+    }
+
+    partial void OnConstruction();
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public MasterPush(MasterPush other) : this() {
+      step_ = other.step_;
+      values_ = other.values_.Clone();
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public MasterPush Clone() {
+      return new MasterPush(this);
+    }
+
+    /// <summary>Field number for the "Step" field.</summary>
+    public const int StepFieldNumber = 1;
+    private ulong step_;
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public ulong Step {
+      get { return step_; }
+      set {
+        step_ = value;
+      }
+    }
+
+    /// <summary>Field number for the "Values" field.</summary>
+    public const int ValuesFieldNumber = 2;
+    private static readonly pbc::MapField<string, pb::ByteString>.Codec _map_values_codec
+        = new pbc::MapField<string, pb::ByteString>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForBytes(18), 18);
+    private readonly pbc::MapField<string, pb::ByteString> values_ = new pbc::MapField<string, pb::ByteString>();
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public pbc::MapField<string, pb::ByteString> Values {
+      get { return values_; }
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public override bool Equals(object other) {
+      return Equals(other as MasterPush);
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public bool Equals(MasterPush other) {
+      if (ReferenceEquals(other, null)) {
+        return false;
+      }
+      if (ReferenceEquals(other, this)) {
+        return true;
+      }
+      if (Step != other.Step) return false;
+      if (!Values.Equals(other.Values)) return false;
+      return true;
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public override int GetHashCode() {
+      int hash = 1;
+      if (Step != 0UL) hash ^= Step.GetHashCode();
+      hash ^= Values.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 (Step != 0UL) {
+        output.WriteRawTag(8);
+        output.WriteUInt64(Step);
+      }
+      values_.WriteTo(output, _map_values_codec);
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public int CalculateSize() {
+      int size = 0;
+      if (Step != 0UL) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Step);
+      }
+      size += values_.CalculateSize(_map_values_codec);
+      return size;
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public void MergeFrom(MasterPush other) {
+      if (other == null) {
+        return;
+      }
+      if (other.Step != 0UL) {
+        Step = other.Step;
+      }
+      values_.Add(other.values_);
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public void MergeFrom(pb::CodedInputStream input) {
+      uint tag;
+      while ((tag = input.ReadTag()) != 0) {
+        switch(tag) {
+          default:
+            input.SkipLastField();
+            break;
+          case 8: {
+            Step = input.ReadUInt64();
+            break;
+          }
+          case 18: {
+            values_.AddEntriesFrom(input, _map_values_codec);
+            break;
+          }
+        }
+      }
+    }
+
+  }
+
+  /// <summary>
+  /// 主机广播消息给flower
+  /// </summary>
+  public sealed partial class MasterNotify : pb::IMessage<MasterNotify> {
+    private static readonly pb::MessageParser<MasterNotify> _parser = new pb::MessageParser<MasterNotify>(() => new MasterNotify());
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public static pb::MessageParser<MasterNotify> Parser { get { return _parser; } }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public static pbr::MessageDescriptor Descriptor {
+      get { return global::Protos.SyncReflection.Descriptor.MessageTypes[6]; }
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    pbr::MessageDescriptor pb::IMessage.Descriptor {
+      get { return Descriptor; }
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public MasterNotify() {
+      OnConstruction();
+    }
+
+    partial void OnConstruction();
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public MasterNotify(MasterNotify other) : this() {
+      step_ = other.step_;
+      values_ = other.values_.Clone();
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public MasterNotify Clone() {
+      return new MasterNotify(this);
+    }
+
+    /// <summary>Field number for the "Step" field.</summary>
+    public const int StepFieldNumber = 1;
+    private ulong step_;
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public ulong Step {
+      get { return step_; }
+      set {
+        step_ = value;
+      }
+    }
+
+    /// <summary>Field number for the "Values" field.</summary>
+    public const int ValuesFieldNumber = 2;
+    private static readonly pbc::MapField<string, pb::ByteString>.Codec _map_values_codec
+        = new pbc::MapField<string, pb::ByteString>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForBytes(18), 18);
+    private readonly pbc::MapField<string, pb::ByteString> values_ = new pbc::MapField<string, pb::ByteString>();
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public pbc::MapField<string, pb::ByteString> Values {
+      get { return values_; }
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public override bool Equals(object other) {
+      return Equals(other as MasterNotify);
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public bool Equals(MasterNotify other) {
+      if (ReferenceEquals(other, null)) {
+        return false;
+      }
+      if (ReferenceEquals(other, this)) {
+        return true;
+      }
+      if (Step != other.Step) return false;
+      if (!Values.Equals(other.Values)) return false;
+      return true;
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public override int GetHashCode() {
+      int hash = 1;
+      if (Step != 0UL) hash ^= Step.GetHashCode();
+      hash ^= Values.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 (Step != 0UL) {
+        output.WriteRawTag(8);
+        output.WriteUInt64(Step);
+      }
+      values_.WriteTo(output, _map_values_codec);
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public int CalculateSize() {
+      int size = 0;
+      if (Step != 0UL) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Step);
+      }
+      size += values_.CalculateSize(_map_values_codec);
+      return size;
+    }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public void MergeFrom(MasterNotify other) {
+      if (other == null) {
+        return;
+      }
+      if (other.Step != 0UL) {
         Step = other.Step;
       }
       values_.Add(other.values_);
@@ -743,7 +1031,7 @@ namespace Protos {
             input.SkipLastField();
             break;
           case 8: {
-            Step = input.ReadInt64();
+            Step = input.ReadUInt64();
             break;
           }
           case 18: {

+ 109 - 224
cs/User.cs

@@ -23,23 +23,21 @@ namespace Protos {
       byte[] descriptorData = global::System.Convert.FromBase64String(
           string.Concat(
             "Cgp1c2VyLnByb3RvEgZwcm90b3MaDnVzZXJpbmZvLnByb3RvGgxyZXN1bHQu",
-            "cHJvdG8iEQoPSGFuZHNoYXJrTm90aWZ5Ig8KDUhhbmRzaGFya1B1c2giFAoS",
-            "SGFuZHNoYXJrQWNrTm90aWZ5Ig0KC0Nsb3NlTm90aWZ5IhsKCWNsb3NlUHVz",
-            "aBIOCgZyZWFzb24YASABKAUiEgoQSGVhcnRiZWF0UmVxdWVzdCITChFIZWFy",
-            "dGJlYXRSZXNwb25zZSIyCgxMb2dpblJlcXVlc3QSIgoIVXNlckluZm8YASAB",
-            "KAsyEC5wcm90b3MuVXNlckluZm8iUAoNTG9naW5SZXNwb25zZRIeCgZSZXN1",
-            "bHQYASABKAsyDi5wcm90b3MuUmVzdWx0Eg8KB0xvYmJ5SUQYAiABKAMSDgoG",
-            "Um9vbUlEGAMgASgDYgZwcm90bzM="));
+            "cHJvdG8iBQoDU1lOIg0KC0Nsb3NlTm90aWZ5IhsKCWNsb3NlUHVzaBIOCgZy",
+            "ZWFzb24YASABKAUiIAoQSGVhcnRiZWF0UmVxdWVzdBIMCgRQaW5nGAEgASgN",
+            "IjMKEUhlYXJ0YmVhdFJlc3BvbnNlEh4KBlJlc3VsdBgBIAEoCzIOLnByb3Rv",
+            "cy5SZXN1bHQiMgoMTG9naW5SZXF1ZXN0EiIKCFVzZXJJbmZvGAEgASgLMhAu",
+            "cHJvdG9zLlVzZXJJbmZvIlAKDUxvZ2luUmVzcG9uc2USHgoGUmVzdWx0GAEg",
+            "ASgLMg4ucHJvdG9zLlJlc3VsdBIPCgdMb2JieUlEGAIgASgNEg4KBlJvb21J",
+            "RBgDIAEoDWIGcHJvdG8z"));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { global::Protos.UserinfoReflection.Descriptor, global::Protos.ResultReflection.Descriptor, },
           new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HandsharkNotify), global::Protos.HandsharkNotify.Parser, null, null, null, null),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HandsharkPush), global::Protos.HandsharkPush.Parser, null, null, null, null),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HandsharkAckNotify), global::Protos.HandsharkAckNotify.Parser, null, null, null, null),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.SYN), global::Protos.SYN.Parser, null, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.CloseNotify), global::Protos.CloseNotify.Parser, null, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.closePush), global::Protos.closePush.Parser, new[]{ "Reason" }, null, null, null),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HeartbeatRequest), global::Protos.HeartbeatRequest.Parser, null, null, null, null),
-            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HeartbeatResponse), global::Protos.HeartbeatResponse.Parser, null, null, null, null),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HeartbeatRequest), global::Protos.HeartbeatRequest.Parser, new[]{ "Ping" }, null, null, null),
+            new pbr::GeneratedClrTypeInfo(typeof(global::Protos.HeartbeatResponse), global::Protos.HeartbeatResponse.Parser, new[]{ "Result" }, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.LoginRequest), global::Protos.LoginRequest.Parser, new[]{ "UserInfo" }, null, null, null),
             new pbr::GeneratedClrTypeInfo(typeof(global::Protos.LoginResponse), global::Protos.LoginResponse.Parser, new[]{ "Result", "LobbyID", "RoomID" }, null, null, null)
           }));
@@ -48,10 +46,10 @@ namespace Protos {
 
   }
   #region Messages
-  public sealed partial class HandsharkNotify : pb::IMessage<HandsharkNotify> {
-    private static readonly pb::MessageParser<HandsharkNotify> _parser = new pb::MessageParser<HandsharkNotify>(() => new HandsharkNotify());
+  public sealed partial class SYN : pb::IMessage<SYN> {
+    private static readonly pb::MessageParser<SYN> _parser = new pb::MessageParser<SYN>(() => new SYN());
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pb::MessageParser<HandsharkNotify> Parser { get { return _parser; } }
+    public static pb::MessageParser<SYN> Parser { get { return _parser; } }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
@@ -64,28 +62,28 @@ namespace Protos {
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkNotify() {
+    public SYN() {
       OnConstruction();
     }
 
     partial void OnConstruction();
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkNotify(HandsharkNotify other) : this() {
+    public SYN(SYN other) : this() {
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkNotify Clone() {
-      return new HandsharkNotify(this);
+    public SYN Clone() {
+      return new SYN(this);
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override bool Equals(object other) {
-      return Equals(other as HandsharkNotify);
+      return Equals(other as SYN);
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public bool Equals(HandsharkNotify other) {
+    public bool Equals(SYN other) {
       if (ReferenceEquals(other, null)) {
         return false;
       }
@@ -117,185 +115,7 @@ namespace Protos {
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void MergeFrom(HandsharkNotify other) {
-      if (other == null) {
-        return;
-      }
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void MergeFrom(pb::CodedInputStream input) {
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-        }
-      }
-    }
-
-  }
-
-  public sealed partial class HandsharkPush : pb::IMessage<HandsharkPush> {
-    private static readonly pb::MessageParser<HandsharkPush> _parser = new pb::MessageParser<HandsharkPush>(() => new HandsharkPush());
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pb::MessageParser<HandsharkPush> Parser { get { return _parser; } }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[1]; }
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    pbr::MessageDescriptor pb::IMessage.Descriptor {
-      get { return Descriptor; }
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkPush() {
-      OnConstruction();
-    }
-
-    partial void OnConstruction();
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkPush(HandsharkPush other) : this() {
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkPush Clone() {
-      return new HandsharkPush(this);
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public override bool Equals(object other) {
-      return Equals(other as HandsharkPush);
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public bool Equals(HandsharkPush other) {
-      if (ReferenceEquals(other, null)) {
-        return false;
-      }
-      if (ReferenceEquals(other, this)) {
-        return true;
-      }
-      return true;
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public override int GetHashCode() {
-      int hash = 1;
-      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) {
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public int CalculateSize() {
-      int size = 0;
-      return size;
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void MergeFrom(HandsharkPush other) {
-      if (other == null) {
-        return;
-      }
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void MergeFrom(pb::CodedInputStream input) {
-      uint tag;
-      while ((tag = input.ReadTag()) != 0) {
-        switch(tag) {
-          default:
-            input.SkipLastField();
-            break;
-        }
-      }
-    }
-
-  }
-
-  public sealed partial class HandsharkAckNotify : pb::IMessage<HandsharkAckNotify> {
-    private static readonly pb::MessageParser<HandsharkAckNotify> _parser = new pb::MessageParser<HandsharkAckNotify>(() => new HandsharkAckNotify());
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pb::MessageParser<HandsharkAckNotify> Parser { get { return _parser; } }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[2]; }
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    pbr::MessageDescriptor pb::IMessage.Descriptor {
-      get { return Descriptor; }
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkAckNotify() {
-      OnConstruction();
-    }
-
-    partial void OnConstruction();
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkAckNotify(HandsharkAckNotify other) : this() {
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public HandsharkAckNotify Clone() {
-      return new HandsharkAckNotify(this);
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public override bool Equals(object other) {
-      return Equals(other as HandsharkAckNotify);
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public bool Equals(HandsharkAckNotify other) {
-      if (ReferenceEquals(other, null)) {
-        return false;
-      }
-      if (ReferenceEquals(other, this)) {
-        return true;
-      }
-      return true;
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public override int GetHashCode() {
-      int hash = 1;
-      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) {
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public int CalculateSize() {
-      int size = 0;
-      return size;
-    }
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void MergeFrom(HandsharkAckNotify other) {
+    public void MergeFrom(SYN other) {
       if (other == null) {
         return;
       }
@@ -322,7 +142,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[3]; }
+      get { return global::Protos.UserReflection.Descriptor.MessageTypes[1]; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -411,7 +231,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[4]; }
+      get { return global::Protos.UserReflection.Descriptor.MessageTypes[2]; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -531,7 +351,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[5]; }
+      get { return global::Protos.UserReflection.Descriptor.MessageTypes[3]; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -548,6 +368,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public HeartbeatRequest(HeartbeatRequest other) : this() {
+      ping_ = other.ping_;
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -555,6 +376,20 @@ namespace Protos {
       return new HeartbeatRequest(this);
     }
 
+    /// <summary>Field number for the "Ping" field.</summary>
+    public const int PingFieldNumber = 1;
+    private uint ping_;
+    /// <summary>
+    /// ping值, 单位毫秒
+    /// </summary>
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public uint Ping {
+      get { return ping_; }
+      set {
+        ping_ = value;
+      }
+    }
+
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override bool Equals(object other) {
       return Equals(other as HeartbeatRequest);
@@ -568,12 +403,14 @@ namespace Protos {
       if (ReferenceEquals(other, this)) {
         return true;
       }
+      if (Ping != other.Ping) return false;
       return true;
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override int GetHashCode() {
       int hash = 1;
+      if (Ping != 0) hash ^= Ping.GetHashCode();
       return hash;
     }
 
@@ -584,11 +421,18 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public void WriteTo(pb::CodedOutputStream output) {
+      if (Ping != 0) {
+        output.WriteRawTag(8);
+        output.WriteUInt32(Ping);
+      }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public int CalculateSize() {
       int size = 0;
+      if (Ping != 0) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Ping);
+      }
       return size;
     }
 
@@ -597,6 +441,9 @@ namespace Protos {
       if (other == null) {
         return;
       }
+      if (other.Ping != 0) {
+        Ping = other.Ping;
+      }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -607,6 +454,10 @@ namespace Protos {
           default:
             input.SkipLastField();
             break;
+          case 8: {
+            Ping = input.ReadUInt32();
+            break;
+          }
         }
       }
     }
@@ -620,7 +471,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[6]; }
+      get { return global::Protos.UserReflection.Descriptor.MessageTypes[4]; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -637,6 +488,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public HeartbeatResponse(HeartbeatResponse other) : this() {
+      Result = other.result_ != null ? other.Result.Clone() : null;
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -644,6 +496,17 @@ namespace Protos {
       return new HeartbeatResponse(this);
     }
 
+    /// <summary>Field number for the "Result" field.</summary>
+    public const int ResultFieldNumber = 1;
+    private global::Protos.Result result_;
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public global::Protos.Result Result {
+      get { return result_; }
+      set {
+        result_ = value;
+      }
+    }
+
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override bool Equals(object other) {
       return Equals(other as HeartbeatResponse);
@@ -657,12 +520,14 @@ namespace Protos {
       if (ReferenceEquals(other, this)) {
         return true;
       }
+      if (!object.Equals(Result, other.Result)) return false;
       return true;
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override int GetHashCode() {
       int hash = 1;
+      if (result_ != null) hash ^= Result.GetHashCode();
       return hash;
     }
 
@@ -673,11 +538,18 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public void WriteTo(pb::CodedOutputStream output) {
+      if (result_ != null) {
+        output.WriteRawTag(10);
+        output.WriteMessage(Result);
+      }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public int CalculateSize() {
       int size = 0;
+      if (result_ != null) {
+        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result);
+      }
       return size;
     }
 
@@ -686,6 +558,12 @@ namespace Protos {
       if (other == null) {
         return;
       }
+      if (other.result_ != null) {
+        if (result_ == null) {
+          result_ = new global::Protos.Result();
+        }
+        Result.MergeFrom(other.Result);
+      }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -696,6 +574,13 @@ namespace Protos {
           default:
             input.SkipLastField();
             break;
+          case 10: {
+            if (result_ == null) {
+              result_ = new global::Protos.Result();
+            }
+            input.ReadMessage(result_);
+            break;
+          }
         }
       }
     }
@@ -709,7 +594,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[7]; }
+      get { return global::Protos.UserReflection.Descriptor.MessageTypes[5]; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -832,7 +717,7 @@ namespace Protos {
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Protos.UserReflection.Descriptor.MessageTypes[8]; }
+      get { return global::Protos.UserReflection.Descriptor.MessageTypes[6]; }
     }
 
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -872,9 +757,9 @@ namespace Protos {
 
     /// <summary>Field number for the "LobbyID" field.</summary>
     public const int LobbyIDFieldNumber = 2;
-    private long lobbyID_;
+    private uint lobbyID_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public long LobbyID {
+    public uint LobbyID {
       get { return lobbyID_; }
       set {
         lobbyID_ = value;
@@ -883,9 +768,9 @@ namespace Protos {
 
     /// <summary>Field number for the "RoomID" field.</summary>
     public const int RoomIDFieldNumber = 3;
-    private long roomID_;
+    private uint roomID_;
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public long RoomID {
+    public uint RoomID {
       get { return roomID_; }
       set {
         roomID_ = value;
@@ -915,8 +800,8 @@ namespace Protos {
     public override int GetHashCode() {
       int hash = 1;
       if (result_ != null) hash ^= Result.GetHashCode();
-      if (LobbyID != 0L) hash ^= LobbyID.GetHashCode();
-      if (RoomID != 0L) hash ^= RoomID.GetHashCode();
+      if (LobbyID != 0) hash ^= LobbyID.GetHashCode();
+      if (RoomID != 0) hash ^= RoomID.GetHashCode();
       return hash;
     }
 
@@ -931,13 +816,13 @@ namespace Protos {
         output.WriteRawTag(10);
         output.WriteMessage(Result);
       }
-      if (LobbyID != 0L) {
+      if (LobbyID != 0) {
         output.WriteRawTag(16);
-        output.WriteInt64(LobbyID);
+        output.WriteUInt32(LobbyID);
       }
-      if (RoomID != 0L) {
+      if (RoomID != 0) {
         output.WriteRawTag(24);
-        output.WriteInt64(RoomID);
+        output.WriteUInt32(RoomID);
       }
     }
 
@@ -947,11 +832,11 @@ namespace Protos {
       if (result_ != null) {
         size += 1 + pb::CodedOutputStream.ComputeMessageSize(Result);
       }
-      if (LobbyID != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(LobbyID);
+      if (LobbyID != 0) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(LobbyID);
       }
-      if (RoomID != 0L) {
-        size += 1 + pb::CodedOutputStream.ComputeInt64Size(RoomID);
+      if (RoomID != 0) {
+        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(RoomID);
       }
       return size;
     }
@@ -967,10 +852,10 @@ namespace Protos {
         }
         Result.MergeFrom(other.Result);
       }
-      if (other.LobbyID != 0L) {
+      if (other.LobbyID != 0) {
         LobbyID = other.LobbyID;
       }
-      if (other.RoomID != 0L) {
+      if (other.RoomID != 0) {
         RoomID = other.RoomID;
       }
     }
@@ -991,11 +876,11 @@ namespace Protos {
             break;
           }
           case 16: {
-            LobbyID = input.ReadInt64();
+            LobbyID = input.ReadUInt32();
             break;
           }
           case 24: {
-            RoomID = input.ReadInt64();
+            RoomID = input.ReadUInt32();
             break;
           }
         }

+ 6 - 6
cs/Userinfo.cs

@@ -23,7 +23,7 @@ namespace Protos {
       byte[] descriptorData = global::System.Convert.FromBase64String(
           string.Concat(
             "Cg51c2VyaW5mby5wcm90bxIGcHJvdG9zIl0KCFVzZXJJbmZvEg4KBlVzZXJJ",
-            "RBgBIAEoBRIOCgZPcGVuaWQYAiABKAkSDwoHVW5pb25pZBgDIAEoCRIQCghO",
+            "RBgBIAEoDRIOCgZPcGVuaWQYAiABKAkSDwoHVW5pb25pZBgDIAEoCRIQCghO",
             "aWNrbmFtZRgEIAEoCRIOCgZBdmF0YXIYBSABKAliBnByb3RvMw=="));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { },
@@ -73,12 +73,12 @@ namespace Protos {
 
     /// <summary>Field number for the "UserID" field.</summary>
     public const int UserIDFieldNumber = 1;
-    private int userID_;
+    private uint userID_;
     /// <summary>
     /// 用户id
     /// </summary>
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public int UserID {
+    public uint UserID {
       get { return userID_; }
       set {
         userID_ = value;
@@ -182,7 +182,7 @@ namespace Protos {
     public void WriteTo(pb::CodedOutputStream output) {
       if (UserID != 0) {
         output.WriteRawTag(8);
-        output.WriteInt32(UserID);
+        output.WriteUInt32(UserID);
       }
       if (Openid.Length != 0) {
         output.WriteRawTag(18);
@@ -206,7 +206,7 @@ namespace Protos {
     public int CalculateSize() {
       int size = 0;
       if (UserID != 0) {
-        size += 1 + pb::CodedOutputStream.ComputeInt32Size(UserID);
+        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UserID);
       }
       if (Openid.Length != 0) {
         size += 1 + pb::CodedOutputStream.ComputeStringSize(Openid);
@@ -254,7 +254,7 @@ namespace Protos {
             input.SkipLastField();
             break;
           case 8: {
-            UserID = input.ReadInt32();
+            UserID = input.ReadUInt32();
             break;
           }
           case 18: {

+ 49 - 0
protos/front.proto

@@ -0,0 +1,49 @@
+syntax = "proto3";
+package protos;
+// 载入游戏响应
+message  CharacterPackage{
+   int32 hand=1;
+     int32 handGrab=2;
+       
+         float position_x=3;
+         float position_y=4;
+         float position_z=5;
+
+        //旋转
+         float rotation_x=6;
+         float rotation_y=7;
+         float rotation_z=8;
+         float rotation_w=9;
+
+        //线速度
+         float linear_velocity_x=10;
+         float linear_velocity_y=11;
+         float linear_velocity_z=12;
+
+        repeated float bonePos=13;
+        repeated float boneRot=14;
+}
+message BoxPackage {
+  int32 effect_id=1;
+        int32 hold_id=2;
+        //坐标  
+         float position_x=3;
+         float position_y=4;
+         float position_z=5;
+
+        //旋转
+         float rotation_x=6;
+         float rotation_y=7;
+         float rotation_z=8;
+         float rotation_w=9;
+
+        //线速度
+         float linear_velocity_x=10;
+         float linear_velocity_y=11;
+         float linear_velocity_z=12;
+
+        //角速度
+         float angle_velocity_x=13;
+         float angle_velocity_y=14;
+         float angle_velocity_z=15;
+}

+ 1 - 1
protos/sync.proto

@@ -12,7 +12,7 @@ message RestoreRequest {
 message RestoreResponse {
     repeated UserInfo Users = 1;
     uint64 Step = 2;
-    map<string, bytes> Values = 3;
+    map<string, bytes> state = 3;
 }
 
 // 同步消息

+ 3 - 0
protos/user.proto

@@ -30,4 +30,7 @@ message LoginResponse {
     Result Result = 1;
     uint32 LobbyID = 2;
     uint32 RoomID = 3;
+	uint32 SyncInterval=4;
+	uint32 N=5;
+    string	Errmsg=6
 }