Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 08 物品过期 #tagCMItemTimeout
|
| | |
|
| | | class tagCMItemTimeout(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("PackType", c_ubyte), #背包类型
|
| | | ("ItemIndex", c_ubyte), #物品在背包中索引
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x08
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x08
|
| | | self.PackType = 0
|
| | | self.ItemIndex = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMItemTimeout)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 08 物品过期 //tagCMItemTimeout:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | PackType:%d,
|
| | | ItemIndex:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.PackType,
|
| | | self.ItemIndex
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMItemTimeout=tagCMItemTimeout()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMItemTimeout.Cmd,m_NAtagCMItemTimeout.SubCmd))] = m_NAtagCMItemTimeout
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A3 02 丢弃背包物品 #tagPlayerDropItem
|
| | |
|
| | | class tagPlayerDropItem(Structure):
|
| | |
| | | Writer = wdb
|
| | | Releaser = wdb
|
| | | RegType = 0
|
| | | RegisterPackCount = 5
|
| | | RegisterPackCount = 6
|
| | |
|
| | | PacketCMD_1=0xA3
|
| | | PacketSubCMD_1=0x02
|
| | |
| | | PacketSubCMD_5=0x07
|
| | | PacketCallFunc_5=OnItemRenew
|
| | |
|
| | | PacketCMD_6=0xA3
|
| | | PacketSubCMD_6=0x08
|
| | | PacketCallFunc_6=OnItemTimeout
|
| | |
|
| | | ;坐骑培养
|
| | | [PlayerHorse]
|
| | | ScriptName = Player\PlayerHorse.py
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 08 物品过期 #tagCMItemTimeout
|
| | |
|
| | | class tagCMItemTimeout(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("PackType", c_ubyte), #背包类型
|
| | | ("ItemIndex", c_ubyte), #物品在背包中索引
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x08
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x08
|
| | | self.PackType = 0
|
| | | self.ItemIndex = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMItemTimeout)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 08 物品过期 //tagCMItemTimeout:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | PackType:%d,
|
| | | ItemIndex:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.PackType,
|
| | | self.ItemIndex
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMItemTimeout=tagCMItemTimeout()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMItemTimeout.Cmd,m_NAtagCMItemTimeout.SubCmd))] = m_NAtagCMItemTimeout
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A3 02 丢弃背包物品 #tagPlayerDropItem
|
| | |
|
| | | class tagPlayerDropItem(Structure):
|
| | |
| | | GameWorld.DebugLog(" 物品无法使用!")
|
| | | return
|
| | |
|
| | | # 使用拍品
|
| | | if not curItem.GetIsBind():
|
| | | __DoLogic_PlayerUseAuctionItem(curPlayer, curItem, itemIndex, exData)
|
| | | return
|
| | | |
| | | if useCnt <= 0:
|
| | | useCnt = curItem.GetCount()
|
| | | GameWorld.DebugLog(" 没指定使用个数,默认使用全部=%s" % useCnt)
|
| | |
|
| | | __DoLogic_PlayerUseItemSelf(curPlayer, itemIndex, tick, useCnt, exData)
|
| | |
|
| | | return
|
| | |
|
| | | def __DoLogic_PlayerUseAuctionItem(curPlayer, curItem, itemIndex, exData):
|
| | | ## 玩家使用拍品
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | itemID = curItem.GetItemTypeID()
|
| | | |
| | | curItem.SetIsBind(1) # 设置为非拍品
|
| | | GameWorld.DebugLog("玩家使用拍品: itemIndex=%s,itemID=%s,exData=%s" % (itemID, itemIndex, exData), playerID)
|
| | | |
| | | if ItemCommon.GetIsEquip(curItem):
|
| | | # 生成传奇属性
|
| | | legendAttrInfo = ItemControler.GetAddEquipLegendAttr(curItem, curPlayer)
|
| | | if not legendAttrInfo:
|
| | | GameWorld.ErrLog("使用装备拍品没有传奇属性!itemID=%s" % (itemID), playerID)
|
| | | return
|
| | | attrIDList, attrValueList = legendAttrInfo
|
| | | # 传奇属性
|
| | | if attrIDList and attrValueList and len(attrIDList) == len(attrValueList):
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrID)
|
| | | curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValue)
|
| | | for i, attrID in enumerate(attrIDList):
|
| | | value = attrValueList[i]
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrID, attrID)
|
| | | curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, value)
|
| | | ItemCommon.MakeEquipGS(curItem)
|
| | | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | ItemCommon.DelItem(curPlayer, timeOutItem, 1, False, "RenewItem")
|
| | | ItemControler.GivePlayerItem(curPlayer, changeItemID, 1, 0, [IPY_GameWorld.rptItem])
|
| | | PlayerControl.NotifyCode(curPlayer, 'Guardian_ContinuePay')
|
| | | return |
| | | return
|
| | |
|
| | | #// A3 08 物品过期 #tagCMItemTimeout
|
| | | #
|
| | | #struct tagCMItemTimeout
|
| | | #
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE PackType; //背包类型
|
| | | # BYTE ItemIndex; //物品在背包中索引
|
| | | #};
|
| | | def OnItemTimeout(index, clientData, tick):
|
| | | return
|