121 【武将】武将系统-服务端(武将锁定、解锁;)
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 8
|
| | | RegisterPackCount = 10
|
| | |
|
| | | PacketCMD_1=0xB2
|
| | | PacketSubCMD_1=0x30
|
| | |
| | | PacketSubCMD_8=0x37
|
| | | PacketCallFunc_8=OnHeroBookUP
|
| | |
|
| | | PacketCMD_9=0xB4
|
| | | PacketSubCMD_9=0x12
|
| | | PacketCallFunc_9=OnHeroBattlePosSave
|
| | | PacketCMD_9=0xB2
|
| | | PacketSubCMD_9=0x38
|
| | | PacketCallFunc_9=OnHeroLock
|
| | |
|
| | | PacketCMD_10=0xB4
|
| | | PacketSubCMD_10=0x12
|
| | | PacketCallFunc_10=OnHeroBattlePosSave
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 38 武将锁定 #tagCSHeroLock
|
| | |
|
| | | class tagCSHeroLock(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ItemIndex", c_ushort), #武将物品所在武将背包位置索引
|
| | | ("IsLock", c_ubyte), #0-解锁;1-锁定
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x38
|
| | | 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 = 0xB2
|
| | | self.SubCmd = 0x38
|
| | | self.ItemIndex = 0
|
| | | self.IsLock = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCSHeroLock)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 38 武将锁定 //tagCSHeroLock:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ItemIndex:%d,
|
| | | IsLock:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ItemIndex,
|
| | | self.IsLock
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCSHeroLock=tagCSHeroLock()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCSHeroLock.Cmd,m_NAtagCSHeroLock.SubCmd))] = m_NAtagCSHeroLock
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 30 武将升级 #tagCSHeroLVUP
|
| | |
|
| | | class tagCSHeroLVUP(Structure):
|
| | |
| | | if endIndex == 0:
|
| | | endIndex = curPack.GetCount() - 1
|
| | | #检查是否能整理
|
| | | for i in range(0, curPack.GetCount()):
|
| | | curItem = curPack.GetAt(i)
|
| | | if curItem.GetIsLocked():
|
| | | #GameWorld.Log("物品有锁, 不允许重整")
|
| | | return
|
| | | #for i in range(0, curPack.GetCount()):
|
| | | # curItem = curPack.GetAt(i)
|
| | | # if curItem.GetIsLocked():
|
| | | # #GameWorld.Log("物品有锁, 不允许重整")
|
| | | # return
|
| | |
|
| | | # 整理方式不同区分
|
| | | if packIndex == ShareDefine.rptHero:
|
| | |
| | | if heroID != useHeroID:
|
| | | GameWorld.DebugLog("武将材料非本体,无法升星!", playerID)
|
| | | return
|
| | | if useItem.GetIsLocked():
|
| | | GameWorld.DebugLog("材料卡锁定中,无法升星! useItemIndex=%s,heroID=%s" % (useItemIndex, heroID), playerID)
|
| | | return
|
| | | washIDCnt = heroItem.GetUserAttrCount(ShareDefine.Def_IudetHeroTalentWashID)
|
| | | if washIDCnt:
|
| | | GameWorld.ErrLog("武将洗炼结果未处理,无法升星! itemIndex=%s,heroID=%s" % (itemIndex, heroID), playerID)
|
| | |
| | |
|
| | | return
|
| | |
|
| | | #// B2 38 武将锁定 #tagCSHeroLock
|
| | | #
|
| | | #struct tagCSHeroLock
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD ItemIndex; //武将物品所在武将背包位置索引
|
| | | # BYTE IsLock; //0-解锁;1-锁定
|
| | | #};
|
| | | def OnHeroLock(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | itemIndex = clientData.ItemIndex
|
| | | isLock = clientData.IsLock
|
| | | heroItem = GetHeroItem(curPlayer, itemIndex)
|
| | | if not heroItem:
|
| | | return
|
| | | heroItem.SetIsLocked(1 if isLock else 0)
|
| | | return
|
| | |
|
| | | #// B4 12 战斗阵型保存 #tagCSHeroBattlePosSave
|
| | | #
|
| | | #struct tagCSHeroBattlePos
|