|  |  |  | 
|---|
|  |  |  | # @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 PlayerManorWar | 
|---|
|  |  |  | import GameWorldBoss | 
|---|
|  |  |  | #import GameWorldActionTeHui | 
|---|
|  |  |  | #import HighLadder | 
|---|
|  |  |  | import PlayerCompensation | 
|---|
|  |  |  | #import GameWorldShopItem | 
|---|
|  |  |  | import ReadChConfig | 
|---|
|  |  |  | import EventReport | 
|---|
|  |  |  | #import ReloadModule | 
|---|
|  |  |  | 
|---|
|  |  |  | import CrossRealmPlayer | 
|---|
|  |  |  | import PlayerFBHelpBattle | 
|---|
|  |  |  | import PlayerFamilyRedPacket | 
|---|
|  |  |  | import PlayerFairyDomain | 
|---|
|  |  |  | import IpyGameDataPY | 
|---|
|  |  |  | import PlayerFamilyParty | 
|---|
|  |  |  | import GameWorldFamilyWar | 
|---|
|  |  |  | import GameWorldArena | 
|---|
|  |  |  | import AuctionHouse | 
|---|
|  |  |  | import PlayerXMZZ | 
|---|
|  |  |  | import PlayerTeam | 
|---|
|  |  |  | import PyGameData | 
|---|
|  |  |  | 
|---|
|  |  |  | 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() | 
|---|
|  |  |  | #开服活动,放在排行榜拷贝昨日榜更新后处理 | 
|---|
|  |  |  | 
|---|
|  |  |  | #GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_ServerDay, openServerDay) | 
|---|
|  |  |  | #清理过期补偿 | 
|---|
|  |  |  | PlayerCompensation.ClearUpTimeOutCompensation() | 
|---|
|  |  |  | PlayerGeTui.ClearFMTGeTuiLimit() | 
|---|
|  |  |  | #PlayerGeTui.ClearFMTGeTuiLimit() | 
|---|
|  |  |  | import PlayerBourse | 
|---|
|  |  |  | PlayerBourse.OverTimeItemsDeal() | 
|---|
|  |  |  | # 仙盟联赛 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #仙魔之争 | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | # 帮主弹劾时钟调用 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #每整分钟处理一次 | 
|---|
|  |  |  | curDateTime = datetime.datetime.today() | 
|---|
|  |  |  | 
|---|
|  |  |  | GameWorldAverageLv.OpenWorldAverageLv() | 
|---|
|  |  |  | #倒计时离队处理 | 
|---|
|  |  |  | PlayerTeam.DoCountdownLeaveTeamLogic(tick) | 
|---|
|  |  |  | #副本助战 | 
|---|
|  |  |  | PlayerFBHelpBattle.OnMinuteProcess() | 
|---|
|  |  |  | #红包 | 
|---|
|  |  |  | PlayerFamilyRedPacket.OnRedPacketMinuteProcess() | 
|---|
|  |  |  | #拍卖行 | 
|---|
|  |  |  | AuctionHouse.OnAuctionItemMinuteProcess(tick) | 
|---|
|  |  |  | #每5分钟触发一次仙盟总战力更新 | 
|---|
|  |  |  | if curMinute % 5 == 0: | 
|---|
|  |  |  | PlayerFamily.UpdFamilyTotalFightPower() | 
|---|
|  |  |  | 
|---|
|  |  |  | Dispose_DataBase_GMShell(tick) | 
|---|
|  |  |  | ##处理重开服务器后, 活动继续开启逻辑根据天数 | 
|---|
|  |  |  | #GameWorldActionControl.Dispose_Action_GoOn_ByDay(tick) | 
|---|
|  |  |  | #定时神秘商店刷新 | 
|---|
|  |  |  | #GameWorldShopItem.Dispose_ShopItemRefresh(tick) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #定时向RouteServer发送消息 | 
|---|
|  |  |  | Dispose_SendMsg_RouteServer(tick) | 
|---|
|  |  |  | 
|---|
|  |  |  | ChPlayer.LoadPlayerLVData() | 
|---|
|  |  |  | #加载助战信息 | 
|---|
|  |  |  | PlayerFBHelpBattle.OnServerStart() | 
|---|
|  |  |  | #本服竞技场 | 
|---|
|  |  |  | GameWorldArena.OnServerStart() | 
|---|
|  |  |  | #跨服PK | 
|---|
|  |  |  | CrossRealmPK.OnGameServerInitOK() | 
|---|
|  |  |  | #世界boss被杀次数重置 | 
|---|
|  |  |  | #GameWorldBoss.CheckResetBossKilledCntOnServerInit() | 
|---|
|  |  |  | #GameWorldActionTeHui.OnGameServerInitOK() # 特惠活动初始化 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | __Func_HighPrecisionProcess(tick) # 主动触发一次高精度的调用,确保服务器启动后一些功能活动等的数据会被加载 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | GameWorld.Log("服务器启动成功: ServerGroupID=%s" % serverGroupID) | 
|---|
|  |  |  | GameWorld.GetGameWorld().SetDict(ChConfig.Def_WorldKey_GameWorldInitOK, 1) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | AuctionHouse.OnGameServerInitOK() | 
|---|
|  |  |  | # 注意:跨服相关信息的调用需放在最后,不然可能导致服务器未启动功能或者功能未加载成功导致跨服服务器与子服之间的数据同步可能出现异常的情况 | 
|---|
|  |  |  | CrossRealmMsg.OnGameServerInitOK() | 
|---|
|  |  |  | return | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 仙盟联赛 | 
|---|
|  |  |  | GameWorldFamilyWar.OnMapServerInitOK() | 
|---|
|  |  |  | # 领地争夺战 | 
|---|
|  |  |  | #PlayerManorWar.OnMapServerInitOK() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 特惠活动 | 
|---|
|  |  |  | #GameWorldActionTeHui.OnMapServerInitOK() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 商店信息 | 
|---|
|  |  |  | #GameWorldShopItem.OnMapServerInitOK() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 跨服服务器状态 | 
|---|
|  |  |  | isCrossServerOpen = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_CrossServerOpen) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # 跨服PK | 
|---|
|  |  |  | CrossRealmPK.OnMapServerInitOK() | 
|---|
|  |  |  | # 本服竞技场 | 
|---|
|  |  |  | GameWorldArena.SendMapServerArenaInfo() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SendAllMapGlobalDropInfo() # 全局掉落控制 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SendMapCommMapLinePlayerCount(True) # 同步一次普通地图线路人数信息 | 
|---|
|  |  |  | #随机假仙盟 | 
|---|
|  |  |  | PlayerFamily.RandomFakeFamily() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #缥缈仙域 | 
|---|
|  |  |  | PlayerFairyDomain.OnMapServerInitOK() | 
|---|
|  |  |  | # 记录服务器是否正常开启完毕 | 
|---|
|  |  |  | getUrl = ReadChConfig.GetPyMongoConfig("EventReport", "OpenStateUrl") + "?Type=MapInit&MapCount=%s"%GameWorld.GetGameWorld().GetGameMapManager().GetCount() | 
|---|
|  |  |  | GameWorld.GetGameWorld().EventReport_EventReport("", "", "", "", 0, getUrl) | 
|---|
|  |  |  | 
|---|
|  |  |  | PlayerTeam.OnServerClose(tick) | 
|---|
|  |  |  | ChPlayer.SavePlayerLVData() | 
|---|
|  |  |  | PlayerFBHelpBattle.OnServerClose() | 
|---|
|  |  |  | GameWorldArena.OnServerClose() | 
|---|
|  |  |  | GameWorld.Log("通知C++关服!") | 
|---|
|  |  |  | GameWorld.GetGameWorld().OnServerClose() | 
|---|
|  |  |  |  | 
|---|