S2C.lua.txt 683 B

12345678910111213141516171819202122232425262728293031
  1. local S2C = {}
  2. local function PrintRes(funcName, res)
  3. local szRes = require("Base/Utils.lua"):Table2String(res, "====> res")
  4. local _, szTimeFormat = require("Base/Utils.lua"):TimeNow()
  5. Debugf("----> S2C:szTimeFormat:%s, funcName:%s, printRes:%s", szTimeFormat, funcName, szRes)
  6. end
  7. function S2C:ERROR(res)
  8. PrintRes("ERROR", res)
  9. end
  10. -- 心跳
  11. function S2C:HEARTBEAT_RESP(res)
  12. PrintRes("HEARTBEAT", res)
  13. if res.code ~= 0 then
  14. print("----> S2C:HEARTBEAT_RESP, res.code" .. res.code)
  15. return
  16. end
  17. end
  18. function S2C:SERVER_HELLO(res)
  19. PrintRes("SERVER_HELLO", res)
  20. end
  21. S2C["/protobuf/customResp"] = function(res)
  22. PrintRes("/protobuf/customResp", res)
  23. end
  24. return S2C