local S2C = {}

local function PrintRes(funcName, res)
	local szRes = require("Base/Utils.lua"):Table2String(res, "====> res")
	Debugf("----> S2C: funcName:%s,  printRes:%s", funcName, szRes)
end

function S2C:HEARTBEAT(res)
	PrintRes("HEARTBEAT", res)

	if res.code ~= 0 then
		Warn("----> S2C:HEARTBEAT, res.code" .. res.code)
		return
	end
	SetCache("HEART_BEAT", 0)
end

function S2C:JOIN_MEETING_REQ(res)
	PrintRes("JOIN_MEETING_REQ", res)

	local eventSystem = require("Base/ZEventDispatchCenter.lua")
	eventSystem:DispatchEvent(eventSystem.EventType.JOIN_MEETING_REQ, res)
end

function S2C:JOIN_MEETING_RESP(res)
	PrintRes("JOIN_MEETING_RESP", res)

	if res.code ~= 0 then
		Warn("----> S2C:JOIN_MEETING_RESP, res.code" .. res.code)
		return
	end

	local eventSystem = require("Base/ZEventDispatchCenter.lua")
	eventSystem:DispatchEvent(eventSystem.EventType.JOIN_MEETING_RESP, res)
end

function S2C:MEETING_SCREEN_REQ(res)
	PrintRes("MEETING_SCREEN_REQ", res)
end

function S2C:MEETING_SCREEN_RESP(res)
	PrintRes("MEETING_SCREEN_RESP", res)
	if res.code ~= 0 then
		Warn("----> S2C:MEETING_SCREEN_RESP, res.code" .. res.code)
		return
	end

	local eventSystem = require("Base/ZEventDispatchCenter.lua")
	eventSystem:DispatchEvent(eventSystem.EventType.MEETING_SCREEN_RESP, res)
end

return S2C