From e6a2d6be0ba69afd50f95837f82a86e2cb71db70 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 07 八月 2025 18:48:19 +0800
Subject: [PATCH] 80 【常规】背包-服务端(A801通知优化,单物品总数量支持超20亿;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index c694aee..2efc92e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -794,6 +794,42 @@
GameWorld.DebugLog("背包类型初始格子数: packType=%s,initCount=%s" % (packType, initCount))
return initCount
+def GetPackOpenItemCnt(curPlayer, packType):
+ ## 获取对应背包已购买的格子数
+ openCntDict = IpyGameDataPY.GetFuncEvalCfg("OpenPack", 3, {})
+ if str(packType) not in openCntDict:
+ return 0
+ openCntList = openCntDict[str(packType)]
+ if not openCntList:
+ return 0
+
+ buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PackBuyCnt % packType)
+ openCnt = sum(openCntList[:buyCnt])
+ if buyCnt > len(openCntList):
+ addCnt = (buyCnt - len(openCntList)) * openCntList[-1]
+ openCnt += addCnt
+
+ return openCnt
+
+def SyncPackBuyCnt(curPlayer, packType=None):
+ ## 同步已购买格子次数信息
+ openCntDict = IpyGameDataPY.GetFuncEvalCfg("OpenPack", 3, {})
+ if not openCntDict:
+ return
+ syncTypeList = [str(packType)] if packType else openCntDict.keys()
+
+ clientPack = ChPyNetSendPack.tagSCPackBuyInfo()
+ clientPack.BuyInfoList = []
+ for packTypeStr in syncTypeList:
+ packType = int(packTypeStr)
+ buy = ChPyNetSendPack.tagSCPackBuy()
+ buy.PackType = packType
+ buy.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PackBuyCnt % packType)
+ clientPack.BuyInfoList.append(buy)
+ clientPack.Count = len(clientPack.BuyInfoList)
+ NetPackCommon.SendFakePack(curPlayer, clientPack)
+ return
+
## 获得虚拟背包格子数
# @param packindex 背包索引
# @return 背包格子数
--
Gitblit v1.8.0