local S2C = {} local function PrintRes(funcName, res) local szRes = require("Base/Utils.lua"):Table2String(res, "====> res") local _, szTimeFormat = require("Base/Utils.lua"):TimeNow() Debugf("----> S2C:szTimeFormat:%s, funcName:%s, printRes:%s", szTimeFormat, funcName, szRes) end function S2C:ERROR(res) PrintRes("ERROR", res) end -- 心跳 function S2C:HEARTBEAT_RESP(res) PrintRes("HEARTBEAT", res) if res.code ~= 0 then print("----> S2C:HEARTBEAT_RESP, res.code" .. res.code) return end end function S2C:SERVER_HELLO(res) PrintRes("SERVER_HELLO", res) end S2C["/protobuf/customResp"] = function(res) PrintRes("/protobuf/customResp", res) end return S2C