| | |
| | | GameWorld.DebugLog(" PlayerID %s no found "%curPackData.PlayerID)
|
| | | return
|
| | |
|
| | | needPackSpaceDict = {}
|
| | | isPackSpaceEnough = True
|
| | | commPackItemCount = 0 # 常规背包物品个数
|
| | | RuneItemCount = 0 # 符印物品个数
|
| | | # 先汇总物品所属背包
|
| | | for i in xrange(curPackData.Count):
|
| | | curPackItem = curPackData.Items[i]
|
| | |
| | | curItemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not curItemData:
|
| | | continue
|
| | | if curItemData.GetType() in [ChConfig.Def_ItemType_Rune, ChConfig.Def_ItemType_RuneExp]:
|
| | | RuneItemCount += curPackItem.Count
|
| | | else:
|
| | | commPackItemCount += 1
|
| | | |
| | | packType = ChConfig.GetItemPackType(curItemData.GetType())
|
| | | needSpace = ItemControler.GetItemNeedPackCount(packType, curItemData, curPackItem.Count)
|
| | | needPackSpaceDict[packType] = needPackSpaceDict.get(packType, 0) + needSpace
|
| | |
|
| | | if isPackSpaceEnough and RuneItemCount > 0:
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, ShareDefine.rptRune, RuneItemCount)
|
| | | if packSpace < RuneItemCount:
|
| | | GameWorld.DebugLog(" needPackSpaceDict=%s" % str(needPackSpaceDict))
|
| | | for packType, needSpace in needPackSpaceDict.items():
|
| | | if needSpace > ItemCommon.GetItemPackSpace(curPlayer, packType, needSpace):
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packType])
|
| | | isPackSpaceEnough = False
|
| | | GameWorld.DebugLog(" 符印背包空间不足, RuneItemCount=%s > packSpace=%s" % (RuneItemCount, packSpace))
|
| | | PlayerControl.NotifyCode(curPlayer, "RuneBagFull") |
| | | |
| | | if isPackSpaceEnough and commPackItemCount > 0:
|
| | | itemPackSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, commPackItemCount)
|
| | | if itemPackSpace < commPackItemCount:
|
| | | isPackSpaceEnough = False
|
| | | GameWorld.DebugLog(" 背包空间不足, commPackItemCount=%s > itemPackSpace=%s" % (commPackItemCount, itemPackSpace))
|
| | | PlayerControl.NotifyCode(curPlayer, "BagFull") |
| | | break
|
| | |
|
| | | #背包空间不足
|
| | | if not isPackSpaceEnough:
|