9952 【BT0.1】【主干】仙盟修改(货币捐献;仙盟事务)
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 13 家族事务操作 #tagCMFamilyAffairOP
|
| | |
|
| | | class tagCMFamilyAffairOP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("OPType", c_ubyte), # 操作类型:1-刷新事务;2-开始事务;3-领取事务奖励;
|
| | | ("AffairID", c_ushort), # 事务ID,可选
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x13
|
| | | 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 = 0xA6
|
| | | self.SubCmd = 0x13
|
| | | self.OPType = 0
|
| | | self.AffairID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFamilyAffairOP)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 13 家族事务操作 //tagCMFamilyAffairOP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | OPType:%d,
|
| | | AffairID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.OPType,
|
| | | self.AffairID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFamilyAffairOP=tagCMFamilyAffairOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFamilyAffairOP.Cmd,m_NAtagCMFamilyAffairOP.SubCmd))] = m_NAtagCMFamilyAffairOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 12 家族捐献货币 #tagCMFamilyMoneyDonate
|
| | |
|
| | | class tagCMFamilyMoneyDonate(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MoneyType", c_ubyte), # 捐献货币类型
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x12
|
| | | 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 = 0xA6
|
| | | self.SubCmd = 0x12
|
| | | self.MoneyType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFamilyMoneyDonate)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 12 家族捐献货币 //tagCMFamilyMoneyDonate:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MoneyType:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MoneyType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFamilyMoneyDonate=tagCMFamilyMoneyDonate()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFamilyMoneyDonate.Cmd,m_NAtagCMFamilyMoneyDonate.SubCmd))] = m_NAtagCMFamilyMoneyDonate
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 09 家族仓库捐赠物品 #tagCMFamilyStoreDonate
|
| | |
|
| | | class tagCMFamilyStoreDonate(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 08 家族事务信息 #tagMCFamilyAffairInfo
|
| | |
|
| | | class tagMCFamilyAffair(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("AffairID", c_ushort), # 事务ID
|
| | | ("Star", c_ubyte), # 星级
|
| | | ("State", c_ubyte), # 状态:0-无;1-进行中;2-已完成
|
| | | ("RemainDuration", c_ushort), # 剩余时长,秒,有剩余时间代表进行中
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.AffairID = 0
|
| | | self.Star = 0
|
| | | self.State = 0
|
| | | self.RemainDuration = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyAffair)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 08 家族事务信息 //tagMCFamilyAffairInfo:
|
| | | AffairID:%d,
|
| | | Star:%d,
|
| | | State:%d,
|
| | | RemainDuration:%d
|
| | | '''\
|
| | | %(
|
| | | self.AffairID,
|
| | | self.Star,
|
| | | self.State,
|
| | | self.RemainDuration
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFamilyAffairInfo(Structure):
|
| | | Head = tagHead()
|
| | | RefreshFreeCount = 0 #(BYTE RefreshFreeCount)// 今日已免费刷新次数
|
| | | Count = 0 #(BYTE Count)
|
| | | AffairInfoList = list() #(vector<tagMCFamilyAffair> AffairInfoList)// 事务列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x08
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.RefreshFreeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temAffairInfoList = tagMCFamilyAffair()
|
| | | _pos = temAffairInfoList.ReadData(_lpData, _pos)
|
| | | self.AffairInfoList.append(temAffairInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x08
|
| | | self.RefreshFreeCount = 0
|
| | | self.Count = 0
|
| | | self.AffairInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.AffairInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.RefreshFreeCount)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.AffairInfoList[i].GetLength(), self.AffairInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | RefreshFreeCount:%d,
|
| | | Count:%d,
|
| | | AffairInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.RefreshFreeCount,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyAffairInfo=tagMCFamilyAffairInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyAffairInfo.Head.Cmd,m_NAtagMCFamilyAffairInfo.Head.SubCmd))] = m_NAtagMCFamilyAffairInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 07 家族boss副本玩家信息 #tagMCFamilyBosFBPlayerInfo
|
| | |
|
| | | class tagMCFamilyBosFBPlayerInfo(Structure):
|
| | |
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GetState", c_ubyte), #是否已领取
|
| | | ("MoneyDonateCount", c_ubyte), #今日货币捐献次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x06
|
| | | self.GetState = 0
|
| | | self.MoneyDonateCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | DumpString = '''// A5 06 仙盟每日福利领取状态 //tagMCFamilyDayAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | GetState:%d
|
| | | GetState:%d,
|
| | | MoneyDonateCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.GetState
|
| | | self.GetState,
|
| | | self.MoneyDonateCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Writer = alee
|
| | | Releaser = alee
|
| | | RegType = 0
|
| | | RegisterPackCount = 5
|
| | | RegisterPackCount = 7
|
| | |
|
| | | PacketCMD_1=0xA6
|
| | | PacketSubCMD_1=0x01
|
| | |
| | | PacketSubCMD_5=0x06
|
| | | PacketCallFunc_5=OnFamilyActivityExchange
|
| | |
|
| | | PacketCMD_6=0xA6
|
| | | PacketSubCMD_6=0x12
|
| | | PacketCallFunc_6=OnFamilyMoneyDonate
|
| | |
|
| | | PacketCMD_7=0xA6
|
| | | PacketSubCMD_7=0x13
|
| | | PacketCallFunc_7=OnFamilyAffairOP
|
| | |
|
| | | ;家族仓库
|
| | | [PlayerFamilyStore]
|
| | | ScriptName = Player\PlayerFamilyStore.py
|
| | |
| | | Def_Player_Dict_UpdateFamilyNameItemIndex = "UpdateFamilyNameItemIndex" # 改名物品在背包的位置
|
| | | Def_Player_Dict_UpdateFamilyName = "UpdateFamilyName" # 改名锁
|
| | | Def_Player_Dict_FamilyDayAward = "FamilyDayAward" # 仙盟每日奖励领奖记录
|
| | | Def_Player_Dict_FamilyMoneyDonateCount = "FamilyMoneyDonateCount" # 仙盟今日货币捐献次数
|
| | |
|
| | | # 仙盟事务
|
| | | Def_Player_Dict_FamilyAffairRefreshFree = "FamilyAffairRefreshFree" # 今日已免费刷新事务次数
|
| | | Def_Player_Dict_FamilyAffairInfo = "FamilyAffairStar_%s" # 事务信息,星级*10+状态(0-无;1-进行中;2-已完成);参数(事务编号ID)
|
| | | Def_Player_Dict_FamilyAffairStartTime = "FamilyAffairStartTime_%s" # 事务开始时间戳,参数(事务编号ID)
|
| | |
|
| | | Def_Player_Dict_DelPackIndex = "DelPackIndex215" # 装备回购不重排,只记录最旧的一个物品
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 13 家族事务操作 #tagCMFamilyAffairOP
|
| | |
|
| | | class tagCMFamilyAffairOP(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("OPType", c_ubyte), # 操作类型:1-刷新事务;2-开始事务;3-领取事务奖励;
|
| | | ("AffairID", c_ushort), # 事务ID,可选
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x13
|
| | | 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 = 0xA6
|
| | | self.SubCmd = 0x13
|
| | | self.OPType = 0
|
| | | self.AffairID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFamilyAffairOP)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 13 家族事务操作 //tagCMFamilyAffairOP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | OPType:%d,
|
| | | AffairID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.OPType,
|
| | | self.AffairID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFamilyAffairOP=tagCMFamilyAffairOP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFamilyAffairOP.Cmd,m_NAtagCMFamilyAffairOP.SubCmd))] = m_NAtagCMFamilyAffairOP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 12 家族捐献货币 #tagCMFamilyMoneyDonate
|
| | |
|
| | | class tagCMFamilyMoneyDonate(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MoneyType", c_ubyte), # 捐献货币类型
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA6
|
| | | self.SubCmd = 0x12
|
| | | 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 = 0xA6
|
| | | self.SubCmd = 0x12
|
| | | self.MoneyType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFamilyMoneyDonate)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A6 12 家族捐献货币 //tagCMFamilyMoneyDonate:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MoneyType:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MoneyType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFamilyMoneyDonate=tagCMFamilyMoneyDonate()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFamilyMoneyDonate.Cmd,m_NAtagCMFamilyMoneyDonate.SubCmd))] = m_NAtagCMFamilyMoneyDonate
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A6 09 家族仓库捐赠物品 #tagCMFamilyStoreDonate
|
| | |
|
| | | class tagCMFamilyStoreDonate(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 08 家族事务信息 #tagMCFamilyAffairInfo
|
| | |
|
| | | class tagMCFamilyAffair(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("AffairID", c_ushort), # 事务ID
|
| | | ("Star", c_ubyte), # 星级
|
| | | ("State", c_ubyte), # 状态:0-无;1-进行中;2-已完成
|
| | | ("RemainDuration", c_ushort), # 剩余时长,秒,有剩余时间代表进行中
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.AffairID = 0
|
| | | self.Star = 0
|
| | | self.State = 0
|
| | | self.RemainDuration = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFamilyAffair)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 08 家族事务信息 //tagMCFamilyAffairInfo:
|
| | | AffairID:%d,
|
| | | Star:%d,
|
| | | State:%d,
|
| | | RemainDuration:%d
|
| | | '''\
|
| | | %(
|
| | | self.AffairID,
|
| | | self.Star,
|
| | | self.State,
|
| | | self.RemainDuration
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFamilyAffairInfo(Structure):
|
| | | Head = tagHead()
|
| | | RefreshFreeCount = 0 #(BYTE RefreshFreeCount)// 今日已免费刷新次数
|
| | | Count = 0 #(BYTE Count)
|
| | | AffairInfoList = list() #(vector<tagMCFamilyAffair> AffairInfoList)// 事务列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x08
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.RefreshFreeCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temAffairInfoList = tagMCFamilyAffair()
|
| | | _pos = temAffairInfoList.ReadData(_lpData, _pos)
|
| | | self.AffairInfoList.append(temAffairInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x08
|
| | | self.RefreshFreeCount = 0
|
| | | self.Count = 0
|
| | | self.AffairInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.AffairInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.RefreshFreeCount)
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.AffairInfoList[i].GetLength(), self.AffairInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | RefreshFreeCount:%d,
|
| | | Count:%d,
|
| | | AffairInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.RefreshFreeCount,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFamilyAffairInfo=tagMCFamilyAffairInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFamilyAffairInfo.Head.Cmd,m_NAtagMCFamilyAffairInfo.Head.SubCmd))] = m_NAtagMCFamilyAffairInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 07 家族boss副本玩家信息 #tagMCFamilyBosFBPlayerInfo
|
| | |
|
| | | class tagMCFamilyBosFBPlayerInfo(Structure):
|
| | |
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("GetState", c_ubyte), #是否已领取
|
| | | ("MoneyDonateCount", c_ubyte), #今日货币捐献次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x06
|
| | | self.GetState = 0
|
| | | self.MoneyDonateCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | DumpString = '''// A5 06 仙盟每日福利领取状态 //tagMCFamilyDayAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | GetState:%d
|
| | | GetState:%d,
|
| | | MoneyDonateCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.GetState
|
| | | self.GetState,
|
| | | self.MoneyDonateCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | def __OnEnterFamily(curPlayer, tick):
|
| | | EventShell.EventResponse_OnFamily(curPlayer)
|
| | | __OnFamilyLVBuffChange(curPlayer, tick)
|
| | | __FamilyAffair_CheckReset(curPlayer)
|
| | | PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
| | | DelAddFamilyRecord(curPlayer)
|
| | | GameLogic_FamilyWar.DoCheckChampionFamilyTitle(curPlayer)
|
| | |
| | | return
|
| | | #每日福利奖励
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyDayAward, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyMoneyDonateCount, 0)
|
| | | Sync_FamilyDayRewardState(curPlayer)
|
| | | __FamilyAffair_Refresh(curPlayer, True)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | PlayerFamilyTech.Sync_PlayerFamilyTechLV(curPlayer)
|
| | | SyncFamilyActivityInfo(curPlayer)
|
| | | Sync_FamilyDayRewardState(curPlayer)
|
| | | __FamilyAffair_CheckReset(curPlayer)
|
| | | return
|
| | |
|
| | | def FamilyPlayerOnLoginCross(curPlayer):
|
| | |
| | | def Sync_FamilyDayRewardState(curPlayer):
|
| | | clientPack = ChPyNetSendPack.tagMCFamilyDayAward()
|
| | | clientPack.GetState = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyDayAward)
|
| | | clientPack.MoneyDonateCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyMoneyDonateCount)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | |
| | | packData.Point = givePoint
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | | #// A6 12 家族捐献货币 #tagCMFamilyMoneyDonate
|
| | | #
|
| | | #struct tagCMFamilyMoneyDonate
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE MoneyType; // 捐献货币类型
|
| | | #};
|
| | | def OnFamilyMoneyDonate(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | moneyType = clientData.MoneyType
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | dailyDonateCountMax = IpyGameDataPY.GetFuncCfg('FamilyDonate', 3)
|
| | | donateCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyMoneyDonateCount)
|
| | | if dailyDonateCountMax and donateCount >= dailyDonateCountMax:
|
| | | GameWorld.DebugLog("今日货币捐献次数已达上限. donateCount=%s" % donateCount, playerID)
|
| | | return
|
| | | |
| | | donatePrizeInfo = IpyGameDataPY.GetFuncEvalCfg('FamilyDonate', 4, {})
|
| | | if str(moneyType) not in donatePrizeInfo:
|
| | | GameWorld.DebugLog("不存在该货币类型捐献: moneyType=%s" % moneyType, playerID)
|
| | | return
|
| | | needMoney, contribution, familyActivity = donatePrizeInfo[str(moneyType)]
|
| | | if not PlayerControl.HaveMoney(curPlayer, moneyType, needMoney):
|
| | | return
|
| | | |
| | | updDonateCount = donateCount + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyMoneyDonateCount, updDonateCount)
|
| | | Sync_FamilyDayRewardState(curPlayer)
|
| | | GameWorld.DebugLog("货币捐献: moneyType=%s,needMoney=%s,updDonateCount=%s,contribution=%s,familyActivity=%s" |
| | | % (moneyType, needMoney, updDonateCount, contribution, familyActivity), playerID)
|
| | | |
| | | if contribution > 0:
|
| | | AddPlayerFamilyActiveValue(curPlayer, contribution, True, ShareDefine.Def_AddFAVReason_FamilyDonateItem, True)
|
| | | |
| | | if familyActivity > 0:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FamilyActivity, familyActivity)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ##--------------------------------------- 仙盟事务 --------------------------------------------------
|
| | | AffairState_None = 0 # 无
|
| | | AffairState_Underway = 1 # 进行中
|
| | | AffairState_Finish = 2 # 已完成
|
| | |
|
| | | #// A6 13 家族事务操作 #tagCMFamilyAffairOP
|
| | | #
|
| | | #struct tagCMFamilyAffairOP
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE OPType; // 操作类型:1-刷新事务;2-开始事务;3-领取事务奖励;
|
| | | # WORD AffairID; // 事务ID,可选
|
| | | #};
|
| | | def OnFamilyAffairOP(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | opType = clientData.OPType
|
| | | affairID = clientData.AffairID
|
| | | |
| | | if opType == 1:
|
| | | __FamilyAffair_Refresh(curPlayer)
|
| | | elif opType == 2:
|
| | | __FamilyAffair_Start(curPlayer, affairID)
|
| | | elif opType == 3:
|
| | | __FamilyAffair_GetAward(curPlayer, affairID) |
| | | return
|
| | |
|
| | | def __FamilyAffair_CheckReset(curPlayer):
|
| | | ## 检查任务重置,登录,进入仙盟触发
|
| | | info = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyAffairInfo % 1)
|
| | | if not info:
|
| | | # 任务1还没分配,默认强制重置
|
| | | __FamilyAffair_Refresh(curPlayer, True)
|
| | | else:
|
| | | SyncFamilyAffairInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __FamilyAffair_Refresh(curPlayer, isReset=False):
|
| | | ## 刷新事务
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | moneyType, moneyValue = 0, 0 |
| | | dayRefreshFreeCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyAffairRefreshFree)
|
| | | if not isReset:
|
| | | freeCountMax = IpyGameDataPY.GetFuncCfg("FamilyAffair", 2)
|
| | | if freeCountMax and dayRefreshFreeCount >= freeCountMax:
|
| | | moneyType, moneyValue = IpyGameDataPY.GetFuncEvalCfg("FamilyAffair", 3)
|
| | | if not PlayerControl.HaveMoney(curPlayer, moneyType, moneyValue):
|
| | | return
|
| | | |
| | | sendMailAffairList = []
|
| | | refreshAffairIDList = []
|
| | | affairCountMax = IpyGameDataPY.GetFuncCfg("FamilyAffair", 1)
|
| | | affairStarDict = IpyGameDataPY.GetFuncEvalCfg("FamilyAffair", 4)
|
| | | maxStar = 0
|
| | | starWeightList = []
|
| | | for starStr, starInfo in affairStarDict.items():
|
| | | star = int(starStr)
|
| | | if star > maxStar:
|
| | | maxStar = star
|
| | | starWeightList.append([starInfo[0], star])
|
| | | |
| | | for affairID in range(1, affairCountMax + 1):
|
| | | star, state = __GetAffairInfo(curPlayer, affairID)
|
| | | if isReset:
|
| | | # 重置时还在进行中的直接发奖励
|
| | | if state == AffairState_Underway:
|
| | | sendMailAffairList.append([affairID, star])
|
| | | refreshAffairIDList.append(affairID)
|
| | | else:
|
| | | # 非重置只处理没有状态非最高星的
|
| | | if state == AffairState_None and star < maxStar:
|
| | | refreshAffairIDList.append(affairID)
|
| | | |
| | | GameWorld.DebugLog("刷新事务: isReset=%s,moneyType=%s,moneyValue=%s,dayRefreshFreeCount=%s" |
| | | % (isReset, moneyType, moneyValue, dayRefreshFreeCount), playerID)
|
| | | GameWorld.DebugLog(" sendMailAffairList=%s" % sendMailAffairList, playerID)
|
| | | |
| | | for mailInfo in sendMailAffairList:
|
| | | affairID, star = mailInfo
|
| | | if str(star) not in affairStarDict:
|
| | | continue
|
| | | paramList = [affairID, star]
|
| | | addItemList = affairStarDict[str(star)][2]
|
| | | PlayerControl.SendMailByKey("FamilyAffairAward", [playerID], addItemList, paramList)
|
| | | |
| | | if isReset:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyAffairRefreshFree, 0)
|
| | | for affairID in range(1, affairCountMax + 1):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyAffairInfo % affairID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyAffairStartTime % affairID, 0)
|
| | | else:
|
| | | if moneyType and moneyValue:
|
| | | PlayerControl.PayMoney(curPlayer, moneyType, moneyValue, "FamilyAffair")
|
| | | else:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyAffairRefreshFree, dayRefreshFreeCount + 1)
|
| | | |
| | | GameWorld.DebugLog(" starWeightList=%s" % starWeightList, playerID)
|
| | | GameWorld.DebugLog(" refreshAffairIDList=%s" % refreshAffairIDList, playerID)
|
| | | for affairID in refreshAffairIDList:
|
| | | star = GameWorld.GetResultByWeightList(starWeightList, 1)
|
| | | __SetAffairInfo(curPlayer, affairID, star, AffairState_None)
|
| | | GameWorld.DebugLog(" 随机事务:affairID=%s,star=%s" % (affairID, star), playerID)
|
| | | |
| | | SyncFamilyAffairInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __FamilyAffair_Start(curPlayer, affairID):
|
| | | ## 开始事务
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | star, state = __GetAffairInfo(curPlayer, affairID)
|
| | | if not star:
|
| | | return
|
| | | if state != AffairState_None:
|
| | | GameWorld.DebugLog("仙盟事务已经进行中或已完成,无法开始: affairID=%s,star=%s,state=%s" % (affairID, star, state), playerID)
|
| | | return
|
| | | startTime = int(time.time())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyAffairStartTime % affairID, startTime)
|
| | | __SetAffairInfo(curPlayer, affairID, star, AffairState_Underway)
|
| | | GameWorld.DebugLog("仙盟事务开始: affairID=%s,star=%s,startTime=%s" % (affairID, star, startTime), playerID)
|
| | | SyncFamilyAffairInfo(curPlayer, affairID)
|
| | | return
|
| | |
|
| | | def __FamilyAffair_GetAward(curPlayer, affairID):
|
| | | ## 领取事务奖励
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | curTime = int(time.time())
|
| | | affairStarDict = IpyGameDataPY.GetFuncEvalCfg("FamilyAffair", 4)
|
| | | star, state = __GetAffairInfo(curPlayer, affairID)
|
| | | if state != AffairState_Underway:
|
| | | GameWorld.DebugLog("仙盟事务状态非进行中无法领取: affairID=%s,star=%s,state=%s" % (affairID, star, state), playerID)
|
| | | SyncFamilyAffairInfo(curPlayer, affairID)
|
| | | return
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyAffairStartTime % affairID)
|
| | | remainDuration = __GetAffairRemainDuration(curPlayer, affairID, star, curTime, affairStarDict)
|
| | | if remainDuration != 0:
|
| | | GameWorld.DebugLog("仙盟事务当前剩余时长未完成: affairID=%s,remainDuration=%s,startTime=%s" |
| | | % (affairID, remainDuration, startTime), playerID)
|
| | | SyncFamilyAffairInfo(curPlayer, affairID)
|
| | | return
|
| | | if str(star) not in affairStarDict:
|
| | | return
|
| | | addItemList = affairStarDict[str(star)][2]
|
| | | if not ItemCommon.GiveAwardItem(curPlayer, addItemList):
|
| | | return
|
| | | __SetAffairInfo(curPlayer, affairID, star, AffairState_Finish)
|
| | | GameWorld.DebugLog("仙盟事务领奖: affairID=%s,star=%s" % (affairID, star), playerID)
|
| | | SyncFamilyAffairInfo(curPlayer, affairID)
|
| | | return
|
| | |
|
| | | def __GetAffairInfo(curPlayer, affairID):
|
| | | affairInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyAffairInfo % affairID)
|
| | | star, state = affairInfo / 10, affairInfo % 10
|
| | | return star, state
|
| | | def __SetAffairInfo(curPlayer, affairID, star, state):
|
| | | info = star * 10 + state
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyAffairInfo % affairID, info)
|
| | | return
|
| | | def __GetAffairRemainDuration(curPlayer, affairID, star, curTime, affairStarDict):
|
| | | ## -1-未开始;>=0-剩余时长
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyAffairStartTime % affairID)
|
| | | if not startTime:
|
| | | return -1
|
| | | starInfo = affairStarDict.get(str(star), [])
|
| | | needDuration = starInfo[1] if len(starInfo) > 1 else 0
|
| | | # 可扩展减时长属性
|
| | | remainDuration = max(needDuration - (curTime - startTime), 0)
|
| | | return remainDuration
|
| | |
|
| | | def SyncFamilyAffairInfo(curPlayer, affairID=None):
|
| | | if affairID == None:
|
| | | affairIDList = []
|
| | | affairCountMax = IpyGameDataPY.GetFuncCfg("FamilyAffair", 1)
|
| | | for affairID in range(1, affairCountMax + 1):
|
| | | affairIDList.append(affairID)
|
| | | else:
|
| | | affairIDList = [affairID]
|
| | | |
| | | curTime = int(time.time())
|
| | | affairStarDict = IpyGameDataPY.GetFuncEvalCfg("FamilyAffair", 4)
|
| | | affairInfoList = []
|
| | | for affairID in affairIDList:
|
| | | star, state = __GetAffairInfo(curPlayer, affairID)
|
| | | remainDuration = __GetAffairRemainDuration(curPlayer, affairID, star, curTime, affairStarDict)
|
| | | affairInfo = ChPyNetSendPack.tagMCFamilyAffair()
|
| | | affairInfo.AffairID = affairID
|
| | | affairInfo.Star = star
|
| | | affairInfo.State = state
|
| | | affairInfo.RemainDuration = max(0, remainDuration)
|
| | | affairInfoList.append(affairInfo)
|
| | | |
| | | if not affairInfoList:
|
| | | return
|
| | | clientPack = ChPyNetSendPack.tagMCFamilyAffairInfo()
|
| | | clientPack.Clear()
|
| | | clientPack.RefreshFreeCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyAffairRefreshFree)
|
| | | clientPack.AffairInfoList = affairInfoList
|
| | | clientPack.Count = len(clientPack.AffairInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | ##--------------------------------------------------------------------------------------------------
|