From aad1382a82aecd2acc312bf81727882c9eadbdd6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 04 十一月 2025 15:43:18 +0800
Subject: [PATCH] 237 【福利内容】每日任务/每周任务/章节奖励-服务端(修复有配置任务条件的任务无法取到任务值的bug;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py | 46 ++++++++++++++++++++++++++++++++++------------
1 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
index 0253314..25f00a3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
@@ -24,6 +24,7 @@
import ChPyNetSendPack
import NetPackCommon
import IpyGameDataPY
+import ShareDefine
import CommFunc
import ObjPool
@@ -81,7 +82,7 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstChargeTime % firstID, int(time.time()))
GameWorld.DebugLog("记录首充档位充值时间戳: ctgID=%s" % ctgID)
- Sync_FirstChargeInfo(curPlayer)
+ Sync_FirstChargeInfo(curPlayer, firstID)
return
def GetPlayerFirstCharge(curPlayer, giftDay, firstIDStr):
@@ -115,28 +116,49 @@
return
awardList = getattr(ipyData, "GetAwardListDay%s" % giftDay)()
+ if not ItemControler.CheckPackSpaceEnough(curPlayer, [itemInfo[:2] for itemInfo in awardList]):
+ return
+
# 更新已领取成功标记
updGetRecord = getRecord | pow(2, giftDay)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstChargeRecord % firstID, updGetRecord)
GameWorld.DebugLog("领取首充奖励: firstID=%s,giftDay=%s,getRecord=%s,updGetRecord=%s, %s" % (firstID, giftDay, getRecord, updGetRecord, awardList))
+ Sync_FirstChargeInfo(curPlayer, firstID)
- ItemControler.GivePlayerItemOrMail(curPlayer, awardList, event=["FirstCharge", False, {}])
-
- Sync_FirstChargeInfo(curPlayer)
+ isAuctionItem = 0
+ notifyAwardList = []
+ for itemID, itemCount, appointID in awardList:
+ setAttrDict = {ShareDefine.Def_CItemKey_AppointID:appointID} if appointID else {}
+ if not ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, event=["FirstCharge", False, {}], setAttrDict=setAttrDict):
+ continue
+ notifyAwardList.append([itemID, itemCount, isAuctionItem])
+ ItemControler.NotifyGiveAwardInfo(curPlayer, notifyAwardList, "FirstCharge")
return
-def Sync_FirstChargeInfo(curPlayer):
+def Sync_FirstChargeInfo(curPlayer, firstID=0):
## 通知首充信息
- clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstChargeInfo)
- clientPack.FirstChargeList = []
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for index in range(ipyDataMgr.GetFirstChargeCount()):
- ipyData = ipyDataMgr.GetFirstChargeByIndex(index)
- firstID = ipyData.GetFirstID()
+ if firstID:
+ syncIDList = [firstID]
+ else:
+ syncIDList = []
+ ipyDataMgr = IpyGameDataPY.IPY_Data()
+ for index in range(ipyDataMgr.GetFirstChargeCount()):
+ ipyData = ipyDataMgr.GetFirstChargeByIndex(index)
+ syncIDList.append(ipyData.GetFirstID())
+
+ firstChargeList = []
+ for firstID in syncIDList:
firstCharge = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstCharge)
+ firstCharge.FirstID = firstID
firstCharge.ChargeTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstChargeTime % firstID)
firstCharge.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstChargeRecord % firstID)
- clientPack.FirstChargeList.append(firstCharge)
+ firstChargeList.append(firstCharge)
+
+ if not firstChargeList:
+ return
+
+ clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstChargeInfo)
+ clientPack.FirstChargeList = firstChargeList
clientPack.Count = len(clientPack.FirstChargeList)
NetPackCommon.SendFakePack(curPlayer, clientPack)
return
--
Gitblit v1.8.0