| | |
| | | # @change: "2014-12-01 19:10" ljd 增加领取合服活动登陆奖励事件记录
|
| | | # @change: "2014-12-21 23:00" hxp 增加功能奖励物品
|
| | | # @change: "2014-12-23 00:30" hxp 充值前/消费时流向信息扩展(增加各大功能信息)
|
| | | # @change: "2015-01-27 22:30" hxp 增加转生等级变更流向
|
| | | # @change: "2015-02-05 15:00" hxp 充值送礼流向扩展信息字典
|
| | | # @change: "2015-02-27 21:00" hxp 增加大师等级升级流向; 重新开启技能学习流向
|
| | | # @change: "2015-03-30 14:00" hxp 增加击杀NPC流向
|
| | |
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import PyGameData
|
| | | #===============================================================================
|
| | | ##发送事件记录给EventShell
|
| | | # @param eventTypeStr: 事件类型标识
|
| | |
| | | if curPlayer:
|
| | | pid = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFromPID)
|
| | | dataDict["pid"] = pid
|
| | | dataDict["fightPower"] = curPlayer.GetFightPower()
|
| | | dataDict["time"] = str(datetime.datetime.today()).split(".")[0]
|
| | |
|
| | | dataStr = str(dataDict)
|
| | |
| | | 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
|
| | |
| | | #发送封包
|
| | | SendEventPack("CTGError", dataDict, curPlayer)
|
| | | GameWorld.ErrLog("%s. %s" % (errorInfo, addDict), curPlayer.GetPlayerID())
|
| | | |
| | | GameWorld.SendGameStateMail("CTGError:%s - %s"%(errorInfo, dataDict))
|
| | | return
|
| | |
|
| | | def DR_CTGOK(curPlayer, addDict):
|
| | |
| | | #发送封包
|
| | | SendEventPack("PlayerCoinAfterCharge", dataDict, curPlayer)
|
| | | return
|
| | | |
| | | |
| | | ## 玩家商城购买物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param buyItemID: 购买物品id
|
| | | # @param buyItemCount: 购买物品数量
|
| | | # @param buyItemGUID: GUID
|
| | | # @return: None
|
| | | def DR_PlayerSupermarket(curPlayer, buyItemID, buyItemCount, buyItemGUID):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'ItemID':buyItemID, 'ItemCount':buyItemCount, |
| | | 'ItemGUID':buyItemGUID}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerSupermarket", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 玩家升级
|
| | | # @param curPlayer: 玩家实例
|
| | |
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerUpgrade", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家转生等级变更
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param reincarnationLvBefore: 之前转生次数
|
| | | # @param playerLVExBefore: 之前转生等级
|
| | | # @param eventName: |
| | | # @return: None
|
| | | def DR_PlayerLVExChange(curPlayer, reincarnationLvBefore, playerLVExBefore, eventName, addDataDict={}):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'ReincarnationLv':curPlayer.GetReincarnationLv(), |
| | | 'PlayerLV':curPlayer.GetLV(), 'PlayerLVEx':curPlayer.GetLVEx(), |
| | | 'TotalExp':curPlayer.GetTotalExp(), 'ReincarnationLvBefore':reincarnationLvBefore, |
| | | 'PlayerLVExBefore':playerLVExBefore, "EventName":eventName}
|
| | | |
| | | dataDict.update(addDataDict)
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerLVExChange", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家大师等级变更
|
| | |
| | | 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执行命令操作
|
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 获得金钱失败
|
| | | def DR_GiveMoneyError(curPlayer, priceType, value, giveType, addDataDict):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), "GiveType":giveType, "GiveValue":value, "AddDataDict":addDataDict}
|
| | | SendEventPack("GiveMoneyError_%s" % priceType, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 获得物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 功能事件名
|
| | |
| | | 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("PlayerGetReward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_MergePlayerEvent(playerID, eventType, eventTime, eventData, opType):
|
| | | # 跨服玩家记录事件流向
|
| | | dataDict = {'PlayerID':playerID, "EventType":eventType, "EventTime":eventTime, 'EventData':eventData}
|
| | | SendEventPack("MergePlayerEvent_%s" % opType, dataDict)
|
| | | return
|
| | |
|
| | | ## 申请加入贵宾俱乐部
|
| | | # @param curPlayer
|
| | | # @param hasRegister: 之前是否已报名
|
| | |
| | | SendEventPack("CollectNPCOK", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家领取充值特惠活动奖励
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param actionID: 活动id
|
| | | # @param actionNum: 活动编号
|
| | | # @param itemID: 物品id
|
| | | # @param itemCnt: 物品数量
|
| | | # @param isPutIn: 是否放入
|
| | | # @param prizeIndex: 奖励中的第x种奖励
|
| | | # @return |
| | | def DR_PlayerTeHuiRechargePrize(curPlayer, actionID, actionNum, itemID, itemCnt, isPutIn, prizeIndex):
|
| | | #MySql不识别 True False,改成1和0
|
| | | isPutIn = 1 if isPutIn else 0
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'ActionID':actionID, 'ActionNum':actionNum, |
| | | 'IsPutIn':isPutIn, "ItemID":itemID, "ItemCount":itemCnt, 'PrizeIndex':prizeIndex}
|
| | | |
| | | SendEventPack("TeHuiRechargePrize", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 领取投资回报
|
| | | # @param curPlayer: 玩家实例
|
| | |
| | |
|
| | | #发送封包
|
| | | SendEventPack("TreasureResult", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 消费VIP升级记录
|
| | | # @param curPlayer
|
| | | # @param lastLV ԭVIPLV
|
| | | # @param curExp 当前VIP经验
|
| | | # @param addExp 增加VIP经验
|
| | | # @param costType 花费类型
|
| | | # @param costGold 花费数
|
| | | # @return: None
|
| | | def DR_PlayerCostVIPLV(curPlayer, lastLV, curExp, addExp, costType, costGold):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'VIPLv':curPlayer.GetVIPLv(), 'lastVIPLv':lastLV,
|
| | | 'curExp':curExp, 'addExp':addExp, 'costType':costType, 'costGold':costGold}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerCostVIPLV", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家提交bug及建议
|
| | |
| | |
|
| | | ## 玩家境界升级
|
| | | # @return
|
| | | def DR_RealmLVUp(curPlayer, realmlv, realmPoint, needRealmPoint):
|
| | | def DR_RealmLVUp(curPlayer, realmlv):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(),
|
| | | 'AccID':curPlayer.GetAccID(), 'realmlv':realmlv, 'curRealmPoint':realmPoint, 'costRealmPoint':needRealmPoint,
|
| | | 'AccID':curPlayer.GetAccID(), 'realmlv':realmlv,
|
| | | 'playerlv':curPlayer.GetLV(), 'power':curPlayer.GetFightPower()}
|
| | |
|
| | | #发送封包
|
| | | 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
|
| | |
|
| | | ## 玩家周狂欢(七天巡礼)
|
| | | # @return
|
| | | def DR_WeekPartyPoint(curPlayer, dayIndex, point):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'AccID':curPlayer.GetAccID(), 'dayIndex':dayIndex, 'point':point}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("WeekPartyPoint", dataDict, curPlayer)
|
| | | return
|
| | | def DR_FeastWeekPartyPoint(curPlayer, dayIndex, point):
|
| | | ##节日巡礼
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'AccID':curPlayer.GetAccID(), 'dayIndex':dayIndex, 'point':point}
|
| | | #发送封包
|
| | | SendEventPack("FeastWeekPartyPoint", dataDict, curPlayer)
|
| | | return |