-----------------------------logic消息分发------------------------

local MiddleHeartBeat = require("middle.MiddleHeartBeat")
local MiddleLogic = require("middle.MiddleLogic")
local MiddleConnect = require("middle.MiddleConnect")
local MiddleManager = require("middle.MiddleManager")
local ChatMiddleLogic = require("chat.ChatMiddleLogic")
local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
local JjcLadderMiddle = require("jjcLadder.JjcLadderMiddle")
local ValleyLogic = require("valley.ValleyLogic")
local ValleyMiddle = require("valley.ValleyMiddle")
local ValleyMiddle = require("valley.ValleyMiddle")
local WarReportMiddle = require("warReport.WarReportMiddle")
local AbsActBillboardLogic = require("absAct.AbsActBillboardLogic")
local AbsActBillboardMiddleLogic = require("absAct.AbsActBillboardMiddleLogic")
local YunYingLogic = require("yunying.YunYingLogic")
local MoZhuLogic = require("mozhu.MoZhuLogic")
local MoZhuMiddleLogic = require("mozhu.MoZhuMiddleLogic")
local ChatLogic = require("chat.ChatLogic")
local CombatVideo = require("combat.CombatVideo")
local HeroMiddleLogic = require("hero.HeroMiddleLogic")
local MiddleCommonLogic = require("middle.MiddleCommonLogic")
local CommerceMiddle = require("serverCommerce.ServerCommerceMiddle")
local MiddleCommonRank = require("middle.MiddleCommonRank")
local BanLogic = require("scene.BanLogic")
local ZhuanpanLogic = require("zhuanpan.ZhuanpanLogic")
local JjcNewLadderMidder = require("jjcnewladder.jjcNewLadderMiddle")
local RebateLogic = require("platform.RebateLogic")
local ServerCommerceActPeakBettleMiddle = require("serverCommerce.ServerCommerceActPeakBettleMiddle")
local GodsAreaNS = require("godsArea.GodsAreaNS")
local GodsAreaCS = require("godsArea.GodsAreaCS")
local BattleDataNS = require("battleDataManager.BattleDataNS")
local BattleDataCS = require("battleDataManager.BattleDataCS")
local AreaBattleCS = require("areaBattle.AreaBattleCS")
local AreaBattleNS = require("areaBattle.AreaBattleNS")
local AnotherWorldBattleNS = require("anotherWorldBattle.AnotherWorldBattleNS")
local AnotherWorldBattleCS = require("anotherWorldBattle.AnotherWorldBattleCS")
local BaiZhanChengShenNS = require("baiZhanChengShen.BaiZhanChengShenNS")
local BaiZhanChengShenCS = require("baiZhanChengShen.BaiZhanChengShenCS")
local ServerCommerceActBattleGroundNS = require("serverCommerce.ServerCommerceActBattleGroundNS")
local ServerCommerceActBattleGroundCS = require("serverCommerce.ServerCommerceActBattleGroundCS")



function LW_HELLO(fd, msg)
	if _G.is_middle ~= true then return end
    -- print("[LW_HELLO] 收到LW_HELLO 消息")
    MiddleConnect.LW_HELLO(fd, msg)
    BaiZhanChengShenCS.onLogicServerConnect(fd)
end

function LW_DISCONNECT(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_DISCONNECT] 收到 LW_DISCONNECT 消息")
    MiddleConnect.LW_DISCONNECT(fd, msg)
end

function LW_HEARTBEAT(fd, msg)
    if _G.is_middle ~= true then return end
    --print("[LW_HEARTBEAT] 收到 LW_HEARTBEAT 消息")

    MiddleHeartBeat.LW_HEARTBEAT(fd, msg)
end

function LW_MOZHU_QUERY(fd,msg)
    if _G.is_middle ~= true then return end
    --print("[LW_MOZHU_QUERY] 收到 LW_MOZHU_QUERY 消息")

    MoZhuMiddleLogic.LW_MOZHU_QUERY(fd,msg)
end

function WL_MOZHU_QUERY(fd,msg)
    if _G.is_middle ~= true then return end
    --print("[WL_MOZHU_QUERY] 收到 WL_MOZHU_QUERY 消息")
    
    MoZhuMiddleLogic.LW_MOZHU_QUERY(fd,msg)
end

function WL_HELLO(fd, msg)
    --if _G.is_middle ~= true then return end
   -- print("[WL_HELLO] 收到 WL_HELLO 消息 fd = "..fd)
    -- table.print_lua_table(msg)

    MiddleConnect.WL_HELLO(fd, msg)
end

function WL_HEARTBEAT(fd, msg)
    -- if _G.is_middle ~= true then return end
    --print("[WL_HEARTBEAT] 收到 WL_HEARTBEAT 消息")

    MiddleHeartBeat.WL_HEARTBEAT(fd, msg)
end


----------------------------------------通用协议---------------------------------------

--------------- 战斗录像--------------------------------------
-- 向跨服查询录像数据
function LW_COMBAT_VIDEO_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    CombatVideo.CS_Video_Query(msg)
end
-- 跨服回应查询
function WL_COMBAT_VIDEO_QUERY(fd, msg)
    CombatVideo.NS_Video_Query_Result(msg)
end

-- 把录像数据保存到跨服
function LW_COMBAT_VIDEO_SAVE(fd, msg)
    if _G.is_middle ~= true then return end
    CombatVideo.CS_Video_Save(msg)
end
--------------------------------------------------------------

-- 跨服通知普通服上传战斗数据
function WL_COMBAT_DATA(fd, msg)
    BattleDataNS.CreateBattleData(fd, msg)
end

function LW_COMBAT_DATA(fd, msg)
    if _G.is_middle ~= true then return end
    BattleDataCS.BattleDataHandleManager(fd, msg)
end

--------------------------------------------------------------------------------------








function LW_MIDDLE_CHAT(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_MIDDLE_CHAT] 收到跨服聊天请求 fd = "..fd)
    MiddleConnect.LW_MIDDLE_CHAT(fd, msg)
end

function WL_MIDDLE_CHAT(fd, msg)
    ChatLogic.WL_MIDDLE_CHAT(fd, msg)
end

-- 聊天查看分享英雄数据(请求的服务器->中心)
function LW_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_MIDDLE_CHAT_QUERY_HERO_DATA] 请求的服务器->中心 获取到消息")
    MiddleConnect.LW_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
end

-- 发送到对应服务器信息(中心->目标服务器)
function WL_MIDDLE_CHAT_QUERY_HERO_DATA(fd, msg)
    print("[WL_MIDDLE_CHAT_QUERY_HERO_DATA] 中心->目标服务器 获取到消息")
    HeroMiddleLogic.HeroMiddleLogic_QueryHeroData_WL(fd, msg)
end

-- 英雄信息回复(目标->中心)
function LW_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_MIDDLE_CHAT_GET_HERO_DATA] 目标->中心 获取到消息")

    MiddleConnect.LW_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
end

-- 英雄信息回复(中心->请求)
function WL_MIDDLE_CHAT_GET_HERO_DATA(fd, msg)
    print("[WL_MIDDLE_CHAT_GET_HERO_DATA] 中心->请求 获取到消息")

    HeroMiddleLogic.HeroMiddleLogic_GetHeroData_WL(fd, msg)
end

function LW_WARREPORT_GET_COMBATINFO(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_WARREPORT_GET_COMBATINFO] 目标->中心 获取到战报录像信息")

    MiddleConnect.LW_WARREPORT_GET_COMBATINFO(fd, msg)
end

function WL_WARREPORT_GET_COMBATINFO(fd, msg)
    print("[WL_WARREPORT_GET_COMBATINFO] 获取到中心消息 请求获取到战报录像信息")
    
    WarReportMiddle.WL_WARREPORT_GET_COMBATINFO_NEW(fd, msg)
end

function LW_WARREPORT_SEND_COMBATINFO(fd, msg)
    if _G.is_middle ~= true then return end

    print("[LW_WARREPORT_SEND_COMBATINFO] 回复中心服 获取到战报录像信息")
    MiddleConnect.LW_WARREPORT_SEND_COMBATINFO(fd, msg)
end

function WL_WARREPORT_SEND_COMBATINFO(fd, msg)
    print("[WL_WARREPORT_GET_COMBATINFO] 获取到其他服消息 获取到战报录像信息回包")

    WarReportMiddle.WL_WARREPORT_SEND_COMBATINFO(fd, msg)
end

-------------------- 跨服玩家头像数据开始 --------------------
function LW_CHAT_PLAYER_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_CHAT_PLAYER_INFO(fd, msg)
end

function WL_CHAT_PLAYER_INFO(fd, msg)
    MiddleCommonLogic.MiddleCommonLogic_GetChatPlayInfo_WL(fd, msg)
end

function LW_CHAT_PLAYER_INFO_SEND(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_CHAT_PLAYER_INFO_SEND(fd, msg)
end

function WL_CHAT_PLAYER_INFO_SEND(fd, msg)
    MiddleCommonLogic.MiddleCommonLogic_SendChatPlayInfo_WL(fd, msg)
end
-------------------- 跨服玩家头像数据结束 --------------------

-------------------- 跨服请求战斗数据开始 --------------------
function LW_COMBAT_GETINFO(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_COMBAT_GETINFO(fd, msg)
end

function WL_COMBAT_GETINFO(fd, msg)
    MiddleCommonLogic.MiddleCommonLogic_CombatBegin_WL(fd, msg)
end

function LW_COMBAT_GETINFO_SEND(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_COMBAT_GETINFO_SEND(fd, msg)
end

function WL_COMBAT_GETINFO_SEND(fd, msg)
    MiddleCommonLogic.MiddleCommonLogic_CombatBegin_SendWL(fd, msg)
end

-------------------- 跨服请求战斗数据结束 --------------------

-------------------- 跨服商业活动开始 ---------------------------
-- 回复开服天数
function LW_COMMERCE_SENDOPENDAY(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_SENDOPENDAY] 回复开服天数")
    CommerceMiddle.CommerceMiddle_SendOpenDay(fd, msg)
end

-- 请求开服天数
function WL_COMMERCE_QUERYOPENDAY(fd, msg)
    print("[WL_COMMERCE_QUERYOPENDAY] 请求开服天数")
    CommerceMiddle.CommerceMiddle_QueryOpenDay(fd, msg)
end

-- 请求是否开启活动
function LW_COMMERCE_ACTOPEN(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_ACTOPEN] 请求是否开启活动")
    CommerceMiddle.CommerceMiddle_QueryOpenAct(fd, msg)
end

function WL_COMMERCE_ACTOPEN(fd, msg)
    print("[WL_COMMERCE_ACTOPEN] 回复是否开启活动")
    CommerceMiddle.CommerceMiddle_SendOpenAct(fd, msg)
end

-- 更新排行榜数据
function LW_COMMERCE_RANK_POINT_CHANGE(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_RANK_POINT_CHANGE] 更新排行榜数据")
    MiddleCommonRank.MiddleCommonRank_ReceiveRankData(msg)
end

-- 请求排行榜数据
function LW_COMMERCE_QUERY_RANK_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_QUERY_RANK_INFO] 请求排行榜数据")
    MiddleCommonRank.MiddleCommonRank_QueryRankInfo(msg)
end

-- 请求排行榜数据回包
function WL_COMMERCE_QUERY_RANK_INFO(fd, msg)
    print("[WL_COMMERCE_QUERY_RANK_INFO] 请求排行榜数据回包")
    CommerceMiddle.CommerveMiddle_GetRankInfo(msg)
end

-- 请求服务器排名
function LW_COMMERCE_QUERY_SERVER_RANK(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_QUERY_SERVER_RANK] 请求服务器排名")
    MiddleCommonRank.MiddleCommonRank_QueryServerRank(msg)
end

-- 获取服务器排行榜服务器排名 回包
function WL_COMMERCE_GET_SERVERRANK_PRIZE(fd, msg)
    print("[WL_COMMERCE_GET_SERVERRANK_PRIZE] 获取服务器排行榜服务器排名 回包")
    CommerceMiddle.CommerceMiddle_GetServerRank(msg)
end

-- 通知中心服全服邮件发送完成
function LW_COMMERCE_TELL_SERVER_MAILOK(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_TELL_SERVER_MAILOK] 通知中心服全服邮件发送完成")
    MiddleCommonRank.MiddleCommonRank_ServerMailOk(msg)
end

-- 发送给对应的服务器 个人排行榜奖励
function WL_COMMERCE_SEND_HUMAN_PRIZE(fd, msg)
    print("[WL_COMMERCE_SEND_HUMAN_PRIZE] 发送给对应的服务器 个人排行榜奖励")
    CommerceMiddle.CommerceMiddle_GetHumanRank(msg)
end

-- 清理排行榜命令
function LW_COMMERCE_CLEAR_RANK(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_CLEAR_RANK] 清理排行榜命令")
    MiddleCommonRank.MiddleCommonRank_ClearRank(msg)
end

function LW_COMMERCE_GM_CLEAR_MAIL(fd, msg)
    if _G.is_middle ~= true then return end
    print("[LW_COMMERCE_GM_CLEAR_MAIL] GM清理排行榜邮件个人发送命令")
    MiddleCommonRank.MiddleCommonRank_GMClearMail(msg)
    CommerceMiddle.CommerceMiddle_GMClearDB(msg.nSrcServerID)
end

-- 中心服请求活动数据
function WL_COMMERCE_GET_ACT_INFO(fd, msg)
    print("[WL_COMMERCE_GET_ACT_INFO] 收到中心服请求活动开放时间数据")
    CommerceMiddle.CommerceMiddle_GetActInfo_WL(msg)
end

-- 普通服发送活动时间数据
function LW_COMMERCE_GET_ACT_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    CommerceMiddle.CommerceMiddle_GetActInfo_LW(msg)
end

-- 普通服请求活动时间
function LW_COMMERCE_ACT_GET_OPENTIME(fd, msg)
    if _G.is_middle ~= true then return end
    CommerceMiddle.CommerceMiddle_GetActOpenTime_LW(msg)
end

function WL_COMMERCE_ACT_GET_OPENTIME(fd, msg)
    CommerceMiddle.CommerceMiddle_GetActOpenTime_WL(msg)
end
-------------------- 跨服商业活动结束 ---------------------------

----------------------- 封禁功能开始 ---------------------------

-- 向跨服查询
function LW_QUERY_BAN_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    BanLogic.CS_Get_BanData(msg)
end

-- 跨服回应查询
function WL_QUERY_BAN_INFO(fd, msg)
    BanLogic.NS_Init_BanData(msg.banList)
end

-- 通知跨服更新
function LW_UPDATE_BAN_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    BanLogic.CS_Update_BanData(msg.banStr)
end

-- 跨服广播更新的封禁数据
function WL_UPDATE_BAN_INFO(fd, msg)
    BanLogic.NS_Update_BanData(msg.banStr)
end

----------------------- 封禁功能结束 ---------------------------
-------------------- 天梯赛开始 ---------------------------
-- 请求参加天梯赛(普通->中心)
function LW_JJC_NEWLADDER_JOINLADDER_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_JOINLADDER_O2C(fd, msg)
end

-- 请求参加天梯赛(中心->战区数据服)
function WL_JJC_NEWLADDER_JOINLADDER_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_JOINLADDER_C2D(fd, msg)
end

-- 请求参加天梯赛(数据->中心)
function LW_JJC_NEWLADDER_JOINLADDER_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_JOINLADDER_D2C(fd, msg)
end

-- 请求参加天梯赛(中心->普通)
function WL_JJC_NEWLADDER_JOINLADDER_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_JOINLADDER_C2O(fd, msg)
end

-- 请求天梯赛排行榜数据(普通->中心)
function LW_JJC_NEWLADDER_QUERY_RANK_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_QUERY_RANK_O2C(msg)
end

-- 请求天梯赛排行榜数据(中心->战区数据服)
function WL_JJC_NEWLADDER_QUERY_RANK_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_QUERY_RANK_C2D(msg)
end

-- 请求天梯赛排行榜数据(数据服->中心)
function LW_JJC_NEWLADDER_QUERY_RANK_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_QUERY_RANK_D2C(msg)
end

-- 请求天梯赛排行榜数据(中心->普通)
function WL_JJC_NEWLADDER_QUERY_RANK_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_QUERY_RANK_C2O(msg)
end

-- 查询是否能够战斗(普通->中心)
function LW_JJC_NEWLADDER_QUERY_CAN_FIGHT_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_QUERY_CAN_FIGHT_O2C(msg)
end

-- 查询是否能够战斗(中心->战区数据服)
function WL_JJC_NEWLADDER_QUERY_CAN_FIGHT_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_QUERY_CAN_FIGHT_C2D(msg)
end

-- 查询是否能够战斗(数据服->中心)
function LW_JJC_NEWLADDER_QUERY_CAN_FIGHT_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_QUERY_CAN_FIGHT_D2C(msg)
end

-- 查询是否能够战斗(中心->普通)
function WL_JJC_NEWLADDER_QUERY_CAN_FIGHT_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_QUERY_CAN_FIGHT_C2O(msg)
end

-- 战斗结束(普通->中心)
function LW_JJC_NEWLADDER_CANCEL_FIGHT_END_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_CANCEL_FIGHT_END_O2C(msg)
end

-- 战斗结束(中心->战区数据服)
function WL_JJC_NEWLADDER_CANCEL_FIGHT_END_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_CANCEL_FIGHT_END_C2D(msg)
end

-- 战斗结束(数据服->中心)
function LW_JJC_NEWLADDER_CANCEL_FIGHT_END_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_CANCEL_FIGHT_END_D2C(msg)
end

-- 战斗结束(中心 -> 普通)
function WL_JJC_NEWLADDER_CANCEL_FIGHT_END_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_CANCEL_FIGHT_END_C2O(msg)
end

-- 发送战败邮件(数据->中心)
function LW_JJC_NEWLADDER_SEND_MAIL_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_SEND_MAIL_D2C(msg)
end

-- 发送战败邮件(中心->目标)
function WL_JJC_NEWLADDER_SEND_MAIL_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_SEND_MAIL_C2O(msg)
end

-- 请求刷新对战列表(普通->中心)
function LW_JJC_NEWLADDER_REFRESH_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_REFRESH_O2C(msg)
end

-- 请求刷新对战列表(中心->数据)
function WL_JJC_NEWLADDER_REFRESH_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_REFRESH_C2D(fd, msg)
end

-- 请求刷新对战列表(数据->中心)
function LW_JJC_NEWLADDER_REFRESH_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_REFRESH_D2C(msg)
end

-- 请求刷新对战列表(中心-普通)
function WL_JJC_NEWLADDER_REFRESH_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_REFRESH_C2O(fd, msg)
end

-- 请求上一轮排名前三数据(普通->中心)
function LW_JJC_NEWLADDER_LAST3RANK_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_LAST3RANK_O2C(msg)
end

-- 请求上一轮排名数据(中心->数据)
function WL_JJC_NEWLADDER_LAST3RANK_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_LAST3RANK_C2D(msg)
end

-- 请求上一轮排名数据(数据->中心)
function LW_JJC_NEWLADDER_LAST3RANK_D2O(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_LAST3RANK_D2O(msg)
end

-- 请求上一轮前3玩家信息(中心-普通)
function WL_JJC_NEWLADDER_LAST3RANK_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_LAST3RANK_C2O(msg)
end

-- 进行点赞(普通->中心)
function LW_JJC_NEWLADDER_SEND_WORSHIP_O2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_SEND_WORSHIP_O2C(msg)
end

-- 进行点赞(中心->数据(被点赞玩家所在服))
function WL_JJC_NEWLADDER_SEND_WORSHIP_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_SEND_WORSHIP_C2D(msg)
end

-- 进行点赞(数据(被点赞玩家所在服)->中心)
function LW_JJC_NEWLADDER_SEND_WORSHIP_D2C(fd, msg)
    if _G.is_middle ~= true then return end
    MiddleConnect.LW_JJC_NEWLADDER_SEND_WORSHIP_D2C(msg)
end

-- 进行点赞回复(中心->普通)
function WL_JJC_NEWLADDER_SEND_WORSHIP_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_SEND_WORSHIP_C2O(msg)
end

-- 告诉战区服点赞数改变(中心->战区数据服)
-- 改变战区数据服记录的点赞数量
function WL_JJC_NEWLADDER_WORSHIP_CHANGE_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_WORSHIP_CHANGE_C2D(msg)
end

-- 通知中心服最新的点赞数
function LW_JJC_NEWLADDER_WORSHIP_CHANGE_D2C(fd, msg)
    if _G.is_middle ~= true then return end

    MiddleConnect.LW_JJC_NEWLADDER_WORSHIP_CHANGE_D2C(msg)
end

-- 通知对应战区所属服务器更新最新的点赞数
function WL_JJC_NEWLADDER_WORSHIP_UPDATE_D2C(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_WORSHIP_UPDATE_D2C(msg)
end

-- 发送排名奖励(数据->中心)
function LW_JJC_NEWLADDER_SEND_RANK_PRIZE_D2C(fd, msg)
    if _G.is_middle ~= true then return end

    MiddleConnect.LW_JJC_NEWLADDER_SEND_RANK_PRIZE_D2C(msg)
end

-- 发送排名奖励(中心->普通)
function WL_JJC_NEWLADDER_SEND_RANK_PRIZE_C2O(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_SEND_RANK_PRIZE_C2O(msg)
end

function LW_JJC_NEWLADDER_QUERY_WORSHIP_D2C(fd, msg)
    if _G.is_middle ~= true then return end

    MiddleConnect.LW_JJC_NEWLADDER_QUERY_WORSHIP_D2C(msg)
end

function WL_JJC_NEWLADDER_QUERY_WORSHIP_C20(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_QUERY_WORSHIP_C20(msg)
end

function LW_JJC_NEWLADDER_QUERY_WORSHIP_O2C(fd, msg)
    if _G.is_middle ~= true then return end

    MiddleConnect.LW_JJC_NEWLADDER_QUERY_WORSHIP_O2C(msg)
end

function WL_JJC_NEWLADDER_QUERY_WORSHIP_C2D(fd, msg)
    JjcNewLadderMidder.WL_JJC_NEWLADDER_QUERY_WORSHIP_C2D(msg)
end

-------------------- 天梯赛结束 ---------------------------

-------------------- 巅峰战场跨服协议开始 ---------------------------
-- 普通服请求跨服排名数据(普通->中心)
-- function LW_PEAK_BATTLEFIELD_QUERY_RANK_O2C(fd, msg)
--     if _G.is_middle ~= true then return end
--     ServerCommerceActPeakBettleMiddle.LW_PEAK_BATTLEFIELD_QUERY_RANK_O2C(fd, msg)
-- end

-- -- 请求跨服排名数据(中心->数据服)
-- function WL_PEAK_BATTLEFIELD_QUERY_RANK_C2D(fd, msg)
--     ServerCommerceActPeakBettleMiddle.WL_PEAK_BATTLEFIELD_QUERY_RANK_C2D(fd, msg)
-- end

-- -- 请求跨服排名数据(数据服->中心)
-- function LW_PEAK_BATTLEFIELD_QUERY_RANK_D2C(fd, msg)
--     if _G.is_middle ~= true then return end
--     ServerCommerceActPeakBettleMiddle.LW_PEAK_BATTLEFIELD_QUERY_RANK_D2C(fd, msg)
-- end

-- -- 获取到跨服排名数据(中心->普通)
-- function WL_PEAK_BATTLEFIELD_QUERY_RANK_C2O(fd, msg)
--     ServerCommerceActPeakBettleMiddle.WL_PEAK_BATTLEFIELD_QUERY_RANK_C2O(fd, msg)
-- end

-- -- 普通服通知排名变化(普通->中心)
-- function LW_PEAK_BATTLEFIELD_RANK_CHANGE_O2C(fd, msg)
--     if _G.is_middle ~= true then return end
--     ServerCommerceActPeakBettleMiddle.LW_PEAK_BATTLEFIELD_RANK_CHANGE_O2C(fd, msg)
-- end

-- -- 排名变化通知(中心->数据服)
-- function WL_PEAK_BATTLEFIELD_RANK_CHANGE_C2D(fd, msg)
--     ServerCommerceActPeakBettleMiddle.WL_PEAK_BATTLEFIELD_RANK_CHANGE_C2D(fd, msg)
-- end

-- -- 发送排名奖励(数据服->中心)
-- function LW_PEAK_BATTLEFIELD_SEND_RANK_REWARD_D2C(fd, msg)
--     if _G.is_middle ~= true then return end
--     ServerCommerceActPeakBettleMiddle.LW_PEAK_BATTLEFIELD_SEND_RANK_REWARD_D2C(fd, msg)
-- end

-- -- 发送排名奖励(中心->普通)
-- function WL_PEAK_BATTLEFIELD_SEND_RANK_REWARD_C2O(fd, msg)
--     ServerCommerceActPeakBettleMiddle.WL_PEAK_BATTLEFIELD_SEND_RANK_REWARD_C2O(fd, msg)
-- end

function LW_BATTLEGROUND_PLAYER_RANK_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_PlayerRank_Req(msg)
end
function WL_BATTLEGROUND_PLAYER_RANK_QUERY(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_PlayerRank_Res(msg)
end

function LW_BATTLEGROUND_MATCHLIST_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_MatchList_Req(msg)
end
function WL_BATTLEGROUND_MATCHLIST_QUERY(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_MatchList_Res(msg)
end


function LW_BATTLEGROUND_PLAYER_DATA_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_PlayerData_Req(msg)
end
function WL_BATTLEGROUND_PLAYER_DATA_QUERY(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_PlayerData_Res(msg)
end


function LW_BATTLEGROUND_RANKLIST_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_RankList_Req(msg)
end
function WL_BATTLEGROUND_RANKLIST_QUERY(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_RankList_Res(msg)
end


function LW_BATTLEGROUND_CHALLENGE_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_Challenge_Req(msg)
end
function WL_BATTLEGROUND_CHALLENGE_QUERY(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_Challenge_Res(msg)
end


function LW_BATTLEGROUND_CHALLENGE_END(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_Challenge_End(msg)
end

function WL_BATTLEGROUND_NOTIFY_PLAYER(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_RankUpdate(msg)
end

function LW_BATTLEGROUND_LINEUP_UPDATE(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_Lineup_Update(msg)
end

function LW_BATTLEGROUND_ACT_END(fd, msg)
    if _G.is_middle ~= true then return end
    ServerCommerceActBattleGroundCS.BG_N2C_Act_End(msg)
end

function WL_BATTLEGROUND_NOTIFY_PRIZEAWARD(fd, msg)
    ServerCommerceActBattleGroundNS.BG_C2N_PrizeAward(msg)
end


-------------------- 巅峰战场跨服协议结束 ---------------------------

-------------------- 返利开始 ---------------------------
-- 向跨服查询该角色能否返利
function LW_REBATE_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    RebateLogic.CS_RebateQuery(msg)
end


function WL_REBATE_OK(fd, msg)
    RebateLogic.NS_Rebate_OK(msg.channelId, msg.serverId, msg.account)
end

---------------------返利结束 ---------------------------


------------------------诸神圣域 ---------------------------

-- 向跨服请求排行榜数据
function LW_GODSATREA_QUERY_RANKLIST(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_RankList_Query(msg.sourceServerId, msg.playerUid)
end
function WL_GODSATREA_QUERY_RANKLIST(fd, msg)
    GodsAreaNS.NS_Send_RankList(msg.playerUid, msg.myRank, msg.rankList)
end


-- 向跨服请求某个排名的玩家数据
function LW_GODSATREA_QUERY_PLAYER_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_GetPlayerInfo(msg.sourceServerId, msg.targetRank, msg.targetUid, msg.playerUid)
end
function WL_GODSATREA_QUERY_PLAYER_INFO(fd, msg)
    GodsAreaNS.NS_Send_PlayerInfo(msg.playerUid, msg.res, msg.playerInfo)
end


-- 向跨服查询是否能挑战某个排名
function LW_GODSATREA_CHALLENGE_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_Challenge_Query(msg.sourceServerId, msg.defenseRank, msg.defenseUid, msg.attackerUid)
end
function WL_GODSATREA_CHALLENGE_QUERY(fd, msg)
    GodsAreaNS.Query_Challenge_Result(msg.attackerUid, msg.res, msg.defenseServerId, msg.defenseRank, msg.defenseUid, msg.defenseName)
end


-- 告诉跨服挑战胜利
function LW_GODSATREA_WIN(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_Challenge_Win(msg.sourceServerId, msg.defenseRank, msg.defenseUid, msg.attackerUid, msg.attackInfo)
end
-- 跨服通知普通服更换称号
function WL_GODSATREA_UPDATE_CHENGHAO(fd, msg)
    GodsAreaNS.NS_Change_Chenghao(msg.targetUid, msg.newRank, msg.isWinner, msg.enemyName)
end


-- 向跨服请求录像数据
function LW_GODSATREA_QUERY_RANK_VIDEO(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_Query_CombatVideo(msg.sourceServerId, msg.playerUid, msg.targetRank)
end
function WL_GODSATREA_QUERY_RANK_VIDEO(fd, msg)
    GodsAreaNS.NS_Query_CombatVideo(msg.isFinish, msg.playerUid, msg.videoData)
end


-- 通知跨服，玩家更新数据了
function LW_GODSATREA_UPDATE_PLAYER_BASE_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_Update_PlayerInfo(msg.playerUid, msg.playerInfo)
end

-- 通知跨服，玩家上阵英雄数据了
function LW_GODSATREA_UPDATE_PLAYER_HERO_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    GodsAreaCS.CS_Update_HeroInfo(msg.playerUid, msg.heroInfo)
end

-- 跨服通知普通服, 给玩家发奖
function WL_GODSATREA_BROCAST_REWARD(fd, msg)
    GodsAreaNS.NS_SendReward(msg.uid2RankTb)
end


-- 跨服让玩家更新基础数据
function WL_GODSATREA_UPDATE_PLAYER_INFO(fd, msg)
    GodsAreaNS.NS_UpdatePlayerBaseInfo(msg.playerUid)
end

----------------------------------------------------------

-------------------------战区争霸-------------------------

-- 跨服通知普通服, 争霸活动开始了
function WL_AREABATTLE_OPEN(fd, msg)
    AreaBattleNS.C2N_BattleStart()
end
-- 普通服报名参加争霸活动
function LW_AREABATTLE_JOIN_BATTLE(fd, msg)
    if _G.is_middle ~= true then return end
    AreaBattleCS.N2C_JoinBattle(msg)
end


-- 请求争霸活动基本信息
function LW_AREABATTLE_BASEINFO_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AreaBattleCS.N2C_GetBaseInfo(msg)
end
function WL_AREABATTLE_BASEINFO_QUERY(fd, msg)
    AreaBattleNS.C2N_BaseInfo(msg)
end


-- 请求本服参战玩家列表
function LW_AREABATTLE_JOINPLAYER_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AreaBattleCS.N2C_GetJoinPlayerArr(msg)
end
function WL_AREABATTLE_JOINPLAYER_QUERY(fd, msg)
    AreaBattleNS.C2N_JoinPlayerArr(msg)
end


-- 请求本轮活动区服匹配列表
function LW_AREABATTLE_MATCHLIST_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AreaBattleCS.N2C_GetMatchList(msg)
end
function WL_AREABATTLE_MATCHLIST_QUERY(fd, msg)
    AreaBattleNS.C2N_MatchList(msg)
end



-- 请求本服战斗录像的展示数据
function LW_AREABATTLE_VIDEOSHOW_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AreaBattleCS.N2C_GetVideoShowData(msg)
end
function WL_AREABATTLE_VIDEOSHOW_QUERY(fd, msg)
    AreaBattleNS.C2N_VideoShowData(msg)
end


-- 跨服通知普通服发奖
function WL_AREABATTLE_SEND_REWARD(fd, msg)
    AreaBattleNS.C2N_SendReward(msg)
end


-------------------------异界之战-------------------------

function WL_ANOTHERWORLDBATTLE_TIPS(fd, msg)
    AnotherWorldBattleNS.C2N_ErrTips(msg)
end


function LW_ANOTHERWORLDBATTLE_GET_STATE(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetState_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_GET_STATE(fd, msg)
    AnotherWorldBattleNS.C2N_State_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_JOIN(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_Join_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_JOIN(fd, msg)
    AnotherWorldBattleNS.C2N_Join_Response(msg)
end



function LW_ANOTHERWORLDBATTLE_ALLCITY_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetAllCity_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_ALLCITY_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_AllCity_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_CITYDETAILED_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetCityDetailed_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_CITYDETAILED_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_CityDetailed_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_POINTtDETAILED_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetPointDetailed_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_POINTDETAILED_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_PointDetailed_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_BASECITY_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetBaseCity_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_BASECITY_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_BaseCity_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_PLAYEROCCUPYPOINT_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetPlayerOccupyPoint_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_PLAYEROCCUPYPOINT_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_PlayerOccupyPoint_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_UNIONRANK_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetUnionRank_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_UNIONRANK_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_UnionRank_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_PLAYERRANK_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetPlayerRank_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_PLAYERRANK_QUERY(fd, msg)
    AnotherWorldBattleNS.C2N_PlayerRank_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_GATHER(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_Gather_Req(msg)
end

function WL_ANOTHERWORLDBATTLE_GATHER(fd, msg)
    AnotherWorldBattleNS.C2N_Gather_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_POINT_ISCAN_CHALLENGE(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_TryChallengdePoint_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_POINT_ISCAN_CHALLENGE(fd, msg)
    AnotherWorldBattleNS.C2N_TryChallengePoint_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_POINT_CHALLENGE_END(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_PointChallengeEnd_Handle(msg)
end


function WL_ANOTHERWORLDBATTLE_POINT_LOSE(fd, msg)
    AnotherWorldBattleNS.C2N_PointLose_Response(msg)
end


function WL_ANOTHERWORLDBATTLE_ISSUEREWARD(fd, msg)
    AnotherWorldBattleNS.C2N_IssueReward(msg)
end


function LW_ANOTHERWORLDBATTLE_UPDATE_PLAYER(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_UpdatePlayerData_Req(msg)
end


function LW_ANOTHERWORLDBATTLE_UPDATE_UNION(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_UpdateUnionData_Req(msg)
end


function LW_ANOTHERWORLDBATTLE_UPDATE_POINT_LINEIP(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_UpdatePointLineup_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_UPDATE_POINT_LINEIP(fd, msg)
    AnotherWorldBattleNS.C2N_UpdatePointLineup_Response(msg)
end


function WL_ANOTHERWORLDBATTLE_ACT_START(fd, msg)
    AnotherWorldBattleNS.C2N_Act_Start(msg)
end


function LW_ANOTHERWORLDBATTLE_UPDATE_HERO(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_UpdateHeroData_Req(msg)
end


function LW_ANOTHERWORLDBATTLE_LEAVE_POINT(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_LeavePoint_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_LEAVE_POINT(fd, msg)
    AnotherWorldBattleNS.C2N_LeavePoint_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_GET_MYUIONMORALE(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_GetMyUnionMoraleInfo_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_GET_MYUIONMORALE(fd, msg)
    AnotherWorldBattleNS.C2N_MyUnionMoraleInfo_Response(msg)
end


function LW_ANOTHERWORLDBATTLE_UIONMORALE_DO(fd, msg)
    if _G.is_middle ~= true then return end
    AnotherWorldBattleCS.N2C_UnionMorale_Do_Req(msg)
end
function WL_ANOTHERWORLDBATTLE_UIONMORALE_DO(fd, msg)
    AnotherWorldBattleNS.C2N_MyUnionMoraleInfo_Response(msg)
end


----------------------- 百战成神 ---------------------------

function LW_BZCS_MATCH(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_Match(msg)
end
function WL_BZCS_MATCH(fd, msg)
    BaiZhanChengShenNS.C2N_Match(msg)
end

function LW_BZCS_RANK_LIST(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_RankList(msg)
end
function WL_BZCS_RANK_LIST(fd, msg)
    BaiZhanChengShenNS.C2N_RankList(msg)
end

function LW_BZCS_OPPONENT_INFO(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_OpponentInfo(msg)
end
function WL_BZCS_OPPONENT_INFO(fd, msg)
    BaiZhanChengShenNS.C2N_OpponentInfo(msg)
end

function LW_BZCS_OPPONENT_LINEUP(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_OpponentLineup(msg)
end
function WL_BZCS_OPPONENT_LINEUP(fd, msg)
    BaiZhanChengShenNS.C2N_OpponentLineup(msg)
end

function LW_BZCS_CAN_FIGHT(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_CanFight(msg)
end
function WL_BZCS_CAN_FIGHT(fd, msg)
    BaiZhanChengShenNS.C2N_CanFight(msg)
end

function LW_BZCS_REGISTER(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_Register(msg)
end

function LW_BZCS_UPDATE_SHOW(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_UpdateShow(msg)
end

function LW_BZCS_FIGHT_END(fd, msg)
    if _G.is_middle ~= true then return end
    BaiZhanChengShenCS.N2C_FightEnd(msg)
end
function WL_BZCS_FIGHT_END(fd, msg)
    BaiZhanChengShenNS.C2N_FightEnd(msg)
end

function WL_BZCS_DEF_NOTIFY(fd, msg)
    BaiZhanChengShenNS.C2N_DefNotify(msg)
end

function WL_BZCS_ISSUE_REWARD(fd, msg)
    BaiZhanChengShenNS.C2N_IssueReward(msg)
end

function WL_BZCS_ACT_START(fd, msg)
    BaiZhanChengShenNS.C2N_Act_Start(msg)
end
function WL_BZCS_ACT_END(fd, msg)
    BaiZhanChengShenNS.C2N_Act_End(msg)
end

function WL_BZCS_TIPS(fd, msg)
    BaiZhanChengShenNS.C2N_ErrTips(msg)
end

----------------------- 桌面添加开始 ---------------------------

-- 普通服→中心服：上报添加桌面，中心服写入并返回最新状态
function LW_DESKTOP_SET(fd, msg)
    if _G.is_middle ~= true then return end
    ZhuanpanLogic.CS_DesktopSet(msg)
end

-- 普通服→中心服：查询桌面状态
function LW_DESKTOP_QUERY(fd, msg)
    if _G.is_middle ~= true then return end
    ZhuanpanLogic.CS_DesktopQuery(msg)
end

-- 中心服→普通服：查询结果回包，普通服转发给客户端
function WL_DESKTOP_QUERY(fd, msg)
    ZhuanpanLogic.NS_DesktopQueryResult(msg)
end

----------------------- 桌面添加结束 ---------------------------
