| | |
| | | import ChItem
|
| | | import GameLogic_Tianzi
|
| | | import PlayerGoldInvest
|
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import PlayerCostRebate
|
| | | import CrossActCTGBillboard
|
| | | import CrossActAllRecharge
|
| | | import PlayerActCollectWords
|
| | | import PlayerActTotalRecharge
|
| | | import PlayerActLianqi
|
| | | import PlayerActGodGift
|
| | | import PlayerActFamilyGCZ
|
| | | import PlayerActFamilyCTGAssist
|
| | | import PlayerActRechargeRebateGold
|
| | | import PlayerActManyDayRecharge
|
| | | import PlayerActSingleRecharge
|
| | | import PlayerActRechargePrize
|
| | | import PlayerActGrowupBuy
|
| | | import PlayerActTurntable
|
| | | import PlayerActBuyOne
|
| | | import PlayerSpringSale
|
| | | import PlayerWeekParty
|
| | | import PlayerFeastWeekParty
|
| | | import PlayerFeastLogin
|
| | | import PlayerFeastWish
|
| | | import PlayerActTask
|
| | | import PlayerActYunshi
|
| | | import PlayerActLunhuidian
|
| | | import PlayerActBuyCountGift
|
| | | import PlayerActLoginNew
|
| | | import PlayerActLogin
|
| | | import PlayerFlashGiftbag
|
| | | import PlayerDailyGiftbag
|
| | | import PlayerOfflineSupport
|
| | | import PlayerLuckyCloudBuy
|
| | | import PlayerLuckyTreasure
|
| | | import PlayerTongTianLing
|
| | | import PlayerFlashSale
|
| | | import PlayerWishingWell
|
| | | import CrossPlayerData
|
| | | import PlayerTreasure
|
| | | import PlayerZhanling
|
| | | import PlayerLove
|
| | |
| | |
|
| | | # 其他跨服功能
|
| | |
|
| | | # 游戏服额外处理玩家
|
| | | if GameWorld.IsMainServer():
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.OnlineCount()):
|
| | | curPlayer = playerManager.OnlineAt(i)
|
| | | if not GameWorld.IsNormalPlayer(curPlayer):
|
| | | continue
|
| | | PlayerOnCrossCenterEvent(curPlayer, centerEventValue)
|
| | | |
| | | PlayerBillboard.OnDay(centerEventValue)
|
| | | return
|
| | |
|
| | |
| | | return
|
| | |
|
| | | #--------------------------------------------------------
|
| | | def PlayerOnCrossCenterEvent(curPlayer, centerEventValue=0):
|
| | | def PlayerOnCrossCenterEvent(curPlayer, centerEventValue=0, gmEvent=""):
|
| | | ## 跨服中心过天
|
| | | if not centerEventValue:
|
| | | centerEventValue = DBDataMgr.GetEventTrigMgr().GetValue(ShareDefine.Def_CrossCenterEvent)
|
| | |
| | | playerEventValue = centerEventValue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnCrossEvent, centerEventValue)
|
| | |
|
| | | if playerEventValue == centerEventValue:
|
| | | if playerEventValue == centerEventValue and not gmEvent:
|
| | | return
|
| | |
|
| | | centerEventTime = GameWorld.ChangeStrToDatetime("%s:%02d:%02d" % centerEventValue, ChConfig.TYPE_Time_Format_YmdHMS)
|
| | | playerEventTime = GameWorld.ChangeStrToDatetime("%s:%02d:%02d" % playerEventValue, ChConfig.TYPE_Time_Format_YmdHMS)
|
| | | centerEventTime = GameWorld.ChangeStrToDatetime("%s" % centerEventValue, ChConfig.TYPE_Time_Format_YmdH)
|
| | | playerEventTime = GameWorld.ChangeStrToDatetime("%s" % playerEventValue, ChConfig.TYPE_Time_Format_YmdH)
|
| | |
|
| | | center_Day = centerEventTime.day
|
| | | center_Month = centerEventTime.month
|
| | |
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnCrossEvent, centerEventValue)
|
| | |
|
| | | if (center_Day != player_Day or center_Month != player_Month or center_Year != player_Year):
|
| | | if (center_Day != player_Day or center_Month != player_Month or center_Year != player_Year or gmEvent == "GMOnDay"):
|
| | | PlayerCrossCenterOnDay(curPlayer, centerEventValue)
|
| | |
|
| | | return
|
| | |
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | #记录玩家字典值,待初始化后执行
|
| | | if not curPlayer.GetGameServerInitOK():
|
| | | GameServerRefresh.Set_PlayerGameServerInitOK_OnDay(curPlayer , 1)
|
| | | return
|
| | | #GameServer已废弃,不再验证
|
| | | #if not curPlayer.GetGameServerInitOK():
|
| | | # GameServerRefresh.Set_PlayerGameServerInitOK_OnDay(curPlayer , 1)
|
| | | # return
|
| | |
|
| | | ondayValue = __Get_Can_OnDay(curPlayer)
|
| | | if not ondayValue:
|
| | |
| | | PlayerFreeGoods.OnDay(curPlayer)
|
| | | #采集次数重置
|
| | | NPCCommon.PlayerOnDay(curPlayer)
|
| | | #跨服竞技场
|
| | | PlayerCrossRealmPK.DoPlayerOnDay(curPlayer)
|
| | | #跨服排位
|
| | | PlayerCrossChampionship.DoPlayerOnDay(curPlayer)
|
| | | #竞技场
|
| | | PlayerArena.OnDayEx(curPlayer)
|
| | | #特殊时间点过天的,一般是游戏功能,此时立即同步一次跨服玩家数据
|
| | | CrossPlayerData.SendMergePlayerDataNow(curPlayer)
|
| | |
|
| | | # 以下为支持两种重置模式切换配置的
|
| | | FBCommon.FBOnDay(curPlayer, onEventType)
|
| | | #许愿池
|
| | | PlayerWishingWell.OnDay(curPlayer)
|
| | | #通天令
|
| | | PlayerTongTianLing.OnDay(curPlayer, onEventType)
|
| | | #任务活动
|
| | | PlayerActTask.OnDay(curPlayer)
|
| | | #登录活动
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def PlayerOnWeek(curPlayer):
|
| | | #记录玩家字典值,待初始化后执行
|
| | | if not curPlayer.GetGameServerInitOK():
|
| | | GameServerRefresh.Set_PlayerGameServerInitOK_OnWeek(curPlayer , 1)
|
| | | return
|
| | | #GameServer已废弃,不再验证
|
| | | #if not curPlayer.GetGameServerInitOK():
|
| | | # GameServerRefresh.Set_PlayerGameServerInitOK_OnWeek(curPlayer , 1)
|
| | | # return
|
| | |
|
| | | onWeekValue = __Get_Can_OnWeek(curPlayer)
|
| | | if not onWeekValue:
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def PlayerOnMonth(curPlayer):
|
| | | #记录玩家字典值,待初始化后执行
|
| | | if not curPlayer.GetGameServerInitOK():
|
| | | GameServerRefresh.Set_PlayerGameServerInitOK_OnMonth(curPlayer , 1)
|
| | | return
|
| | | #GameServer已废弃,不再验证
|
| | | #if not curPlayer.GetGameServerInitOK():
|
| | | # GameServerRefresh.Set_PlayerGameServerInitOK_OnMonth(curPlayer , 1)
|
| | | # return
|
| | |
|
| | | onMonthValue = __Get_Can_OnMonth(curPlayer)
|
| | | if not onMonthValue:
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def PlayerOnYear(curPlayer):
|
| | | #记录玩家字典值,待初始化后执行
|
| | | if not curPlayer.GetGameServerInitOK():
|
| | | GameServerRefresh.Set_PlayerGameServerInitOK_OnYear(curPlayer , 1)
|
| | | return
|
| | | #GameServer已废弃,不再验证
|
| | | #if not curPlayer.GetGameServerInitOK():
|
| | | # GameServerRefresh.Set_PlayerGameServerInitOK_OnYear(curPlayer , 1)
|
| | | # return
|
| | |
|
| | | curPlayerID = curPlayer.GetPlayerID()
|
| | |
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def PlayerOnHour(curPlayer):
|
| | | #记录玩家字典值,待初始化后执行
|
| | | if not curPlayer.GetGameServerInitOK():
|
| | | GameServerRefresh.Set_PlayerGameServerInitOK_OnHour(curPlayer , 1)
|
| | | return
|
| | | #GameServer已废弃,不再验证
|
| | | #if not curPlayer.GetGameServerInitOK():
|
| | | # GameServerRefresh.Set_PlayerGameServerInitOK_OnHour(curPlayer , 1)
|
| | | # return
|
| | |
|
| | | curPlayerID = curPlayer.GetPlayerID()
|
| | |
|
| | |
| | | PlayerControl.SetCoupleInfo(playerID, coupleInfo)
|
| | | return
|
| | |
|
| | | if key.startswith(ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]): |
| | | keyHead = ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]
|
| | | actionName = key[len(keyHead):]
|
| | | actInfo = eval(msgValue)
|
| | | actNum = actInfo.get(ShareDefine.ActKey_ActNum, 0)
|
| | | if actionName in ShareDefine.MultiActNumOperationActNameList:
|
| | | if not actNum:
|
| | | GameWorld.ErrLog('MultiActNumOperation can not found actNum. actionName=%s,msg = %s' % (actionName, msg))
|
| | | return
|
| | | if actionName not in PyGameData.g_operationActionDict:
|
| | | PyGameData.g_operationActionDict[actionName] = {}
|
| | | PyGameData.g_operationActionDict[actionName][actNum] = actInfo
|
| | | else:
|
| | | PyGameData.g_operationActionDict[actionName] = actInfo
|
| | | |
| | | if actionName == ShareDefine.OperationActionName_ExpRate:
|
| | | PlayerControl.RefreshOperationAction_ExpRate()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_CostRebate:
|
| | | PlayerCostRebate.RefreshCostRebateActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_TotalRecharge:
|
| | | PlayerActTotalRecharge.RefreshTotalRechargeActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_GodGift:
|
| | | PlayerActGodGift.RefreshGodGiftActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_ManyDayRecharge:
|
| | | PlayerActManyDayRecharge.RefreshManyDayRechargeActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_SingleRecharge:
|
| | | PlayerActSingleRecharge.RefreshSingleRechargeActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_Turntable:
|
| | | PlayerActTurntable.RefreshTurntableActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_SpringSale:
|
| | | PlayerSpringSale.RefreshSpringSaleActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_FlashGiftbag:
|
| | | PlayerFlashGiftbag.RefreshFlashGiftbagActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_DailyGiftbag:
|
| | | PlayerDailyGiftbag.RefreshDailyGiftbagActionInfo()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_BuyOne:
|
| | | PlayerActBuyOne.RefreshBuyOneActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_FamilyCTGAssist:
|
| | | PlayerActFamilyCTGAssist.RefreshFamilyCTGAssistActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_FlashSale:
|
| | | PlayerFlashSale.RefreshflashSaleActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_WishingWell:
|
| | | PlayerWishingWell.RefreshWishingWellAction()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_CollectWords:
|
| | | PlayerActCollectWords.RefreshActCollectWordsInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_WeekParty:
|
| | | PlayerWeekParty.RefreshOperationAction_WeekParty()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_BuyCountGift:
|
| | | PlayerActBuyCountGift.RefreshBuyCountGiftActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_ActTask:
|
| | | PlayerActTask.RefreshActTaskActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_Yunshi:
|
| | | PlayerActYunshi.RefreshActYunshiActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_Lunhuidian:
|
| | | PlayerActLunhuidian.RefreshActLunhuidianActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_LoginAward:
|
| | | PlayerActLogin.RefreshOperationAction_LoginAward()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_ActLoginNew:
|
| | | PlayerActLoginNew.RefreshActLoginActionInfo(actNum)
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_FeastLogin:
|
| | | PlayerFeastLogin.RefreshFeastLoginActionInfo()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_FeastWish:
|
| | | PlayerFeastWish.RefreshFeastWishActionInfo()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_FeastWeekParty:
|
| | | PlayerFeastWeekParty.RefreshOperationAction_FeastWeekParty()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_LuckyTreasure:
|
| | | PlayerLuckyTreasure.RefreshLuckyTreasureAction()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_RechargePrize:
|
| | | PlayerActRechargePrize.RefreshRechargePrizeActionInfo()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_GrowupBuy:
|
| | | PlayerActGrowupBuy.RefreshGrowupBuyActionInfo()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_RechargeRebateGold:
|
| | | PlayerActRechargeRebateGold.RefreshRechargeRebateGoldActionInfo()
|
| | | |
| | | if key.startswith(ShareDefine.Def_Notify_WorldKey_OperationActionInfo[:-2]):
|
| | | # 运营活动改为通过 GameWorldAction.OnMapOperationActionRefresh 触发刷新
|
| | | return
|
| | |
|
| | | if key.startswith(ShareDefine.Def_Notify_WorldKey_CrossActInfo[:-2]):
|
| | |
| | | #GameWorld.DebugLog("跨服服务器地图,不处理")
|
| | | return
|
| | |
|
| | | if actionName == ShareDefine.CrossActName_CTGBillboard:
|
| | | CrossActCTGBillboard.RefreshCrossActCTGBillboardInfo()
|
| | | |
| | | elif actionName == ShareDefine.CrossActName_AllRecharge:
|
| | | CrossActAllRecharge.RefreshCrossActAllRechargeInfo()
|
| | | |
| | | elif actionName == ShareDefine.CrossActName_Lianqi:
|
| | | PlayerActLianqi.RefreshCrossActLianqiInfo()
|
| | | |
| | | elif actionName == ShareDefine.CrossActName_FamilyGCZ:
|
| | | PlayerActFamilyGCZ.RefreshActFamilyGCZInfo()
|
| | | |
| | | return
|
| | |
|
| | | if key == ShareDefine.Def_Notify_WorldKey_CrossZoneName:
|
| | | PyGameData.g_crossZoneName = msgValue
|
| | | return
|
| | | |
| | | # 幸运云购
|
| | | if key == ShareDefine.Def_Notify_WorldKey_LuckyCloudBuyInfo:
|
| | | PyGameData.g_luckyCloudBuyInfo = eval(msgValue)
|
| | | PlayerLuckyCloudBuy.OnLuckyCloudBuyChange()
|
| | | return
|
| | |
|
| | | if msgValue.isdigit():
|
| | |
| | | # elif key == ShareDefine.Def_Notify_WorldKey_MapServerScriptReloadVersion:
|
| | | # ReloadModule.DoMapServerScriptReload(value, tick)
|
| | | #===============================================================================================
|
| | | |
| | | # 跨服PK
|
| | | elif key == ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID:
|
| | | PlayerCrossRealmPK.OnCrossRealmPKSeasonChange(value)
|
| | | |
| | | #通用设置
|
| | | befValue = gameWorldMgr.GetGameWorldDictByKey(key)
|
| | | gameWorldMgr.SetGameWorldDict(key, value)
|