Bladeren bron

format filed datatype

王虎 4 jaren geleden
bovenliggende
commit
72e6310b52
7 gewijzigde bestanden met toevoegingen van 27 en 26 verwijderingen
  1. 2 0
      README.md
  2. 0 5
      close.proto
  3. 1 1
      lobby.proto
  4. 1 1
      room.proto
  5. 16 4
      sync.proto
  6. 6 14
      user.proto
  7. 1 1
      userinfo.proto

+ 2 - 0
README.md

@@ -60,5 +60,7 @@
 | 152 | SyncRequest | c -> s | 客户端同步数据 |
 | 153 | SyncResponse | s -> c | 服务器响应同步结果 |
 | 154 | SyncPush | s -> c | 服务器通知客户端想要他人的同步数据 |
+| 155 | MasterPush | s -> c | 服务器合并lockStep的消息给master |
+| 156 | MasterNotify | c -> s | master通知服务器广播数据给follow |
 
 

+ 0 - 5
close.proto

@@ -1,5 +0,0 @@
-
-syntax = "proto3";
-
-package protos;
-

+ 1 - 1
lobby.proto

@@ -9,5 +9,5 @@ message LobbyJoinPush {
 
 // 用户离开大厅
 message LobbyLeavePush {
-    int32 UserID = 1;
+    uint32 UserID = 1;
 }

+ 1 - 1
room.proto

@@ -13,7 +13,7 @@ message RoomJoinPush {
 }
 
 message RoomLeavePush {
-    int32 UserID = 1;
+    uint32 UserID = 1;
 }
 
 message RoomDismissPush {

+ 16 - 4
sync.proto

@@ -11,25 +11,37 @@ message RestoreRequest {
 // 载入游戏响应
 message RestoreResponse {
     repeated UserInfo Users = 1;
-    int64 Step = 2;
+    uint64 Step = 2;
     map<string, bytes> Values = 3;
 }
 
 // 同步消息
 message SyncRequest {
-    int64 Step = 1;
+    uint64 Step = 1;
     map<string, bytes> Values = 2;
 }
 
 // 同步消息响应
 message SyncResponse {
     bool Status = 1;
-    int64 Step = 2; // status=false时才有值
+    uint64 Step = 2; // status=false时才有值
     map<string, bytes> Values = 3; // status=false时才有值
 }
 
 // 同步消息推送
 message SyncPush {
-    int64 Step = 1;
+    uint64 Step = 1;
+    map<string, bytes> Values = 2;
+}
+
+// 服务器合并用户操作给master
+message MasterPush {
+    uint64 Step = 1;
+    map<string, bytes> Values = 2;
+}
+
+// 主机广播消息给flower
+message MasterNotify {
+    uint64 Step = 1;
     map<string, bytes> Values = 2;
 }

+ 6 - 14
user.proto

@@ -4,16 +4,9 @@ package protos;
 import "userinfo.proto";
 import "result.proto";
 
-message HandsharkNotify {
+message SYN {
 }
 
-message HandsharkPush {
-}
-
-message HandsharkAckNotify {
-}
-
-
 message CloseNotify {
 }
 
@@ -22,11 +15,11 @@ message closePush {
 }
 
 message HeartbeatRequest {
-
+    uint32 Ping = 1; // ping值, 单位毫秒
 }
 
 message HeartbeatResponse {
-    
+    Result Result = 1;
 }
 
 message LoginRequest {
@@ -35,7 +28,6 @@ message LoginRequest {
 
 message LoginResponse {
     Result Result = 1;
-    int64 LobbyID = 2;
-    int64 RoomID = 3;
-}
-
+    uint32 LobbyID = 2;
+    uint32 RoomID = 3;
+}

+ 1 - 1
userinfo.proto

@@ -2,7 +2,7 @@ syntax = "proto3";
 package protos;
 
 message UserInfo{
-    int32 UserID = 1; // 用户id
+    uint32 UserID = 1; // 用户id
     string Openid = 2; // 平台openid
     string Unionid = 3; // 平台unionid
     string Nickname = 4; // 用户昵称