5104 【1.3】新增记录玩家战力下降前后战力记录流向,有下降生成流向,涨战力不记录
| | |
| | | curFamily.Broadcast_FamilyChange()
|
| | | #通知地图服务器刷新
|
| | | PlayerFamily.SendPack_MapServer_PlayerFamilyRefresh(curFamily)
|
| | | GameWorld.Log(" __DoOpenCostLogic 扣除家族兽粮=%s OK!" % (foodCost))
|
| | | GameWorld.Log(" __DoOpenCostLogic 扣除家族兽粮=%s OK!, familyID=%s,playerFamilyLV=%s" |
| | | % (foodCost, curFamily.GetFamilyID(), curMember.GetFamilyLV()), curPlayer.GetPlayerID())
|
| | | return True
|
| | |
|
| | |
|
| | |
| | | Rune_Source_Default, # 默认 1
|
| | | Item_Source_Compound, # 符印合成 2
|
| | | ) = range(3) |
| | |
|
| | | (
|
| | | PowerDownType_Rune, #符印替换
|
| | | PowerDownType_LVUP, #人物升级
|
| | | PowerDownType_EquipChange, #装备替换
|
| | | PowerDownType_StoneChange, #宝石替换
|
| | | PowerDownType_Suit, #套装合成
|
| | | PowerDownType_EquipWash, #洗练
|
| | | PowerDownType_Title, #称号过期
|
| | | PowerDownType_Dogz, #神兽召回
|
| | | ) = range(7)
|
| | | FightPowerDownRecordDict = {
|
| | | PowerDownType_Rune:'Rune',
|
| | | PowerDownType_LVUP:'LVUP',
|
| | | PowerDownType_EquipChange:'EquipChange',
|
| | | PowerDownType_StoneChange:'StoneChange',
|
| | | PowerDownType_Suit:'Suit',
|
| | | PowerDownType_EquipWash:'EquipWash',
|
| | | PowerDownType_Title:'DelTitle',
|
| | | PowerDownType_Dogz:'DogzState',
|
| | | } |
| | |
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import PyGameData
|
| | | #===============================================================================
|
| | | ##发送事件记录给EventShell
|
| | | # @param eventTypeStr: 事件类型标识
|
| | |
| | | name = curPlayer.GetName()
|
| | |
|
| | | dataDict = {'Type':'login', 'IP':str(ip), 'AccID':accID,
|
| | | 'Name':name, 'LoginTime':str(loginTime), 'LogoutTime':''}
|
| | | 'Name':name, 'LoginTime':str(loginTime), 'LogoutTime':'', 'MFPFightPower':GetMFPFightPowerInfo(curPlayer)}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("LogInOut", dataDict, curPlayer)
|
| | |
| | | goldPaper = curPlayer.GetGoldPaper()
|
| | | dataDict = {'Type':'logout', 'IP':ip, 'AccID':accID, 'LV':lv, 'VipLV':vipLV,
|
| | | 'Name':name, 'LoginTime':str(loginTime), 'Gold':gold, 'GoldPaper':goldPaper,
|
| | | 'LogoutTime':str(logoutTime)}
|
| | | 'LogoutTime':str(logoutTime), 'MFPFightPower':GetMFPFightPowerInfo(curPlayer)}
|
| | | #发送封包
|
| | | SendEventPack("LogInOut", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def GetMFPFightPowerInfo(curPlayer):
|
| | | #记录模块战力
|
| | | dataDict = {}
|
| | | for mfpType in ShareDefine.ModuleFightPowerTypeList:
|
| | | fightPower = PlayerControl.GetMFPFightPower(curPlayer, mfpType)
|
| | | dataDict[mfpType] = fightPower
|
| | | return dataDict
|
| | |
|
| | | ## 新增有效登陆
|
| | | # @param accID: 账号ID
|
| | |
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(),
|
| | | "AccID":curPlayer.GetAccID()}
|
| | | dataDict.update(addDict)
|
| | | |
| | | SendEventPack("StoneChange_%s"%eventName, dataDict, curPlayer)
|
| | | Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_StoneChange, addDict)
|
| | | return
|
| | |
|
| | | def DR_VIPChange(curPlayer, eventName, addDict={}):
|
| | |
| | | #发送封包
|
| | | SendEventPack("RealmLVUp", dataDict, curPlayer)
|
| | | return |
| | |
|
| | | def Cache_FightPowerChangeInfo(curPlayer, dotype, dataDict):
|
| | | ##暂存可能导致战力降低的行为信息
|
| | | dataDict['dotime'] = str(datetime.datetime.today()).split(".")[0]
|
| | | eventName = ChConfig.FightPowerDownRecordDict.get(dotype, 'Unknown')
|
| | | if eventName in PyGameData.g_fightpowerChangeDataRecordDict:
|
| | | PyGameData.g_fightpowerChangeDataRecordDict[eventName].append(dataDict)
|
| | | else:
|
| | | PyGameData.g_fightpowerChangeDataRecordDict[eventName] = [dataDict]
|
| | | return
|
| | |
|
| | | def DR_FightPowerChangeInfo(curPlayer, beforePower):
|
| | | ##记录战力降低的行为信息
|
| | | dataDict = {'beforePower':beforePower, 'PlayerID':curPlayer.GetPlayerID(), 'AccID':curPlayer.GetAccID()}
|
| | | for dotype, dateList in PyGameData.g_fightpowerChangeDataRecordDict.items():
|
| | | rList = []
|
| | | for dateInfo in dateList:
|
| | | dateTimeStr = dateInfo['dotime']
|
| | | if GameWorld.GetPastSeconds(dateTimeStr) >10:
|
| | | continue
|
| | | rList.append(dateInfo)
|
| | | dataDict[dotype] = rList
|
| | | PyGameData.g_fightpowerChangeDataRecordDict = {}
|
| | | #发送封包
|
| | | SendEventPack("FightPowerChangeInfo", dataDict, curPlayer)
|
| | | return
|
| | |
| | | import ItemControler
|
| | | import IpyGameDataPY
|
| | | import EventShell
|
| | | import DataRecordPack
|
| | |
|
| | |
|
| | | #//A3 17 套装合成#tagCMSuitCompose
|
| | |
| | |
|
| | | #通知等级
|
| | | ChEquip.NotifyEquipPartSuiteLV(curPlayer, equipPlace)
|
| | | dataDict = {'equipPlace':equipPlace,'suiteType':suiteType,'tagSuitLV':tagSuitLV,'curSuiteLV':curSuiteLV}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_Suit, dataDict)
|
| | |
|
| | | #先刷装备BUFF 再计算属性
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer)
|
| | |
| | | giveItemDict[itemID] = giveItemDict.get(itemID, 0) + itemCnt
|
| | |
|
| | | ChEquip.SetEquipPartSuiteLV(curPlayer, equipPlace, suiteType, toSuiteLV)
|
| | | dataDict = {'equipPlace':equipPlace,'suiteType':suiteType,'tagSuitLV':toSuiteLV,'curSuiteLV':curSuiteLV}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_Suit, dataDict)
|
| | |
|
| | | if not giveItemDict:
|
| | | return
|
| | |
| | | import PlayerControl
|
| | | import PlayerSuccess
|
| | | import IPY_GameWorld
|
| | | import DataRecordPack
|
| | | import ShareDefine
|
| | | import ItemCommon
|
| | | import ChConfig
|
| | |
| | | if attrNum in useGoldAttrNumList:
|
| | | isRefreshAttr = True
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum), tempValue)
|
| | | dataDict = {'equipPlace':equipPlace,'attrNum':attrNum,'oldValue':washValue,'newValue':tempValue}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipWash, dataDict)
|
| | | GameWorld.DebugLog(" 勾选洗练,直接更新数值: %s" % tempValue, playerID)
|
| | | else:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPlace, attrNum), tempValue)
|
| | |
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValueTemp % (equipPlace, attrNum), 0)
|
| | | if isSave == 1:
|
| | | oldValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipWashValue % (equipPlace, attrNum), tempValue)
|
| | | dataDict = {'equipPlace':equipPlace,'attrNum':attrNum,'oldValue':oldValue,'newValue':tempValue}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipWash, dataDict)
|
| | | GameWorld.DebugLog("保存洗练数据: equipPlace=%s,attrNum=%s,tempValue=%s" % (equipPlace, attrNum, tempValue), playerID)
|
| | |
|
| | | if isSave == 1:
|
| | |
| | | import Operate_EquipStone
|
| | | import Operate_EquipSuitCompose
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import EventShell
|
| | |
|
| | | import math
|
| | |
| | | return -1
|
| | |
|
| | | curPlayer = self.__Player
|
| | | #equipPack = self.__PlayerEquip
|
| | | #equipItem = equipPack.GetAt(packEquipIndex)
|
| | | |
| | | equipPack = self.__PlayerEquip
|
| | | equipItem = equipPack.GetAt(packEquipIndex)
|
| | | desItemID, desUserData = [0, ''] if equipItem.IsEmpty() else [equipItem.GetItemTypeID(), equipItem.GetUserData()]
|
| | | srcItemID, srcUserData = curItem.GetItemTypeID(), curItem.GetUserData()
|
| | | # 装备绑定处理 在 DoLogic_ItemBindType函数有处理,此处注释掉
|
| | | # if not curItem.GetIsBind():
|
| | | # SetItemIsBind(curItem, True)
|
| | |
| | | #套装降级处理
|
| | | Operate_EquipSuitCompose.CheckEquipSuitReduce(curPlayer, packEquipIndex)
|
| | | EventShell.EventRespons_EquipStar(curPlayer)
|
| | | dataDict = {'dotype':'EquipItem', 'desItemID':desItemID, 'desUserData':desUserData,'srcItemID':srcItemID,'srcUserData':srcUserData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | | |
| | | self.RefreshStartEquipCount()
|
| | | return packEquipIndex if result else -1
|
| | |
|
| | |
| | | return
|
| | |
|
| | | equipID = curEquip.GetItemTypeID()
|
| | |
|
| | | userData = curEquip.GetUserData()
|
| | | #该物品锁定不执行==============================================
|
| | | if curEquip.GetIsLocked():
|
| | | PlayerControl.NotifyCode(curPlayer, "RescannotEquip")
|
| | |
| | | #套装降级处理
|
| | | Operate_EquipSuitCompose.CheckEquipSuitReduce(curPlayer, equipIndex)
|
| | | EventShell.EventRespons_EquipStar(curPlayer)
|
| | | dataDict = {'dotype':'UnEquipItem', 'equipID':equipID, 'userData':userData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | | #===============================================================================
|
| | | # #destItemPlace = 卸下物品的位置
|
| | | # destItemPlace = curPack.GetAt(packIndex)
|
| | |
| | |
|
| | | # 记录玩家升级
|
| | | DataRecordPack.DR_PlayerUpgrade(curPlayer, curPlayer.GetLV(), GetPlayerTotalExp(curPlayer), lvUpNeedExp)
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_LVUP, {'lv':curLV})
|
| | |
|
| | | self.__DoLVUPAddPoint() # 升级加点
|
| | | #self.__DoLvUpAddSkill() # 升级加技能
|
| | |
| | | mfpInfo.MFPCnt = len(mfpDataList)
|
| | | mfpInfo.MFPList = mfpDataList
|
| | | NetPackCommon.SendFakePack(curPlayer, mfpInfo)
|
| | | |
| | | beforeFightPower = curPlayer.GetFightPower()
|
| | | curPlayer.SetFightPower(totalFightPower, False)
|
| | | if totalFightPower < beforeFightPower:
|
| | | DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | highestFightPower = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_Highest, 0,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | if totalFightPower > highestFightPower:
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Highest, totalFightPower,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | GameWorld.DebugLog("总战力: %s, 历史最高战力: %s" % (totalFightPower, highestFightPower))
|
| | | GameWorld.DebugLog("总战力: %s, 历史最高战力: %s, beforeFightPower=%s" % (totalFightPower, highestFightPower, beforeFightPower))
|
| | | PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer)
|
| | | # 记录开服活动数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_FightPower, totalFightPower)
|
| | |
| | | import SkillCommon
|
| | | import SkillShell
|
| | | import PassiveBuffEffMng
|
| | | import DataRecordPack
|
| | |
|
| | | import time
|
| | | #-------------------------------------------------------------
|
| | |
| | | if curDienstgradData:
|
| | | # 删除对应技能
|
| | | __DelSkill(curPlayer, curDienstgradData)
|
| | | |
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_Title, {'dienstgradID':dienstgradID})
|
| | | #重新刷新角色属性
|
| | | if isRefreshAttr:
|
| | | CalcAllDienstgradAttr(curPlayer)
|
| | |
| | | import SkillCommon
|
| | | import SkillShell
|
| | | import PlayerSuccess
|
| | | import DataRecordPack
|
| | |
|
| | | import time
|
| | |
|
| | |
| | |
|
| | | # 设置成功后才能刷技能
|
| | | PassiveBuffEffMng.PlayerDogzSkill(curPlayer)
|
| | | if not isFight:
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_Title, {'dogzID':dogzID})
|
| | | return
|
| | |
|
| | |
|
| | |
| | | import PlayerMagicWeapon
|
| | | import IPY_GameWorld
|
| | | import OpenServerCampaign
|
| | | import DataRecordPack
|
| | |
|
| | | g_runeLVExpDict = {}
|
| | |
|
| | |
| | | if emptyIndex == -1:
|
| | | GameWorld.DebugLog("符印背包已满,无法摘下! ", curPlayer.GetPlayerID())
|
| | | return True
|
| | | |
| | | desRuneData = 0
|
| | | # 摘下设置孔数据为0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Rune_Data % srcRuneNum, 0)
|
| | | ItemControler.SetVPackItemKeyData(curPlayer, ShareDefine.rptRune, emptyIndex, srcRuneData)
|
| | | |
| | | dataDict = {'desBackPack':desBackPack, 'srcRuneData':srcRuneData, 'desRuneData':desRuneData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_Rune, dataDict)
|
| | | RefreshRuneAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | Sync_RuneInfo(curPlayer)
|
| | |
| | | g_teamFBMemRelationAddDict = {} # 组队副本队员关系加成信息 {playerID:[relation, relationAdd, relationPlayerID, relationPlayerName], ...}
|
| | |
|
| | |
|
| | | g_fightpowerChangeDataRecordDict = {} #导致战力降低的各种行为记录 |