sync.proto 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. syntax = "proto3";
  2. package protos;
  3. import "userinfo.proto";
  4. import "result.proto";
  5. // 载入游戏请求
  6. message RestoreRequest {
  7. }
  8. // 载入游戏响应
  9. message RestoreResponse {
  10. repeated UserInfo Users = 1;
  11. uint64 Step = 2;
  12. map<string, bytes> state = 3;
  13. }
  14. // 同步消息
  15. message SyncRequest {
  16. uint64 Step = 1;
  17. map<string, bytes> Values = 2;
  18. }
  19. // 同步消息响应
  20. message SyncResponse {
  21. bool Status = 1;
  22. uint64 Step = 2; // status=false时才有值
  23. map<string, bytes> Values = 3; // status=false时才有值
  24. uint64 T = 4; // 服务器收到sync request的时间戳(毫秒)
  25. }
  26. // 客户端发送实时消息
  27. message DMessageRequest {
  28. repeated uint32 UserIDs = 1;
  29. map<string, bytes> Values = 2;
  30. }
  31. // 服务器响应用户实时消息结果
  32. message DMessageResponse {
  33. Result Result = 1;
  34. }
  35. // 服务器转发实时消息
  36. message DMessagePush {
  37. map<string, bytes> Values = 1;
  38. }
  39. // 同步消息推送
  40. message SyncPush {
  41. uint64 Step = 1;
  42. map<string, bytes> Values = 2;
  43. }
  44. // 服务器合并用户操作给master
  45. message MasterPush {
  46. uint64 Step = 1;
  47. map<string, bytes> Values = 2;
  48. uint64 T = 3; // 服务器开始推送时间戳
  49. }
  50. // 主机广播消息给flower
  51. message MasterNotify {
  52. uint64 Step = 1;
  53. map<string, bytes> Values = 2;
  54. }
  55. // 主机广播消息给flower
  56. message MasterNotifyResponse {
  57. uint64 T = 1; // 服务器收到MasterNotify的时间戳(毫秒)
  58. }
  59. // 主机存储状态
  60. message MasterStoreNotify {
  61. map<string, bytes> Values = 1;
  62. }
  63. // 主机读取状态
  64. message MasterLoadRequest {}
  65. // 同步消息响应
  66. message MasterLoadResponse {
  67. Result Result = 1;
  68. map<string, bytes> Values = 2;
  69. }