6374 【后端】【2.0】删除无用功能代码、封包、配置(删除修复代码)
| | |
| | | Def_PDict_DailyGoldChargeState = "DailyGoldChargeState" # 天天首充活动状态,0-未开启;1-已开启
|
| | | Def_PDict_DailyChargeState = "DailyChargeState" # 当日是否已充值
|
| | | Def_PDict_SuperGiftStartTime = "SuperGiftStartTime" # 超值礼包开始时间
|
| | | Def_PDict_SuperGiftHasOpen = "SuperGiftHasOpen" # 超值礼包是否开过
|
| | | Def_PDict_DailyGoldChargePrizeRecord = "DailyGoldChargePrizeRecord" # 天天首充领奖记录,0-不可领;1-可领;2-已领
|
| | | Def_PDict_DailyGoldChargeCnt = "DailyGoldChargeCnt" # 当日已充值数
|
| | | Def_PDict_IsReBorn = "Def_PDict_IsReBorn" # 是否回城复活
|
| | |
| | | }
|
| | |
|
| | | #版本修正标记, 使用key格式 Def_Player_Dict_VersionFix
|
| | | (
|
| | | Def_VerFix_ChatBubbleBox, # 1.2版本购买VIP礼包可获得激活气泡框道具,针对已购买过VIP礼包的老号处理;
|
| | | Def_VerFix_CTGDoublePrize, # 1.2版本开放首充双倍,重置老号充值ID对应累计充值次数;
|
| | | Def_VerFix_RuneSource, # 修复老号双属性符印的获取途径;
|
| | | Def_VerFix_FMTDouble, # 1.3版本VIP特权变更,记录切换版本前的VIP特权(封魔坛双倍挑战);
|
| | | Def_VerFix_SuperGift, # 超值礼包开启变更,原领取首充开启,改成等级到开启;
|
| | | Def_VerFix_Horse, # 坐骑等级上限修改,对应技能触发修改;
|
| | | Def_VerFix_Pet, # 灵宠等级上限修改,对应技能触发修改;
|
| | | Def_VerFix_AddPoint, # 老号属性点修复;
|
| | | Def_VerFix_GodWeaponItem, # 1.5删除中级神兵石;
|
| | | Def_VerFix_ZXTower, # 诛仙塔奖励变更补偿;
|
| | | ) = range(10)
|
| | | #(
|
| | | #
|
| | | #) = range(0)
|
| | |
|
| | | ##==================================================================================================
|
| | | #游戏消费点类型定义
|
| | |
| | |
|
| | | ## 登录
|
| | | def ShopItemOnLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_SuperGift):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_SuperGift, 1)
|
| | | isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
|
| | | if isGet:#首充奖励已领取则代表超值礼包已开启过,
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftHasOpen, 1)
|
| | | |
| | | |
| | | SyncMysticalLimitShopInfo(curPlayer)
|
| | | SyncShopItemTodayBuyCount(curPlayer)
|
| | | SyncSuperGiftInfo(curPlayer)
|
| | |
| | | #活动结束 重置
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, 0)
|
| | | else:
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuperGiftHasOpen):
|
| | | #老号已开启过超值礼包则不再开启
|
| | | return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, curTime)
|
| | | addItemList = IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList', 2)
|
| | |
| | |
|
| | |
|
| | | def OnFBPlayerOnLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_FMTDouble):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_FMTDouble, 1)
|
| | | needViplv = IpyGameDataPY.GetFuncCfg('DemonJarSpecial')
|
| | | if curPlayer.GetVIPLv() >= needViplv:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FMTOldDouble, 1)
|
| | | GameWorld.DebugLog('1.3版本前可以双倍挑战')
|
| | | NotifyFMTDouble(curPlayer)
|
| | | return
|
| | |
|
| | |
| | |
|
| | |
|
| | | def OnFBPlayerOnLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ZXTower):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ZXTower, 1)
|
| | | #奖励变更补偿 s级通关奖励里的宝石
|
| | | curFloor = __GetZhuXianTowerCurPassLV(curPlayer)
|
| | | if curFloor:
|
| | | giveItemList = []
|
| | | for floor in xrange(1, curFloor+1):
|
| | | ipyData = GetTowerIpyData(floor)
|
| | | if not ipyData:
|
| | | continue
|
| | | for itemInfo in ipyData.GetFirstAward():
|
| | | itemID = itemInfo[0]
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | if itemData.GetType() == ChConfig.Def_ItemType_ZhuXianStone:
|
| | | giveItemList.append(itemInfo)
|
| | | if giveItemList:
|
| | | PlayerControl.SendMailByKey('KillGodTowerCompensation', [curPlayer.GetID()], giveItemList)
|
| | | |
| | | |
| | | |
| | | SyncZhuXianLevelInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | |
|
| | | #上线检查一次装备属性
|
| | | ItemControler.PlayerItemControler(curPlayer).CheckRolePackEquipAttr()
|
| | | #上线检查加点属性点
|
| | | PlayerControl.FixOldAddPoint(curPlayer)
|
| | | |
| | | #更新服务器组ID
|
| | | PlayerControl.UpdPlayerServerGroupID(curPlayer)
|
| | |
|
| | |
| | | __RefreshAndSyncPetInfo(rolePet)
|
| | | #自动出战宠物
|
| | | __AutoSummonPet_OnLogin(curPlayer, rolePet)
|
| | | |
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_Pet):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_Pet, 1)
|
| | | #等级不能超上限,技能删了重新学
|
| | | |
| | | petPackIndex = ShareDefine.rptPet
|
| | | petPack = curPlayer.GetItemManager().GetPack(petPackIndex)
|
| | | for i in range(petPack.GetCount()):
|
| | | petItem = petPack.GetAt(i)
|
| | | if petItem.IsEmpty():
|
| | | continue |
| | | petItemNPCID = petItem.GetUserAttr(ShareDefine.Def_IudetPet_NPCID)
|
| | | curClassLV = petItem.GetUserAttr(ShareDefine.Def_IudetPet_ClassLV) + 1
|
| | | petIpyData = PlayerPet.GetPetIpydata(petItemNPCID)
|
| | | if not petIpyData:
|
| | | continue
|
| | | maxLV = petIpyData.GetMaxRank()
|
| | | if curClassLV > maxLV:
|
| | | petItem.SetUserAttr(ShareDefine.Def_IudetPet_ClassLV, max(0, maxLV - 1))
|
| | | petItem.SetUserAttr(ShareDefine.Def_IudetPet_Exp, 0)
|
| | | GameWorld.Log(' 老号宠物等级超过上限,宠物ID=%s,原LV=%s,重置为=%s'%(petItemNPCID, curClassLV, maxLV))
|
| | | curClassLV = maxLV
|
| | | petItem.ClearUserAttr(ShareDefine.Def_IudetPet_Skill)
|
| | | petSkillList = petIpyData.GetSkillID()
|
| | | petSkillUnLockList = petIpyData.GetSkillUnLock()
|
| | | for i, skillid in enumerate(petSkillList):
|
| | | limitPetClassLV = petSkillUnLockList[i] # 学习此技能所需宠物阶级
|
| | | if curClassLV < limitPetClassLV:
|
| | | continue
|
| | | petItem.AddUserAttr(ShareDefine.Def_IudetPet_Skill, skillid)
|
| | | if ReCallFightPet(curPlayer):
|
| | | PlayerPet.AutoSummonPet(curPlayer)
|
| | | # 重刷战力
|
| | | PlayerPet.SetPetSkillFightPower(curPlayer) # 技能战力重算
|
| | | PlayerPet.RefreshPetItemAddAttr(curPlayer, True)
|
| | |
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
| | | GameWorld.DebugLog(' 加点功能开启处理 beforeFreePoint=%s,curLV=%s, setFreePoint=%s'%(beforeFreePoint, curLV, setFreePoint), curPlayer.GetID())
|
| | | return
|
| | |
|
| | | def FixOldAddPoint(curPlayer):
|
| | | ##老号加点处理 重置已加点数,
|
| | | if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_AddPoint):
|
| | | return
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_AddPoint, 1)
|
| | | baseSTR, basePNE, basePHY, baseCON = GetPlayerBasePoint(curPlayer.GetJob())
|
| | | addPoint = curPlayer.GetFreePoint()
|
| | | attrInfoDict = {'BaseSTR':baseSTR,'BasePNE':basePNE,'BasePHY':basePHY,'BaseCON':baseCON}
|
| | | for attrKey, basePoint in attrInfoDict.items():
|
| | | addPoint += (getattr(curPlayer, 'Get%s'%attrKey)() - basePoint)
|
| | | fixFreePoint = GetAllPointByLV(curPlayer)
|
| | | if addPoint != fixFreePoint:
|
| | | for attrKey, basePoint in attrInfoDict.items():
|
| | | getattr(curPlayer, 'Set%s'%attrKey)(basePoint)
|
| | | curPlayer.SetFreePoint(fixFreePoint)
|
| | | #重置天赋
|
| | | PlayerGreatMaster.DoResetMasterSkillPoint(curPlayer)
|
| | | #邮件补偿
|
| | | SendMailByKey('PointCompensation', [curPlayer.GetID()], [], goldPaper=200)
|
| | | |
| | | addDataDict = {'beforeTotalPoint':addPoint}
|
| | | DataRecordPack.DR_Freepoint(curPlayer, "FixOldAddPoint", fixFreePoint, addDataDict)
|
| | | GameWorld.Log('老号加点处理 重置已加点数 addPoint=%s, fixFreePoint=%s' % (addPoint, fixFreePoint))
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
| | | # @param curPlayer 玩家
|
| | | # @return None
|
| | | def PlayerHorseLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_Horse):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_Horse, 1)
|
| | | #等级不能超上限,技能删了重新学
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | delCnt = 0
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | dataIndex = i-delCnt
|
| | | skill = skillManager.GetSkillByIndex(dataIndex)
|
| | | if skill == None:
|
| | | continue
|
| | | if skill.GetFuncType() != ChConfig.Def_SkillFuncType_HorseSkill:
|
| | | continue
|
| | | skillTypeID = skill.GetSkillTypeID()
|
| | | skillManager.DeleteSkillBySkillTypeID(skillTypeID)
|
| | | delCnt += 1
|
| | | |
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetHorseCount()):
|
| | | ipyData = ipyDataMgr.GetHorseByIndex(i)
|
| | | horseID = ipyData.GetHorseID()
|
| | | curlv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
|
| | | if not curlv:
|
| | | continue
|
| | | maxLV = ipyData.GetMaxLV()
|
| | | if curlv > maxLV:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV % horseID, maxLV, ChConfig.Def_PDictType_Horse)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_Exp % horseID, 0, ChConfig.Def_PDictType_Horse)
|
| | | GameWorld.Log(' 老号坐骑等级超过上限,坐骑ID=%s,原LV=%s,重置为=%s'%(horseID, curlv, maxLV))
|
| | | curlv = maxLV
|
| | | |
| | | for lv in xrange(1, curlv + 1):
|
| | | upIpyData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
|
| | | if not upIpyData:
|
| | | break
|
| | | skillIDList = upIpyData.GetSkillID()
|
| | | if not skillIDList:
|
| | | continue
|
| | | for skillID in skillIDList:
|
| | | __GiveSkill(curPlayer, skillID, tick)
|
| | | # 重刷战力
|
| | | curControl = PlayerControl.PlayerControl(curPlayer)
|
| | | curControl.RefreshAllSkill()
|
| | | RefreshHorseAttr(curPlayer)
|
| | | |
| | | |
| | | Sync_HorseClassData(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | # @param curPlayer 玩家
|
| | | # @return None
|
| | | def PlayerRuneLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_RuneSource):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_RuneSource, 1)
|
| | | runeHoleCnt = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4)
|
| | | for RuneNum in xrange(1, runeHoleCnt + 1):
|
| | | RuneData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_Data % RuneNum, 0)
|
| | | if not RuneData:
|
| | | continue
|
| | | RuneItemID = ItemControler.GetRuneItemID(RuneData)
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('RuneCompound', RuneItemID)
|
| | | if not ipyData:
|
| | | continue
|
| | | RuneSource = ItemControler.GetRuneItemSource(RuneData)
|
| | | if RuneSource != ChConfig.Item_Source_Compound:
|
| | | RuneItemPlusLV = ItemControler.GetRuneItemPlusLV(RuneData)
|
| | | RuneIsLock = ItemControler.GetRuneItemIsLock(RuneData)
|
| | | updRuneData = ItemControler.GetRuneItemKeyData(RuneItemID, RuneItemPlusLV, RuneIsLock, ChConfig.Item_Source_Compound)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Rune_Data % RuneNum, updRuneData)
|
| | | GameWorld.Log('上线修复双属性符印来源 RuneNum=%s,oldRuneData=%s,updRuneData=%s'%(RuneNum, RuneData, updRuneData))
|
| | | packIndex = ShareDefine.rptRune
|
| | | for place in xrange(ItemCommon.GetVPackCnt(packIndex)):
|
| | | RuneData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_VPackItem % (packIndex, place))
|
| | | if not RuneData:
|
| | | continue
|
| | | RuneItemID = ItemControler.GetRuneItemID(RuneData)
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('RuneCompound', RuneItemID)
|
| | | if not ipyData:
|
| | | continue
|
| | | RuneSource = ItemControler.GetRuneItemSource(RuneData)
|
| | | if RuneSource != ChConfig.Item_Source_Compound:
|
| | | RuneItemPlusLV = ItemControler.GetRuneItemPlusLV(RuneData)
|
| | | RuneIsLock = ItemControler.GetRuneItemIsLock(RuneData)
|
| | | updRuneData = ItemControler.GetRuneItemKeyData(RuneItemID, RuneItemPlusLV, RuneIsLock, ChConfig.Item_Source_Compound)
|
| | | ItemControler.SetVPackItemKeyData(curPlayer, ShareDefine.rptRune, place, updRuneData)
|
| | | GameWorld.Log('上线修复双属性符印来源 place=%s,oldRuneData=%s,updRuneData=%s'%(place, RuneData, updRuneData))
|
| | | |
| | | |
| | | DoUnlockRuneHole(curPlayer, False)
|
| | | Sync_RuneInfo(curPlayer)
|
| | | return
|
| | |
| | | # @return None
|
| | | def DoOnLogin(curPlayer, tick):
|
| | | #记录登陆时间
|
| | | |
| | | # VIP礼包聊天气泡框
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ChatBubbleBox):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ChatBubbleBox, 1)
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetChatBubbleBoxCount()):
|
| | | ipyData = ipyDataMgr.GetChatBubbleBoxByIndex(i)
|
| | | needVIPLVGift = ipyData.GetNeedVIPLVGift()
|
| | | if not needVIPLVGift:
|
| | | continue
|
| | | record = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_VipAwardRecord)
|
| | | hasBuy = record & pow(2, needVIPLVGift)
|
| | | if not hasBuy:
|
| | | continue
|
| | | boxID = ipyData.GetBoxID()
|
| | | ChPlayer.DoActivateChatBubbleBox(curPlayer, boxID)
|
| | | drDict = {"PlayerID":curPlayer.GetPlayerID(),"AccID":curPlayer.GetAccID(), "needVIPLVGift":needVIPLVGift, "BoxID":boxID}
|
| | | DataRecordPack.SendEventPack("VIPGiftActChatBubbleBox", drDict, curPlayer)
|
| | | GameWorld.Log("老号激活VIP礼包聊天气泡框: boxID=%s,needVIPLVGift=%s" % (boxID, needVIPLVGift), curPlayer.GetPlayerID())
|
| | | else:
|
| | | GameWorld.DebugLog("已经激活过老号VIP气泡框")
|
| | | |
| | | Sycn_VIPMsg(curPlayer)
|
| | | Sycn_VIPAwardRecord(curPlayer)
|
| | | Sycn_VIPTime(curPlayer, True)
|