From a2b6496da2384f6ad3adb23a75e2776cb7c95862 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 16 三月 2020 18:39:58 +0800 Subject: [PATCH] 8401 【后端】BOSS复活修改(boss信息表无复活时间配置的boss不处理复活检查逻辑,防止和关联的活动控制复活状态冲突) --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py | 73 ++++++++++++++++++------------------ 1 files changed, 37 insertions(+), 36 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py index 169174c..4693671 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyRedPacket.py @@ -87,19 +87,23 @@ ##---------------------------------------- 节日红包 ----------------------------------------------- -def OnResetFeastRedPacket(ipyData): +def OnResetFeastRedPacket(ipyData, dayIndex): ## 重置节日红包状态 if not ipyData: return dayRedPackIDList = ipyData.GetRedPacketIDList() - GameWorld.DebugLog("重置红包发放状态: dayRedPackIDList=%s" % dayRedPackIDList) - for redPackIDList in dayRedPackIDList: - for redPackID in redPackIDList: - if PlayerDBGSEvent.GetDBGSTrig_ByKey(DBKey_RedPacketSend % redPackID): - PlayerDBGSEvent.SetDBGSTrig_ByKey(DBKey_RedPacketSend % redPackID, 0) - + GameWorld.Log("重置节日红包发放状态: dayRedPackIDList=%s, dayIndex=%s" % (dayRedPackIDList, dayIndex)) + if dayIndex < 0 or dayIndex >= len(dayRedPackIDList): + GameWorld.ErrLog("当前节日天索引没有配配置系统红包ID! dayRedPackIDList=%s, dayIndex=%s" % (dayRedPackIDList, dayIndex)) + return + + for redPackID in dayRedPackIDList[dayIndex]: + GameWorld.Log(" 重置节日红包发放状态: redPackID=%s" % redPackID) + if PlayerDBGSEvent.GetDBGSTrig_ByKey(DBKey_RedPacketSend % redPackID): + PlayerDBGSEvent.SetDBGSTrig_ByKey(DBKey_RedPacketSend % redPackID, 0) + return def __GetTodayRedPacketByTimeList(): @@ -221,12 +225,9 @@ jobRank = 0 playerName = "" playerID = 0 - familyID = 0 family = None - redPacketRecData = __SaveNewRedRecord(familyID, playerID, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt, state, sysCreateTime=sysCreateTime) - #通知 - __NotifyFamilyRedPacketInfo(family, redPacketRecData, []) + __SaveNewRedRecord(family, playerID, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt, state, sysCreateTime=sysCreateTime) return ## 生成新红包 @@ -252,24 +253,9 @@ GameWorld.DebugLog(" 生成新仙盟红包 红包额度不能低于红包个数!outputNum=%s,redCnt=%s" % (outputNum, packetCnt)) return job = curPlayer.GetJob() - jobRank = PlayerControl.GetJobRank(curPlayer) + jobRank = 0 playerName = curPlayer.GetName() - redPacketRecData = __SaveNewRedRecord(familyID, playerID, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt, state, wishStr) - #通知 - if redPacketRecData: - __NotifyFamilyRedPacketInfo(family, redPacketRecData, []) - if not familyID: - if not PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OSRedPacket): - PlayerControl.WorldNotify(0, 'OpenRedBag2', [playerName, data, outputNum]) - PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OSRedPacket, 1) - elif data in IpyGameDataPY.GetFuncEvalCfg('OSRSuccess'): - PlayerControl.WorldNotify(0, 'OpenRedBag3', [playerName, data, outputNum]) - #大于200额度的红包 - getTypeRainDict = IpyGameDataPY.GetFuncEvalCfg('OpenServerRedPacketRain', 2, {}) - if str(getType) in getTypeRainDict: - PlayerControl.WorldNotify(0, getTypeRainDict[str(getType)]) - elif outputNum >= IpyGameDataPY.GetFuncCfg('OpenServerRedPacketRain'): - PlayerControl.WorldNotify(0, 'OSRedpackSfx') + __SaveNewRedRecord(family, playerID, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt, state, wishStr, data=data) return def CreatNewFamilyRedPacket(family, playerID, redPackID): @@ -293,16 +279,13 @@ jobRank = 0 playerName = member.GetName() - redPacketRecData = __SaveNewRedRecord(familyID, playerID, playerName, job, jobRank, getType, moneyType, outputNum, 0) - #通知 - __NotifyFamilyRedPacketInfo(family, redPacketRecData, []) + __SaveNewRedRecord(family, playerID, playerName, job, jobRank, getType, moneyType, outputNum, 0) return ## 记录新红包数据 -def __SaveNewRedRecord(familyID, ownerid, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt,state=State_NoSend, wishStr='', sysCreateTime=None): +def __SaveNewRedRecord(family, ownerid, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt,state=State_NoSend, wishStr='', sysCreateTime=None, data=0): global g_allRecordDict global g_redPackCountDict - job = job + jobRank * 10 #个位是job 十位百位是jobrank recordType = ShareDefine.Def_UniversalGameRecType_FamilyRedPacketAllRecord universalRecMgr = GameWorld.GetUniversalRecMgr() recordList = universalRecMgr.GetTypeList(recordType) @@ -314,6 +297,7 @@ GameWorld.DebugLog("当前红包数: g_redPackCountDict=%s" % g_redPackCountDict) break + familyID = family.GetID() if family else 0 recData = recordList.AddRec() @@ -337,6 +321,24 @@ recData.SetStrValue3(wishStr)#祝福语 g_allRecordDict[redPacketID] = recData GameWorld.Log("生成新的红包: familyID=%s,redPacketID=%s,ownerid=%s,ownername=%s,getType=%s,moneyType=%s,outputNum=%s,packetCnt=%s" % (familyID, redPacketID, ownerid, playerName, getType, moneyType, outputNum, packetCnt)) + + #通知 + __NotifyFamilyRedPacketInfo(family, recData, []) + if getType == ShareDefine.RedPackType_OpenServer: + if not PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OSRedPacket): + PlayerControl.WorldNotify(0, 'OpenRedBag2', [playerName, data, outputNum]) + PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OSRedPacket, 1) + elif data in IpyGameDataPY.GetFuncEvalCfg('OSRSuccess'): + PlayerControl.WorldNotify(0, 'OpenRedBag3', [playerName, data, outputNum]) + + if not familyID: + #大于200额度的红包 + getTypeRainDict = IpyGameDataPY.GetFuncEvalCfg('OpenServerRedPacketRain', 2, {}) + if str(getType) in getTypeRainDict: + PlayerControl.WorldNotify(0, getTypeRainDict[str(getType)]) + elif outputNum >= IpyGameDataPY.GetFuncCfg('OpenServerRedPacketRain'): + PlayerControl.WorldNotify(0, 'OSRedpackSfx', [getType]) + return recData @@ -487,8 +489,6 @@ playerID= curPlayer.GetPlayerID() job = curPlayer.GetJob() - jobRank = PlayerControl.GetJobRank(curPlayer) - job = jobRank * 10 + job playerName = curPlayer.GetName() @@ -635,7 +635,8 @@ strValue1 = universalRecData.GetStrValue1() strValue1List = strValue1.split('|') playerID = strValue1List[0] - if playerID: + getWay = int(strValue1List[3]) + if playerID and getWay is ShareDefine.RedPackType_GoldPacket: playerID = int(playerID) grabRecordDict = __GetGrabRecord(redPacketID) outNum = sum([a[0] for a in grabRecordDict.values()]) #已被抢的钱 -- Gitblit v1.8.0