10249 【越南】【砍树】仙宫(增加累计消耗货币值同步;)
# Conflicts:
# ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 16 累计消耗货币信息 #tagMCUseMoneyTotalInfo
|
| | |
|
| | | class tagMCUseMoneyTotal(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("MoneyType", c_ubyte), # 货币类型,仅同步需要记录的货币类型
|
| | | ("UseTotal", c_int), # 累计消耗货币值
|
| | | ]
|
| | |
|
| | | 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.MoneyType = 0
|
| | | self.UseTotal = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCUseMoneyTotal)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 16 累计消耗货币信息 //tagMCUseMoneyTotalInfo:
|
| | | MoneyType:%d,
|
| | | UseTotal:%d
|
| | | '''\
|
| | | %(
|
| | | self.MoneyType,
|
| | | self.UseTotal
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCUseMoneyTotalInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | InfoList = list() #(vector<tagMCUseMoneyTotal> InfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temInfoList = tagMCUseMoneyTotal()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x16
|
| | | self.Count = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.InfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCUseMoneyTotalInfo=tagMCUseMoneyTotalInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCUseMoneyTotalInfo.Head.Cmd,m_NAtagMCUseMoneyTotalInfo.Head.SubCmd))] = m_NAtagMCUseMoneyTotalInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 14 仙宫信息 #tagMCXiangongInfo
|
| | |
|
| | | class tagMCXiangong(Structure):
|
| | |
| | | 39:"成就积分", 41:"仙桃", 42:"灵玉", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 99:"代币"
|
| | | }
|
| | |
|
| | | #需要记录累计消耗的货币类型
|
| | | UseTotalPriceTypeList = [TYPE_Price_TiandaoFruit]
|
| | |
|
| | | #以下是旧的金钱类型
|
| | | TYPE_Price_Magic_Integral = 101 # 魔方寻宝积分
|
| | | TYPE_Price_GongXun = 105 # 功勋点
|
| | |
| | | Def_PDict_MysticalShopLVRefreshCnt = "MysticalShopLVRefreshCnt" # 神秘商店等级段刷新次数
|
| | | Def_PDict_MoneyMinus = "MoneyMinus_%s" # 货币对应负值, 参数[货币类型]
|
| | | Def_PDict_Currency = "PlayerCurrency_%s" # 自定义货币类型, 参数[自定义货币类型]
|
| | | Def_PDict_UseMoneyTotal = "UseMoneyTotal_%s" # 累计消耗货币, 参数[货币类型]
|
| | | Def_PDict_TJGSet = "TJGSet" # 脱机挂系统设定
|
| | | Def_PDict_TJGDeadTime = "TJGDeadTime" # 脱机被杀时间
|
| | | Def_PDict_TJGDeadPayTime = "TJGDeadPayTime" # 脱机被杀后可补偿的时间
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 16 累计消耗货币信息 #tagMCUseMoneyTotalInfo
|
| | |
|
| | | class tagMCUseMoneyTotal(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("MoneyType", c_ubyte), # 货币类型,仅同步需要记录的货币类型
|
| | | ("UseTotal", c_int), # 累计消耗货币值
|
| | | ]
|
| | |
|
| | | 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.MoneyType = 0
|
| | | self.UseTotal = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCUseMoneyTotal)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 16 累计消耗货币信息 //tagMCUseMoneyTotalInfo:
|
| | | MoneyType:%d,
|
| | | UseTotal:%d
|
| | | '''\
|
| | | %(
|
| | | self.MoneyType,
|
| | | self.UseTotal
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCUseMoneyTotalInfo(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | InfoList = list() #(vector<tagMCUseMoneyTotal> InfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temInfoList = tagMCUseMoneyTotal()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x16
|
| | | self.Count = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.InfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCUseMoneyTotalInfo=tagMCUseMoneyTotalInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCUseMoneyTotalInfo.Head.Cmd,m_NAtagMCUseMoneyTotalInfo.Head.SubCmd))] = m_NAtagMCUseMoneyTotalInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 14 仙宫信息 #tagMCXiangongInfo
|
| | |
|
| | | class tagMCXiangong(Structure):
|
| | |
| | |
|
| | | # 自定义货币值同步
|
| | | PlayerControl.NotifyPlayerAllCurrency(curPlayer)
|
| | | PlayerControl.NotifyUseMoneyTotal(curPlayer)
|
| | | #通知基础属性
|
| | | NotifyPlayerBasePoint(curPlayer)
|
| | |
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
|
| | | def NotifyUseMoneyTotal(curPlayer, moneyTypeList=None):
|
| | | if moneyTypeList:
|
| | | notifyMoneyTypeList = moneyTypeList
|
| | | else:
|
| | | notifyMoneyTypeList = ShareDefine.UseTotalPriceTypeList
|
| | | |
| | | infoList = []
|
| | | for moneyType in notifyMoneyTypeList:
|
| | | useTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UseMoneyTotal % moneyType)
|
| | | if not useTotal and moneyTypeList == None:
|
| | | continue
|
| | | info = ChPyNetSendPack.tagMCUseMoneyTotal()
|
| | | info.MoneyType = moneyType
|
| | | info.UseTotal = useTotal
|
| | | infoList.append(info)
|
| | | |
| | | if not infoList:
|
| | | return
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCUseMoneyTotalInfo()
|
| | | clientPack.Clear()
|
| | | clientPack.InfoList = infoList
|
| | | clientPack.Count = len(clientPack.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | ##玩家是否有钱款
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | # @param quantity 消费数量
|
| | | # @return None
|
| | | def __PayMoneyAfter(curPlayer, type_Price, price, costType, infoDict, quantity, costVIPGold):
|
| | | if type_Price in ShareDefine.UseTotalPriceTypeList:
|
| | | useTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UseMoneyTotal % type_Price)
|
| | | useTotal = min(useTotal + price, ChConfig.Def_UpperLimit_DWord)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UseMoneyTotal % type_Price, useTotal)
|
| | | NotifyUseMoneyTotal(curPlayer, [type_Price])
|
| | | |
| | | #金子支付
|
| | | if type_Price == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | __PayMoneyAfterByGoldMoney(curPlayer, type_Price, price, costType, infoDict, costVIPGold)
|
| | |
| | | 39:"成就积分", 41:"仙桃", 42:"灵玉", 43:"凭证积分", 44:"聚魂精华", 45:"骑宠养成积分", 46:"古宝养成积分", 47:"天道果", 99:"代币"
|
| | | }
|
| | |
|
| | | #需要记录累计消耗的货币类型
|
| | | UseTotalPriceTypeList = [TYPE_Price_TiandaoFruit]
|
| | |
|
| | | #以下是旧的金钱类型
|
| | | TYPE_Price_Magic_Integral = 101 # 魔方寻宝积分
|
| | | TYPE_Price_GongXun = 105 # 功勋点
|