S2C.lua.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. local S2C = {}
  2. local function PrintRes(funcName, res)
  3. local szRes = require("Base/Utils.lua"):Table2String(res, "====> res")
  4. Debugf("----> S2C: funcName:%s, printRes:%s", funcName, szRes)
  5. end
  6. function S2C:HEARTBEAT(res)
  7. PrintRes("HEARTBEAT", res)
  8. if res.code ~= 0 then
  9. Warn("----> S2C:HEARTBEAT, res.code" .. res.code)
  10. return
  11. end
  12. SetCache("HEART_BEAT", 0)
  13. end
  14. function S2C:JOIN_MEETING_REQ(res)
  15. PrintRes("JOIN_MEETING_REQ", res)
  16. local eventSystem = require("Base/ZEventDispatchCenter.lua")
  17. eventSystem:DispatchEvent(eventSystem.EventType.JOIN_MEETING_REQ, res)
  18. end
  19. function S2C:JOIN_MEETING_RESP(res)
  20. PrintRes("JOIN_MEETING_RESP", res)
  21. if res.code ~= 0 then
  22. Warn("----> S2C:JOIN_MEETING_RESP, res.code" .. res.code)
  23. return
  24. end
  25. local eventSystem = require("Base/ZEventDispatchCenter.lua")
  26. eventSystem:DispatchEvent(eventSystem.EventType.JOIN_MEETING_RESP, res)
  27. end
  28. function S2C:MEETING_SCREEN_REQ(res)
  29. PrintRes("MEETING_SCREEN_REQ", res)
  30. end
  31. function S2C:MEETING_SCREEN_RESP(res)
  32. PrintRes("MEETING_SCREEN_RESP", res)
  33. if res.code ~= 0 then
  34. Warn("----> S2C:MEETING_SCREEN_RESP, res.code" .. res.code)
  35. return
  36. end
  37. local eventSystem = require("Base/ZEventDispatchCenter.lua")
  38. eventSystem:DispatchEvent(eventSystem.EventType.MEETING_SCREEN_RESP, res)
  39. end
  40. return S2C