소스 검색

Merge branch 'master' of http://git.xwxgame.com/backend/delivery-proto

陈真 4 년 전
부모
커밋
55c862cb67
2개의 변경된 파일10개의 추가작업 그리고 7개의 파일을 삭제
  1. 5 6
      README.md
  2. 5 1
      protos/sync.proto

+ 5 - 6
README.md

@@ -37,11 +37,10 @@
 ### 3.2 act定义
 | 协议号 | message | 方向 | 备注 |
 | --- | --- | --- | --- |
-| 1 | HandsharkNotify | c -> s | 客户端发送握手请求 |
-| 2 | HandsharkPush | s -> c | 服务端确认握手请求 |
-| 3 | HandsharkAckNotify | c -> s | 客户端确认握手请求 |
-| 4 | CloseNotify | c -> s | 客户端关闭连接 |
-| 5 | ClosePush | s -> c | 客户端关闭用户连接 |
+| 4 | SYN | c -> s | 客户端SYN请求 |
+| 4 | SYN | s -> c| 服务器响应SYN请求 |
+| 5 | CloseNotify | c -> s | 客户端关闭连接 |
+| 5 | ClosePush | s -> c | 服务器关闭用户连接 |
 | 10 | LoginRequest | c -> s | 客户端请求登陆 |
 | 11 | LoginResponse | s -> c | 服务器响应登陆请求 |
 | 12 | HeartbeatRequest | c -> s | 客户端心跳 |
@@ -59,7 +58,7 @@
 | 150 | RestoreRequest | c -> s | 客户端请求恢复数据 |
 | 151 | RestoreResponse | s -> c | 服务器响应当前状态 |
 | 152 | SyncRequest | c -> s | 客户端同步数据 |
-| 152 | SyncResponse | s -> c | 服务器响应同步结果 |
 | 153 | SyncResponse | s -> c | 服务器响应同步结果 |
+| 154 | SyncPush | s -> c | 服务器通知客户端想要他人的同步数据 |
 
 

+ 5 - 1
protos/sync.proto

@@ -2,13 +2,15 @@ syntax = "proto3";
 
 package protos;
 
+import "userinfo.proto";
+
 // 载入游戏请求
 message RestoreRequest {
 }
 
 // 载入游戏响应
 message RestoreResponse {
-    map<int32, UserInfo> Users = 1;
+    repeated UserInfo Users = 1;
     int64 Step = 2;
     map<string, bytes> Values = 3;
 }
@@ -22,6 +24,8 @@ message SyncRequest {
 // 同步消息响应
 message SyncResponse {
     bool Status = 1;
+    int64 Step = 2; // status=false时才有值
+    map<string, bytes> Values = 3; // status=false时才有值
 }
 
 // 同步消息推送