389 流向记录(登录、下线、主线任务、主线关卡、副本、货币、物品)
| | |
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import PyGameData
|
| | | import IpyGameDataPY
|
| | | #===============================================================================
|
| | | ##发送事件记录给EventShell
|
| | | # @param eventTypeStr: 事件类型标识
|
| | |
| | | if not GameWorld.IsNormalPlayer(curPlayer):
|
| | | return
|
| | | pid = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFromPID)
|
| | | if pid:
|
| | | dataDict["pid"] = pid
|
| | | dataDict["fightPower"] = PlayerControl.GetFightPower(curPlayer)
|
| | | dataDict["PlayerLV"] = curPlayer.GetLV()
|
| | |
| | | loginTime = curPlayer.GetLoginTime()
|
| | | name = curPlayer.GetName()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | #lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | lv = curPlayer.GetLV()
|
| | | gold = curPlayer.GetGold()
|
| | |
|
| | | dataDict = {'Type':'login', 'IP':str(ip), 'AccID':accID, 'mapID':mapID, 'lineID':lineID,
|
| | | 'Name':name, 'LoginTime':str(loginTime), 'LogoutTime':'', 'MFPFightPower':GetMFPFightPowerInfo(curPlayer),
|
| | | 'LV':curPlayer.GetLV(), 'TotalExp':PlayerControl.GetPlayerTotalExp(curPlayer)}
|
| | | dataDict = {'Type':'login', 'IP':str(ip), 'AccID':accID, 'MapID':mapID, 'Name':name, 'LV':lv, 'Gold':gold, |
| | | 'LoginTime':str(loginTime), 'LogoutTime':''}
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | regCrossZoneID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBZoneID)
|
| | |
| | | logoutTime = curPlayer.GetLogoffTime()
|
| | | loginTime = curPlayer.GetLoginTime()
|
| | | lv = curPlayer.GetLV()
|
| | | vipLV = curPlayer.GetVIPLv()
|
| | | gold = curPlayer.GetGold()
|
| | | 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), 'MFPFightPower':GetMFPFightPowerInfo(curPlayer), |
| | | 'TotalExp':PlayerControl.GetPlayerTotalExp(curPlayer)}
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | dataDict = {'Type':'logout', 'IP':ip, 'AccID':accID, 'MapID':mapID, 'Name':name, 'LV':lv, 'Gold':gold, |
| | | 'LoginTime':str(loginTime), 'LogoutTime':str(logoutTime)}
|
| | | #发送封包
|
| | | 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
|
| | | # @param ip: ip
|
| | | # @return: None
|
| | | def DR_LoginValid(accID, ip, curPlayer):
|
| | |
|
| | | dataDict = {'AccID':accID, 'IP':ip}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("LoginValid", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 新增第一次登陆
|
| | | # @param accID: 账号ID
|
| | |
| | | SendEventPack("CTGOK", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 功能流向信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: {}
|
| | | def __GetFuncDRDict(curPlayer):
|
| | | drDict = {}
|
| | | |
| | | # 官爵阶级、祝福值
|
| | | offBlessValue = 0
|
| | | offRank = curPlayer.GetOfficialRank()
|
| | | drDict["Official"] = [offRank, offBlessValue]
|
| | | |
| | | return drDict
|
| | |
|
| | | ## 玩家升级
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param playerLV: 玩家等级
|
| | |
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerUpgrade", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_Task(curPlayer, taskGroup, taskID, eventName="", drDict={}):
|
| | | ## 任务流向
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'TaskID':taskID, 'TaskGroup':taskGroup, 'eventName':eventName}
|
| | | dataDict.update(drDict)
|
| | | SendEventPack("Task_%s" % taskGroup, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_MainLevelPass(curPlayer, lvID):
|
| | | ## 主线关卡过关
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'lvID':lvID}
|
| | | SendEventPack("MainLevelPass", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_FBPass(curPlayer, mapID, funcLineID, drDict={}):
|
| | | ## 副本过关
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'MapID':mapID, 'LineID':funcLineID}
|
| | | dataDict.update(drDict)
|
| | | SendEventPack("FBPass_%s" % mapID, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ##累计登陆礼包
|
| | |
| | | return
|
| | |
|
| | | #避免记录太多信息
|
| | | if moneyType in [IPY_GameWorld.TYPE_Price_Silver_Money] and moneyCount < ChConfig.Def_DRRecord_Min_Silver:
|
| | | if moneyType in IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 3):
|
| | | #GameWorld.DebugLogEx("消耗不记录的货币类型: %s", moneyType)
|
| | | return
|
| | | moneyRecordDict = IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 4, {})
|
| | | if moneyType in moneyRecordDict:
|
| | | recordSet = moneyRecordDict[moneyType]
|
| | | if moneyCount < recordSet:
|
| | | #GameWorld.DebugLogEx("消耗过少不记录的货币类型: %s,moneyCount=%s < %s", moneyType, moneyCount, recordSet)
|
| | | return
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(),
|
| | |
| | | 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
|
| | |
|
| | | dataDict.update(addDataDict)
|
| | | dataDict.update(__GetFuncDRDict(curPlayer))
|
| | |
|
| | | #金子
|
| | | if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | |
| | | return
|
| | |
|
| | | #避免记录太多信息
|
| | | if moneyType in [IPY_GameWorld.TYPE_Price_Silver_Money] and moneyCount < ChConfig.Def_DRRecord_Min_Silver:
|
| | | if moneyType in IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 1):
|
| | | #GameWorld.DebugLogEx("获得不记录的货币类型: %s", moneyType)
|
| | | return
|
| | | moneyRecordDict = IpyGameDataPY.GetFuncEvalCfg("MoneyRecord", 2, {})
|
| | | if moneyType in moneyRecordDict:
|
| | | recordSet = moneyRecordDict[moneyType]
|
| | | if moneyCount < recordSet:
|
| | | #GameWorld.DebugLogEx("获得过少不记录的货币类型: %s,moneyCount=%s < %s", moneyType, moneyCount, recordSet)
|
| | | return
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(),
|
| | |
| | | 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
|
| | |
|
| | | dataDict.update(addDataDict)
|
| | | dataDict.update(__GetFuncDRDict(curPlayer))
|
| | |
|
| | | #金子
|
| | | if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | |
| | | import ReadChConfig
|
| | | import PlayerActivity
|
| | | import ChPyNetSendPack
|
| | | import DataRecordPack
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBPassLineID % mapID, funcLineID)
|
| | | if isNotify:
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | DataRecordPack.DR_FBPass(curPlayer, mapID, funcLineID)
|
| | | return
|
| | |
|
| | | def CheckCanEnterFBComm(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, reqEnterCnt=1, isNotify=True, isTeamAsk=False):
|
| | |
| | | moneyTotal = int(round(moneyTotal)) # 四舍五入取整
|
| | | GameWorld.DebugLog("moneyTotal=%s,mjExTotal=%s" % (moneyTotal, mjExTotal), playerID)
|
| | |
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
|
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, isSysHint=False)
|
| | | PlayerLLMJ.AddExpDecompose(curPlayer, mjExTotal)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_EquipDecompose, decomposeCnt)
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerBillboard
|
| | | import ChPyNetSendPack
|
| | | import DataRecordPack
|
| | | import NetPackCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Tianzi", False, {}], isNotifyAward=False)
|
| | | SyncTianziInfo(curPlayer, lineID, bossID)
|
| | | __onFBTianzi(curPlayer)
|
| | | |
| | | DataRecordPack.DR_FBPass(curPlayer, mapID, funcLineID, {"hpNum":hpNum, "totalHurt":totalHurt})
|
| | | return
|
| | |
|
| | | def __getTianziAwardList(todayHurt, bossID, sweepCnt=1):
|
| | |
| | |
|
| | | itemType = curItem.GetType()
|
| | | itemID = curItem.GetItemTypeID()
|
| | | |
| | | if itemType in IpyGameDataPY.GetFuncEvalCfg("ItemRecordRule", 4) \
|
| | | or itemID in IpyGameDataPY.GetFuncEvalCfg("ItemRecordRule", 5):
|
| | | GameWorld.DebugLog("不需要记录的物品类型或ID! itemType=%s,itemID=%s" % (itemType, itemID))
|
| | | return False
|
| | | |
| | | itemTypeMinColorDict = IpyGameDataPY.GetFuncEvalCfg("ItemRecordRule", 1)
|
| | | if itemType in itemTypeMinColorDict:
|
| | | minColor = itemTypeMinColorDict[itemType]
|
| | |
| | | or itemID in IpyGameDataPY.GetFuncEvalCfg("ItemRecordRule", 3):
|
| | | #GameWorld.DebugLog("需要记录的物品类型或ID! itemType=%s,itemID=%s" % (itemType, itemID))
|
| | | return True
|
| | | |
| | | if itemType in IpyGameDataPY.GetFuncEvalCfg("ItemRecordRule", 4) \
|
| | | or itemID in IpyGameDataPY.GetFuncEvalCfg("ItemRecordRule", 5):
|
| | | #GameWorld.DebugLog("不需要记录的物品类型或ID! itemType=%s,itemID=%s" % (itemType, itemID))
|
| | | return False
|
| | |
|
| | | #if itemType == ChConfig.Def_ItemType_Rune:
|
| | | # return IsRuneItemNeedRecord(curItem, curItem.GetUserAttr(ShareDefine.Def_IudetRuneLV))
|
| | |
| | | import PlayerPrestigeSys
|
| | | import FBCommon
|
| | | import PassiveBuffEffMng
|
| | | import EventReport
|
| | | import PlayerSuccess
|
| | | import ItemControler
|
| | | import GameFuncComm
|
| | |
| | | __PayMoneyAfterBySilverPaper(curPlayer, price)
|
| | |
|
| | | #转盘活动
|
| | | PlayerActTurntable.OnPlayerUseGold(curPlayer, type_Price, price)
|
| | | #PlayerActTurntable.OnPlayerUseGold(curPlayer, type_Price, price)
|
| | | #轮回殿
|
| | | PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_PayMoney, type_Price, price)
|
| | | #PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_PayMoney, type_Price, price)
|
| | | if type_Price == ShareDefine.TYPE_Price_Xiantao:
|
| | | # 累加未结算战锤 - 经验
|
| | | unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp)
|
| | |
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_OSAMainLevel, lvID)
|
| | | if OpenServerActivity.GetOSAState(curPlayer, ShareDefine.Def_BT_OSA_MainLevel) == 1:
|
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_OSA_MainLevel, lvID)
|
| | | DataRecordPack.DR_MainLevelPass(curPlayer, lvID)
|
| | | return value
|
| | | def GetMainLevelPassInfo(curPlayer):
|
| | | ## 获取主线关卡过关进度信息
|
| | |
| | | wave = value % 100
|
| | | return chapterID, levelNum, wave
|
| | |
|
| | | ## 额外记录最后一次接到的主线任务ID,仅接到新任务时更新即可,可方便用于后台统计或其他判断
|
| | | def GetMainTaskID(curPlayer):return curPlayer.GetExAttr20()
|
| | | def SetMainTaskID(curPlayer, value): curPlayer.SetExAttr20(value)
|
| | |
|
| | | ## 获取佩戴的称号ID
|
| | | def GetTitleID(curPlayer): return curPlayer.GetExAttr3()
|
| | | def SetTitleID(curPlayer, titleID):
|
| | |
| | | import NetPackCommon
|
| | | import PlayerGoldRush
|
| | | import ChPyNetSendPack
|
| | | import DataRecordPack
|
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | | import GameFuncComm
|
| | |
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetTaskCount()):
|
| | | ipyData = ipyDataMgr.GetTaskByIndex(index)
|
| | | taskGroup = ipyData.GetTaskGroup()
|
| | | tGroup = ipyData.GetTaskGroup()
|
| | | taskID = ipyData.GetTaskID()
|
| | | if taskGroup not in taskIDListDict:
|
| | | taskIDListDict[taskGroup] = []
|
| | | taskIDList = taskIDListDict[taskGroup]
|
| | | if tGroup not in taskIDListDict:
|
| | | taskIDListDict[tGroup] = []
|
| | | taskIDList = taskIDListDict[tGroup]
|
| | | if taskID not in taskIDList:
|
| | | taskIDList.append(taskID)
|
| | | IpyGameDataPY.SetConfigEx(key, taskIDListDict)
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def __giveNewTask(curPlayer, taskGroup=ChConfig.TaskGroup_Main):
|
| | | def __giveNewTask(curPlayer, taskGroup=ChConfig.TaskGroup_Main, preTaskID=0):
|
| | | ## 给新任务
|
| | | # @param preTaskID: 上一个任务ID
|
| | | taskIDList = GetTaskIDList(taskGroup)
|
| | | if not taskIDList:
|
| | | return
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskValue % taskGroup, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TaskState % taskGroup, ChConfig.TaskState_Doing)
|
| | | GameWorld.DebugLog("接到新任务: taskGroup=%s,newTaskID=%s" % (taskGroup, newTaskID), playerID)
|
| | | |
| | | # 额外记录接到任务
|
| | | if taskGroup == ChConfig.TaskGroup_Main:
|
| | | PlayerControl.SetMainTaskID(curPlayer, newTaskID)
|
| | | DataRecordPack.DR_Task(curPlayer, taskGroup, newTaskID, "new", {"preTaskID":preTaskID})
|
| | | |
| | | return SetTaskValue(curPlayer, ipyData, taskValue)
|
| | |
|
| | | def __GetTaskValue(curPlayer, ipyData):
|
| | |
| | | appointInfo[itemID] = appointID
|
| | | ItemControler.NotifyGiveAwardInfo(curPlayer, notifyAwardList, "Task", dataEx={"appointInfo":appointInfo})
|
| | |
|
| | | if not __giveNewTask(curPlayer, taskGroup):
|
| | | if not __giveNewTask(curPlayer, taskGroup, taskID):
|
| | | SyncTaskInfo(curPlayer, [taskGroup])
|
| | |
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|