commands.proto 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. syntax = "proto3";
  2. package pb;
  3. option go_package = "/pb";
  4. // 状态命令枚举
  5. enum ECommand {
  6. SEND_MSG = 0; // 消息信息
  7. MSG_HEART_BEAT = 3; // 心跳
  8. // status
  9. ON_PLAYER_DISCONNECT = 1004; // 玩家断开连接 cmd_str:玩家id cmd_val:登出原因ErrorReason
  10. ON_PLAYER_CONNECT = 1005; // 玩家连接 cmd_str:玩家id
  11. ON_PLAYER_WAIT_QUEUE_INFO = 1006; // 玩家等待队列信息 消息体:CommandMsg.buff.array_id_info
  12. ON_PLAYER_RECEIVE_REPLY = 1007; // 玩家被应答 cmd_str:客服id
  13. ON_PLAYER_WAIT_QUEUE_LEN = 1008; // 玩家等待队列长度 cmd_val: 队列人数
  14. ON_SERVICE_DISCONNECT = 3002; // 客服断开连接 cmd_str:客服id
  15. ON_SERVICE_CONNECT = 3003; // 客服连接 cmd_str:客服id
  16. ON_SERVICE_HANG_UP_LIST = 3004; // 客服-玩家挂断列表 消息体:CommandMsg.buff.array_id_info
  17. // 请求操作
  18. CALL_PLAYER_MSG = 2001; // 玩家->服务端 发送消息
  19. CALL_SERVICE_MSG = 2002; // 客服->服务端 发送消息
  20. CALL_PLAYER_LOGOUT = 2003; // 玩家登出
  21. CALL_SERVICE_LOGOUT = 2004; // 客服登出
  22. CALL_SERVICE_REPLY = 2005; // 客服应答 cmd_str:待应答的玩家id
  23. CALL_PLAYER_CHAT_LOG= 2006; // 获取玩家聊天记录 cmd_str:玩家id 返回:CommandMsg.buff.array_chat_log
  24. // gm debug
  25. MSG_TEST = 100001;
  26. }
  27. // 错误枚举
  28. enum ErrorReason {
  29. ERROR_DUMMY = 0;
  30. PLAYER_HEART_BEAT_FAILED = 1000; // 玩家心跳失败
  31. PLAYER_REPEAT_LOGIN = 1001; // 玩家重复登录
  32. PLAYER_WAIT_QUEUE_OVERTIME = 1002; // 玩家等待队列超时
  33. PLAYER_TALK_INTERVAL_LIMIT = 1003; // 玩家发言时间超时
  34. PLAYER_CALL_LOGOUT = 1004; // 玩家主动登出
  35. SERVICE_REPEAT_LOGIN = 2001; // 客服重复登录
  36. SERVICE_CALL_LOGOUT = 2002; // 客服主动登出
  37. SERVICE_HEART_BEAT_FAILED = 2003; // 客服心跳超时
  38. }
  39. // 内网调试debug命令
  40. enum EDebugCmd {
  41. /*
  42. 修改队列等待时间(s):
  43. cmd_str: WaitConnServiceLimit
  44. cmd_val: 30
  45. 修改长时间聊天未发言时限(s):
  46. cmd_str:LastTalkIntervalLimit
  47. cmd_val:60
  48. *消息example:
  49. msg.cmd_type: ECommand.MSG_TEST
  50. msg.cmd_val: EDebugCmd.MODIFY_CONFIG
  51. msg.cmd_str: "{\"WaitConnServiceLimit\": 3600}"
  52. */
  53. MODIFY_CONFIG = 0; // 修改配置
  54. SERVICE_REPLY = 1; // 客服连接
  55. GET_CHAT_LOG = 2; // 获取聊天log cmd_str:客服id
  56. }
  57. // error
  58. enum EErrorCode {
  59. ERR_DUMMY = 0;
  60. ERR_HANDLER_CALL_ERR = 1; // 请求调用失败
  61. ERR_REQUEST_LIMIT = 101; // 请求过于频繁
  62. ERR_PLAYER_CONN_ERR = 102; // 玩家连接失败
  63. ERR_PARAM_ERROR = 103; // 参数错误
  64. ERR_SERVICE_CONN_ERR = 104; // 客服连接失败
  65. }