sync.proto 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. }
  25. // 同步消息推送
  26. message SyncPush {
  27. uint64 Step = 1;
  28. map<string, bytes> Values = 2;
  29. }
  30. // 服务器合并用户操作给master
  31. message MasterPush {
  32. uint64 Step = 1;
  33. map<string, bytes> Values = 2;
  34. }
  35. // 主机广播消息给flower
  36. message MasterNotify {
  37. uint64 Step = 1;
  38. map<string, bytes> Values = 2;
  39. }
  40. // 主机存储状态
  41. message MasterStoreNotify {
  42. map<string, bytes> Values = 1;
  43. }
  44. // 主机读取状态
  45. message MasterLoadRequest {}
  46. // 同步消息响应
  47. message MasterLoadResponse {
  48. Result Result = 1;
  49. map<string, bytes> Values = 2;
  50. }