From ec68dabc97521a7706344e7d038e9f08462f4fe8 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 16 十二月 2025 10:26:34 +0800
Subject: [PATCH] 16 卡牌服务端(删除多余备档报错防范;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py | 35 +++++++++++++++++++++++------------
1 files changed, 23 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 76ade25..818c651 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
@@ -26,7 +26,6 @@
import IpyGameDataPY
import ShareDefine
import CommFunc
-import ObjPool
import time
@@ -82,7 +81,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):
@@ -123,7 +122,7 @@
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)
+ Sync_FirstChargeInfo(curPlayer, firstID)
isAuctionItem = 0
notifyAwardList = []
@@ -135,18 +134,30 @@
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()
- firstCharge = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstCharge)
+ 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 = 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 = ChPyNetSendPack.tagSCFirstChargeInfo()
+ clientPack.FirstChargeList = firstChargeList
clientPack.Count = len(clientPack.FirstChargeList)
NetPackCommon.SendFakePack(curPlayer, clientPack)
return
--
Gitblit v1.8.0