QuestionProxy.lua 998 B

123456789101112131415161718192021222324252627282930313233
  1. local RemoteProxy = requireProxy("remote/RemoteProxy")
  2. local QuestionProxy = class("QuestionProxy", RemoteProxy)
  3. QuestionProxy.NAME = global.ProxyTable.QuestionProxy
  4. function QuestionProxy:ctor()
  5. QuestionProxy.super.ctor(self)
  6. end
  7. function QuestionProxy:onRegister()
  8. QuestionProxy.super.onRegister(self)
  9. end
  10. function QuestionProxy:handle_MSG_SC_SENDQUESTION(msg)
  11. local msgHdr = msg:GetHeader()
  12. local jsonData = ParseRawMsgToJson(msg)
  13. jsonData.time = msgHdr.recog
  14. dump(jsonData, "jsonData___")
  15. global.Facade:sendNotification(global.NoticeTable.QuestionLayer_Open, jsonData)
  16. end
  17. function QuestionProxy:sendAnswer(data)
  18. dump(data)
  19. LuaSendMsg(global.MsgType.MSG_CS_SENDANSWER, data)
  20. end
  21. function QuestionProxy:RegisterMsgHandler()
  22. local msgType = global.MsgType
  23. -- 收到消息
  24. LuaRegisterMsgHandler(msgType.MSG_SC_SENDQUESTION, handler(self, self.handle_MSG_SC_SENDQUESTION))--下发答题
  25. end
  26. return QuestionProxy