| | |
| | | # @change: "2014-02-27 12:00" hxp 增加世界boss逻辑
|
| | | # @change: "2014-04-26 19:30" hxp 增加领地战活动
|
| | | # @change: "2014-06-21 15:20" hxp 增加特惠活动
|
| | | # @change: "2014-08-04 17:30" xmnathan 天梯每日更新
|
| | | # @change: "2014-08-15 17:00" xmnathan 修改OnDay函数内的执行顺序
|
| | | # @change: "2014-10-08 10:30" xmnathan add 定时清理过期补偿
|
| | | # @change: "2014-10-29 22:00" hxp MapServerInitOK增加扩展key状态通知
|
| | |
| | | import GameWorldAverageLv
|
| | | import PlayerDBOper
|
| | | import PlayerGeTui
|
| | | #import GameWorldMixServerCampaign
|
| | | #import PlayerManorWar
|
| | | import GameWorldBoss
|
| | | #import GameWorldActionTeHui
|
| | | #import HighLadder
|
| | | import PlayerCompensation
|
| | | #import GameWorldShopItem
|
| | | import ReadChConfig
|
| | | import EventReport
|
| | | #import ReloadModule
|
| | | import CrossRealmPK
|
| | | import CrossRealmMsg
|
| | | import CrossRealmPlayer
|
| | | import CrossBattlefield
|
| | | import CrossActionControl
|
| | | import PlayerFBHelpBattle
|
| | | import PlayerFamilyRedPacket
|
| | | import PlayerFairyDomain
|
| | | import IpyGameDataPY
|
| | | import PlayerFamilyParty
|
| | | import PlayerFamilyZhenfa
|
| | | import GameWorldFamilyWar
|
| | | import GameWorldArena
|
| | | import CrossLuckyCloudBuy
|
| | | import AuctionHouse
|
| | | import PlayerXMZZ
|
| | | import PlayerLove
|
| | | import PlayerTeam
|
| | | import PyGameData
|
| | | import CrossBoss
|
| | | import ChPlayer
|
| | | import PyDataManager
|
| | | import GameWorldOpenServerCampaign
|
| | | import CrossBillboard
|
| | | import CrossChampionship
|
| | | import GameWorldMineArea
|
| | | import GameWorship
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | GameWorld.Log("GameServer -> OnHour!")
|
| | | PlayerEventCounter.DoLogic_GameServer_OnHour(tick)
|
| | | GameWorld.GetGameWorld().OnHour(curTimeStr)
|
| | | #每小时更新天梯
|
| | | #HighLadder.OnHour()
|
| | | #设置存取数据库Key
|
| | | __SetWorldKey_SavePlayer(curTimeStr)
|
| | | #每小时清空宝物掉落
|
| | |
| | | GameLogInfo.Set_Server_Hour()
|
| | |
|
| | | PlayerFamily.FamilyOnHour()
|
| | | ChPlayer.CheckOnedayJobPlayerLoginoffTimeout()
|
| | | return
|
| | |
|
| | | ## 触发每日事件(参数 -> 当前时间)
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def OnDay(curTimeStr, tick):
|
| | | GameWorld.Log("GameServer -> OnDay!")
|
| | | #天梯竞技场,放在排行榜更新之前处理
|
| | | #HighLadder.OnDay()
|
| | | #排行榜拷贝昨日榜单
|
| | | PlayerBillboard.CopyBillboardOnDay()
|
| | | CrossBillboard.CopyBillboardOnDay()
|
| | | #开服活动,放在排行榜拷贝昨日榜更新后处理
|
| | | PlayerEventCounter.DoLogic_GameServer_OnDay(tick)
|
| | | # 通知开服天数, 放在地图OnDay之前处理, 不然地图在OnDay时需要用到开服天时会取到昨天的值
|
| | |
| | | # 通知开服天数
|
| | | #openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|
| | | #GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_ServerDay, openServerDay)
|
| | | GameWorldOpenServerCampaign.DoOnDay()
|
| | | #清理过期补偿
|
| | | PlayerCompensation.ClearUpTimeOutCompensation()
|
| | | PlayerGeTui.ClearFMTGeTuiLimit()
|
| | | #PlayerGeTui.ClearFMTGeTuiLimit()
|
| | | import PlayerBourse
|
| | | PlayerBourse.OverTimeItemsDeal()
|
| | | # 仙盟联赛
|
| | | GameWorldFamilyWar.DoOnDay()
|
| | | # 情缘
|
| | | PlayerLove.DoOnDay()
|
| | | # 云购
|
| | | CrossLuckyCloudBuy.DoOnDay()
|
| | | # 膜拜
|
| | | GameWorship.DoOnDay()
|
| | | return
|
| | |
|
| | | def OnDayEx(tick):
|
| | |
| | |
|
| | | #仙魔之争
|
| | | PlayerXMZZ.XMZZOndayEx()
|
| | | #boss复活
|
| | | GameWorldBoss.BossRebornOnDayEx()
|
| | | return
|
| | |
|
| | | ## 触发每周事件(参数 -> 当前时间)
|
| | |
| | | def __Func_HighPrecisionProcess(tick):
|
| | | if not GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit):
|
| | | return
|
| | | curTime = int(time.time())
|
| | | |
| | | #仙盟宴会答题定时器
|
| | | PlayerFamilyParty.FamilyParty_Process(tick)
|
| | | # 帮主弹劾时钟调用
|
| | | PlayerFamily.OnLeaderImpeachTick(tick)
|
| | | |
| | | #跨服玩家
|
| | | CrossRealmPlayer.OnCrossProcess(tick)
|
| | | #跨服PK匹配
|
| | | CrossRealmPK.OnPKMatchProcess(tick)
|
| | |
|
| | | GameWorldBoss.DoCheckWorldBossReborn(tick)
|
| | | GameWorldBoss.ProcessBossGeTui(tick)
|
| | | PlayerGeTui.ProcessNewGuyCallBackGeTui(tick)
|
| | | #GameWorldBoss.ProcessBossGeTui(tick)
|
| | | #PlayerGeTui.ProcessNewGuyCallBackGeTui(tick)
|
| | | #组队副本版本
|
| | | PlayerTeam.DoTeamProcess(tick)
|
| | |
|
| | | #操作Python表
|
| | | PlayerDBOper.PyDBProccess(tick)
|
| | | |
| | | #拍卖行
|
| | | AuctionHouse.OnAuctionItemTimeProcess(curTime, tick)
|
| | | |
| | | #情缘
|
| | | PlayerLove.OnTimeProcess(curTime, tick)
|
| | | |
| | | #福地
|
| | | GameWorldMineArea.OnMineItemTimeProcess(curTime, tick)
|
| | |
|
| | | #每整分钟处理一次
|
| | | curDateTime = datetime.datetime.today()
|
| | |
| | |
|
| | | def GameWorldProcessOnMinute(curMinute, tick):
|
| | | # 每整分钟触发一次
|
| | | CheckServerHasPlayerLoginAfterInitOK()
|
| | | #检查服务器正式开服
|
| | | DoCheckNewServerOpen(tick)
|
| | | |
| | | #回报数据库当前在线玩家数
|
| | | DisposeGameActivePlayer(tick)
|
| | | #处理游戏世界中的时间事件
|
| | | DisposeGameWorldEvenByTime(tick)
|
| | | GameWorldActionControl.Dispose_OperationActionState()
|
| | |
| | | GameWorldActionControl.Dispose_FBStateTime()
|
| | | #跨服PK
|
| | | CrossRealmPK.OnMinuteProcess()
|
| | | #跨服排位
|
| | | CrossChampionship.OnMinuteProcess(curMinute)
|
| | | CrossBattlefield.OnMinuteProcess()
|
| | | #处理重开服务器后, 活动继续开启逻辑根据天数
|
| | | #GameWorldActionControl.Dispose_Action_GoOn_ByDay(tick)
|
| | | #触发世界等级
|
| | | GameWorldAverageLv.OpenWorldAverageLv()
|
| | | #倒计时离队处理
|
| | | PlayerTeam.DoCountdownLeaveTeamLogic(tick)
|
| | | #副本助战
|
| | | PlayerFBHelpBattle.OnMinuteProcess()
|
| | | #红包
|
| | | PlayerFamilyRedPacket.OnRedPacketMinuteProcess()
|
| | | #拍卖行
|
| | | AuctionHouse.OnAuctionItemMinuteProcess(tick)
|
| | | #福地
|
| | | GameWorldMineArea.OnProcessOnMinute()
|
| | | #每5分钟触发一次仙盟总战力更新
|
| | | if curMinute % 5 == 0:
|
| | | PlayerFamily.UpdFamilyTotalFightPower()
|
| | | PlayerFamilyRedPacket.CheckDelRedpacketData()
|
| | | |
| | | return
|
| | |
|
| | | def CheckServerHasPlayerLoginAfterInitOK():
|
| | | ## 检查服务器启动成功后是否有玩家正常登录
|
| | | initGameWorldTime = GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit)
|
| | | if not initGameWorldTime:
|
| | | return
|
| | | |
| | | if PyGameData.g_noPlayerLoginWarningMailState:
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | noPlayerLoginWarningTimes = IpyGameDataPY.GetFuncCfg("ServerEvent", 1) * 60 # x分钟没有玩家登录则预警
|
| | | if curTime - initGameWorldTime < noPlayerLoginWarningTimes:
|
| | | return
|
| | | |
| | | GameWorld.SendGameError("NoPlayerLogin")
|
| | | PyGameData.g_noPlayerLoginWarningMailState = 1
|
| | | return
|
| | |
|
| | | def OnReloadConfig():
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #处理世界活动
|
| | | DisposeGameWorldGame(tick)
|
| | | #回报数据库当前在线玩家数
|
| | | DisposeGameActivePlayer(tick)
|
| | | #DisposeGameActivePlayer(tick)
|
| | | #同步地图服务器时间
|
| | | Dispose_MapServer_Time(tick)
|
| | | #保存玩家数据
|
| | |
| | | Dispose_DataBase_GMShell(tick)
|
| | | ##处理重开服务器后, 活动继续开启逻辑根据天数
|
| | | #GameWorldActionControl.Dispose_Action_GoOn_ByDay(tick)
|
| | | #定时神秘商店刷新
|
| | | #GameWorldShopItem.Dispose_ShopItemRefresh(tick)
|
| | |
|
| | | #定时向RouteServer发送消息
|
| | | Dispose_SendMsg_RouteServer(tick)
|
| | |
| | | # 所有服务器人数要回报一次, 每个map也要回报一次
|
| | | # gameWorld.GetTickByType(0 - n) 取间隔
|
| | | def DisposeGameActivePlayer(tick):
|
| | | # gameWorld = GameWorld.GetGameWorld()
|
| | | # lastTick = gameWorld.GetTickByType(ChConfig.TYPE_GetActivePlayerCount)
|
| | | # |
| | | # if lastTick == -1:
|
| | | # #GameWorld.Log("未初始化服务器")
|
| | | # return
|
| | | # |
| | | # if tick - lastTick < ChConfig.TYPE_Tick_Time[ChConfig.TYPE_GetActivePlayerCount]:
|
| | | # return
|
| | | # |
| | | # |
| | | # gameWorld.SetTickByType(ChConfig.TYPE_GetActivePlayerCount , tick)
|
| | | |
| | | gameWorld = GameWorld.GetGameWorld() |
| | | curMinute = datetime.datetime.today().minute |
| | | #为了每个服的输出时间点统一一个分钟点,便于统计
|
| | | if datetime.datetime.today().minute % 5 != 0:
|
| | | if curMinute % 5 != 0:
|
| | | return
|
| | | noteData = gameWorld.GetDictByKey("OnlineCntM")
|
| | | if noteData == curMinute:
|
| | | # 同一分钟不多发送,此处不建议用CD处理,避免两CD冲突
|
| | | return
|
| | | gameWorld.SetDict("OnlineCntM", curMinute)
|
| | |
|
| | | # 全服在线人数平台明细
|
| | | platformOLDict = {} # 平台在线人数 {平台:人数, ...}
|
| | |
| | | #activePlayerCount = GameWorld.GetPlayerManager().GetActivePlayerCount()
|
| | | #DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, platformOLDict, tjgOnlineCnt)
|
| | | #===========================================================================
|
| | | for platform, playerCnt in platformOLDict.items():
|
| | | DataRecordPack.DR_OnLinePlayerCount(playerCnt, platform, tjgOnlineCnt) # 单平台
|
| | | EventReport.WriteEvent_concurrency(playerCnt, 0, platform) # 单平台 此处不能传脱机挂玩家总数
|
| | | |
| | |
|
| | | isMixture = False #是否混服
|
| | | if isMixture:
|
| | | for platform, playerCnt in platformOLDict.items():
|
| | | DataRecordPack.DR_OnLinePlayerCount(playerCnt, platform, tjgOnlineCnt) # 单平台
|
| | | EventReport.WriteEvent_concurrency(playerCnt, 0, platform) # 单平台 此处不能传脱机挂玩家总数
|
| | | DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, {}, tjgOnlineCnt) # 总在线
|
| | | #EventReport.WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt)
|
| | | else:
|
| | | serverPlatform = GameWorld.GetPlatform()
|
| | | DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, {}, tjgOnlineCnt) # 总在线
|
| | | EventReport.WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt, serverPlatform)
|
| | | #===========================================================================
|
| | |
|
| | | DataRecordPack.DR_OnLinePlayerCount(activePlayerCount, {}, tjgOnlineCnt) # 总在线
|
| | | #EventReport.WriteEvent_concurrency(activePlayerCount, tjgOnlineCnt)
|
| | | #刷新当前地图服务器
|
| | | #===========================================================================
|
| | | # custom_concurrencyMapList = ReadChConfig.GetEvalChConfig("EventReportMapID")
|
| | |
| | | def InitGameWorld(tick):
|
| | | #标记GameWorld初始化完成
|
| | | GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_IsGameWorldInit, int(time.time()))
|
| | | LoadDBPlayer()
|
| | | #初始化游戏时钟
|
| | | GameWorld.GetGameWorld().SetTickTypeCount(ChConfig.TYPE_Tick_Count)
|
| | | #初始话开服时间、星期几
|
| | |
| | | if initOpenServerTime <= 0 or openServerWeekday <= 0:
|
| | | #记录首次开发时间(现实时间戳)
|
| | | PlayerDBGSEvent.SetInitOpenServerTime(initOpenServerTime if initOpenServerTime else int(time.time()))
|
| | |
|
| | | |
| | | #初始化家族数量
|
| | | GameWorld.GetFamilyManager().SetFamilyUpperLimitCount(ChConfig.Def_Family_MaxCnt)
|
| | | #排序元宝交易平台
|
| | | GameWorld.GetGameWorld().GetDBGoldOrderFormMgr().Sort()
|
| | | PlayerBillboard.ClearBillboardOnServerInit()
|
| | | #排序排行榜
|
| | | PlayerBillboard.SortServerBillboard()
|
| | | #排序仙盟
|
| | | PlayerFamily.DoFamilySort()
|
| | | #仙盟
|
| | | PlayerFamily.OnGameServerInitOK()
|
| | | GameWorldActionControl.Dispose_FBStateTime()
|
| | | #仙盟联赛
|
| | | GameWorldFamilyWar.OnGameServerInitOK()
|
| | |
| | | ChPlayer.LoadPlayerLVData()
|
| | | #加载助战信息
|
| | | PlayerFBHelpBattle.OnServerStart()
|
| | | #本服竞技场
|
| | | GameWorldArena.OnServerStart()
|
| | | #跨服PK
|
| | | CrossRealmPK.OnGameServerInitOK()
|
| | | #跨服排位
|
| | | CrossChampionship.OnServerStart()
|
| | | #跨服战场
|
| | | CrossBattlefield.OnServerStart()
|
| | | #红包
|
| | | PlayerFamilyRedPacket.OnServerStart()
|
| | | #云购
|
| | | CrossLuckyCloudBuy.OnServerStart()
|
| | | #世界boss被杀次数重置
|
| | | #GameWorldBoss.CheckResetBossKilledCntOnServerInit()
|
| | | #GameWorldActionTeHui.OnGameServerInitOK() # 特惠活动初始化
|
| | | #子服启动成功告知跨服主服
|
| | | serverGroupID = GameWorld.GetServerGroupID()
|
| | | GameWorld.Log("服务器启动成功: ServerGroupID=%s" % serverGroupID)
|
| | | |
| | | __Func_HighPrecisionProcess(tick) # 主动触发一次高精度的调用,确保服务器启动后一些功能活动等的数据会被加载
|
| | | |
| | | GameWorld.Log("=============================== 服务器启动成功 ===================================")
|
| | | isCrossServer = GameWorld.IsCrossServer()
|
| | | if isCrossServer:
|
| | | isServerClose = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_CrossServerClose)
|
| | | isServerOpen = 0 if isServerClose else 1
|
| | | GameWorld.GetGameWorld().SetDict(ShareDefine.Def_Notify_WorldKey_CrossServerOpen, isServerOpen)
|
| | | GameWorld.Log("跨服服务器启动成功: isServerOpen=%s,crossZoneName=%s" % (isServerOpen, GameWorld.GetCrossZoneName()))
|
| | | else:
|
| | | serverGroupID = GameWorld.GetServerGroupID()
|
| | | GameWorld.Log("服务器启动成功: ServerGroupID=%s" % serverGroupID)
|
| | | GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_GameWorldInitOK, 1)
|
| | | |
| | | AuctionHouse.OnGameServerInitOK()
|
| | | # 注意:跨服相关信息的调用需放在最后,不然可能导致服务器未启动功能或者功能未加载成功导致跨服服务器与子服之间的数据同步可能出现异常的情况
|
| | | CrossRealmMsg.OnGameServerInitOK()
|
| | | if PyGameData.g_allMapServerInitOK:
|
| | | GameWorld.Log("InitGameWorld时AllMapServerInitOK已触发则补触发一次!")
|
| | | GameWorld.SendGameError("GameWarning", "InitGameWorld later than AllMapServerInitOK")
|
| | | AllMapServerInitOK(tick)
|
| | | |
| | | return
|
| | |
|
| | | def LoadDBPlayer():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | PlayerDBOper.FindDBOper(PlayerDBOper.Table_DBPlayer, {}, {"PlayerID":1, "AccID":1, "_id":0}, LoadDBPlayerRet)
|
| | | return
|
| | |
|
| | | def LoadDBPlayerRet(resultSetList, extendValueList):
|
| | | for resultDict in resultSetList:
|
| | | PyGameData.g_dbPlayerIDMap[resultDict["PlayerID"]] = resultDict["AccID"]
|
| | | GameWorld.Log("启动服务器加载DBPlayer玩家账号ID对应关系! %s, %s" % (len(PyGameData.g_dbPlayerIDMap), PyGameData.g_dbPlayerIDMap))
|
| | | |
| | | PlayerFamily.OnLoadDBPlayerOK()
|
| | | return
|
| | |
|
| | | def DoCheckNewServerOpen(tick):
|
| | |
| | | universalRecMgr.Delete(recType)
|
| | | if recordCount:
|
| | | GameWorld.Log("DeleteRecData recType=%s, count=%s" % (recType, recordCount))
|
| | | |
| | | CrossBoss.g_bossRecDataDict = {} # 需要清除,不然会导致跨服boss通用记录缓存对象错误
|
| | | |
| | | #清 家族
|
| | | familyList = []
|
| | | familyMgr = GameWorld.GetFamilyManager()
|
| | |
| | |
|
| | | PyGameData.g_sortBOSSRefreshList = [] # boss刷新信息记录缓存重置, 不重置会导致通知前端的boss信息为空
|
| | |
|
| | | GameWorldArena.OnServerStart()
|
| | | |
| | | CrossBattlefield.OnServerStart()
|
| | | |
| | | PlayerDBGSEvent.SetInitOpenServerTime(setOpenServerTime)
|
| | |
|
| | | ReadChConfig.ReloadConfig()
|
| | |
|
| | | AllMapServerInitOK(tick)
|
| | | |
| | | GameWorld.GetGameWorld().SaveGameServerData()
|
| | | GameWorld.SendGameError("ClearOpenServerOK")
|
| | | return
|
| | |
|
| | | ## 服务器开服时是星期几
|
| | |
| | | # @return None
|
| | | # @remarks 当一个mapServer开启时,
|
| | | def AllMapServerInitOK(tick):
|
| | | PyGameData.g_allMapServerInitOK = True
|
| | | if not GameWorld.GetGameWorld().GetDictByKey(ChConfig.Def_WorldKey_IsGameWorldInit):
|
| | | GameWorld.Log("AllMapServerInitOK时GameServer还未启动好!")
|
| | | return
|
| | | #通知所有地图服务器初始化成功, 同步时间
|
| | | GameWorld.GetGameWorld().Notify_AllMapServerInitOK(GameWorld.GetCurrentDataTimeStr())
|
| | |
|
| | |
| | |
|
| | | #触发节假日活动
|
| | | #GameWorldActionHoliday.ActionHoliday_OpenAndClose(tick, True)
|
| | | #合服活动
|
| | | #GameWorldMixServerCampaign.UpdateMixServerCampaignState(True)
|
| | |
|
| | | #通知世界等级
|
| | | worldLv = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | |
| | | # 合服天
|
| | | mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_MixServerDay, mixServerDay)
|
| | | # 上次合服时的开服天数
|
| | | # 上次合服时的开服天数、世界等级
|
| | | lastMixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerDay)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_LastMixServerDay, lastMixServerDay)
|
| | | # 上次清除排行榜的标记
|
| | | lastSign = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_ClearBillboardSign)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_ClearBillboardSign, lastSign)
|
| | | lastMixServerWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerWorldLV)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_LastMixServerWorldLV, lastMixServerWorldLV)
|
| | |
|
| | | # 通知战盟相关活动开启状态
|
| | | fadState = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_FamilyActivityDayState)
|
| | |
| | |
|
| | | # 仙盟联赛
|
| | | GameWorldFamilyWar.OnMapServerInitOK()
|
| | | # 领地争夺战
|
| | | #PlayerManorWar.OnMapServerInitOK()
|
| | |
|
| | | # 特惠活动
|
| | | #GameWorldActionTeHui.OnMapServerInitOK()
|
| | | |
| | | # 商店信息
|
| | | #GameWorldShopItem.OnMapServerInitOK()
|
| | | # 跨服服务器状态
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_CrossServerTime, PyGameData.g_crossServerTimeInfo)
|
| | | isCrossServerOpen = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerOpen)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_CrossServerOpen, isCrossServerOpen)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_CrossZoneName, PyGameData.g_crossZoneName)
|
| | |
|
| | | # 跨服PK
|
| | | CrossRealmPK.OnMapServerInitOK()
|
| | | #跨服战场
|
| | | CrossBattlefield.OnMapServerInitOK()
|
| | | # 本服竞技场
|
| | | GameWorldArena.SendMapServerArenaInfo()
|
| | | # 幸运云购
|
| | | CrossLuckyCloudBuy.OnMapServerInitOK()
|
| | |
|
| | | SendAllMapGlobalDropInfo() # 全局掉落控制
|
| | |
|
| | | SendMapCommMapLinePlayerCount(True) # 同步一次普通地图线路人数信息
|
| | | #随机假仙盟
|
| | | PlayerFamily.RandomFakeFamily()
|
| | | #仙盟阵法
|
| | | PlayerFamilyZhenfa.OnMapServerInitOK()
|
| | | #缥缈仙域
|
| | | PlayerFairyDomain.OnMapServerInitOK()
|
| | | #情侣信息
|
| | | PyDataManager.GetDBPyCoupleManager().SendMapServerCoupleInfo()
|
| | | # 记录服务器是否正常开启完毕
|
| | | getUrl = ReadChConfig.GetPyMongoConfig("EventReport", "OpenStateUrl") + "?Type=MapInit&MapCount=%s"%GameWorld.GetGameWorld().GetGameMapManager().GetCount()
|
| | | GameWorld.GetGameWorld().EventReport_EventReport("", "", "", "", 0, getUrl)
|
| | | return
|
| | |
|
| | | ## 服务器合服首次启动数据加载处理
|
| | |
| | | GameWorld.DebugLog("合服首次启动加载已经处理过!")
|
| | | return
|
| | |
|
| | | GameWorld.DebugLog("合服首次启动加载处理...")
|
| | | GameWorld.Log("合服首次启动加载处理...")
|
| | |
|
| | | # 清除指定通用数据
|
| | | # 清除指定通用数据,一般是合服工具删,这里可以再做个补充
|
| | | universalRecMgr = GameWorld.GetUniversalRecMgr()
|
| | | delRecTypeList = [ShareDefine.Def_UniversalGameRecType_ManorWarInfo,
|
| | | ]
|
| | | GameWorld.DebugLog(" 清除指定通用数据 delRecTypeList=%s" % str(delRecTypeList))
|
| | | delRecTypeList = []
|
| | | GameWorld.Log("清除指定通用数据 delRecTypeList=%s" % str(delRecTypeList))
|
| | | for delRecType in delRecTypeList:
|
| | | universalRecMgr.Delete(delRecType)
|
| | | |
| | | |
| | | # 删除过期的通用数据
|
| | | __DelOutofdayRecData(universalRecMgr)
|
| | |
|
| | | # 仙盟联赛重置
|
| | | GameWorldFamilyWar.DoFamilyWarReset()
|
| | | # 仙盟
|
| | | PlayerFamily.OnMixServerInit()
|
| | |
|
| | | # 设置合服首次启动加载成功
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServerInitOK, 1)
|
| | |
|
| | | # 设置本次合服时的开服天数
|
| | | # 设置本次合服时的开服天数、世界等级
|
| | | serverDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerDay, serverDay)
|
| | | GameWorld.DebugLog(" 合服首次启动加载成功...")
|
| | | worldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerWorldLV, worldLV)
|
| | | GameWorld.Log(" 合服首次启动加载成功! serverDay=%s,worldLV=%s" % (serverDay, worldLV))
|
| | | return
|
| | |
|
| | | def __DelOutofdayRecData(universalRecMgr):
|
| | | # 删除过期的通用数据
|
| | | curTime = int(time.time())
|
| | | GameWorld.Log("执行删除过期的通用数据, curTime=%s" % curTime)
|
| | | delOutofdayRecDataDict = {
|
| | | }
|
| | | GameWorld.Log("执行删除过期的通用数据, curTime=%s,delOutofdayRecDataDict=%s" % (curTime, delOutofdayRecDataDict))
|
| | | for otDayRecType, otTime in delOutofdayRecDataDict.items():
|
| | | otRecDataList = universalRecMgr.GetTypeList(otDayRecType)
|
| | | if not otRecDataList:
|
| | |
| | | gameMapManager = GameWorld.GetGameWorld().GetGameMapManager()
|
| | |
|
| | | curMap = gameMapManager.Find(mapServerPack.GetRouteServerIndex(), mapServerPack.GetMapID())
|
| | | |
| | | if curMap == None:
|
| | | return
|
| | |
|
| | | if mapServerPack.GetState() not in [0,1,2,3] and curMap.GetState() != mapServerPack.GetState():
|
| | | # 记录服务器是否正常开启完毕, 避免重复发送
|
| | | GameWorld.DebugLog("MapServer_RunningStateRefresh--_%s"%([mapServerPack.GetState(), curMap.GetState(), mapServerPack.GetMapID(), curMap.GetID()]))
|
| | | GameWorld.SendGameError("MapError")
|
| | | |
| | | curMap.SetState(mapServerPack.GetState())
|
| | | curMap.SetRefreshTick(tick)
|
| | | |
| | | return
|
| | |
|
| | | |
| | | ## 刷新地图服务器状态, 如果1分钟没有状态回报, 刷新为消失状态
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | |
| | |
|
| | | gameMapManager = GameWorld.GetGameWorld().GetGameMapManager()
|
| | |
|
| | | isSendMapClose = False
|
| | | for i in range(0, gameMapManager.GetCount()):
|
| | | curMap = gameMapManager.GetAt(i)
|
| | |
|
| | |
| | | if tick - curMap.GetRefreshTick() < ChConfig.Def_Tick_MapServer_MssNone:
|
| | | #间隔未到
|
| | | continue
|
| | |
|
| | | |
| | | curMap.SetState(IPY_GameServer.mssNone)
|
| | | if not isSendMapClose:
|
| | | # 避免多地图发送过多邮件, 如关服的时候
|
| | | GameWorld.SendGameError("MapDisconnect") # 状态报告
|
| | | isSendMapClose = True
|
| | |
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
| | | PlayerTeam.OnServerClose(tick)
|
| | | ChPlayer.SavePlayerLVData()
|
| | | PlayerFBHelpBattle.OnServerClose()
|
| | | CrossActionControl.OnServerClose()
|
| | | CrossChampionship.OnServerClose()
|
| | | CrossBattlefield.OnServerClose()
|
| | | PlayerFamilyRedPacket.OnServerClose()
|
| | | CrossLuckyCloudBuy.OnServerClose()
|
| | | GameWorldArena.OnServerClose()
|
| | | PlayerLove.OnServerClose()
|
| | | GameWorld.Log("通知C++关服!")
|
| | | GameWorld.GetGameWorld().OnServerClose()
|
| | |
|
| | | |
| | | def ChangeGameServerState(state):
|
| | | # 只接收大于等于mssPyError
|
| | | GameWorld.DebugLog("ChangeGameServerState:%s"%state)
|
| | | GameWorld.SendGameError("GameServerError")
|
| | | |
| | | |