6211 【后端】【1.6】合服任务单(删除旧合服相关内容)
| | |
| | | ShareDefine.Def_BT_RechargeTeHuiLast : 20, #充值特惠活动排行榜-上一期记录
|
| | | ShareDefine.Def_BT_RechargeTeHui : 20, #充值特惠活动排行榜-当前期记录
|
| | |
|
| | | ShareDefine.Def_BT_MixCampaign_PlayerBattle : 2, #战力榜(合服活动)
|
| | | ShareDefine.Def_BT_MixCampaign_Recharge : 2, #累计充值榜(合服活动)
|
| | | ShareDefine.Def_BT_MixCampaign_WinFamilyMember:1, #获胜战盟成员(合服活动)
|
| | | ShareDefine.Def_BT_MixCampaign_FamilyKillBoss: 1, #战盟击杀boss(合服活动)
|
| | | |
| | | ShareDefine.Def_BT_CostTeHui : 10, #消费特惠排行榜
|
| | | ShareDefine.Def_BT_CostTeHuiLast : 10, #消费特惠排行榜上一期
|
| | | }
|
| | |
| | | import PlayerEventCounter
|
| | | import ShareDefine
|
| | | import PlayerBillboard
|
| | | import GameWorldMixServerCampaign
|
| | | import PlayerUniversalGameRec
|
| | | import GameWorldActionTeHui
|
| | | import GameWorldProcess
|
| | |
| | | PlayerDBGSEvent.SetInitOpenServerTime(curTime)
|
| | | openServerWeekday = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OpenServerWeekday)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_OpenServerWeekday, openServerWeekday)
|
| | | # 重置数据记录及领奖状态
|
| | | for campaignType in ShareDefine.Def_Campaign_Type_List:
|
| | | GameWorld.GetGameWorld().SetDict(ShareDefine.Def_Notify_WorldKey_MixServerCampaignSaveData % campaignType, 0)
|
| | | GameWorld.GetGameWorld().SetDict(ShareDefine.Def_Notify_WorldKey_MixServerCampaignGetAward % campaignType, 0)
|
| | |
|
| | | # 通知开服活动状态
|
| | | GameWorldMixServerCampaign.UpdateMixServerCampaignState(True)
|
| | | # 清除开服活动相关排行榜
|
| | | for oscBillboardType in ShareDefine.Def_Campaign_Billboard_Dict.values():
|
| | | PlayerBillboard.ClearBillboardByIndex(oscBillboardType)
|
| | |
|
| | | # 清除合服活动相关排行榜
|
| | | for copyType in GameWorldMixServerCampaign.Def_MixAward_Billboard_Copy_Dict.values():
|
| | | PlayerBillboard.ClearBillboardByIndex(copyType)
|
| | | for billboardCampaignType in ShareDefine.Def_MixCampaign_Billboard_Dict.values():
|
| | | PlayerBillboard.ClearBillboardByIndex(billboardCampaignType)
|
| | | |
| | | # 清除竞技场数据
|
| | | # GameWorld.GetHightLadderMgr().ClearAllPlayer()
|
| | | # HighLadder.Sync_HightLadderCanFightPlayer(curPlayer, curPlayer.GetPlayerID())
|
| | |
| | | import GameWorld
|
| | | import PlayerDBGSEvent
|
| | | import PlayerEventCounter
|
| | | import GameWorldActionTeHui
|
| | | import GameWorldMixServerCampaign
|
| | | import PlayerBillboard
|
| | | import ShareDefine
|
| | | import GMCommon
|
| | | #---------------------------------------------------------------------
|
| | |
| | | def OnExec(curPlayer, cmdList):
|
| | |
|
| | | if len(cmdList) <= 0:
|
| | | GameWorld.DebugAnswer(curPlayer, 'SetMixServer 合服状态(0-非合服,1-合服), 合服时的开服天(选填默认15)')
|
| | | GameWorld.DebugAnswer(curPlayer, 'SetMixServer 合服状态(0-非合服,1-合服) 合服时的开服天(选填默认15)')
|
| | | return
|
| | |
|
| | | isMix = cmdList[0]
|
| | | curDay = cmdList[1] if len(cmdList) > 1 else 15
|
| | |
|
| | | if isMix:
|
| | | #(清世界等级)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv, 0)
|
| | | #通知地图服务器当前世界等级
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_WorldAverageLv, 0)
|
| | | |
| | | #设置合服(默认设置开服天为15天)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer, 1)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay, 0)
|
| | |
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay, 0)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay, curDay)
|
| | |
|
| | |
|
| | | openDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|
| | | isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer)
|
| | | mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay)
|
| | |
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_ServerDay, openDay)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_IsMixServer, isMixServer)
|
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_MixServerDay, mixServerDay)
|
| | | |
| | | PlayerEventCounter.Sync_OpenServerDay(curPlayer)
|
| | | |
| | | GameWorldMixServerCampaign.UpdateMixServerCampaignState(True)
|
| | |
|
| | | # 清除合服活动相关排行榜
|
| | | for copyType in GameWorldMixServerCampaign.Def_MixAward_Billboard_Copy_Dict.values():
|
| | | PlayerBillboard.ClearBillboardByIndex(copyType)
|
| | | for billboardCampaignType in ShareDefine.Def_MixCampaign_Billboard_Dict.values():
|
| | | PlayerBillboard.ClearBillboardByIndex(billboardCampaignType)
|
| | | |
| | | # 重置数据记录及领奖状态
|
| | | for campaignType in ShareDefine.Def_Campaign_Type_List:
|
| | | GameWorld.GetGameWorld().SetDict(ShareDefine.Def_Notify_WorldKey_MixServerCampaignSaveData % campaignType, 0)
|
| | | GameWorld.GetGameWorld().SetDict(ShareDefine.Def_Notify_WorldKey_MixServerCampaignGetAward % campaignType, 0)
|
| | | |
| | | # 清除特惠活动数据
|
| | | GameWorldActionTeHui.OnGMClearTeHui()
|
| | |
|
| | | # 刷新一次活动
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | GMCommon.ActionControlRefresh(tick)
|
| | |
|
| | | PlayerEventCounter.Sync_OpenServerDay(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, '设置合服状态成功!当前开服天数:%s, 是否合服:%s, 当前合服天数:%s'
|
| | | % (openDay, isMixServer, mixServerDay))
|
| | | % (PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay) + 1,
|
| | | PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer),
|
| | | PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay) + 1))
|
| | | return
|
| | |
|
| | |
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FBOpenRecord, fbOpenRecord)
|
| | | return
|
| | |
|
| | | ## 处理重开服务器后, 活动继续开启逻辑根据天数
|
| | | # @param tick 当前时间 |
| | | # @return None
|
| | | def Dispose_Action_GoOn_ByDay(tick):
|
| | | #已固定在每整分钟触发,故暂不需要时间间隔控制
|
| | | #if not GameWorld.SetWorldDictKey(ChConfig.TYPE_ActionOpenAndCloseByDayCountGoOn, tick):
|
| | | # #间隔未到
|
| | | # return
|
| | | |
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | |
| | | Dispose_ActionGoOnByDayKey()
|
| | | return
|
| | |
|
| | | ## 当前时间与指定时间比较
|
| | | # @param curTime 当前服务器时间
|
| | | # @param timeInfo 指定时间 [[3,4(星期几)], 年,月,日,时,分]
|
| | |
| | | return
|
| | |
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | ## 根据活动开启的活动事件OnDay
|
| | | # @param None: |
| | | # @return: None
|
| | | def DoLogic_ActionByDayKeyOnDay():
|
| | | openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|
| | | isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer)
|
| | | mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay)
|
| | | repeatDayInfo = ReadChConfig.GetEvalChConfig('ActionControlByDayKeyRepeat')
|
| | | startRepeatOpenDay, startRepeatMixDay, repeatList = repeatDayInfo
|
| | | # 不是循环阶段 |
| | | if openServerDay < startRepeatOpenDay or (isMixServer and mixServerDay < startRepeatMixDay):
|
| | | GameWorld.Log("没有正式进入周期循环,不处理!")
|
| | | return
|
| | | |
| | | Def_RepeatOrderKey = PlayerDBGSEvent.Def_TeHuiRepeatOrderKey
|
| | | Def_RepeatNumKey = PlayerDBGSEvent.Def_TeHuiRepeatNumKey
|
| | | |
| | | # 强制更新一次世界等级
|
| | | GameWorldAverageLv.OpenWorldAverageLv()
|
| | | |
| | | repeatOrder = PlayerDBGSEvent.GetDBGSTrig_ByKey(Def_RepeatOrderKey)
|
| | | repeatOrder = "" if not repeatOrder else str(repeatOrder)
|
| | | preRepeatNum = PlayerDBGSEvent.GetDBGSTrig_ByKey(Def_RepeatNumKey)
|
| | | preRepeatNum = "" if not preRepeatNum else str(preRepeatNum)
|
| | | worldAverageLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | GameWorld.Log("处理周期循环: openServerDay=%s,isMixServer=%s,mixServerDay=%s" % (openServerDay, isMixServer, mixServerDay))
|
| | | GameWorld.Log(" startRepeatOpenDay=%s,startRepeatMixDay=%s,repeatOrder=%s,preRepeatNum=%s,worldAverageLV=%s" |
| | | % (startRepeatOpenDay, startRepeatMixDay, repeatOrder, preRepeatNum, worldAverageLV))
|
| | | |
| | | # 开始循环
|
| | | if openServerDay == startRepeatOpenDay or (isMixServer and mixServerDay == startRepeatMixDay):
|
| | | repeatOrder = ""
|
| | | for i, repeatInfo in enumerate(repeatList, 1):
|
| | | if i > 9:
|
| | | break
|
| | | needWorldAverageLV = repeatInfo[0]
|
| | | if worldAverageLV < needWorldAverageLV:
|
| | | continue
|
| | | repeatOrder = "%s%s" % (repeatOrder, i)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(Def_RepeatOrderKey, GameWorld.ToIntDef(repeatOrder))
|
| | | GameWorld.Log(" 开始循环, 生成循环编号顺序: %s" % repeatOrder)
|
| | | |
| | | # 还没全部开始循环,则判断是否有动态新插入的循环
|
| | | elif len(repeatOrder) < len(repeatList):
|
| | | GameWorld.Log(" 还没全部开始循环,判断是否有动态新插入的循环..")
|
| | | for i, repeatInfo in enumerate(repeatList, 1):
|
| | | if i > 9:
|
| | | break
|
| | | if str(i) in repeatOrder: # 已经在循环里的不处理
|
| | | continue
|
| | | needWorldAverageLV = repeatInfo[0]
|
| | | if worldAverageLV < needWorldAverageLV:
|
| | | continue
|
| | | |
| | | # 插入新循环
|
| | | if preRepeatNum in repeatOrder:
|
| | | insertIndex = repeatOrder.index(preRepeatNum)
|
| | | repeatOrder = repeatOrder[:insertIndex + 1] + str(i) + repeatOrder[insertIndex + 1:]
|
| | | else:
|
| | | repeatOrder = str(i)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(Def_RepeatOrderKey, GameWorld.ToIntDef(repeatOrder))
|
| | | GameWorld.Log(" 编号%s, needWorldAverageLV=%s,插入循环,更新循环编号顺序: %s" % (i, needWorldAverageLV, repeatOrder))
|
| | | break
|
| | | |
| | | if not repeatOrder:
|
| | | GameWorld.Log(" 没有可循环的活动!")
|
| | | return
|
| | | |
| | | # 进入下一天循环编号
|
| | | if preRepeatNum and preRepeatNum in repeatOrder:
|
| | | nextRepeatIndex = repeatOrder.index(preRepeatNum) + 1
|
| | | nextRepeatIndex = 0 if nextRepeatIndex >= len(repeatOrder) else nextRepeatIndex
|
| | | else:
|
| | | nextRepeatIndex = 0
|
| | | nextRepeatNum = GameWorld.ToIntDef(repeatOrder[nextRepeatIndex])
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(Def_RepeatNumKey, nextRepeatNum)
|
| | | if nextRepeatNum <= 0 or nextRepeatNum > len(repeatList):
|
| | | GameWorld.Log(" 下一个循环编号错误!nextRepeatNum=%s" % nextRepeatNum)
|
| | | return
|
| | | |
| | | GameWorld.Log(" 过天变更循环活动状态, nextRepeatNum=%s" % nextRepeatNum)
|
| | | |
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | nextRepeatDict = repeatList[nextRepeatNum - 1][1]
|
| | | for dictName, signID in nextRepeatDict.items():
|
| | | # 已经是这个值不处理
|
| | | if gameWorld.GetDictByKey(dictName) == signID:
|
| | | #GameWorld.DebugLog(" 已经是这个值不处理dictName=%s,signID=%s" % (dictName,signID))
|
| | | continue
|
| | | |
| | | # 默认当前的0点开始到当天的23点59分
|
| | | curDay, beginDay, beginH, beginM, endDay, endH, endM = 0, 0, 0, 0, 0, 23, 59
|
| | | __ChangeDA_ActionSign(gameWorld, dictName, signID, curDay, beginDay, beginH, beginM, endDay, endH, endM)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
|
| | | ## 处理重开服务器后, 活动继续开启逻辑根据天数key
|
| | | # @param None
|
| | | # @return None
|
| | | def Dispose_ActionGoOnByDayKey():
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | GameWorld.DebugLog("处理特惠状态信息...")
|
| | | openServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|
| | | isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer)
|
| | | mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay)
|
| | | allActionGoOnInfo = ReadChConfig.GetEvalChConfig("ActionControlByDayKeyGoOn")
|
| | | |
| | | if not isMixServer:
|
| | | __DoActionGoOnByDayKeyCheck(allActionGoOnInfo[0], openServerDay)
|
| | | else:
|
| | | __DoActionGoOnByDayKeyCheck(allActionGoOnInfo[1], mixServerDay)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ## 按天开启可循环活动检查
|
| | | # @param controlList: |
| | | # @return: None
|
| | | def __DoActionGoOnByDayKeyCheck(goOnList, curDay):
|
| | | curTime = GameWorld.GetServerTime()
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | for goOnControl in goOnList:
|
| | | beginDay, beginH, beginM = goOnControl[0]
|
| | | endDay, endH, endM = goOnControl[1]
|
| | | if curDay < beginDay or curDay > endDay:
|
| | | #活动不在这一时间段
|
| | | #GameWorld.DebugLog("活动不在这一时间段curDay=%s < beginDay=%s or curDay > endDay=%s" |
| | | # % (curDay,beginDay,endDay))
|
| | | continue
|
| | | |
| | | dictName = goOnControl[2] # 字典名
|
| | | signID = goOnControl[3] # 标记
|
| | | |
| | | # 已经是这个值不处理
|
| | | if gameWorld.GetDictByKey(dictName) == signID:
|
| | | #GameWorld.DebugLog("已经是这个值不处理dictName=%s,signID=%s" % (dictName,signID))
|
| | | continue
|
| | |
|
| | | beginTime = ['-', '-', '-', '-', beginH, beginM]
|
| | | endTime = ['-', '-', '-', '-', endH, endM]
|
| | | #还没开始
|
| | | if curDay == beginDay and CompareActTime(curTime, beginTime) == ChConfig.Def_Cmp_Lower:
|
| | | #GameWorld.DebugLog("还没开始...")
|
| | | continue
|
| | | |
| | | #已经结束
|
| | | if curDay == endDay and CompareActTime(curTime, endTime) == ChConfig.Def_Cmp_Greater:
|
| | | #GameWorld.DebugLog("已经结束...")
|
| | | continue
|
| | | |
| | | __ChangeDA_ActionSign(gameWorld, dictName, signID, curDay, beginDay, beginH, beginM, endDay, endH, endM)
|
| | | |
| | | return
|
| | |
|
| | | def __ChangeDA_ActionSign(gameWorld, dictName, signID, curDay, beginDay, beginH, beginM, endDay, endH, endM):
|
| | | # 计算开始及结束日期
|
| | | beginTime, endTime = GetBeginEndTimeByDay(dictName, curDay, beginDay, beginH, beginM, endDay, endH, endM)
|
| | | |
| | | actionID = int(time.time())
|
| | | GameWorld.Log('活动状态变更: dictName=%s,signID=%s,beginTime=%s,endTime=%s,actionID=%s' |
| | | % (dictName, signID, beginTime, endTime, actionID))
|
| | | |
| | | #潜规则:在ChConfig活动相关设置中,提取了字典名
|
| | | gameWorld.SetDict(dictName, signID)
|
| | | gameWorld.SetDict(ShareDefine.Def_Notify_WorldKey_DayAction_BeginTime % dictName, beginTime)
|
| | | gameWorld.SetDict(ShareDefine.Def_Notify_WorldKey_DayAction_EndTime % dictName, endTime)
|
| | | # 标记活动唯一id
|
| | | actionIDKey = ShareDefine.Def_Notify_WorldKey_DayAction_ID % dictName
|
| | | gameWorld.SetDict(actionIDKey, actionID)
|
| | | |
| | | #通知Mapserver,设置字典
|
| | | GameWorld.SendMapServerMsgEx(actionIDKey, actionID)
|
| | | GameWorld.SendMapServerMsgEx(dictName, signID)
|
| | | |
| | | #处理GameServer活动逻辑
|
| | | __DoLogic_GameServer_ActionState(dictName, signID)
|
| | | return
|
| | |
|
| | | ## 获取开启结束时间
|
| | | # @param tick |
| | | # @return None
|
| | | def GetBeginEndTimeByDay(dictName, curDay, beginDay, beginH, beginM, endDay, endH, endM):
|
| | | beginDiffDays = max(0, curDay - beginDay)
|
| | | beginDateTime = GameWorld.GetDatetimeBySubDays(beginDiffDays)
|
| | | beginDateTimeStr = str(beginDateTime).split(".")[0]
|
| | | beginDateTimeStr = "%s %02d:%02d:00" % (beginDateTimeStr[:10], beginH, beginM)
|
| | | beginTimeNum = GameWorld.ChangeTimeStrToNum(beginDateTimeStr, ChConfig.TYPE_Time_Format)
|
| | |
|
| | | endDiffDays = max(0, endDay - curDay)
|
| | | endDateTime = GameWorld.GetDatetimeByDiffDays(endDiffDays)
|
| | | endDateTimeStr = str(endDateTime).split(".")[0]
|
| | | endDateTimeStr = "%s %02d:%02d:59" % (endDateTimeStr[:10], endH, endM)
|
| | | endTimeNum = GameWorld.ChangeTimeStrToNum(endDateTimeStr, ChConfig.TYPE_Time_Format)
|
| | | return beginTimeNum, endTimeNum
|
| | |
|
| | |
|
| | |
| | | import GameWorldAverageLv
|
| | | import PlayerDBOper
|
| | | import PlayerGeTui
|
| | | #import GameWorldMixServerCampaign
|
| | | #import PlayerManorWar
|
| | | import GameWorldBoss
|
| | | #import GameWorldActionTeHui
|
| | |
| | | GameWorld.GetFamilyManager().SetFamilyUpperLimitCount(ChConfig.Def_Family_MaxCnt)
|
| | | #排序元宝交易平台
|
| | | GameWorld.GetGameWorld().GetDBGoldOrderFormMgr().Sort()
|
| | | PlayerBillboard.ClearBillboardOnServerInit()
|
| | | #排序排行榜
|
| | | PlayerBillboard.SortServerBillboard()
|
| | | #排序仙盟
|
| | |
| | |
|
| | | #触发节假日活动
|
| | | #GameWorldActionHoliday.ActionHoliday_OpenAndClose(tick, True)
|
| | | #合服活动
|
| | | #GameWorldMixServerCampaign.UpdateMixServerCampaignState(True)
|
| | |
|
| | | #通知世界等级
|
| | | worldLv = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | |
| | | # 上次合服时的开服天数
|
| | | 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)
|
| | |
|
| | | # 通知战盟相关活动开启状态
|
| | | fadState = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_FamilyActivityDayState)
|
| | |
| | | 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)
|
| | |
|
| | |
| | | # 设置本次合服时的开服天数
|
| | | serverDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_ServerDay)
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_LastMixServerDay, serverDay)
|
| | | GameWorld.DebugLog(" 合服首次启动加载成功...")
|
| | | GameWorld.Log(" 合服首次启动加载成功!")
|
| | | 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:
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def ClearBillboardOnServerInit():
|
| | | ##开启服务器重置排行榜处理
|
| | | BillBoardClearSetting = ReadChConfig.GetEvalChConfig("BillBoardClearSetting")
|
| | | |
| | | clearSign, clearIndexList = BillBoardClearSetting
|
| | | |
| | | lastSign = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_ClearBillboardSign)
|
| | | |
| | | if clearSign == lastSign:
|
| | | GameWorld.Log("服务器开启清除排行榜检查:标记相同不用清除clearSign=%s" % (clearSign))
|
| | | return
|
| | | |
| | | for billboardIndex in clearIndexList:
|
| | | |
| | | # 合服累充活动判断
|
| | | if billboardIndex == ShareDefine.Def_BT_MixCampaign_Recharge:
|
| | | isMixServer = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_IsMixServer) # 是否合服
|
| | | mixServerDay = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_MixServerDay) # 合服天数
|
| | |
|
| | | mixType = ShareDefine.Def_MixCampaign_Type_RechargeRank
|
| | | mixServerCampaignDict = ReadChConfig.GetEvalChConfig("MixServerCampaign")
|
| | | campaignInfoList = mixServerCampaignDict.get(mixType, [])
|
| | | dayList = campaignInfoList[0]
|
| | | if not isMixServer or mixServerDay not in dayList:
|
| | | GameWorld.Log('非合服充值活动记录数据期间,不清除累充排行榜(%s)! isMixServer=%s,mixServerDay=%s,dayList=%s' |
| | | % (billboardIndex, isMixServer, mixServerDay, str(dayList)))
|
| | | continue
|
| | | |
| | | # 特惠充值判断
|
| | | elif billboardIndex == ShareDefine.Def_BT_RechargeTeHui:
|
| | | actionNumKey = ShareDefine.Def_Notify_WorldKey_DayAction_RechargeRank
|
| | | actionNum = PlayerDBGSEvent.GetDBGSTrig_ByKey(actionNumKey)
|
| | | if not actionNum:
|
| | | GameWorld.Log('当前没有充值特惠排行活动,不清除排行榜(%s)!' % (billboardIndex))
|
| | | continue
|
| | | |
| | | ClearBillboardByIndex(billboardIndex)
|
| | | |
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_ClearBillboardSign, clearSign)
|
| | | |
| | | GameWorld.Log("服务器开启清除排行榜: lastSign=%s,clearSign=%s,clearIndexList=%s" |
| | | % (lastSign, clearSign, str(clearIndexList)))
|
| | | return
|
| | |
|
| | | def SortServerBillboard():
|
| | | ##排序所有排行榜
|
| | | billboardMgr = GameWorld.GetBillboard()
|
| | |
| | | playerBillBoardData = playerBillBoard.AddToBillboard(billboardDataID)
|
| | |
|
| | | return [playerBillBoard, playerBillBoardData]
|
| | |
|
| | | def MapServer_UpdMSRechargeRankBillboard(cmdList):
|
| | | ##合服活动充值点数排行更新
|
| | | playerID, playerName, playerOpInfo, playerJob, fightPower, familyName, totalChangeCoinPoint = cmdList
|
| | | UpdatePlayerBillboard(playerID, playerName, familyName, ShareDefine.Def_BT_MixCampaign_Recharge,
|
| | | playerJob, fightPower, totalChangeCoinPoint, totalChangeCoinPoint)
|
| | | return
|
| | |
|
| | | def MapServer_UpdateTotalRechargeBillboard(cmdList):
|
| | | ##总充值点数排行更新
|
| | |
| | | #家族更新
|
| | | PlayerFamily.FamilyOnDay(tick)
|
| | |
|
| | | #合服活动
|
| | | #GameWorldMixServerCampaign.MixServerOnDay()
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(i)
|
| | |
| | | GameWorld.DebugLog(' 玩家战盟名变更处理, newFamilyName=%s' % familyName, playerID)
|
| | | #不处理排行榜
|
| | | needChangeFamilyBillboardList = [
|
| | | #ShareDefine.Def_BT_MixCampaign_Recharge, # 累计充值(合服活动)
|
| | | #ShareDefine.Def_BT_RechargeTeHui, # 充值特惠活动排行榜-当前期记录
|
| | | ]
|
| | | billboardMgr = GameWorld.GetBillboard()
|
| | |
| | | import PlayerUniversalGameRec
|
| | | import PlayerFamily
|
| | | import GameWorldOpenServerCampaign
|
| | | import GameWorldMixServerCampaign
|
| | | import ShareDefine
|
| | | import GameDataRecord
|
| | | import GameWorldShopItem
|
| | |
| | | PlayerBillboard.MapServer_UpdateTotalRechargeBillboard(eval(resultName))
|
| | | return
|
| | |
|
| | | if callName == 'UpdMSRechargeRankBillboard': #地图服务器更新玩家合服活动充值总数排行榜
|
| | | PlayerBillboard.MapServer_UpdMSRechargeRankBillboard(eval(resultName))
|
| | | return
|
| | | |
| | | if callName == 'UpdMSFamilyKillBossBillboard': #地图服务器更新玩家合服活动战盟击杀boss总数排行榜
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | GameWorldMixServerCampaign.UpdMixCampaignFamiliyBossCnt(curPlayer, eval(resultName))
|
| | | return
|
| | | |
| | | if callName == 'ExitExam': #地图服务器玩家退出答题
|
| | | PlayerExam.MapServer_ExitAction(srcPlayerID)
|
| | | return
|
| | |
| | | if callName == 'SendInviteCode':
|
| | | #邀请码验证回复
|
| | | resultName = PlayerRecall.PlayerRecall_InviteCode(srcPlayerID, pack.GetQueryID())
|
| | | |
| | | if callName == 'MixServerCampaignAward':
|
| | | #可否领取合服活动奖励
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | resultName = '%s' % GameWorldMixServerCampaign.CanGiveMixCampaignAward(curPlayer, eval(resultName))
|
| | |
|
| | | if callName == 'OpenServerCampaignAward':
|
| | | #可否领取开服活动奖励
|
| | |
| | | Def_Notify_WorldKey_CrossPKSeasonID = "CrossPKSeasonID" # 本服跨服PK当前赛季
|
| | | Def_Notify_WorldKey_CrossPKSeasonState = "CrossPKSeasonState" # 本服跨服PK赛季状态 0-关闭,1-开启中
|
| | |
|
| | | Def_Notify_WorldKey_MixServerCampaignSaveData = "MixServerCampaignSaveData_%s" # 合服活动记录数据时机0-否 1-是
|
| | | Def_Notify_WorldKey_MixServerCampaignGetAward = "MixServerCampaignGetAward_%s" # 合服活动可领奖时机0-否 1-是
|
| | |
|
| | | Def_Notify_WorldKey_GameWorldBossRebornCross = 'BossRebornCross_%s_%s' # 跨服世界boss重生, 参数为(zoneID, bossID)
|
| | | Def_Notify_WorldKey_GameWorldBossReborn = 'BossReborn_%s' # 世界boss重生, 参数为(bossID)
|
| | | Def_Notify_WorldKey_BossKilledCnt = 'BossKilledCnt_%s' # boss击杀次数, 参数为NPCID
|
| | |
| | |
|
| | | Def_Notify_WorldKey_LoginAwardStartDate = 'LoginAwardStartDate_%s' # 登录领取奖励开始时间,参数为活动类型
|
| | | Def_Notify_WorldKey_LoginAwardEndDate = 'LoginAwardEndDate_%s' # 登录领取奖励结束时间,参数为活动类型
|
| | |
|
| | | Def_Notify_WorldKey_ClearBillboardSign = 'ClearBillboardSign' # 清除排行榜标记
|
| | |
|
| | | Def_Notify_WorldKey_RedPacketOutput = 'RedPacketOutput' # 红包产出信息
|
| | |
|
| | |
| | | Def_BT_RechargeTeHuiLast, #充值特惠活动排行榜-上一期记录
|
| | | Def_BT_RechargeTeHui, #充值特惠活动排行榜-当前期记录
|
| | |
|
| | | Def_BT_MixCampaign_PlayerBattle, #总战斗力(合服活动)
|
| | | Def_BT_MixCampaign_Recharge, #累计充值(合服活动)
|
| | | Def_BT_MixCampaign_WinFamilyMember, #获胜战盟成员,按职位排(合服活动)
|
| | | Def_BT_MixCampaign_FamilyKillBoss, #战盟击杀boss(合服活动)
|
| | | |
| | | Def_BT_CostTeHui, #消费特惠排行榜
|
| | | Def_BT_CostTeHuiLast, #消费特惠排行榜上一期
|
| | |
|
| | | Def_BT_Max, #排行榜最大类型
|
| | | ) = range(0, 34 + 2) |
| | | ) = range(0, 30 + 2) |
| | |
|
| | | #职业对应战力排行榜类型
|
| | | JobFightPowerBillboardDict = {
|
| | |
| | | Def_Enter_Truck, #进入骠车
|
| | | ) = range(1, 3)
|
| | |
|
| | | Def_OSC_ValidDay = 6 # 开服活动有效活动天
|
| | | Def_MSC_ValidDay = 5 # 合服活动有效活动天
|
| | |
|
| | | # 开服活动类型标识, 不可超过32
|
| | | Def_Campaign_Type_List = (
|
| | | Def_Campaign_Type_PlusLV, # 强化等级排行 1
|
| | |
| | | Def_CampaignAwardState_None, # 无
|
| | | Def_CampaignAwardState_Allow, # 允许领奖
|
| | | Def_CampaignAwardState_Over, # 领奖结束
|
| | | ) = range(3)
|
| | |
|
| | | #合服活动类型标识
|
| | | Def_MixCampaign_Type_List = (
|
| | | Def_MixCampaign_Type_PlayerBattle, # 总战斗力0
|
| | | Def_MixCampaign_Type_RechargeFirst, # 首充奖励1
|
| | | Def_MixCampaign_Type_RechargeRank, # 累计充值排行奖励2
|
| | | Def_MixCampaign_Type_RechargeCnt, # 累计充值保底奖励3
|
| | | Def_MixCampaign_Type_FamilyWar, # 冰封王座家族战获胜家族成员奖励4
|
| | | Def_MixCampaign_Type_FamilyWarEnter, # 冰封王座参与奖5
|
| | | Def_MixCampaign_Type_FamilyKillBoss, # 战盟击杀boss排行
|
| | | Def_MixCampaign_Type_PlayerKillBoss, # 个人击杀boss
|
| | | ) = range(8)
|
| | |
|
| | | #合服活动类型对应的奖励排行榜
|
| | | Def_MixCampaign_Billboard_Dict = {
|
| | | Def_MixCampaign_Type_PlayerBattle:Def_BT_MixCampaign_PlayerBattle, # 总战斗力
|
| | | Def_MixCampaign_Type_RechargeRank:Def_BT_MixCampaign_Recharge, # 累计充值排行 |
| | | Def_MixCampaign_Type_FamilyWar:Def_BT_MixCampaign_WinFamilyMember, # 获胜战盟成员 |
| | | Def_MixCampaign_Type_FamilyKillBoss:Def_BT_MixCampaign_FamilyKillBoss, # 战盟击杀boss排行 |
| | | }
|
| | |
|
| | | # 直接在MapServer中处理的合服活动类型
|
| | | DoOnMapServerMixCampaignTypeList = [
|
| | | Def_MixCampaign_Type_RechargeFirst,
|
| | | Def_MixCampaign_Type_RechargeCnt,
|
| | | Def_MixCampaign_Type_FamilyWarEnter,
|
| | | Def_MixCampaign_Type_PlayerKillBoss,
|
| | | ]
|
| | | # 合服活动请求GameServer操作类型定义
|
| | | (
|
| | | Def_MSCGameServerQuery_QueryAward, # 查询
|
| | | Def_MSCGameServerQuery_GetAward, # 领奖
|
| | | Def_MSCGameServerQuery_MailAward, # 邮件发送奖励
|
| | | ) = range(3)
|
| | |
|
| | | #队伍最大人数
|
| | |
| | | PacketSubCMD_5=0x26
|
| | | PacketCallFunc_5=QueryFamilyArrestAwardReceiveState
|
| | |
|
| | | PacketCMD_6 = 0xAF
|
| | | PacketSubCMD_6 = 0x02
|
| | | PacketCallFunc_6 = GiveMixServerCampaignAward
|
| | | PacketCMD_6=
|
| | | PacketSubCMD_6=
|
| | | PacketCallFunc_6=
|
| | |
|
| | | PacketCMD_7=0xA2
|
| | | PacketSubCMD_7=0x13
|
| | |
| | | Def_PlayerKey_AtkInterval = "NormalAtkInterval_%s" # 公共技能CD类型
|
| | | Def_PlayerKey_AtkTick = "NormalAtkTick_%s" # 公共技能CD类型
|
| | | Def_PlayerKey_QueryOpenServerAwardState = "QueryOpenServerAwardState" # 查询开服奖励状态
|
| | | Def_PlayerKey_QueryMixServerAwardState = "QueryMixServerAwardState" # 查询合服奖励状态
|
| | | Def_PlayerKey_QueryFamilyStoreTick = "QueryFamilyStoreTick" # 战盟仓库操作tick
|
| | |
|
| | | Def_PlayerKey_QueryMarkIdCardIndex = 'QueryMarkIdCardIndex' # 指定账号生成卡类型
|
| | |
| | | Def_PDict_SuperGiftHasOpen = "SuperGiftHasOpen" # 超值礼包是否开过
|
| | | Def_PDict_DailyGoldChargePrizeRecord = "DailyGoldChargePrizeRecord" # 天天首充领奖记录,0-不可领;1-可领;2-已领
|
| | | Def_PDict_DailyGoldChargeCnt = "DailyGoldChargeCnt" # 当日已充值数
|
| | | Def_PDict_SingleGoldGiftIndex = "SingleGoldGiftIndex" # 单日充值多选一礼包领取状态, 0-未领取,>0已领取索引
|
| | | Def_PDict_UnlimitedGoldGiftCnt = "UnlimitedGoldGiftCnt" # 当日无限领取礼包已领取次数
|
| | | Def_PDict_IsReBorn = "Def_PDict_IsReBorn" # 是否回城复活
|
| | | Def_PDict_FamilyWarDailyReward = "FamilyWarDailyReward" # 王者仙盟每日俸禄领取状态
|
| | | Def_PDict_Family_Contribution = "FamilyContribution" #战盟贡献度
|
| | |
| | | Def_PDict_HighLadder_IsRelCD = "HighLadderIsRelCD" #天梯是否进入真正挑战冷却
|
| | | Def_PDict_HighLadder_WinningStreak = "HighLadderWinningStreak" #天梯连胜场次
|
| | | Def_PDict_HighLadder_HistoryMaxOrder = "HighLadderMaxOrder" #天梯历史最高排名
|
| | | Def_PDict_MixLoginDayState = "PMixLoginDayState" # 合服天登陆状态<按登陆天从低位起0-未领1-可领2-已领>
|
| | | Def_PDict_FestivalLoginState = "FestivalLoginState_%s" # 节日登陆奖励状态_%s表示节日类型<按登陆天从低位起0-未领1-可领2-已领>
|
| | | Def_PDict_Currency = "PlayerCurrency_%s" # 自定义货币类型, 参数[自定义货币类型]
|
| | | Def_PDict_TJGSet = "TJGSet" # 脱机挂系统设定
|
| | |
| | |
|
| | | Def_PDict_LoginClientType = "LoginClientType" # 客户端登录类型
|
| | |
|
| | | Def_PDict_ReUpdBillboardSign = "ReUpdBillboardSign" # 重新同步排行表标记
|
| | | Def_PDict_MSFirstLogin_UpdBillboard = "MSFirstLogin_UpdBillboard" # 合服首登同步排行榜信息
|
| | | Def_PDict_MixLoginDay = "MixLoginDay" # 合服首登处理标记
|
| | |
|
| | |
| | | Def_PDict_OSC_TagAwardRecord = "OSCTagAwardRecord_%s" # 开服活动目标奖励记录, 参数(活动类型), 按奖励位存储是否领取
|
| | | Def_PDict_OSC_RecordData = "OSCRecordData_%s" # 开服活动记录数值, 参数(活动类型)
|
| | | Def_PDict_OSC_EndMailState = "EndMailState" # 开服活动结束发放邮件处理状态, 记录该状态的目的是防止开服活动版本变更导致旧号重复补发奖励;
|
| | |
|
| | | Def_PDict_MixServerCampaign_AwardRecord = "MSCAwardRecord_%s" # 合服活动奖励记录
|
| | | Def_PDict_MixServerCampaign_RecordData = "MSCRecordData_%s" # 合服活动记录数值
|
| | | Def_PDict_MixServerCampaign_MailState = "MSCMailState" # 合服活动结束补发未领奖记录邮件状态, 按类型位二进制存储状态
|
| | |
|
| | | # 坐骑 Def_PDictType_Horse
|
| | | Def_PDict_Horser_LV = "Horser_LV_%d" # 坐骑等级 0代表未激活 1代表1级
|
| | |
| | | SendEventPack("LVAward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ##合服登陆奖励
|
| | | def DR_MixLoginDayAward(curPlayer, getState):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | "rewardState":getState
|
| | | }
|
| | | |
| | | SendEventPack("MixLoginDayAward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 使用新手媒体卡
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param cardStr: 卡号
|
| | |
| | | dataDict["PlayerName"] = curPlayer.GetPlayerName()
|
| | |
|
| | | SendEventPack("OpenServerAward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 合服活动奖励领取情况
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param dataDict: 记录信息字典
|
| | | # @return: None
|
| | | def DR_MixServerAward(curPlayer, dataDict):
|
| | | dataDict["PlayerID"] = curPlayer.GetPlayerID()
|
| | | dataDict["AccID"] = curPlayer.GetAccID()
|
| | | dataDict["PlayerName"] = curPlayer.GetPlayerName()
|
| | | |
| | | SendEventPack("MixServerAward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## GM执行命令操作
|
| | |
| | | #"""Version = 2014-12-09 17:00"""
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | | import PlayerMixLoginDayAward
|
| | | import ClearFightPowerHistor
|
| | | import PlayerControl
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 执行逻辑
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, cmdList):
|
| | | # 清除玩家历史最高战力,防止不上榜
|
| | | ClearFightPowerHistor.OnExec(curPlayer, [])
|
| | |
|
| | | # 重置首登同步排行榜记录
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MSFirstLogin_UpdBillboard, 0)
|
| | |
|
| | | # 重置奖励领取状态
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixLoginDayState, 0)
|
| | | |
| | | # 邮件奖励记录
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixServerCampaign_MailState, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | |
| | | # 重置后通知客户端
|
| | | PlayerMixLoginDayAward.NotifyPlayerAwardState(curPlayer)
|
| | | |
| | | |
| | | if len(cmdList) == 0:
|
| | | for i in ShareDefine.Def_MixCampaign_Type_List:
|
| | | __DoMSCReset(curPlayer, i)
|
| | | return
|
| | | |
| | | campaignType = cmdList[0]
|
| | | if campaignType not in ShareDefine.Def_MixCampaign_Type_List:
|
| | | return
|
| | | |
| | | __DoMSCReset(curPlayer, campaignType)
|
| | | return
|
| | |
|
| | | ## 合服活动领取属性重置
|
| | | # @param curPlayer 当前玩家
|
| | | # @param campaignType 重置类型
|
| | | # @return None
|
| | | def __DoMSCReset(curPlayer, campaignType):
|
| | | # 更新领奖记录
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixServerCampaign_AwardRecord \
|
| | | % campaignType, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixServerCampaign_RecordData \
|
| | | % campaignType, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | GameWorld.DebugAnswer(curPlayer, 'MSCReset %s OK!'%campaignType)
|
| | | return
|
| | |
| | | return
|
| | | ##------------------------------------------------------------------------------
|
| | |
|
| | | ## 合服活动BOSS(勇者大陆)
|
| | | # @param npcRefresh 刷新的npc对象
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def NPCRefresh_63(npcRefresh, tick): return __RefreshMixBoss(npcRefresh, tick)
|
| | | def NPCRefresh_64(npcRefresh, tick): return __RefreshMixBoss(npcRefresh, tick)
|
| | | def NPCRefresh_65(npcRefresh, tick): return __RefreshMixBoss(npcRefresh, tick)
|
| | |
|
| | | ## 合服活动BOSS(勇者大陆)
|
| | | # @param npcRefresh 刷新的npc对象
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | def __RefreshMixBoss(npcRefresh, tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | isMixServer = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_IsMixServer)
|
| | | mixDay = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_MixServerDay)
|
| | | refreshMark = npcRefresh.GetRefreshMark()
|
| | | |
| | | # 配置
|
| | | mixBossInfo = ReadChConfig.GetEvalChConfig("MixBossInfo")
|
| | | curBossInfo = mixBossInfo.get(refreshMark)
|
| | | if not curBossInfo:
|
| | | #GameWorld.DebugLog("__RefreshMixBoss() hasn't configuration refreshMark(%s)"%refreshMark)
|
| | | return
|
| | | npcId, mixTime, refreshTimeList = curBossInfo
|
| | | |
| | | # 合服期间
|
| | | if not isMixServer or mixDay < mixTime[0] or mixDay > mixTime[1]:
|
| | | #GameWorld.DebugLog("__RefreshMixBoss() no mix server")
|
| | | return
|
| | | |
| | | # 一线刷新
|
| | | lineId = GameWorld.GetGameWorld().GetLineID()
|
| | | if lineId != 0:
|
| | | #GameWorld.DebugLog("__RefreshMixBoss() not in 1 line(%s), now"%lineId)
|
| | | return
|
| | | |
| | | # 有怪
|
| | | if npcRefresh.GetCount() > 0:
|
| | | #GameWorld.DebugLog("__RefreshMixBoss() have mix server boss(%s), now"%refreshMark)
|
| | | return
|
| | | |
| | | # 刷新时间匹配
|
| | | curTime = GameWorld.GetCurrentTime()
|
| | | if (curTime.hour, curTime.minute) not in refreshTimeList:
|
| | | #GameWorld.DebugLog("__RefreshMixBoss() npcId(%s) isn't refresh(%s) time(%s)"
|
| | | # % (npcId, str((curTime.hour, curTime.minute)), refreshTimeList))
|
| | | return
|
| | | |
| | | # 刷新Tick 一分钟内不再刷新
|
| | | refreshTickKey = ChConfig.Map_NPC_WorldBossLastReBornTick % npcId
|
| | | lastRefreshTick = gameWorld.GetGameWorldDictByKey(refreshTickKey)
|
| | | if tick - lastRefreshTick <= 60 * 1000:
|
| | | #GameWorld.DebugLog("__RefreshMixBoss() not refresh inside minute, npcID(%s) tick(%s) lastTick(%s)"
|
| | | # % (npcId, tick, lastRefreshTick))
|
| | | return
|
| | | gameWorld.SetGameWorldDict(refreshTickKey, tick)
|
| | | |
| | | # 刷新NPC
|
| | | npcRefresh.Refresh(npcId, ChConfig.Def_SuperBossAngryCount, 1, False)
|
| | | # 初始化NPC
|
| | | __InitNewBornNPC(npcRefresh, tick)
|
| | | |
| | | GameWorld.DebugLog("__RefreshMixBoss() refresh mix server boss npcId(%s) success!!!" % (npcId))
|
| | | return
|
| | |
|
| | | ## 地图M个点随机刷N只怪
|
| | | # @param npcRefresh 刷新实例
|
| | | # @param tick 当前时间
|
| | |
| | | import PlayerLVAward
|
| | | import PlayerGoldGift
|
| | | import PlayerSignDay
|
| | | import MixServerCampaign
|
| | | import PlayerPet
|
| | | import PlayerPrestigeSys
|
| | | import PlayerFamily
|
| | |
| | | import PlayerAttrFruit
|
| | | import PlayerSuccess
|
| | | import PlayerDienstgrad
|
| | | import PlayerMixLoginDayAward
|
| | | import PlayerFreeGoods
|
| | | import PlayerRecover
|
| | | import GameLogic_IceLode
|
| | |
| | | # 开服活动奖励信息
|
| | | OpenServerCampaign.OnOpenServerCampaignLogin(curPlayer)
|
| | | #
|
| | | # # 通知合服奖励领取状态
|
| | | # PlayerMixLoginDayAward.OnLoginNotifyMixLoginDayAward(curPlayer)
|
| | | # |
| | | # # 通知合服奖励
|
| | | # MixServerCampaign.OnMixServerCampaignLogin(curPlayer)
|
| | | # |
| | | # # 节日登陆奖励
|
| | | # PlayerFestivalLogin.OnLoginFestivalLogin(curPlayer)
|
| | |
|
| | |
| | |
|
| | | # 同步排行榜
|
| | | PlayerBillboard.UpdBillboardOnMixServerFirstLogin(curPlayer, lastMixServerDay)
|
| | | |
| | | # 其他
|
| | | # ...
|
| | | # 重置登录奖励领取状态
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixLoginDayState, 0)
|
| | | PlayerMixLoginDayAward.NotifyPlayerAwardState(curPlayer)
|
| | | |
| | | # 重置各合服活动数据
|
| | | for campaignType in ShareDefine.Def_MixCampaign_Type_List:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixServerCampaign_AwardRecord \
|
| | | % campaignType, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixServerCampaign_RecordData \
|
| | | % campaignType, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | |
|
| | |
|
| | | # 重置玩家改名次数
|
| | | UpdatePlayerName.ResetChangeNameCnt(curPlayer)
|
| | |
| | | sendMsg = str(familyIDList)
|
| | | curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_RequestIsFamily, curPlayer.GetID(),
|
| | | 'RequestIsFamily', sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | |
|
| | | #===============================================================================
|
| | | #// AF 02 合服活动奖励 #tagCMMixCampaignAward
|
| | | #
|
| | | #struct tagCMMixCampaignAward
|
| | | #
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE Type; //0-查询;1-领取
|
| | | # DWORD CampaignType; //奖励类型
|
| | | # BYTE Index; //奖励位,领取时用
|
| | | #};
|
| | | #===============================================================================
|
| | | ## 合服活动奖励
|
| | | # @param index: 玩家索引
|
| | | # @param clientData: 封包结构体
|
| | | # @param tick: 时间戳
|
| | | # @return: |
| | | def GiveMixServerCampaignAward(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | |
| | | campaignType = clientData.CampaignType
|
| | | queryType = clientData.Type
|
| | | awardIndex = clientData.Index # 奖励位
|
| | |
|
| | | GameWorld.DebugLog("GiveMixServerCampaignAward campaignType=%s,queryType=%s,awardIndex=%s" |
| | | % (campaignType, queryType, awardIndex))
|
| | | if queryType == ShareDefine.Def_MSCGameServerQuery_MailAward:
|
| | | GameWorld.DebugLog(" 客户端不可发领取合服邮件奖励类型")
|
| | | return
|
| | | |
| | | isMix = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_IsMixServer)
|
| | | if not isMix:
|
| | | GameWorld.ErrLog(" 当前非合服状态!")
|
| | | return |
| | | |
| | | if campaignType not in ShareDefine.Def_MixCampaign_Type_List:
|
| | | GameWorld.ErrLog(" 合服活动类型错误campaignType=%s error! not define" % campaignType)
|
| | | return
|
| | | |
| | | # 如果直接在MapServer中处理,则返回
|
| | | if MixServerCampaign.DoMixServerCampaignOnMapServer(curPlayer, campaignType, queryType, awardIndex):
|
| | | return
|
| | | |
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MixServerCampaign_AwardRecord \
|
| | | % campaignType, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | awardState = GameWorld.GetDataByDigitPlace(awardRecord, awardIndex)
|
| | | |
| | | if awardState == MixServerCampaign.Def_AwardState_Got:
|
| | | if queryType == ShareDefine.Def_MSCGameServerQuery_QueryAward:
|
| | | recordData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MixServerCampaign_RecordData \
|
| | | % campaignType, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | MixServerCampaign.Sync_MixServerCampaignAward(curPlayer, campaignType, awardState, recordData)
|
| | | GameWorld.DebugLog(" 已经领取过该奖励...")
|
| | | return
|
| | |
|
| | | #领奖的需要等待GameServer回包以后才处理下一个封包
|
| | | if queryType != ShareDefine.Def_MSCGameServerQuery_QueryAward:
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_QueryMixServerAwardState) == 1:
|
| | | GameWorld.DebugLog(" 已经在查询中...")
|
| | | return
|
| | | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_QueryMixServerAwardState, 1)
|
| | | |
| | | familyID = curPlayer.GetFamilyID()
|
| | | |
| | | #[请求类型, 活动类型, 领取索引, 家族ID]
|
| | | msgList = [queryType, campaignType, awardIndex, familyID]
|
| | | |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, 'MixServerCampaignAward', \
|
| | | '%s' % (msgList), len(str(msgList)))
|
| | |
|
| | | GameWorld.DebugLog(" msgList=%s" % str(msgList))
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import PlayerControl
|
| | | import ReadChConfig
|
| | | import OpenServerCampaign
|
| | | import MixServerCampaign
|
| | | import PlayerSuccess
|
| | | import GameFuncComm
|
| | | import EventReport
|
| | |
|
| | |
| | | def BillboardOnLogin(curPlayer):
|
| | | # 上线默认同步排行榜
|
| | | UpdatePlayerBillboardOnLeaveServer(curPlayer) #排行榜已实时更新,故上线不再同步
|
| | | |
| | | curSign = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ClearBillboardSign)
|
| | | |
| | | playerSign = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ReUpdBillboardSign)
|
| | | |
| | | if playerSign == curSign:
|
| | | GameWorld.DebugLog("玩家登录检查是否重新同步排行榜!标记相同不同步curSign=%s" % curSign)
|
| | | return
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ReUpdBillboardSign, curSign)
|
| | | GameWorld.DebugLog("玩家登录重新同步排行榜!更新同步标记lastSign=%s,curSign=%s" % (playerSign, curSign))
|
| | | |
| | | # 如果是合服充值活动记录时机,则同步一次排行榜
|
| | | mixServerRechargeType = ShareDefine.Def_MixCampaign_Type_RechargeRank
|
| | | if MixServerCampaign.IsNeedSaveMixServerCampaignRecordData(mixServerRechargeType):
|
| | | mixRecordDataType = ShareDefine.Def_MixCampaign_Type_RechargeCnt
|
| | | mixRecordDataKey = ChConfig.Def_PDict_MixServerCampaign_RecordData % mixRecordDataType
|
| | | mixRecordData = curPlayer.NomalDictGetProperty(mixRecordDataKey, 0, ChConfig.Def_PDictType_OpenServerCampaign)
|
| | | UpdateMixServerRechargeRankBillboard(curPlayer, mixRecordData)
|
| | | else:
|
| | | GameWorld.DebugLog("非合服充值活动记录时机,不同步!")
|
| | | |
| | | # 特惠充值排行
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | actionNumKey = ShareDefine.Def_Notify_WorldKey_DayAction_RechargeRank
|
| | | actionNum = gameWorld.GetGameWorldDictByKey(actionNumKey)
|
| | | if actionNum:
|
| | | curTotalGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TeHui_RechargeRankTotalGold, 0,
|
| | | ChConfig.Def_PDictType_TeHuiAction)
|
| | | curTotalGold = max(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TeHui_RechargeRankTotalGoldEx, 0,
|
| | | ChConfig.Def_PDictType_TeHuiAction), curTotalGold)
|
| | | actionID = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DayAction_ID % actionNumKey)
|
| | | UpdateRechargeRankBillboard(curPlayer, actionID, actionNum, curTotalGold)
|
| | | else:
|
| | | GameWorld.DebugLog("非特惠充值排行活动时机,不同步!")
|
| | | |
| | | GameWorld.DebugLog("玩家登录重新同步排行榜!OK!")
|
| | | return
|
| | |
|
| | | ##合服首次上线强制更新一次排行榜
|
| | |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'UpdCostRankBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ## 更新合服累计充值活动排行榜
|
| | | # @param playerID: 玩家ID
|
| | | # @return: |
| | | def UpdateMixServerRechargeRankBillboard(curPlayer, value):
|
| | | # if GameWorld.IsGM(curPlayer):
|
| | | # #GM不上榜
|
| | | # return
|
| | | |
| | | mixServerRechargeBillLimit = ReadChConfig.GetEvalChConfig("MixServerRechargeBillLimit")
|
| | | GameWorld.DebugLog(" 更新合服累计充值活动排行榜 value=%s,limit=%s" |
| | | % (value, mixServerRechargeBillLimit), curPlayer.GetPlayerID())
|
| | | # 未达到上榜条件
|
| | | if value < mixServerRechargeBillLimit:
|
| | | return
|
| | | |
| | | #排行榜需要数据[玩家ID, 玩家名字, 玩家职业, 击杀数]
|
| | | playerID = curPlayer.GetID()
|
| | | playerName = curPlayer.GetName()
|
| | | playerOpInfo = curPlayer.GetOperateInfo()
|
| | | playerJob = curPlayer.GetJob()
|
| | | fightPower = curPlayer.GetFightPower()
|
| | | familyName = curPlayer.GetFamilyName()
|
| | | sendMsg = '%s' % ([playerID, playerName, playerOpInfo, playerJob, fightPower, familyName, value]) |
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'UpdMSRechargeRankBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ##更新玩家充值排行榜
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | | ## 更新合服战盟击杀boss活动排行榜
|
| | | # @param playerID: 玩家ID
|
| | | # @return: |
| | | def UpdateMixServerFamilyKillBossBillboard(curPlayer, value):
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | if not familyID:
|
| | | return
|
| | | #排行榜需要数据[玩家ID]
|
| | | playerID = curPlayer.GetID()
|
| | | # playerName = curPlayer.GetName()
|
| | | # playerOpInfo = curPlayer.GetOperateInfo()
|
| | | # playerJob = curPlayer.GetJob()
|
| | | # fightPower = curPlayer.GetFightPower()
|
| | | # familyName = curPlayer.GetFamilyName()
|
| | | sendMsg = '%s' % ([value])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(playerID, 0, 0, 'UpdMSFamilyKillBossBillboard', \
|
| | | sendMsg, len(sendMsg))
|
| | | return
|
| | |
| | |
|
| | | # 重置今日已充值数, 领取礼包索引
|
| | | #PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt, 0)
|
| | | #PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleGoldGiftIndex, 0)
|
| | | #PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnlimitedGoldGiftCnt, 0)
|
| | | # 通知单日充值多选一礼包信息
|
| | | #Sync_SingleGoldGiftInfo(curPlayer, True)
|
| | | #Sync_UnlimitedGoldGiftRecord(curPlayer)
|
| | | return
|
| | |
|
| | | ## 充值豪礼OnLogin
|
| | |
| | |
|
| | | # 充值达到额定元宝获得奖励,邮件发送
|
| | | __GiveGoldGiftByMail(curPlayer)
|
| | | |
| | | # 通知单日充值多选一礼包信息
|
| | | Sync_SingleGoldGiftInfo(curPlayer, True)
|
| | | return
|
| | |
|
| | | ## 单日充值任选一奖励
|
| | | # @param curPlayer: 玩家
|
| | | # @param giftIndex: 礼包索引
|
| | | # @param giftLV: 礼包档次
|
| | | # @return: None
|
| | | def GetSingleGoldGift(curPlayer, giftIndex, giftLV, giftType):
|
| | | |
| | | findSingleGoldGift = GetTodaySingleGoldGiftInfo()
|
| | | |
| | | GameWorld.DebugLog("当日充值奖励领奖 (档%s - %s) giftType=%s,findSingleGoldGift=%s" |
| | | % (giftLV, giftIndex, giftType, str(findSingleGoldGift)))
|
| | | |
| | | if not findSingleGoldGift:
|
| | | GameWorld.DebugLog(" 今日未配置充值单选礼包!")
|
| | | return
|
| | |
|
| | | todayGiftType = findSingleGoldGift[2]
|
| | | if giftType != todayGiftType:
|
| | | GameWorld.DebugLog(" 非当日充值礼包类型!todayGiftType=%s" % todayGiftType)
|
| | | return
|
| | | |
| | | goldGiftInfoList = findSingleGoldGift[3]
|
| | | |
| | | # 无限领取礼包类型
|
| | | if giftType == 1:
|
| | | __GetUnlimitedGoldGift(curPlayer, goldGiftInfoList)
|
| | | return
|
| | | |
| | | if giftIndex <= 0:
|
| | | return
|
| | | |
| | | if giftLV >= len(goldGiftInfoList):
|
| | | GameWorld.ErrLog("单日充值单选礼包配置错误SingleGoldGift.txt 不存在该奖励档!giftLV=%s" % giftLV)
|
| | | return
|
| | | |
| | | curGoldGiftInfo = goldGiftInfoList[giftLV]
|
| | | needGold, chooseGiftList = curGoldGiftInfo
|
| | | |
| | | dailyGoldCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyGoldChargeCnt)
|
| | | |
| | | if dailyGoldCnt < needGold:
|
| | | GameWorld.DebugLog(" 今日充值额度未满足,无法领奖!needGold=%s,dailyGoldCnt=%s" |
| | | % (needGold, dailyGoldCnt))
|
| | | return
|
| | | |
| | | goldGiftAwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleGoldGiftIndex)
|
| | | singleGoldGiftIndex = GameWorld.GetDataByDigitPlace(goldGiftAwardRecord, giftLV)
|
| | | if singleGoldGiftIndex > 0:
|
| | | GameWorld.DebugLog(" 今日已领取!singleGoldGiftIndex=%s" % (singleGoldGiftIndex))
|
| | | return
|
| | | |
| | | if giftIndex > len(chooseGiftList):
|
| | | GameWorld.ErrLog("单日充值单选礼包配置错误SingleGoldGift.txt giftIndex=%s 不在奖励列表里!" % giftIndex)
|
| | | return
|
| | | |
| | | hasSpace = ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem)
|
| | | if not hasSpace:
|
| | | GameWorld.DebugLog(" 背包已满!")
|
| | | return
|
| | | |
| | | # 更新领奖索引
|
| | | updGoldGiftRecord = GameWorld.ChangeDataByDigitPlace(goldGiftAwardRecord, giftLV, giftIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleGoldGiftIndex, updGoldGiftRecord)
|
| | | |
| | | itemID, itemCount, isBind = chooseGiftList[giftIndex - 1]
|
| | | isOK = ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], True)
|
| | | if not isOK:
|
| | | return
|
| | |
|
| | | # 流向
|
| | | infoDict = {"SingleGiftIndex":giftIndex, "ItemID":itemID, "ItemCount":itemCount, "IsBind":isBind,
|
| | | "SingleGiftLV":giftLV, "GoldGiftAwardRecord":updGoldGiftRecord}
|
| | | DataRecordPack.DR_GoldGiftGiveItem(curPlayer, "SingleGoldGift", infoDict)
|
| | | |
| | | # 同步客户端状态
|
| | | Sync_SingleGoldGiftInfo(curPlayer)
|
| | | GameWorld.DebugLog(" awardRecord=%s,updRecord=%s,infoDict=%s" % (goldGiftAwardRecord, updGoldGiftRecord, infoDict))
|
| | | return
|
| | |
|
| | | def __GetUnlimitedGoldGift(curPlayer, goldGiftInfoList):
|
| | | |
| | | dailyGoldCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyGoldChargeCnt)
|
| | | |
| | | # 已领取次数
|
| | | hadGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnlimitedGoldGiftCnt)
|
| | | |
| | | maxGetCnt = goldGiftInfoList[0] # 最大重复领取次数
|
| | | perNeedGold = goldGiftInfoList[1] # 每次领取需要充值钻石数
|
| | | curCanGetCnt = dailyGoldCnt / perNeedGold # 当前可领取的最大次数
|
| | | if maxGetCnt > 0:
|
| | | curCanGetCnt = min(curCanGetCnt, maxGetCnt)
|
| | | |
| | | GameWorld.DebugLog("领取当日充值无限领取礼包:dailyGoldCnt=%s / per(%s) = canCnt(%s),hadGetCnt=%s,MaxCntCfg=%s" |
| | | % (dailyGoldCnt, perNeedGold, curCanGetCnt, hadGetCnt, maxGetCnt))
|
| | | |
| | | if curCanGetCnt <= 0:
|
| | | GameWorld.DebugLog(" 可领取次数=%s,不可领取!" % curCanGetCnt)
|
| | | return
|
| | | |
| | | if hadGetCnt >= curCanGetCnt:
|
| | | GameWorld.DebugLog(" 已达到最大领取次数!%s" % curCanGetCnt)
|
| | | return
|
| | | |
| | | getCnt = curCanGetCnt - hadGetCnt
|
| | | |
| | | # 检查背包
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem)
|
| | | needSpace = goldGiftInfoList[2]
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | |
|
| | | # 给物品
|
| | | curGetCnt = getCnt
|
| | | awardItemList = goldGiftInfoList[3]
|
| | | for itemID, itemCnt, isBind in awardItemList:
|
| | | gameData = GameWorld.GetGameData()
|
| | | curItemData = gameData.GetItemByTypeID(itemID)
|
| | | if curItemData == None:
|
| | | GameWorld.ErrLog("领取当日充值无限领取礼包,物品ID数据错误!(%s)" % itemID, curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | maxPackCount = curItemData.GetPackCount()
|
| | | perSpaceCanGetCnt = maxPackCount / itemCnt # 单个空位最大可领取次数
|
| | | curGetCnt = min(perSpaceCanGetCnt, curGetCnt)
|
| | | #GameWorld.DebugLog(" itemID=%s,maxPackCount=%s,giveCnt=%s,perSpaceCanGetCnt=%s,curGetCnt=%s" |
| | | # % (itemID, maxPackCount, itemCnt, perSpaceCanGetCnt, curGetCnt))
|
| | | |
| | | # 更新已领取成功标记
|
| | | updGetCnt = hadGetCnt + curGetCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnlimitedGoldGiftCnt, updGetCnt)
|
| | |
|
| | | # 给物品
|
| | | awardItemList = goldGiftInfoList[3]
|
| | | isOKStr = ""
|
| | | for itemID, itemCnt, isBind in awardItemList:
|
| | | isOK = ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt * curGetCnt, isBind, |
| | | [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True)
|
| | | |
| | | isOKStr = "%s%s" % (str(int(isOK)), isOKStr)
|
| | | |
| | | # 记录领取事件
|
| | | addDataDict = {"isOKStr":isOKStr, "awardItemList":str(awardItemList), "DailyGoldCnt":dailyGoldCnt,
|
| | | "TodayGetCnt":updGetCnt, "CurGetCnt":curGetCnt}
|
| | | DataRecordPack.DR_FuncGiveItem(curPlayer, "UnlimitedGoldGift", addDataDict)
|
| | | |
| | | # 通知客户端
|
| | | Sync_UnlimitedGoldGiftRecord(curPlayer)
|
| | | GameWorld.DebugLog(" 领取充值无限领取礼包奖励OK!TodayGetCnt=%s,CurGetCnt=%s" % (updGetCnt, curGetCnt))
|
| | | return
|
| | |
|
| | |
|
| | | ## 通知无限领取礼包已领取次数
|
| | | # @param None
|
| | | # @return None
|
| | | def Sync_UnlimitedGoldGiftRecord(curPlayer):
|
| | | #record = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnlimitedGoldGiftCnt)
|
| | | #ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ShareDefine.Def_RewardType_UnlimitedGoldGift, record)
|
| | | return
|
| | |
|
| | |
|
| | | ## 玩家累计充值元宝发送邮件奖励
|
| | | # @param curPlayer: 玩家
|
| | |
| | | sendPack.FirstGoldTry = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldTry)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | | ## 通知单日充值多选一礼包信息
|
| | | # @param curPlayer
|
| | | # @return None
|
| | | def Sync_SingleGoldGiftInfo(curPlayer, isCheckTime=False):
|
| | | #===============================================================================================
|
| | | # if isCheckTime:
|
| | | # todayGiftInfo = GetTodaySingleGoldGiftInfo()
|
| | | # if not todayGiftInfo:
|
| | | # return
|
| | | # |
| | | # sendPack = ChPyNetSendPack.tagMCSingleGoldGift()
|
| | | # sendPack.Clear()
|
| | | # sendPack.GoldCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyGoldChargeCnt)
|
| | | # sendPack.GiftIndex = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleGoldGiftIndex)
|
| | | # NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | #===============================================================================================
|
| | | return
|
| | |
|
| | | ## 获取单日充值多选一礼包信息
|
| | | # @param None
|
| | | # @return None代表今日无活动
|
| | | def GetTodaySingleGoldGiftInfo():
|
| | | # 开服前7天默认不开启
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)
|
| | | |
| | | singleGoldGiftList = ReadChConfig.GetEvalChConfig("SingleGoldGift")
|
| | | |
| | | curDataTimeStr = GameWorld.GetCurrentDataTimeStr()
|
| | | |
| | | curTime = GameWorld.GetCurrentTime()
|
| | | weekday = curTime.weekday() + 1
|
| | | |
| | | findSingleGoldGift = None
|
| | | for giftInfo in singleGoldGiftList:
|
| | | |
| | | # 判断日期, 日期活动优先
|
| | | dateTimeInfo = giftInfo[0]
|
| | | if dateTimeInfo:
|
| | | startTime = dateTimeInfo[0]
|
| | | endTime = dateTimeInfo[1]
|
| | | if startTime <= curDataTimeStr <= endTime:
|
| | | findSingleGoldGift = giftInfo
|
| | | break
|
| | | |
| | | # 判断星期, 开服前7天默认不开启星期活动
|
| | | weekDayInfo = giftInfo[1]
|
| | | if weekday in weekDayInfo and openServerDay >= ShareDefine.Def_OSC_ValidDay:
|
| | | findSingleGoldGift = giftInfo
|
| | | break
|
| | | |
| | | return findSingleGoldGift
|
| | |
|
| | |
|
| | | #// A5 11 试用首充武器 #tagCMTryFirstGoldItem
|
| | | #
|
| | |
| | | Def_Notify_WorldKey_CrossPKSeasonID = "CrossPKSeasonID" # 本服跨服PK当前赛季
|
| | | Def_Notify_WorldKey_CrossPKSeasonState = "CrossPKSeasonState" # 本服跨服PK赛季状态 0-关闭,1-开启中
|
| | |
|
| | | Def_Notify_WorldKey_MixServerCampaignSaveData = "MixServerCampaignSaveData_%s" # 合服活动记录数据时机0-否 1-是
|
| | | Def_Notify_WorldKey_MixServerCampaignGetAward = "MixServerCampaignGetAward_%s" # 合服活动可领奖时机0-否 1-是
|
| | |
|
| | | Def_Notify_WorldKey_GameWorldBossRebornCross = 'BossRebornCross_%s_%s' # 跨服世界boss重生, 参数为(zoneID, bossID)
|
| | | Def_Notify_WorldKey_GameWorldBossReborn = 'BossReborn_%s' # 世界boss重生, 参数为(bossID)
|
| | | Def_Notify_WorldKey_BossKilledCnt = 'BossKilledCnt_%s' # boss击杀次数, 参数为NPCID
|
| | |
| | |
|
| | | Def_Notify_WorldKey_LoginAwardStartDate = 'LoginAwardStartDate_%s' # 登录领取奖励开始时间,参数为活动类型
|
| | | Def_Notify_WorldKey_LoginAwardEndDate = 'LoginAwardEndDate_%s' # 登录领取奖励结束时间,参数为活动类型
|
| | |
|
| | | Def_Notify_WorldKey_ClearBillboardSign = 'ClearBillboardSign' # 清除排行榜标记
|
| | |
|
| | | Def_Notify_WorldKey_RedPacketOutput = 'RedPacketOutput' # 红包产出信息
|
| | |
|
| | |
| | | Def_BT_RechargeTeHuiLast, #充值特惠活动排行榜-上一期记录
|
| | | Def_BT_RechargeTeHui, #充值特惠活动排行榜-当前期记录
|
| | |
|
| | | Def_BT_MixCampaign_PlayerBattle, #总战斗力(合服活动)
|
| | | Def_BT_MixCampaign_Recharge, #累计充值(合服活动)
|
| | | Def_BT_MixCampaign_WinFamilyMember, #获胜战盟成员,按职位排(合服活动)
|
| | | Def_BT_MixCampaign_FamilyKillBoss, #战盟击杀boss(合服活动)
|
| | | |
| | | Def_BT_CostTeHui, #消费特惠排行榜
|
| | | Def_BT_CostTeHuiLast, #消费特惠排行榜上一期
|
| | |
|
| | | Def_BT_Max, #排行榜最大类型
|
| | | ) = range(0, 34 + 2) |
| | | ) = range(0, 30 + 2) |
| | |
|
| | | #职业对应战力排行榜类型
|
| | | JobFightPowerBillboardDict = {
|
| | |
| | | Def_Enter_Truck, #进入骠车
|
| | | ) = range(1, 3)
|
| | |
|
| | | Def_OSC_ValidDay = 6 # 开服活动有效活动天
|
| | | Def_MSC_ValidDay = 5 # 合服活动有效活动天
|
| | |
|
| | | # 开服活动类型标识, 不可超过32
|
| | | Def_Campaign_Type_List = (
|
| | | Def_Campaign_Type_PlusLV, # 强化等级排行 1
|
| | |
| | | Def_CampaignAwardState_None, # 无
|
| | | Def_CampaignAwardState_Allow, # 允许领奖
|
| | | Def_CampaignAwardState_Over, # 领奖结束
|
| | | ) = range(3)
|
| | |
|
| | | #合服活动类型标识
|
| | | Def_MixCampaign_Type_List = (
|
| | | Def_MixCampaign_Type_PlayerBattle, # 总战斗力0
|
| | | Def_MixCampaign_Type_RechargeFirst, # 首充奖励1
|
| | | Def_MixCampaign_Type_RechargeRank, # 累计充值排行奖励2
|
| | | Def_MixCampaign_Type_RechargeCnt, # 累计充值保底奖励3
|
| | | Def_MixCampaign_Type_FamilyWar, # 冰封王座家族战获胜家族成员奖励4
|
| | | Def_MixCampaign_Type_FamilyWarEnter, # 冰封王座参与奖5
|
| | | Def_MixCampaign_Type_FamilyKillBoss, # 战盟击杀boss排行
|
| | | Def_MixCampaign_Type_PlayerKillBoss, # 个人击杀boss
|
| | | ) = range(8)
|
| | |
|
| | | #合服活动类型对应的奖励排行榜
|
| | | Def_MixCampaign_Billboard_Dict = {
|
| | | Def_MixCampaign_Type_PlayerBattle:Def_BT_MixCampaign_PlayerBattle, # 总战斗力
|
| | | Def_MixCampaign_Type_RechargeRank:Def_BT_MixCampaign_Recharge, # 累计充值排行 |
| | | Def_MixCampaign_Type_FamilyWar:Def_BT_MixCampaign_WinFamilyMember, # 获胜战盟成员 |
| | | Def_MixCampaign_Type_FamilyKillBoss:Def_BT_MixCampaign_FamilyKillBoss, # 战盟击杀boss排行 |
| | | }
|
| | |
|
| | | # 直接在MapServer中处理的合服活动类型
|
| | | DoOnMapServerMixCampaignTypeList = [
|
| | | Def_MixCampaign_Type_RechargeFirst,
|
| | | Def_MixCampaign_Type_RechargeCnt,
|
| | | Def_MixCampaign_Type_FamilyWarEnter,
|
| | | Def_MixCampaign_Type_PlayerKillBoss,
|
| | | ]
|
| | | # 合服活动请求GameServer操作类型定义
|
| | | (
|
| | | Def_MSCGameServerQuery_QueryAward, # 查询
|
| | | Def_MSCGameServerQuery_GetAward, # 领奖
|
| | | Def_MSCGameServerQuery_MailAward, # 邮件发送奖励
|
| | | ) = range(3)
|
| | |
|
| | | #队伍最大人数
|