proto_user.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. -- 用户相关协议 2000~2099
  2. local proto_struct = [[
  3. ]]
  4. local proto_c2s =
  5. [[
  6. # 获取自己的信息
  7. user_self_info 2000 {
  8. request {
  9. }
  10. response {
  11. code 0: integer
  12. playerInfo 1: DataPlayerInfo # 个人信息
  13. }
  14. }
  15. # 连接保活
  16. user_keepalive 2001 {
  17. request {
  18. }
  19. response {
  20. systemTime 0: integer # 玩家系统时间
  21. }
  22. }
  23. # 获取玩家信息
  24. user_get_info 2002 {
  25. request {
  26. uid 0: integer # 玩家id
  27. }
  28. response {
  29. code 0: integer
  30. baseInfo 1: DataUserBaseInfo # 基础信息
  31. }
  32. }
  33. # 获取验证码
  34. user_get_verify_code 2003 {
  35. request {
  36. }
  37. response {
  38. code 0: integer
  39. vcode 1: string # 验证码 - 测试环境返回 - 随机6位数字
  40. }
  41. }
  42. # 更新主播邀请码
  43. user_update_band_share_code 2004 {
  44. request {
  45. shareCode 0: string # 邀请码
  46. }
  47. response {
  48. code 0: integer
  49. }
  50. }
  51. # 更新自己邀请码
  52. user_update_share_code 2005 {
  53. request {
  54. shareCode 0: string # 邀请码 空:随机
  55. }
  56. response {
  57. code 0: integer
  58. }
  59. }
  60. # 更新steam交易链接
  61. user_update_steam_link 2006 {
  62. request {
  63. link 0: string # 链接
  64. vcode 1: string # 验证码
  65. }
  66. response {
  67. code 0: integer
  68. }
  69. }
  70. # 更新头像
  71. user_update_icon 2007 {
  72. request {
  73. icon 0: string
  74. }
  75. response {
  76. code 0: integer
  77. }
  78. }
  79. # 更新昵称
  80. user_update_nickname 2008 {
  81. request {
  82. nickname 0: string
  83. }
  84. response {
  85. code 0: integer
  86. }
  87. }
  88. # 更新密码
  89. user_update_password 2009 {
  90. request {
  91. oldPassword 0: string
  92. newPassword 1: string
  93. }
  94. response {
  95. code 0: integer
  96. }
  97. }
  98. # 注销
  99. user_cancel_account 2010 {
  100. request {
  101. }
  102. response {
  103. code 0: integer
  104. }
  105. }
  106. # 实名认证 - 更新信息
  107. user_identity_update_info 2011 {
  108. request {
  109. name 0: string # 真实姓名
  110. idcard 1: string # 身份证号
  111. }
  112. response {
  113. code 0: integer
  114. }
  115. }
  116. ]]
  117. local proto_s2c =
  118. [[
  119. # 玩家系统信息
  120. on_user_system_info 2000 {
  121. request {
  122. payInfo 0: DataPay # 支付统计信息
  123. }
  124. }
  125. # 玩家状态
  126. on_server_code 2001 {
  127. request {
  128. code 0: integer # 值为497时是被顶号了,不要自动连接
  129. }
  130. }
  131. ]]
  132. local proto = {
  133. c2s = proto_struct .. proto_c2s,
  134. s2c = proto_struct .. proto_s2c
  135. }
  136. return proto