| | |
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import PyGameData
|
| | | import IpyGameDataPY
|
| | | #===============================================================================
|
| | | ##发送事件记录给EventShell
|
| | | # @param eventTypeStr: 事件类型标识
|
| | | # @param dataDict: 事件字典
|
| | | # @return None
|
| | | def SendEventPack(eventTypeStr, dataDict, curPlayer=None):
|
| | |
|
| | | def SendEventPack(eventTypeStr, dataDict, curPlayer=None, checkBatServer=True):
|
| | | |
| | | if checkBatServer and GameWorld.IsBattleServer():
|
| | | GameWorld.DebugLogEx("战斗服务器暂不做流向记录")
|
| | | return
|
| | | |
| | | if curPlayer:
|
| | | if not GameWorld.IsNormalPlayer(curPlayer):
|
| | | return
|
| | | pid = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFromPID)
|
| | | dataDict["pid"] = pid
|
| | | if pid:
|
| | | dataDict["pid"] = pid
|
| | | dataDict["fightPower"] = PlayerControl.GetFightPower(curPlayer)
|
| | | dataDict["PlayerLV"] = curPlayer.GetLV()
|
| | | dataDict["IP"] = curPlayer.GetIP()
|
| | |
| | | dataStr = str(dataDict)
|
| | | GameWorld.GetGameWorld().EventShell_SendEventEx(eventTypeStr, len(eventTypeStr), dataStr, len(dataStr))
|
| | | return
|
| | |
|
| | |
|
| | | ## 二次非同天登陆
|
| | | # @param accID: 账号ID
|
| | | # @param ip: ip
|
| | | # @return: None
|
| | | def DR_OtherDayLogin(accID, ip, curPlayer):
|
| | | |
| | | dataDict = {'AccID':accID, 'IP':ip}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("OtherDayLogin", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 登陆
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | 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)
|
| | | def DR_OnlineTimeToday(curPlayer, onlineTime):
|
| | | ## 今日累计在线时长
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'OnlineTime':onlineTime}
|
| | | SendEventPack("OnlineTimeToday", dataDict)
|
| | | return
|
| | |
|
| | |
|
| | | ## 新增第一次登陆
|
| | | # @param accID: 账号ID
|
| | |
| | | SendEventPack("FirstLogin", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 放生宠物 |
| | | # @param curPlayer: 玩家实例
|
| | | # @param petID: 宠物ID
|
| | | # @param petNPCID: 宠物NPCID
|
| | | # @param petNPCName: 宠物NPC名字
|
| | | # @return: None
|
| | | def DR_FreePet(curPlayer, petID, petNPCID, petNPCName):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PetID':petID, 'NPCID':petNPCID, 'NPCName':petNPCName}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("FreePet", dataDict, curPlayer)
|
| | | def DR_OnLinePlayerCount(playerCount):
|
| | | ## 服务器在线人数
|
| | | # @param playerCount: 人数
|
| | | dataDict = {'OnLinePlayerCount':playerCount}
|
| | | SendEventPack("OnLinePlayerCount", dataDict)
|
| | | return
|
| | |
|
| | |
|
| | | ## 副本奖励物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param mapID: 地图ID
|
| | | # @param itemID: 物品ID
|
| | | # @param itemCnt: 物品数量
|
| | | # @param isBind: 是否绑定
|
| | | # @return: None
|
| | | def DR_FBGiveItem(curPlayer, mapID, itemID, itemCnt, isBind):
|
| | | #MySql不识别 True False,改成1和0
|
| | | isBind = 1 if isBind else 0
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'MapID':mapID, 'ItemID':itemID, 'ItemCount':itemCnt, |
| | | 'IsBind':isBind}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("FBGiveItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 功能奖励物品
|
| | | # @param curPlayer: 玩家实例
|
| | |
| | | dataDict.update(addDataDict)
|
| | | #发送封包
|
| | | SendEventPack("GiveItem_%s" % funcName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 获得任务
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param missionID: 任务ID
|
| | | # @return: None
|
| | | def DR_AddNewMission(curPlayer, missionID):
|
| | | return
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), 'AccID':curPlayer.GetAccID(), |
| | | 'MissionID':missionID}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("AddNewMission", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 完成任务 |
| | | # @param curPlayer: 玩家实例
|
| | | # @param missionID: 任务ID
|
| | | # @return: None
|
| | | def DR_DeleteMission(curPlayer, missionID):
|
| | | return
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'MissionID':missionID}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("DeleteMission", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 仓库存入金钱
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param moneyType: 金钱类型
|
| | | # @param moneyCount: 金钱数量
|
| | | # @return: None
|
| | | def DR_SetMoneyInWarehouse(curPlayer, moneyType, moneyCount):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), |
| | | 'MoneyType':moneyType, 'MoneyCount':moneyCount, |
| | | 'WarehouseMoneyCount':PlayerControl.GetWarehouseMoney(curPlayer, moneyType), |
| | | 'PlayerMoneyCount':PlayerControl.GetMoney(curPlayer, moneyType)}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("SetMoneyInWarehouse", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 仓库取出金钱
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param moneyType: 金钱类型
|
| | | # @param moneyCount: 金钱数量
|
| | | # @return: None
|
| | | def DR_GetMoneyInWarehouse(curPlayer, moneyType, moneyCount):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), |
| | | 'MoneyType':moneyType, 'MoneyCount':moneyCount, |
| | | 'WarehouseMoneyCount':PlayerControl.GetWarehouseMoney(curPlayer, moneyType), |
| | | 'PlayerMoneyCount':PlayerControl.GetMoney(curPlayer, moneyType)}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("GetMoneyInWarehouse", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 出售物品获得金钱 |
| | | # @param curPlayer: 玩家实例
|
| | | # @param moneyType: 金钱类型
|
| | | # @param moneyCount: 金钱数量
|
| | | # @return: None
|
| | | def DR_GetMoneyBySellPackItem(curPlayer, moneyType, moneyCount):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), |
| | | 'MoneyType':moneyType, 'MoneyCount':moneyCount, |
| | | 'PlayerMoneyCount':PlayerControl.GetMoney(curPlayer, moneyType)}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("GetMoneyBySellPackItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_CTGError(curPlayer, errorInfo, addDict):
|
| | |
| | | SendEventPack("CTGOK", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家充值后的元宝信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param addGold: 增值元宝
|
| | | # @param totalGold: 剩余元宝
|
| | | # @return: None
|
| | | def DR_PlayerGoldAfterCharge(curPlayer, addGold, totalGold):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'AddGold':addGold, 'TotalGold':totalGold}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerGoldAfterCharge", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家充值前的相关信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param infoDict: 额为赠送数
|
| | | # @return: None
|
| | | def DR_PlayerInfoBeforeCharge(curPlayer, infoDict={}):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV(),
|
| | | 'TotalGold':curPlayer.GetGold(),
|
| | | }
|
| | | |
| | | dataDict.update(__GetFuncDRDict(curPlayer))
|
| | | dataDict.update(infoDict)
|
| | | |
| | | #发送封包
|
| | | SendEventPack("PlayerInfoBeforeCharge", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 功能流向信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: {}
|
| | | def __GetFuncDRDict(curPlayer):
|
| | | drDict = {}
|
| | | |
| | | # 官爵阶级、祝福值
|
| | | offBlessValue = 0
|
| | | offRank = curPlayer.GetOfficialRank()
|
| | | drDict["Official"] = [offRank, offBlessValue]
|
| | | |
| | | return drDict
|
| | |
|
| | | ## 玩家充值后的点券信息及vip等级
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param changeCoin: 兑换的点券数
|
| | | # @param totaChangelCoin: 总兑换点券数
|
| | | # @param prizeCoin: 赠送点券数
|
| | | # @param totalPrizeCoin: 总赠送点券数
|
| | | # @param playerVIPLV: vip等级
|
| | | # @param crazyCoin: 额为赠送数
|
| | | # @return: None
|
| | | def DR_PlayerCoinAfterCharge(curPlayer, changeCoin, totaChangelCoin, prizeCoin, |
| | | totalPrizeCoin, playerVIPLV, crazyCoin, orderID):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'ChangeCoin':changeCoin, 'TotaChangelCoin':totaChangelCoin,
|
| | | 'PrizeCoin':prizeCoin, 'TotalPrizeCoin':totalPrizeCoin, 'VIPLv':playerVIPLV, |
| | | "CrazyCoin":crazyCoin, 'QueryOrderID':orderID}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerCoinAfterCharge", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家升级
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param playerLV: 玩家等级
|
| | |
| | | SendEventPack("PlayerUpgrade", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家大师等级变更
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param totalMasterExp: 当前总大师经验
|
| | | # @param eventName: 变更事件名
|
| | | # @return: None
|
| | | def DR_PlayerMasterLVChange(curPlayer, totalMasterExp, addDataDict={}):
|
| | |
|
| | | def DR_Task(curPlayer, taskGroup, taskID, eventName="", drDict={}):
|
| | | ## 任务流向
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(),
|
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), |
| | | 'TotalExp':curPlayer.GetTotalExp(), 'MasterLV':curPlayer.GetLV2(), |
| | | 'TotalExpMaster':totalMasterExp}
|
| | | |
| | | dataDict.update(addDataDict)
|
| | | |
| | | #发送封包
|
| | | SendEventPack("PlayerMasterLVChange", dataDict, curPlayer)
|
| | | 'AccID':curPlayer.GetAccID(), 'TaskID':taskID, 'TaskGroup':taskGroup, 'eventName':eventName}
|
| | | dataDict.update(drDict)
|
| | | SendEventPack("Task_%s" % taskGroup, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ##充值送物品
|
| | | def DR_BillingGiveItem(curPlayer, itemID, itemCnt):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | "ItemID":itemID,
|
| | | 'ItemCount':itemCnt
|
| | | }
|
| | | |
| | | SendEventPack("BillingGiveItem", dataDict, curPlayer)
|
| | | 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
|
| | |
|
| | | ##充值领豪礼
|
| | | def DR_GoldGiftGiveItem(curPlayer, giftNum, infoDict={}):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | "GiftNum":giftNum
|
| | | }
|
| | | def DR_FightStat(reqPlayerID, mapID, funcLineID, isWin, turnNum, turnMax, heroCount, costTime, statInfo, drLineupInfo):
|
| | | ## 战斗统计
|
| | | dataDict = {'PlayerID':reqPlayerID, 'mapID':mapID, 'funcLineID':funcLineID, 'isWin':isWin, |
| | | 'turnNum':turnNum, 'turnMax':turnMax, 'heroCount':heroCount, 'costTime':costTime}
|
| | | SendEventPack("FightTime", dataDict, checkBatServer=False)
|
| | |
|
| | | dataDict.update(infoDict)
|
| | | SendEventPack("GoldGiftGiveItem", dataDict, curPlayer)
|
| | | #战斗失败的记录明细信息
|
| | | if not isWin:
|
| | | failDRDict = {"statInfo":statInfo, "drLineupInfo":drLineupInfo}
|
| | | failDRDict.update(dataDict)
|
| | | SendEventPack("FightFail_%s" % mapID, failDRDict, checkBatServer=False)
|
| | | return
|
| | |
|
| | | ##累计登陆礼包
|
| | |
| | | SendEventPack("LVAward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 使用新手媒体卡
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param cardStr: 卡号
|
| | | # @param cardType: 卡的key
|
| | | # @param itemID: 给予物品ID
|
| | | # @param itemCnt: 给予物品数量
|
| | | # @return: None
|
| | | def DR_UseNewGuyCard(curPlayer, cardStr, cardType, itemID, itemCnt):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'LV':curPlayer.GetLV(),
|
| | | 'CreateRoleTime':curPlayer.GetCreateRoleTime(),
|
| | | 'CardStr':cardStr,
|
| | | 'CardType':cardType,
|
| | | "ItemID":itemID,
|
| | | 'ItemCount':itemCnt
|
| | | }
|
| | | |
| | | SendEventPack("UseNewGuyCard", dataDict, curPlayer)
|
| | | return
|
| | | |
| | | def DR_UseMediaCard(curPlayer, cardCode, cardType, awardItemList, addDataDict={}):
|
| | | # 使用新媒体卡
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'LV':curPlayer.GetLV(), 'CardCode':cardCode, 'CardType':cardType,
|
| | | "AwardItemList":awardItemList,
|
| | | }
|
| | | dataDict.update(addDataDict)
|
| | | SendEventPack("UseMediaCard", dataDict, curPlayer)
|
| | | return
|
| | | |
| | | ## 开服活动奖励领取情况
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param dataDict: 记录信息字典
|
| | | # @return: None
|
| | | def DR_OpenServerAward(curPlayer, dataDict):
|
| | | dataDict["PlayerID"] = curPlayer.GetPlayerID()
|
| | | dataDict["AccID"] = curPlayer.GetAccID()
|
| | | dataDict["PlayerName"] = curPlayer.GetPlayerName()
|
| | | |
| | | SendEventPack("OpenServerAward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## GM执行命令操作
|
| | | # @param playerID: 玩家ID
|
| | | # @param playerName:玩家名字
|
| | |
| | | #发送封包
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | SendEventPack("GMToolOperate", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 出售指定背包物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param dataDict: 记录信息字典
|
| | | # @return: |
| | | def DR_SellPackItem(curPlayer, dataDict):
|
| | | dataDict.update({"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()})
|
| | | SendEventPack("SellPackItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | SendEventPack("BuyItem_%s" % eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 任务给予金钱
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 事件类型
|
| | | # @param missionID: 任务ID
|
| | | # @param moneyType: 金钱类型
|
| | | # @param moneyCount: 金钱数量
|
| | | # @return: |
| | | def DR_EventAddMoney(curPlayer, eventName, missionID, moneyType, moneyCount):
|
| | | return
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "MissionID":missionID, "MoneyType":moneyType, "MoneyCount":moneyCount, |
| | | 'PlayerMoneyCount':PlayerControl.GetMoney(curPlayer, moneyType)}
|
| | | |
| | | SendEventPack("EventAddMoney_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 任务给予经验
|
| | | def DR_EventAddExp(curPlayer, missionID, exp):
|
| | | return
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "MissionID":missionID, "GiveExp":exp, "PlayerExp":curPlayer.GetTotalExp()}
|
| | | |
| | | SendEventPack("EventAddExp", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 删除物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 功能事件名
|
| | |
| | |
|
| | | SendEventPack("DeleteItem_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 活动期间任意重置给予物品
|
| | | # @param cyrPlayer: 玩家实例
|
| | | # @param giveItemInfoDict: 物品信息字典
|
| | | # @return
|
| | | def DR_RandCoinGiveItem(curPlayer, giveItemInfoDict):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()}
|
| | | dataDict.update(giveItemInfoDict)
|
| | | |
| | | SendEventPack("RandCoinGiveItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 活动期间单次充值给予物品
|
| | | # @param cyrPlayer: 玩家实例
|
| | | # @param giveItemInfoDict: 物品信息字典
|
| | | # @return
|
| | | def DR_OnTimeCoinGiveItem(curPlayer, giveItemInfoDict):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()}
|
| | | dataDict.update(giveItemInfoDict)
|
| | | |
| | | SendEventPack("OnTimeCoinGiveItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 累计充值给予物品
|
| | | # @param cyrPlayer: 玩家实例
|
| | | # @param giveItemInfoDict: 物品信息字典
|
| | | # @return
|
| | | def DR_TotalCoinGiveItem(curPlayer, giveItemInfoDict):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()}
|
| | | dataDict.update(giveItemInfoDict)
|
| | | |
| | | SendEventPack("TotalCoinGiveItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 释放技能消耗物品
|
| | | # @param curPlayer: 玩家实例
|
| | |
| | | SendEventPack("ChangePackItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 设置仓库密码
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param OldPsw: 旧密码
|
| | | # @param NewPsw: 新密码
|
| | | # @return: |
| | | def DR_SetWarehousePsw(curPlayer, oldPsw, newPsw):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "OldPsw":oldPsw, "NewPsw":newPsw}
|
| | | |
| | | SendEventPack("SetWarehousePsw", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 消耗金钱
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 功能事件名
|
| | |
| | | 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(),
|
| | | 'AccID':curPlayer.GetAccID(), "eventName":eventName,
|
| | | 'MoneyType':moneyType, 'MoneyCount':moneyCount,
|
| | |
| | | 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
|
| | |
|
| | | dataDict.update(addDataDict)
|
| | | dataDict.update(__GetFuncDRDict(curPlayer))
|
| | |
|
| | | #金子
|
| | | if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | |
| | | SendEventPack("UseCurrency_%s" % moneyType, dataDict, curPlayer)
|
| | |
|
| | | #战盟贡献
|
| | | elif moneyType == ShareDefine.TYPE_Price_Family_Contribution:
|
| | | SendEventPack("UseFamilyContribution", dataDict, curPlayer)
|
| | | #elif moneyType == ShareDefine.TYPE_Price_Family_Contribution:
|
| | | # SendEventPack("UseFamilyContribution", 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", 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(),
|
| | | 'AccID':curPlayer.GetAccID(), "eventName":eventName,
|
| | | 'MoneyType':moneyType, 'MoneyCount':moneyCount,
|
| | |
| | | 'VIPLV':curPlayer.GetVIPLv(), 'PlayerLV':curPlayer.GetLV()}
|
| | |
|
| | | dataDict.update(addDataDict)
|
| | | dataDict.update(__GetFuncDRDict(curPlayer))
|
| | |
|
| | | #金子
|
| | | if moneyType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | |
| | | SendEventPack("GivePlayerItem_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 装备加工
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 功能事件名
|
| | | # @param addDataDict: 附加信息
|
| | | # @return: |
| | | def DR_EquipMachining(curPlayer, eventName, addDataDict):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()}
|
| | | dataDict.update(addDataDict)
|
| | | |
| | | SendEventPack("EquipMachining_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_StoneItemChange(curPlayer, eventName, addDict={}):
|
| | | # 记录宝石物品变更
|
| | | 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={}):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()}
|
| | | dataDict.update(addDict)
|
| | | |
| | | SendEventPack("VIPTimeChange_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 学习和升级技能
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param SkillID: 技能ID
|
| | |
| | | SendEventPack("LearnORUPSkill", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 碎片合成给予物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param itemID: 物品ID
|
| | | # @param itemCnt: 物品数量
|
| | | # @param isBind: 是否绑定
|
| | | # @return: |
| | | def DR_StuffMachining(curPlayer, itemID, itemCnt, isBind):
|
| | | return
|
| | | #MySql不识别 True False,改成1和0
|
| | | isBind = 1 if isBind else 0
|
| | | |
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "ItemID":itemID, "ItemCount":itemCnt, "IsBind":isBind}
|
| | | |
| | | SendEventPack("StuffMachining", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 背包格子数量购买
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param packType: 背包类型
|
| | | # @param buyCnt: 购买格子数
|
| | | # @param totalCnt: 总购买数
|
| | | # @return: |
| | | def DR_OpenPackCount(curPlayer, packType, buyCnt, tatleCnt):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "PackType":packType, "Count":buyCnt, "TotalCount":tatleCnt}
|
| | | |
| | | SendEventPack("OpenPackCount", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 笑恩录点数改变
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param changePoint: 改变点数
|
| | | # @param resultPoint: 结果点数
|
| | | # @return: |
| | | def DR_EventXELPoint(curPlayer, changePoint, resultPoint):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "ChangePoing":changePoint, "Point":resultPoint}
|
| | | |
| | | SendEventPack("EventXELPoint", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 添加称号
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 来源事件名
|
| | | # @param titleID: 称号ID
|
| | | # @param addDataDict: 附加属性
|
| | | # @return
|
| | | def DR_AddTitle(curPlayer, eventName, titleID, addDataDict={}):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "ItemID":titleID}
|
| | | dataDict.update(addDataDict)
|
| | | |
| | | SendEventPack("AddTitle_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 玩家剩余属性点
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 来源事件名
|
| | | # @param point: 点数
|
| | | # @param addDataDict: 附加属性
|
| | | def DR_Freepoint(curPlayer, eventName, point, addDataDict={}):
|
| | | return
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "Point":point, "TotalPoint":curPlayer.GetFreePoint()}
|
| | | dataDict.update(addDataDict)
|
| | | |
| | | SendEventPack("Freepoint_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 真气改变
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 事件类型
|
| | | # @param value: 数值
|
| | | # @param addDataDict: 附加属性
|
| | | def DR_ChangeZhenQi(curPlayer, eventName, value, addDataDict={}):
|
| | | return
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(),
|
| | | "Value":value, "TotalValue":curPlayer.GetExAttr5()}
|
| | | |
| | | dataDict.update(addDataDict)
|
| | | |
| | | SendEventPack("ChangeZhenQi_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 使用宠物满魂,得到宠物
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param itemID: 物品ID
|
| | | # @param itemGUID: 物品GUID
|
| | | # @param petNpcName: 宠物NPC名字
|
| | | # @param petNpcID: 宠物NPC
|
| | | # @return: |
| | | def DR_UsePetSoul(curPlayer, itemID, itemGUID, petNpcName, petNpcID):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID(), |
| | | "ItemID":itemID, "ItemGUID":itemGUID, "NPCID":petNpcID, "NPCName":petNpcName}
|
| | | |
| | | SendEventPack("UsePetSoul", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 镖车
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 事件名
|
| | | # @param addDataDict: 附加属性
|
| | | # @return: |
| | | def DR_Truck(curPlayer, eventName, addDataDict):
|
| | | dataDict = {"PlayerID":curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | "AccID":curPlayer.GetAccID()}
|
| | | |
| | | dataDict.update(addDataDict)
|
| | | |
| | | SendEventPack("Truck_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 设置玩家SB状态
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param state: ״̬
|
| | | # @return: |
| | | def SetPlayerSBState(curPlayer, state):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), "State":state} |
| | | |
| | | SendEventPack("SetPlayerSBState", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家家族信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: 事件名
|
| | | # @param addDataDict: 附加属性
|
| | | # @return: |
| | | def DR_PlayerFamily(curPlayer, eventName, addDataDict):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID()} |
| | | dataDict.update(addDataDict)
|
| | | |
| | | SendEventPack("PlayerFamily_%s"%eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 获得威望值
|
| | | # @param curPlayer 玩家实例
|
| | | # @param addPrestige 添加值
|
| | | # @param addType 原因
|
| | | # @return
|
| | | def DR_GetPrestigeValue(curPlayer, addPrestige, addType):
|
| | | return
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | "Prestige":addPrestige, "TotalPrestige":PlayerControl.GetPrestige(curPlayer), "Type":addType}
|
| | | |
| | | SendEventPack("GetPrestigeValue", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 失去威望值
|
| | | # @param curPlayer 玩家实例
|
| | | # @param addPrestige 添加值
|
| | | # @param addType 原因
|
| | | # @return
|
| | | def DR_LostPrestigeValue(curPlayer, addPrestige, addType):
|
| | | return
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | "Prestige":addPrestige, "TotalPrestige":PlayerControl.GetPrestige(curPlayer), "Type":addType}
|
| | | |
| | | SendEventPack("LostPrestigeValue", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 记录错误信息
|
| | | # @param info: 错误信息
|
| | | # @param playerID: 玩家ID
|
| | | # @param playerName: 玩家名字
|
| | | # @param accID: 账号ID
|
| | | # @return
|
| | | def DR_ErrorInfo(info, playerID, playerName, accID):
|
| | | curMapID = GameWorld.GetMap().GetMapID()
|
| | | |
| | | dataDict = {"errInfo":info, "mapID":curMapID, "playerID":playerID, "PlayerName":playerName, "accID":accID}
|
| | | |
| | | SendEventPack("ErrorInfo", dataDict)
|
| | | return
|
| | | |
| | |
|
| | | ## 玩家一次性兑换点卷送元宝
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param useCoin: 兑换点券数
|
| | | # @param giveGold:给予元宝
|
| | | # @return |
| | | def DR_OneTimeCoinGiveGold(curPlayer, useCoin, giveGold):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'UseCoin':useCoin, 'GiveGold':giveGold, 'TotalGold':curPlayer.GetGold()}
|
| | | #发送封包
|
| | | SendEventPack("OneTimeCoinGiveGold", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 增加玩家家族活跃度
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param addValue: 增加值
|
| | | # @param curValue: 增加后值
|
| | | # @param reason:增加原因
|
| | | # @return |
| | | def DR_AddPlayerFamilyActiveValue(curPlayer, addValue, curValue, reason):
|
| | | return
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'addValue':addValue, 'FamilyActiveValue':curValue, 'Reason':reason}
|
| | | #发送封包
|
| | | SendEventPack("AddPlayerFamilyActiveValue", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 宠物加点
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param petID: 宠物id
|
| | | # @param refreshType: 增点类型
|
| | | # @param addPoint: 增加点数
|
| | | # @param npcID: 宠物npcid
|
| | | # @return |
| | | def DR_PetAddPoint(curPlayer, petID, refreshType, addPoint, npcID):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'PetID':petID, 'AttrType':refreshType, 'AddPoint':addPoint, 'NPCID':npcID}
|
| | | #发送封包
|
| | | SendEventPack("PetAddPoint", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 宠物加亲密度
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param petID: 宠物id
|
| | | # @param addValue: 增加点数
|
| | | # @param npcID: 宠物npcid
|
| | | # @param curFriendliness: 增点类型
|
| | | # @return |
| | | def DR_AddFriendliness(curPlayer, petID, addValue, petNPCID, curFriendliness):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'PetID':petID, 'AddValue':addValue, 'Friendliness':curFriendliness, 'NPCID':petNPCID}
|
| | | #发送封包
|
| | | SendEventPack("AddFriendliness", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 玩家升星
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param itemID: 物品ID
|
| | | # @param starLV: 物品星级
|
| | | # @param addDataDict: 附加材料的字典
|
| | | # @return |
| | | def DR_UpStarLVSuccess(curPlayer, exp, starLV):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), "StarLV":starLV, "Exp":exp}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("UpStarLVSuccess", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家死亡
|
| | | # @param tagObjType: 攻击方类型
|
| | | # @param tagObj: 攻击方ID
|
| | | # @param mapID: 死亡玩家所在地图ID
|
| | | # @return
|
| | | def DR_PlayerDead(atkObjType, atkObjID, curPlayer, mapID):
|
| | | return
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'MapID':mapID, |
| | | 'AtkObjType':atkObjType, "ObjID":atkObjID}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("PlayerDead", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 给存奖励表物品
|
| | | # @param curPlayer: 玩家
|
| | | # @param rewardType: 奖励类型
|
| | | # @param itemID: 物品ID
|
| | | # @param itemCnt: 物品个数
|
| | | # @return
|
| | | def DR_PlayerGetReward(curPlayer, rewardType, itemID, itemCnt):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'itemID':itemID, 'itemCnt':itemCnt,
|
| | | 'rewardType':rewardType}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("PlayerGetReward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 申请加入贵宾俱乐部
|
| | | # @param curPlayer
|
| | | # @param hasRegister: 之前是否已报名
|
| | | # @param moneyType: 消耗金钱类型
|
| | | # @param money: 消耗金钱数量
|
| | | # @return
|
| | | def DR_ApplyVIPClub(curPlayer, name, sex, tel, mail, addr, qq, birthday, postalcode, serverID, giveItemOK):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), "QQ":qq,
|
| | | 'AccID':curPlayer.GetAccID(), 'Name':name, "Sex":sex, "Tel":tel, "Mail":mail, "Address":addr,
|
| | | "Birthday":birthday, "Postalcode":postalcode, "ServerID":serverID, "GiveItemOK":giveItemOK}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("ApplyVIPClub", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 跨服赛报名
|
| | | # @param curPlayer
|
| | | # @param hasRegister: 之前是否已报名
|
| | | # @param moneyType: 消耗金钱类型
|
| | | # @param money: 消耗金钱数量
|
| | | # @return
|
| | | def DR_MergeWarRegister(curPlayer, hasRegisterCnt, moneyType, money):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'HasRegisterCnt':hasRegisterCnt,
|
| | | 'MoneyType':moneyType, "MoneyCnt":money}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("MergeWarRegister", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 跨服赛报名结果
|
| | | # @param curPlayer
|
| | | # @param hasRegister: 之前是否已报名
|
| | | # @param moneyType: 消耗金钱类型
|
| | | # @param money: 消耗金钱数量
|
| | | # @return
|
| | | def DR_MergeWarRegisterResult(curPlayer, result, errorMsg, newAccount):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'Result':result, "ErrorMsg":errorMsg, "NewAccount":newAccount}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("MergeWarRegisterResult", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | #Supernatural-------------------------------------------------------------------------------
|
| | | ## 交易出售物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param tagPlayer: 物品ID
|
| | | # @param itemID: 物品ID
|
| | | # @param itemCnt: 物品数量
|
| | | # @param itemData: 物品信息
|
| | | # @return
|
| | | def DR_TradeLostItem(curPlayer, tagPlayer, itemID, itemCnt, itemData): |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'TagPlayer':tagPlayer.GetPlayerID(), "ItemID":itemID,
|
| | | "ItemCnt":itemCnt}
|
| | | |
| | | dataDict.update(itemData)
|
| | | #发送封包
|
| | | SendEventPack("TradeLostItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 交易购得物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param tagPlayer: 物品ID
|
| | | # @param itemID: 物品ID
|
| | | # @param itemCnt: 物品数量
|
| | | # @return
|
| | | def DR_TradeGetItem(curPlayer, tagPlayer, itemID, itemCnt, itemData): |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'TagPlayer':tagPlayer.GetPlayerID(), "ItemID":itemID,
|
| | | "ItemCnt":itemCnt}
|
| | |
|
| | | dataDict.update(itemData)
|
| | | #发送封包
|
| | | SendEventPack("TradeGetItem", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 交易中金钱变化
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param tagPlayer: 目标玩家
|
| | | # @param goldEx: 交易前元宝
|
| | | # @param silverEx:交易前 银子
|
| | | # @param gPaperEx: 交易前金票
|
| | | # @param sPaperEx: 交易前银票
|
| | | # @return
|
| | | def DR_TradeMoney(curPlayer, tagPlayer, goldEx, silverEx, gPaperEx, sPaperEx): |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'TagPlayer':tagPlayer.GetPlayerID(), |
| | | "Gold":curPlayer.GetGold(), "Silver":PlayerControl.GetSilver(curPlayer), |
| | | "GoldPaper":curPlayer.GetGoldPaper(), "SilverPaper":curPlayer.GetSilverPaper(),
|
| | | "GoldEx":goldEx, "SilverEx":silverEx, "GPaperEx":gPaperEx, "SPaperEx":sPaperEx}
|
| | | #发送封包
|
| | | SendEventPack("TradeMoney", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 玩家马匹进阶
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param classLV: 阶级
|
| | | # @param horseID: 新马匹id
|
| | | # @return: None
|
| | | def DR_NewHorseByClassUp(curPlayer, classLV, horseID):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'ClassLV':classLV,
|
| | | 'HorseID':horseID,
|
| | | }
|
| | | |
| | | SendEventPack("NewHorseByClassUp", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 坐骑幻化皮肤删除
|
| | | def DR_HorseSkinDel(curPlayer, skinID):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'skinID':skinID,}
|
| | | SendEventPack("HorseSkinDel", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家进阶式系统流向记录
|
| | | # @param curPlayer
|
| | | # @param classLV 阶级
|
| | | # @param extraInfoDict 预留信息字典
|
| | | # @return: None
|
| | | def DR_ClassUpSystem(curPlayer, drKey, classLV, extraInfoDict={}):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), |
| | | 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'ClassLV':classLV,
|
| | | }
|
| | | dataDict.update(extraInfoDict)
|
| | | SendEventPack(drKey, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 装备合成物品
|
| | | # @param curPlayer: 玩家实例
|
| | |
| | | dataDict.update(itemData)
|
| | | #发送封包
|
| | | SendEventPack(recordName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 采集特殊NPC
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param npcID: npcID
|
| | | # @return: None
|
| | | def DR_CollectNPCOK(curPlayer, npcID, giveMoney, giveExp, giveZhenQi, giveItemList):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), 'GiveMoney':giveMoney, |
| | | 'GiveExp':giveExp, 'GiveZhenQi':giveZhenQi, 'GiveItemList':str(giveItemList),
|
| | | 'NPCID':npcID}
|
| | | #发送封包
|
| | | SendEventPack("CollectNPCOK", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 领取投资回报
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: None
|
| | | def DR_GetGoldInvestReward(curPlayer, investType, rewardIndex, itemList):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), 'InvestType':investType, |
| | | 'RewardIndex':rewardIndex,
|
| | | 'itemList':itemList}
|
| | | #发送封包
|
| | | SendEventPack("GetGoldInvestReward", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 击杀NPC流向
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param eventName: |
| | | # @param npcID: npcID
|
| | | # @return: None
|
| | | def DR_KillNPC(curPlayer, eventName, npcID, extendDict={}):
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), 'MapID':mapID, 'NPCID':npcID}
|
| | | |
| | | dataDict.update(extendDict)
|
| | | |
| | | #发送封包
|
| | | SendEventPack("KillNPC_%s" % eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_TreasureResult(curPlayer, actionType, successCnt, extendDict={}):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(),
|
| | | "ActionType":actionType, "successCnt":successCnt}
|
| | | |
| | | dataDict.update(extendDict)
|
| | | |
| | | #发送封包
|
| | | SendEventPack("TreasureResult", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家提交bug及建议
|
| | | def DR_BugSuggest(curPlayer, eventName, content):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'content':content}
|
| | | #发送封包
|
| | | SendEventPack("PlayerSubmit_%s" % eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 资源找回记录
|
| | | # @param curPlayer
|
| | | # @return: None
|
| | | def DR_PlayerRecover(curPlayer, recoverWay, recoverCntDict, totalExp, totalMoney, totalSP, totalItemDict):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'recoverWay':recoverWay, 'recoverCntDict':recoverCntDict,
|
| | | 'totalExp':totalExp, 'totalMoney':totalMoney, 'totalSP':totalSP, 'totalItemDict':totalItemDict}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("PlayerRecover", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_GlobalDropCD(curPlayer, npcID, itemID):
|
| | | # 全局掉落CD掉落记录
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), 'NPCID':npcID, 'ItemID':itemID}
|
| | | #发送封包
|
| | | SendEventPack("GlobalDropCD", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_GlobalDropRate(curPlayer, npcID, itemID, killedCnt, dropRate):
|
| | | # 全局击杀掉落概率掉落记录
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), 'NPCID':npcID, |
| | | 'ItemID':itemID, 'KilledCnt':killedCnt, 'DropRate':dropRate}
|
| | | #发送封包
|
| | | SendEventPack("GlobalDropRate", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_MagicWeaponExp(curPlayer, mwID, succID, newExp, needExp):
|
| | | # 法宝激活经验获得记录
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'mwID':mwID, 'succID':succID, |
| | | 'newExp':newExp, 'needExp':needExp}
|
| | | #发送封包
|
| | | SendEventPack("MagicWeaponExp", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_MagicWeaponActive(curPlayer, mwID, mwLV):
|
| | | # 法宝等级升级记录
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'mwID':mwID, 'mwLV':mwLV}
|
| | | #发送封包
|
| | | SendEventPack("MagicWeaponActive", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家上线成就检查
|
| | | # @return
|
| | | def DR_CheckOldPlayerSuccess(curPlayer):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID()}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("CheckOldPlayerSuccess", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家境界升级
|
| | | # @return
|
| | | def DR_RealmLVUp(curPlayer, realmlv):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'realmlv':realmlv,
|
| | | 'playerlv':curPlayer.GetLV(), 'power':PlayerControl.GetFightPower(curPlayer)}
|
| | | |
| | | #发送封包
|
| | | SendEventPack("RealmLVUp", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def Cache_FightPowerChangeInfo(curPlayer, dotype, dataDict):
|
| | |
| | | SendEventPack("MailDel", dataDict)
|
| | | return
|
| | |
|
| | | def DR_ServerMail(GUID, eventName, addDict={}):
|
| | | ## 全服邮件流向
|
| | | dataDict = {'GUID':GUID, "eventName":eventName}
|
| | | dataDict.update(addDict)
|
| | | SendEventPack("MailServerMail", dataDict)
|
| | | return
|
| | |
|
| | | def DR_CreateRole(playerData):
|
| | | dataDict = {'PlayerID':playerData.PlayerID, 'AccID':playerData.AccID, 'PlayerName':playerData.PlayerName, "Job":playerData.Job}
|
| | | #发送封包
|
| | | SendEventPack("CreateRole", dataDict)
|
| | | return |
| | | return
|
| | |
|