message.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. syntax = "proto3";
  2. package tutorial;
  3. option java_package = "com.duowan.allstar.proto";
  4. option java_outer_classname = "MessageProtos";
  5. message Message {
  6. enum Type {
  7. SELF = 0;
  8. DATA = 1;
  9. NOTIFY = 2;
  10. ROLEOPT = 3;
  11. REPORT = 4;
  12. BD_ITEM = 5;
  13. // 心跳包类型
  14. HB = 6;
  15. }
  16. Type type = 1;
  17. message DataMessage {
  18. int32 code = 1;
  19. int32 result = 2;
  20. string data = 3;
  21. string msg = 4;
  22. }
  23. DataMessage dataMessage = 2;
  24. // Enum nType {1: 普通通知;2: 好友列表通知; 3: 艺人列表通知,4:用户家园建筑列表通知,5:任务大厅通知}
  25. message NotificationMessage {
  26. int32 nType = 1;
  27. }
  28. NotificationMessage notificationMessage = 3;
  29. // 即对 targetUid 做了什么操作 opt
  30. // e.g.: 向 targetUid 赎身; 向 targetUid 签约
  31. // Enum opt {1: 赎身; 2: 抢夺; 3: 签约; 4: 解雇; 5: 入驻;6: 召回;7: 驱赶;8: 举报;9:通过好友申请;10:成为好友}
  32. message RoleOptMessage {
  33. // 目标用户
  34. int64 targetUid = 1;
  35. // 赎身或者抢夺成功时,前任老板的uid
  36. int64 exBossUid = 2;
  37. // 操作类型
  38. int32 opt = 3;
  39. }
  40. RoleOptMessage roleOptMessage = 4;
  41. // 数据上报
  42. message ReportData {
  43. /**
  44. * 上报序号,每次重新获取时重置
  45. */
  46. int32 seq = 1;
  47. /**
  48. * 时间戳
  49. */
  50. int64 t = 2;
  51. /**
  52. * @see com.duowan.allstar.model.enumeration.Cmd
  53. */
  54. int32 cmd = 3;
  55. /**
  56. * grossIncome
  57. */
  58. int64 gi = 4;
  59. /**
  60. * @see com.duowan.allstar.model.home.UserExtra#stars
  61. */
  62. int64 s = 5;
  63. /**
  64. * @see BuildingInfoForm
  65. */
  66. repeated BuildingInfo b = 6;
  67. /**
  68. * 未解锁建筑
  69. */
  70. repeated BuildingInfo ub = 7;
  71. }
  72. ReportData reportData = 5;
  73. message BuildingInfo {
  74. // buildingId
  75. int64 id = 1;
  76. // 等级
  77. int32 l = 2;
  78. // coin count 金币存储次数
  79. int32 cc = 3;
  80. }
  81. string msg = 6;
  82. message BuildingItems {
  83. int64 buildingId = 1;
  84. Item item = 2;
  85. }
  86. BuildingItems buildingItems = 7;
  87. message Item {
  88. int64 id = 1;
  89. int32 count = 2;
  90. }
  91. }