王虎 3 anni fa
parent
commit
44f8fe47f8
4 ha cambiato i file con 120 aggiunte e 2 eliminazioni
  1. 19 2
      README.md
  2. 77 0
      protos/party.proto
  3. 22 0
      protos/sync.proto
  4. 2 0
      protos/userinfo.proto

+ 19 - 2
README.md

@@ -69,5 +69,22 @@
 | 161 | DMessageResponse | s -> c | 服务端响应协议结果 |
 | 162 | DMessagePush | s -> c | 服务端转发消息给其他人 |
 | 163 | MasterNotifyResponse | s -> c | 服务器收到masterNotify的响应 |
-
-
+| 170 | PartyJoinRequest | c -> s | 请求加入派对 |
+| 171 | PartyJoinResponse | s -> c | 加入派对响应 |
+| 172 | PartyJoinPush | s -> c | 推送其他人加入派对的消息 |
+| 173 | PartyLeaveRequest | c -> s | 请求退出派对 |
+| 174 | PartyLeaveResponse | s -> c | 退出派对响应 |
+| 175 | PartyLeavePush | s -> c | 退出派对消息推送 |
+| 176 | PartyReadyRequest | c -> s | 请求已准备 |
+| 177 | PartyReadyResponse | s -> c | 响应已准备 |
+| 178 | PartyReadyPush | s -> c | 推送已准备 |
+| 179 | PartyFullPush | s -> c | 推送房间已满 |
+| 181 | PartyFinishPush | s -> c | 推送房间结束 |
+| 182 | PartyStageCrossRequest | c -> s | 请求通关小关卡 |
+| 183 | PartyStageCrossResponse | s -> c | 响应通关小关卡 |
+| 184 | PartyStageCrossPush | s -> c | 推送其他人通关小关卡 |
+| 185 | PartyStageStartPush | s -> c | 推送小关卡开始 |
+| 186 | PartyStageFinishPush | s -> c | 推送小关卡结束 |
+| 187 | PartySyncRequest | c -> s | 客户端同步数据 |
+| 188 | PartySyncResponse | s -> c | 服务器响应同步结果 |
+| 189 | PartySyncPush | s -> c | 服务器通知客户端想要他人的同步数据 |

+ 77 - 0
protos/party.proto

@@ -0,0 +1,77 @@
+syntax = "proto3";
+package protos;
+
+import "userinfo.proto";
+import "result.proto";
+
+message PartyJoinRequest {
+    uint64 PartyID = 1;
+    int32 PartyType = 2; // 1 = 糖豆人; 2 = ** ; 3 = **
+    int32 Identidy = 3; // 身份 0 = 游戏者; 1 = 观察者
+}
+
+message PartyJoinResponse {
+    Result Result = 1;
+    uint32 PartyID = 2;
+    int32 Identidy = 3; // 身份 0 = 游戏者; 1 = 观察者
+}
+
+message PartyJoinPush {
+    UserInfo UserInfo = 1;
+}
+
+message PartyLeaveRequest {
+}
+
+message PartyLeaveResponse {
+    Result Result = 1;
+}
+
+message PartyLeavePush {
+    uint32 UserID = 1;
+}
+
+message PartyReadyRequest {
+}
+
+message PartyReadyResponse {
+    Result Result = 1;
+}
+
+message PartyReadyPush {
+    uint32 UserID = 1;
+}
+
+message PartyFullPush {
+}
+
+message PartyStartPush {
+}
+
+message PartyFinishPush {
+}
+
+message PartyStageCrossRequest { 
+    uint32 StageIndex = 1; // 第几个小关
+}
+
+message PartyStageCrossResponse {
+    Result Result = 1;
+    uint32 CrossIndex = 2; // 第几个通关的
+}
+
+message PartyStageCrossPush {
+    uint32 UserID = 1;
+    uint32 StageIndex = 2; // 第几个小关
+    uint32 CrossIndex = 3; // 第几个通关的
+}
+
+message PartyStageStartPush {
+    uint32 StageIndex = 1; // 第几个小关
+    repeated uint32 Users = 2; // 参加用户
+}
+
+message PartyStageFinishPush {
+    uint32 StageIndex = 1; // 第几个小关
+    repeated uint32 Users = 2; // 过关用户
+}

+ 22 - 0
protos/sync.proto

@@ -14,6 +14,7 @@ message RestoreResponse {
     repeated UserInfo Users = 1;
     uint64 Step = 2;
     map<string, bytes> state = 3;
+    string Road = 4;
 }
 
 // 同步消息
@@ -83,4 +84,25 @@ message MasterLoadRequest {}
 message MasterLoadResponse {
     Result Result = 1;
     map<string, bytes> Values = 2;
+}
+
+// 同步消息
+message PartySyncRequest {
+    uint64 Step = 1;
+    map<string, bytes> Values = 2;
+}
+
+// 同步消息响应
+message PartySyncResponse {
+    bool Status = 1;
+    uint64 Step = 2; // status=false时才有值
+    map<string, bytes> Values = 3; // status=false时才有值
+    uint64 T = 4; // 服务器收到sync request的时间戳(毫秒)
+}
+
+// 同步消息推送
+message PartySyncPush {
+    uint64 Step = 1;
+    map<string, bytes> Values = 2;
+    uint64 T = 3; // 服务器开始推送时间戳
 }

+ 2 - 0
protos/userinfo.proto

@@ -8,4 +8,6 @@ message UserInfo{
     string Nickname = 4; // 用户昵称
     string Avatar = 5; // 用户形象
     // 其他扩展属性
+    uint32 Identity = 6; // 用户身份 0=游戏者; 1=观察者
+    bool Ready = 7; // 用户状态 0=未准备; 1=已准备
 }