message.proto 2.3 KB

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