| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572 |
- local Util = require("common.Util")
- local WarZoneConf = require("excel.WarZone")
- local MiddleConnect = require("middle.MiddleConnect")
- local MiddleManager = require("middle.MiddleManager")
- local InnerMsg = require("core.InnerMsg")
- local Config = require("Config")
- local CommonDB = require("common.CommonDB")
- local Timer = require("core.Timer")
- local CommonDefine = require("common.CommonDefine")
- local ServerCommerceManger = require("serverCommerce.ServerCommerceManager")
- local ServerCommerceActDefine = require("serverCommerce.ServerCommerceActDefine")
- local ServerCommerceRank = require("serverCommerce.ServerCommerceActRank")
- local Log = require("common.Log")
- -- 缓存开服天数
- local tServerOpenDay = nil
- local SERVERCOMMERCEOPENDAY = 8 -- 活动开启要求天数
- -- 缓存已经回复的开服天数的服务器
- local tServerOKDay = nil
- local function CommerceMiddle_WriteLog(szLogText)
- Log.write(Log.LOGID_OSS_COMMON_ACT, szLogText)
- end
- -- 检查是否进入下一轮
- local function CommerceMiddle_CheckGoNextBatch(nServerKey)
- if _G.is_middle ~= true then
- return false
- end
- local tDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if not tDBData then
- return true
- end
- -- 已经是第三轮了
- if tDBData.nBatchID >= 3 then
- return false
- end
- local nNowTime = os.time()
- if nNowTime < tDBData.nEndTime then
- return false
- end
- local nDiffDay = Util.diffDay(tDBData.nEndTime)
- if nDiffDay > ServerCommerceActDefine.COMMERCEACT_NEXTDAY then
- print("[CommerceMiddle_CheckGoNextBatch] 间隔天数已经满足条件 nDiffDay = "..nDiffDay)
- return true
- end
-
- return false
- end
- local function CommerceMiddle_CreateActTime()
- local nNowTime = os.time()
- local nEndTime = nNowTime + (ServerCommerceActDefine.COMMERCEACT_LASTDAY - 1)* 86400
- local tEndDate = os.date("*t",nEndTime)
- tEndDate.hour = ServerCommerceActDefine.COMMERCEACT_ENDTIME
- tEndDate.min = 0
- tEndDate.sec = 0
- nEndTime = os.time(tEndDate)
- return nNowTime, nEndTime
- end
- -- 更新下一轮DB数据
- local function CommerceMiddle_CreateNextBatchDB(nServerKey)
- local tOldDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if not tOldDBData then
- CommerceMiddle_WriteLog("[CommerceMiddle_CreateNextBatchDB] 更新下一轮中心服活动时间数据, 但是不存在久的数据 nServerKey = "..nServerKey)
- end
- local nBeginTime, nEndTime = CommerceMiddle_CreateActTime()
- local nBatchID = 1
- if tOldDBData and tOldDBData.nBatchID then
- nBatchID = tOldDBData.nBatchID + 1
- end
- local tDBData =
- {
- nBatchID = nBatchID,
- nBeginTime = nBeginTime,
- nEndTime = nEndTime
- }
- local szText = "[CommerceMiddle_CreateNewDB] 更新下一轮的DB数据 nServerKey = "..nServerKey.." nBatchID = "..tDBData.nBatchID
- .." nBeginTime = "..tDBData.nBeginTime.." nEndTime = "..tDBData.nEndTime
- CommerceMiddle_WriteLog(szText)
- CommonDB.SetCommerceMiddleAct_ByKey(nServerKey, tDBData)
- end
- -- 创建新的DB数据
- local function CommerceMiddle_CreateNewDB(nServerKey)
- local tOldData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if tOldData then
- local bRet = CommerceMiddle_CheckGoNextBatch(nServerKey)
- if false == bRet then
- return
- else
- CommerceMiddle_WriteLog("[CommerceMiddle_CreateNewDB] 该服务器满足生成下一轮条件, 生成中心服时间数据 nServerKey = "..nServerKey)
- CommerceMiddle_CreateNextBatchDB(nServerKey)
- return
- end
- end
- local nBeginTime, nEndTime = CommerceMiddle_CreateActTime()
- local tDBData =
- {
- nBatchID = 1,
- nBeginTime = nBeginTime,
- nEndTime = nEndTime
- }
- local szText = "[CommerceMiddle_CreateNewDB] 生成新的DB数据 nServerKey = "..nServerKey.." nBatchID = "..tDBData.nBatchID
- .." nBeginTime = "..tDBData.nBeginTime.." nEndTime = "..tDBData.nEndTime
- CommerceMiddle_WriteLog(szText)
- CommonDB.SetCommerceMiddleAct_ByKey(nServerKey, tDBData)
- end
- local function CommerceMiddle_Refresh(nServerKey)
- if _G.is_middle ~= true or not tServerOpenDay then
- return
- end
- local nOpenDay = tServerOpenDay[nServerKey]
- if nOpenDay < 8 then
- print("[CommerceMiddle_Refresh] 当前开服时间不足直接返回")
- return
- elseif nOpenDay == 8 then
- CommerceMiddle_WriteLog("[CommerceMiddle_Refresh] 该服务器时间到达8天, 生成中心服时间数据 nServerKey = "..nServerKey)
- CommerceMiddle_CreateNewDB(nServerKey)
- else
- if true == CommerceMiddle_CheckGoNextBatch(nServerKey) then
- CommerceMiddle_WriteLog("[CommerceMiddle_Refresh] 该服务器满足生成下一轮条件, 生成中心服时间数据 nServerKey = "..nServerKey)
- CommerceMiddle_CreateNextBatchDB(nServerKey)
- else
- print("[CommerceMiddle_Refresh] 当前不满足条件不生成下一轮")
- end
- end
- end
- -- 发送活动开始时间
- local function CommerceMiddle_SendOpenTime(nServerID)
- local fd = MiddleManager.getFDBySvrIndex(nServerID)
- if not fd then
- print("[CommerceMiddle_SendOpenTime] 获取不到对应的fd nServerID = "..nServerID)
- return
- end
- local nServerConfID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(nServerID)
- local nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nServerConfID)
- local tDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if not tDBData then
- CommerceMiddle_WriteLog("[CommerceMiddle_SendOpenTime] 不存在对应的中心服DB数据 nServerKey = "..nServerKey)
- return
- end
-
- local tMsgData = InnerMsg.wl.WL_COMMERCE_ACT_GET_OPENTIME
- tMsgData.nBatchID = tDBData.nBatchID
- tMsgData.nBeginTime = tDBData.nBeginTime
- tMsgData.nEndTime = tDBData.nEndTime
- InnerMsg.sendMsg(fd, tMsgData)
- end
- -- 起服获取信息
- function CommerceMiddle_InitServer()
- if _G.is_middle ~= true then
- return
- end
- Timer.addLater(ServerCommerceActDefine.COMMERCEACT_INITOPENDAY, CommerceMiddle_GetOpen)
- print("[CommerceMiddle_InitServer] 起服定时去获取数据 nTime = "..ServerCommerceActDefine.COMMERCEACT_INITOPENDAY)
- end
- -- 定时获取普通服开服信息
- function CommerceMiddle_OnZero()
- if _G.is_middle ~= true then
- return
- end
- Timer.addLater(15, CommerceMiddle_GetOpen)
- print("[CommerceMiddle_OnZero] 整点定时去获取数据")
- end
- -- 获取(中心服主动去获取)
- function CommerceMiddle_GetOpen()
- if _G.is_middle ~= true then
- return
- end
- tServerOKDay = {}
- print("[CommerceMiddle_GetOpen] 开始去获取服务器开启信息")
- local tWarZoneConf = WarZoneConf.group
- for _, v in ipairs(tWarZoneConf) do
- local nFirstServerID = MiddleConnect.MiddleConnect_ConfServerID2TrueServerID(v.nMinServerID)
- print("[CommerceMiddle_GetOpen] nMinServerID = "..v.nMinServerID.." nFirstServerID = "..nFirstServerID)
- local fd = MiddleManager.getFDBySvrIndex(nFirstServerID)
- if fd then
- tServerOKDay[nFirstServerID] = 0
- print("[CommerceMiddle_GetOpen] 中心服主动去获取数据 nFirstServerID = "..nFirstServerID)
- local tMsgData = InnerMsg.wl.WL_COMMERCE_QUERYOPENDAY
- InnerMsg.sendMsg(fd, tMsgData)
- print("[CommerceMiddle_GetOpen] 发送结束")
- else
- print("[CommerceMiddle_GetOpen] 中心服主动去获取数据, 但是获取不到fd nFirstServerID = "..nFirstServerID)
- end
- end
- end
- -- 回复开服天数
- function CommerceMiddle_SendOpenDay(fd, msg)
- local nOpenDay = msg.nOpenDay
- local nServerConfID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
- if not tServerOpenDay then
- tServerOpenDay = {}
- end
- if not tServerOKDay then
- print("[CommerceMiddle_SendOpenDay] 没有正确的对 tServerOKDay 进行初始化")
- tServerOKDay = {}
- end
- tServerOpenDay[nServerConfID] = nOpenDay
- print("[CommerceMiddle_SendOpenDay] 回复开服天数 nServerConfID = "..nServerConfID.." nOpenDay = "..nOpenDay)
-
- tServerOKDay[msg.nSrcServerID] = 1
- local bOK = true
- for _, v in pairs(tServerOKDay) do
- if 0 == v then
- bOK = false
- end
- end
- if true == bOK then
- CommerMiddle_CheckMiddleInfo()
- end
- end
- -- 请求开服天数
- function CommerceMiddle_QueryOpenDay(fd, msg)
- local tMsgData = InnerMsg.lw.LW_COMMERCE_SENDOPENDAY
- tMsgData.nOpenDay = CommonDB.getServerOpenDay()
- tMsgData.nSrcServerID = Config.SVR_INDEX
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerceMiddle_QueryOpenDay] 请求开服天数")
- end
- function CommerceMiddle_QueryOpenAct(fd, msg)
- local nConfServerID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
- local nFirstServerID
- for _, v in ipairs(WarZoneConf.group) do
- if v.nMinServerID <= nConfServerID and v.nMaxServerID >= nConfServerID then
- nFirstServerID = v.nMinServerID
- break
- end
- end
-
- if nil == nFirstServerID or not tServerOpenDay or not tServerOpenDay[nFirstServerID] then
- print("[QueryOpenAct] 获取不到战区的第一个服务器\n")
- return
- end
- local nSrcFD = MiddleManager.getFDBySvrIndex(msg.nSrcServerID)
- if not nSrcFD then
- return
- end
- local tMsgData = InnerMsg.wl.WL_COMMERCE_ACTOPEN
- tMsgData.nOpen = tServerOpenDay[nFirstServerID] >= SERVERCOMMERCEOPENDAY and 1 or 0
- tMsgData.nOperate = msg.nOperate
- tMsgData.nServerKey = nFirstServerID
- InnerMsg.sendMsg(nSrcFD, tMsgData)
- print("[CommerceMiddle_QueryOpenAct] 请求中心服活动是否开启 nOpen = "..tMsgData.nOpen)
- end
- function CommerceMiddle_SendOpenAct(fd, msg)
- print("[CommerceMiddle_SendOpenAct] 获取到中心服发送的是否开服数据 nOpen = "..msg.nOpen)
- ServerCommerceManger.CommerceAct_ActCheckOpen(msg.nOpen, msg.nOperate, msg.nServerKey)
- end
- -- 发送玩家排行榜信息
- function CommerveMiddle_HumanPointChange(human, nPoint)
- local tMsgData = InnerMsg.lw.LW_COMMERCE_RANK_POINT_CHANGE
- tMsgData.uuid = human.db._id
- tMsgData.name = human.db.name
- tMsgData.head = human.db.head
- tMsgData.headFrame = human.db.headFrame
- tMsgData.nSrcServerID = Config.SVR_INDEX
- tMsgData.nValue = nPoint
- tMsgData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
- tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN
- tMsgData.nOperate = CommonDefine.COMMONRANK_VALUE_REPLACE
- tMsgData.servername = Config.NEW_SVR_INDEX.."区"
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerveMiddle_HumanPointChange] 发送玩家排行榜信息结束 name = "..tMsgData.name.." nValue = "..tMsgData.nValue)
- end
- -- 服务器点数改变发送排行榜信息
- function CommerveMiddle_ServerPointChange(nPoint)
- local tMsgData = InnerMsg.lw.LW_COMMERCE_RANK_POINT_CHANGE
- tMsgData.uuid = Config.NEW_SVR_INDEX
- tMsgData.name = Config.NEW_SVR_INDEX.."区"
- tMsgData.head = -1
- tMsgData.headFrame = -1
- tMsgData.nSrcServerID = Config.SVR_INDEX
- tMsgData.nValue = nPoint
- tMsgData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
- tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER
- tMsgData.nOperate = CommonDefine.COMMONRANK_VALUE_REPLACE
- tMsgData.servername = Config.NEW_SVR_INDEX.."区"
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerveMiddle_HumanPointChange] 发送服务器排行榜信息结束 name = "..tMsgData.name.." nValue = "..tMsgData.nValue)
- end
- -- 请求排行榜数据
- function CommerveMiddle_QueryRankInfo(nRankType, nRankSubType)
- local tMsgData = InnerMsg.lw.LW_COMMERCE_QUERY_RANK_INFO
- tMsgData.nRankType = nRankType
- tMsgData.nRankSubType = nRankSubType
- tMsgData.nSrcServerID = Config.SVR_INDEX
-
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerveMiddle_QueryRankInfo] 向中心服请求排行榜数据")
- end
- -- 获取到排行榜数据
- function CommerveMiddle_GetRankInfo(tData)
- ServerCommerceRank.CommercerActRank_GetRankInfo(tData)
- end
- -- 检测是否存在中心服数据
- function CommerMiddle_CheckMiddleInfo()
- if _G.is_middle ~= true then
- return
- end
-
- for nServerID, v in pairs(tServerOKDay) do
- local nServerConfID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(nServerID)
- local nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nServerConfID)
- print("[CommerMiddle_CheckMiddleInfo] 进行判断中心服是否存在数据 nServerKey = "..nServerKey.." nServerID = "..nServerID)
- local tDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- local nOpenDay = tServerOpenDay[nServerConfID]
- -- 不存在去拿数据
- if nil == tDBData then
- --if nOpenDay >= 8 then
- local fd = MiddleManager.getFDBySvrIndex(nServerID)
- if fd then
- local tMsgData = InnerMsg.wl.WL_COMMERCE_GET_ACT_INFO
- tMsgData.nReqServerID = 0
- InnerMsg.sendMsg(fd, tMsgData)
- print("[CommerMiddle_CheckMiddleInfo] 发送数据完成")
- else
- print("[CommerMiddle_CheckMiddleInfo] 获取不到FD nServerID = "..nServerID)
- end
- --end
- else
- print("[CommerMiddle_CheckMiddleInfo] 存在数据, 判断是否刷新 nServerID = "..nServerID.." nServerKey = "..nServerKey
- .." nBatchID = "..tDBData.nBatchID.." nBeginTime = "..tDBData.nBeginTime.." nEndTime = "..tDBData.nEndTime)
- CommerceMiddle_Refresh(nServerKey)
- end
- end
- end
- -- 中心服请求活动时间相关数据
- function CommerceMiddle_GetActInfo_WL(msg)
- print("[CommerceMiddle_GetActInfo] 收到中心服请求")
- local tDBData = CommonDB.GetCommerceActInfo()
- local tMsgData = InnerMsg.lw.LW_COMMERCE_GET_ACT_INFO
- -- table.print_lua_table(tDBData)
- tMsgData.nReqServerID = msg.nReqServerID
- tMsgData.nSrcServerID = Config.SVR_INDEX
- tMsgData.nOperate = 0
- tMsgData.nBatchID = 0
- tMsgData.nBeginTime = 0
- tMsgData.nEndTime = 0
- if not tDBData or nil == _G.next(tDBData) then
- tMsgData.nOperate = 2
- else
- tMsgData.nOperate = 1
- tMsgData.nBatchID = tDBData.nBatchID
- tMsgData.nBeginTime = tDBData.nBeginTime
- tMsgData.nEndTime = tDBData.nEndTime
- end
- InnerMsg.sendMsg(0, tMsgData)
- end
- -- 中心服收到活动相关数据
- function CommerceMiddle_GetActInfo_LW(msg)
- if msg.nOperate == 0 then
- print("[CommerceMiddle_GetActInfo_LW] 不存在对应的数据")
- end
-
- local nReqServerID = msg.nReqServerID
- local nServerConfID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
- local nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nServerConfID)
- print("[CommerceMiddle_GetActInfo_LW] 中心服收到回包 nReqServerID = "..nReqServerID.." nServerConfID = "..nServerConfID)
- -- table.print_lua_table(msg)
- local tDBData = {
- nBatchID = 0,
- nBeginTime = 0,
- nEndTime = 0
- }
- local tOldDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if tOldDBData then
- print("[CommerceMiddle_GetActInfo_LW] 存在db数据")
- -- table.print_lua_table(tOldDBData)
- end
- -- 不存在对应的数据
- if msg.nOperate == 2 then
- print("[CommerceMiddle_GetActInfo_LW] 当前上报的服务器没有对应的数据, 活动未开始")
- CommerceMiddle_Refresh(nServerKey)
- elseif msg.nOperate == 1 then
- if nil == tOldDBData then
- tDBData.nBatchID = msg.nBatchID
- tDBData.nBeginTime = msg.nBeginTime
- tDBData.nEndTime = msg.nEndTime
- print("[CommerceMiddle_GetActInfo_LW] 当前不存在数据, 进行了设置 nServerKey = "..nServerKey)
- CommonDB.SetCommerceMiddleAct_ByKey(nServerKey, tDBData)
- end
- tOldDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if tOldDBData then
- print("[CommerceMiddle_GetActInfo_LW] 设置后的数据打印")
- -- table.print_lua_table(tOldDBData)
- end
- CommerceMiddle_Refresh(nServerKey)
- end
- print("[CommerceMiddle_GetActInfo_LW] 1111111")
- -- table.print_lua_table(tDBData)
- if 0 ~= nReqServerID then
- print("[CommerceMiddle_GetActInfo_LW] 当前有服务器请求数据 nReqServerID = "..nReqServerID)
- CommerceMiddle_SendOpenTime(nReqServerID)
- end
- end
- -- 普通服请求活动时间
- function CommerceMiddle_GetActOpenTime_LW(msg)
- if _G.is_middle ~= true then return end
- local nServerConfID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
- local nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nServerConfID)
- local tDBData = CommonDB.GetCommerceMiddleAct_ByKey(nServerKey)
- if nil == tDBData then
- local nFirstServerID = MiddleConnect.MiddleConnect_ConfServerID2TrueServerID(nServerKey)
- local fd = MiddleManager.getFDBySvrIndex(nFirstServerID)
- if fd then
- local tMsgData = InnerMsg.wl.WL_COMMERCE_GET_ACT_INFO
- tMsgData.nReqServerID = msg.nSrcServerID
- InnerMsg.sendMsg(fd, tMsgData)
- else
- print("[CommerceMiddle_GetActOpenTime_LW] 不存在对应的fd 数据 nFirstServerID = "..nFirstServerID)
- end
- else
- CommerceMiddle_Refresh(nServerKey)
- CommerceMiddle_SendOpenTime(msg.nSrcServerID)
- end
- end
- function CommerceMiddle_GetActOpenTime_WL(msg)
- ServerCommerceManger.CommerceAct_GetActTime(msg)
- end
- ------------------ 活动管理器操作 ------------------------
- -- 请求活动是否开启
- function CommerceMiddle_IsActOpen(nOperate)
- local tMsgData = InnerMsg.lw.LW_COMMERCE_ACTOPEN
- tMsgData.nSrcServerID = Config.SVR_INDEX
- tMsgData.nOperate = nOperate
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerceMiddle_IsActOpen] 普通服开始请求活动信息")
- end
- -- 请求当前服务器排行最新的排名
- function CommerceMiddle_QueryServerRank(nOperate)
- local tMsgData = InnerMsg.lw.LW_COMMERCE_QUERY_SERVER_RANK
- tMsgData.nSrcServerID = Config.SVR_INDEX
- tMsgData.nServerUuid = tostring(Config.NEW_SVR_INDEX)
- tMsgData.nOperate = nOperate
- InnerMsg.sendMsg(0, tMsgData)
- end
- -- 获取到 当前服务器排行最新的排名
- function CommerceMiddle_GetServerRank(msg)
- ServerCommerceRank.CommercerActRank_GetServerRank(msg)
- end
- -- 通知中心服当前服务器在线全服玩家邮件结束
- function CommerceMiddle_TellServerMailOk()
- local tMsgData = InnerMsg.lw.LW_COMMERCE_TELL_SERVER_MAILOK
- tMsgData.nSrcServerID = Config.SVR_INDEX
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerceMiddle_TellServerMailOk] 通知中心服当前服务器在线全服玩家邮件结束")
- end
- function CommerceMiddle_GetHumanRank(msg)
- ServerCommerceRank.CommercerActRank_SendHumanRankPrize(msg)
- end
- function CommerceMiddle_ClearRank()
- local tMsgData = InnerMsg.lw.LW_COMMERCE_CLEAR_RANK
- tMsgData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
- tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER
- tMsgData.nSrcServerID = Config.SVR_INDEX
- InnerMsg.sendMsg(0, tMsgData)
- tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN
- InnerMsg.sendMsg(0, tMsgData)
- end
- function CommerceMiddle_GMClearMiddleMail()
- local tMsgData = InnerMsg.lw.LW_COMMERCE_GM_CLEAR_MAIL
- tMsgData.nSrcServerID = Config.SVR_INDEX
- InnerMsg.sendMsg(0, tMsgData)
- end
- function CommerceMiddle_QueryActOpenTime()
- local tMsgData = InnerMsg.lw.LW_COMMERCE_ACT_GET_OPENTIME
- tMsgData.nSrcServerID = Config.SVR_INDEX
- InnerMsg.sendMsg(0, tMsgData)
- print("[CommerceMiddle_QueryActOpenTime] 请求中心服活动开启时间")
- end
- function CommerceMiddle_GMClearDB(nServerID)
- local nServerConfID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(nServerID)
- local nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nServerConfID)
- local nBeginTime, nEndTime = CommerceMiddle_CreateActTime()
- local tDBData =
- {
- nBatchID = 1,
- nBeginTime = nBeginTime,
- nEndTime = nEndTime
- }
- local szText = "[CommerceMiddle_GMClearDB] 生成新的DB数据 nServerKey = "..nServerKey.." nBatchID = "..tDBData.nBatchID
- .." nBeginTime = "..tDBData.nBeginTime.." nEndTime = "..tDBData.nEndTime
- CommerceMiddle_WriteLog(szText)
- CommonDB.SetCommerceMiddleAct_ByKey(nServerKey, tDBData)
- CommerceMiddle_SendOpenTime(nServerID)
- end
|