| | |
| | | WORD _Cnt; //次数
|
| | | DWORD EventID; //事件编号
|
| | | list Award; //定制奖励(没配走正常奖励规则)[[物品ID,数量,是否拍品],..]
|
| | | };
|
| | |
|
| | | //副本Buff表
|
| | |
|
| | | struct tagFBBuyBuff
|
| | | {
|
| | | DWORD _MapId; //
|
| | | WORD _MoneyCnt; //仙玉数量
|
| | | DWORD BuffID; //BuffID
|
| | | WORD BuffCD; //间隔时间s
|
| | | }; |
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 34 自定义场景中获取采集奖励 #tagCMGetCustomSceneCollectAward
|
| | |
|
| | | class tagCMGetCustomSceneCollectAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("NPCID", c_int), #采集的NPCID
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x34
|
| | | 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 = 0xA2
|
| | | self.SubCmd = 0x34
|
| | | self.NPCID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMGetCustomSceneCollectAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 34 自定义场景中获取采集奖励 //tagCMGetCustomSceneCollectAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | NPCID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.NPCID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGetCustomSceneCollectAward=tagCMGetCustomSceneCollectAward()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGetCustomSceneCollectAward.Cmd,m_NAtagCMGetCustomSceneCollectAward.SubCmd))] = m_NAtagCMGetCustomSceneCollectAward
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 21 领取跑环每轮结束奖励 #tagCMGetRunTaskEndAward
|
| | |
|
| | | class tagCMGetRunTaskEndAward(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 0A 副本购买buff #tagCMFBBuyBuff
|
| | |
|
| | | class tagCMFBBuyBuff(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("MoneyCnt", c_ushort), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x0A
|
| | | 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 = 0xB1
|
| | | self.SubCmd = 0x0A
|
| | | self.MapID = 0
|
| | | self.MoneyCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFBBuyBuff)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 0A 副本购买buff //tagCMFBBuyBuff:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | MoneyCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.MoneyCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFBBuyBuff=tagCMFBBuyBuff()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFBBuyBuff.Cmd,m_NAtagCMFBBuyBuff.SubCmd))] = m_NAtagCMFBBuyBuff
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 09 结算自定义副本奖励 #tagCMGiveCustomFBPrize
|
| | |
|
| | | class tagCMGiveCustomFBPrize(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 15 副本买buff信息通知 #tagMCFBBuyBuffInfo
|
| | |
|
| | | class tagMCFBBuyBuffTime(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("MapID", c_int), |
| | | ("MoneyCnt", c_ushort), |
| | | ("BuyTime", 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.MapID = 0
|
| | | self.MoneyCnt = 0
|
| | | self.BuyTime = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFBBuyBuffTime)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 15 副本买buff信息通知 //tagMCFBBuyBuffInfo:
|
| | | MapID:%d,
|
| | | MoneyCnt:%d,
|
| | | BuyTime:%d
|
| | | '''\
|
| | | %(
|
| | | self.MapID,
|
| | | self.MoneyCnt,
|
| | | self.BuyTime
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFBBuyBuffInfo(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)
|
| | | InfoList = list() #(vector<tagMCFBBuyBuffTime> InfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x15
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temInfoList = tagMCFBBuyBuffTime()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x15
|
| | | self.Cnt = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | 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.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFBBuyBuffInfo=tagMCFBBuyBuffInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBBuyBuffInfo.Head.Cmd,m_NAtagMCFBBuyBuffInfo.Head.SubCmd))] = m_NAtagMCFBBuyBuffInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 09 副本次数恢复剩余时间 #tagMCFBCntRegainRemainTime
|
| | |
|
| | | class tagMCFBCntRegain(Structure):
|
| | |
| | | elif msgType == ShareDefine.ClientServerMsg_SetPlayerAttrValue:
|
| | | MapServer_CrossSetPlayerAttrValue(msgData)
|
| | |
|
| | | elif msgType == ShareDefine.ClientServerMsg_AddBuff:
|
| | | MapServer_CrossAddBuff(msgData)
|
| | | |
| | | # 需要发送到地图服务器处理的
|
| | | elif msgType in [ShareDefine.ClientServerMsg_Reborn, ShareDefine.ClientServerMsg_CollectNPC]:
|
| | | MapServer_CrossServerReceiveMsg(msgType, msgData, serverGroupID)
|
| | |
| | | player.MapServer_QueryPlayerResult(0, 0, "CrossSetPlayerAttrValue", msgInfo, len(msgInfo))
|
| | | return
|
| | |
|
| | | def MapServer_CrossAddBuff(msgData):
|
| | | ## 收到子服信息,添加buff
|
| | | tagPlayerID = msgData.get("PlayerID")
|
| | | if not tagPlayerID:
|
| | | return
|
| | | tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(tagPlayerID)
|
| | | if not tagPlayer:
|
| | | return
|
| | | buffID = msgData.get("buffID")
|
| | | if not buffID:
|
| | | return
|
| | | sendMsg = str(buffID)
|
| | | tagPlayer.MapServer_QueryPlayerResult(0, 0, 'AddBuff', sendMsg, len(sendMsg))
|
| | | return
|
| | | ## ================================================================================================
|
| | |
|
| | | def SendMsgToClientServer(msgType, dataMsg, serverGroupIDList=[]):
|
| | |
| | | ClientServerMsg_SetPlayerAttrValue = "SetPlayerAttrValue" # 玩家属性数值更新
|
| | | ClientServerMsg_CollectNPC = "CollectNPC" # 采集NPC
|
| | | ClientServerMsg_EnterFB = "EnterFB" # 请求进入跨服副本
|
| | | ClientServerMsg_AddBuff = "AddBuff" # 添加BUFF
|
| | |
|
| | | #跨服广播类型定义
|
| | | CrossNotify_World = "World"
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 10
|
| | | RegisterPackCount = 11
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x08
|
| | |
| | | PacketSubCMD_10=0x09
|
| | | PacketCallFunc_10=OnGiveCustomFBPrize
|
| | |
|
| | | PacketCMD_11=0xB1
|
| | | PacketSubCMD_11=0x0A
|
| | | PacketCallFunc_11=OnFBBuyBuff
|
| | |
|
| | | ;玩家相关
|
| | | [ChPlayer]
|
| | | ScriptName = Player\ChPlayer.py
|
| | |
| | | Def_Cost_MysteryShopRefresh, # 神秘商店刷新
|
| | | Def_Cost_AuctionBid, # 拍卖行竞价
|
| | | Def_Cost_BuyDailyActionCnt, # 购买活动次数
|
| | | Def_Cost_FBBuyBuff, # 副本买buff
|
| | | #-----------以下为暂时没用的,先不删除,如有新增消费点则放在这些之前------------
|
| | | Def_Cost_RefreshArrestTask, # 刷新悬赏任务
|
| | | Def_Cost_OffLineExp, # 兑换离线经验
|
| | |
| | | Def_Cost_Trade, # 交易
|
| | | Def_Cost_Rename, # 改名
|
| | | Def_Cost_SkillLvUp, # 技能升级
|
| | | ) = range(2000, 2000 + 57)
|
| | | ) = range(2000, 2000 + 58)
|
| | |
|
| | | Def_Cost_Reason_SonKey = "reason_name_son" # 消费点原因子类说明key
|
| | |
|
| | |
| | | Def_Cost_MysteryShopRefresh:"MysteryShopRefresh",
|
| | | Def_Cost_AuctionBid:"AuctionBid",
|
| | | Def_Cost_BuyDailyActionCnt:"BuyDailyActionCnt",
|
| | | Def_Cost_FBBuyBuff:"FBBuyBuff",
|
| | | }
|
| | | ## -----------------------------------------------------
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 34 自定义场景中获取采集奖励 #tagCMGetCustomSceneCollectAward
|
| | |
|
| | | class tagCMGetCustomSceneCollectAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("NPCID", c_int), #采集的NPCID
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x34
|
| | | 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 = 0xA2
|
| | | self.SubCmd = 0x34
|
| | | self.NPCID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMGetCustomSceneCollectAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 34 自定义场景中获取采集奖励 //tagCMGetCustomSceneCollectAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | NPCID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.NPCID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGetCustomSceneCollectAward=tagCMGetCustomSceneCollectAward()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGetCustomSceneCollectAward.Cmd,m_NAtagCMGetCustomSceneCollectAward.SubCmd))] = m_NAtagCMGetCustomSceneCollectAward
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 21 领取跑环每轮结束奖励 #tagCMGetRunTaskEndAward
|
| | |
|
| | | class tagCMGetRunTaskEndAward(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 0A 副本购买buff #tagCMFBBuyBuff
|
| | |
|
| | | class tagCMFBBuyBuff(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("MoneyCnt", c_ushort), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x0A
|
| | | 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 = 0xB1
|
| | | self.SubCmd = 0x0A
|
| | | self.MapID = 0
|
| | | self.MoneyCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMFBBuyBuff)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 0A 副本购买buff //tagCMFBBuyBuff:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | MoneyCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.MoneyCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMFBBuyBuff=tagCMFBBuyBuff()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFBBuyBuff.Cmd,m_NAtagCMFBBuyBuff.SubCmd))] = m_NAtagCMFBBuyBuff
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 09 结算自定义副本奖励 #tagCMGiveCustomFBPrize
|
| | |
|
| | | class tagCMGiveCustomFBPrize(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 15 副本买buff信息通知 #tagMCFBBuyBuffInfo
|
| | |
|
| | | class tagMCFBBuyBuffTime(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("MapID", c_int), |
| | | ("MoneyCnt", c_ushort), |
| | | ("BuyTime", 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.MapID = 0
|
| | | self.MoneyCnt = 0
|
| | | self.BuyTime = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFBBuyBuffTime)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 15 副本买buff信息通知 //tagMCFBBuyBuffInfo:
|
| | | MapID:%d,
|
| | | MoneyCnt:%d,
|
| | | BuyTime:%d
|
| | | '''\
|
| | | %(
|
| | | self.MapID,
|
| | | self.MoneyCnt,
|
| | | self.BuyTime
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFBBuyBuffInfo(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)
|
| | | InfoList = list() #(vector<tagMCFBBuyBuffTime> InfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x15
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temInfoList = tagMCFBBuyBuffTime()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x15
|
| | | self.Cnt = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | 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.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFBBuyBuffInfo=tagMCFBBuyBuffInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBBuyBuffInfo.Head.Cmd,m_NAtagMCFBBuyBuffInfo.Head.SubCmd))] = m_NAtagMCFBBuyBuffInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 09 副本次数恢复剩余时间 #tagMCFBCntRegainRemainTime
|
| | |
|
| | | class tagMCFBCntRegain(Structure):
|
| | |
| | | ("DWORD", "EventID", 0),
|
| | | ("list", "Award", 0),
|
| | | ),
|
| | |
|
| | | "FBBuyBuff":(
|
| | | ("DWORD", "MapId", 1),
|
| | | ("WORD", "MoneyCnt", 1),
|
| | | ("DWORD", "BuffID", 0),
|
| | | ("WORD", "BuffCD", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetCnt(self): return self.Cnt # 次数
|
| | | def GetEventID(self): return self.EventID # 事件编号
|
| | | def GetAward(self): return self.Award # 定制奖励(没配走正常奖励规则)[[物品ID,数量,是否拍品],..] |
| | | |
| | | # 副本Buff表 |
| | | class IPY_FBBuyBuff(): |
| | | |
| | | def __init__(self): |
| | | self.MapId = 0
|
| | | self.MoneyCnt = 0
|
| | | self.BuffID = 0
|
| | | self.BuffCD = 0 |
| | | return |
| | | |
| | | def GetMapId(self): return self.MapId # |
| | | def GetMoneyCnt(self): return self.MoneyCnt # 仙玉数量
|
| | | def GetBuffID(self): return self.BuffID # BuffID
|
| | | def GetBuffCD(self): return self.BuffCD # 间隔时间s |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | |
| | | self.ipyFairyAdventuresLen = len(self.ipyFairyAdventuresCache)
|
| | | self.ipyFairyDomainAppointCache = self.__LoadFileData("FairyDomainAppoint", IPY_FairyDomainAppoint)
|
| | | self.ipyFairyDomainAppointLen = len(self.ipyFairyDomainAppointCache)
|
| | | self.ipyFBBuyBuffCache = self.__LoadFileData("FBBuyBuff", IPY_FBBuyBuff)
|
| | | self.ipyFBBuyBuffLen = len(self.ipyFBBuyBuffCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetFairyAdventuresByIndex(self, index): return self.ipyFairyAdventuresCache[index]
|
| | | def GetFairyDomainAppointCount(self): return self.ipyFairyDomainAppointLen
|
| | | def GetFairyDomainAppointByIndex(self, index): return self.ipyFairyDomainAppointCache[index]
|
| | | def GetFBBuyBuffCount(self): return self.ipyFBBuyBuffLen
|
| | | def GetFBBuyBuffByIndex(self, index): return self.ipyFBBuyBuffCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | import PlayerDogz
|
| | | import PlayerCoat
|
| | | import PlayerQuDaoDoubleBill
|
| | | import PlayerFB
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | | PlayerGatherSoul.PlayerLogin(curPlayer)
|
| | | #缥缈仙域
|
| | | PlayerFairyDomain.OnLogin(curPlayer)
|
| | | PlayerFB.OnLogin(curPlayer)
|
| | |
|
| | | curPlayer.SetState(0) # 脱机挂恢复为正常上线
|
| | | curPlayer.SetFacePic(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线
|
| | |
| | | PyGameData.g_crossPlayerDienstgradChangeInfo.pop(playerID, None)
|
| | | PyGameData.g_crossPlayerItemsChangeInfo.pop(playerID, None)
|
| | | PyGameData.g_crossPlayerSkillsChangeInfo.pop(playerID, None)
|
| | | PyGameData.g_fbBuyBuffTimeDict.pop(playerID, None)
|
| | | GameWorld.DebugLog("清除同步跨服数据的临时缓存", playerID)
|
| | | return
|
| | |
|
| | |
| | | import GameFuncComm
|
| | | import FBHelpBattle
|
| | | import ItemControler
|
| | | import SkillShell
|
| | | import PyGameData
|
| | |
|
| | | import time
|
| | | import math
|
| | | #---------------------------------------------------------------------
|
| | | def OnLogin(curPlayer):
|
| | | NotifyBuyFBBuffInfo(curPlayer)
|
| | | return
|
| | |
|
| | | ## 玩家副本行为封包 A5 08
|
| | | # @param playerIndex 玩家索引
|
| | |
| | | return
|
| | |
|
| | |
|
| | | #// B1 0A 副本购买buff #tagCMFBBuyBuff
|
| | | #struct tagCMFBBuyBuff
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID;
|
| | | # WORD MoneyCnt;
|
| | | #};
|
| | | def OnFBBuyBuff(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | mapID = clientData.MapID
|
| | | moneyCnt = clientData.MoneyCnt
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FBBuyBuff', mapID, moneyCnt)
|
| | | if not ipyData:
|
| | | return
|
| | | addBuffID = ipyData.GetBuffID()
|
| | | curSkill = GameWorld.GetGameData().GetSkillBySkillID(addBuffID)
|
| | | if not curSkill:
|
| | | return
|
| | | crossMapID = PlayerControl.GetCrossMapID(curPlayer)
|
| | | if crossMapID and mapID !=crossMapID:
|
| | | return
|
| | | if not crossMapID and mapID != GameWorld.GetMap().GetMapID():
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | #判断CD |
| | | timeKey = (mapID, moneyCnt)
|
| | | lastTime = PyGameData.g_fbBuyBuffTimeDict.get(playerID, {}).get(timeKey, 0)
|
| | | if lastTime and curTime - lastTime < ipyData.GetBuffCD():
|
| | | GameWorld.DebugLog('副本购买buff CD未到 ')
|
| | | return
|
| | |
|
| | | #扣钱
|
| | | infoDict = {"MapID":mapID, "addBuffID":addBuffID}
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, moneyCnt, ChConfig.Def_Cost_FBBuyBuff, infoDict):
|
| | | return
|
| | | if playerID not in PyGameData.g_fbBuyBuffTimeDict:
|
| | | PyGameData.g_fbBuyBuffTimeDict[playerID] = {}
|
| | | PyGameData.g_fbBuyBuffTimeDict[playerID][timeKey] = curTime
|
| | | NotifyBuyFBBuffInfo(curPlayer)
|
| | | if crossMapID:
|
| | | msgDict = {"PlayerID":curPlayer.GetPlayerID(), "buffID":addBuffID}
|
| | | GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_AddBuff, msgDict)
|
| | | GameWorld.DebugLog("跨服中请求复活, crossMapID=%s,msgDict=%s" % (crossMapID, msgDict), playerID)
|
| | | return
|
| | |
|
| | | SkillShell.__DoLogic_AddBuff(curPlayer, curPlayer, curSkill, False, tick, 0, 0)
|
| | | #SkillCommon.AddBuffBySkillType(curPlayer, addBuffID, tick)
|
| | | return
|
| | |
|
| | | def NotifyBuyFBBuffInfo(curPlayer):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | buffTimeDict = PyGameData.g_fbBuyBuffTimeDict.get(playerID, {})
|
| | | if not buffTimeDict:
|
| | | return
|
| | | packData = ChPyNetSendPack.tagMCFBBuyBuffInfo()
|
| | | packData.InfoList = []
|
| | | for timeKey, buyTime in buffTimeDict.items():
|
| | | mapID, moneyCnt = timeKey
|
| | | timeInfo = ChPyNetSendPack.tagMCFBBuyBuffTime()
|
| | | timeInfo.MapID = mapID
|
| | | timeInfo.MoneyCnt = moneyCnt
|
| | | timeInfo.BuyTime = buyTime
|
| | | packData.InfoList.append(timeInfo)
|
| | | packData.Cnt = len(packData.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
| | | #"""Version = 2019-03-19 21:00"""
|
| | | #---------------------------------------------------------------------
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | | import SkillShell
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## XX
|
| | |
| | | buffID = GameWorld.ToIntDef(funResult, 0)
|
| | | if not buffID:
|
| | | return
|
| | | SkillCommon.AddBuffBySkillType(curPlayer, buffID, tick)
|
| | | #SkillCommon.AddBuffBySkillType(curPlayer, buffID, tick)
|
| | | curSkill = GameWorld.GetGameData().GetSkillBySkillID(buffID)
|
| | | if not curSkill:
|
| | | return
|
| | | SkillShell.__DoLogic_AddBuff(curPlayer, curPlayer, curSkill, False, tick, 0, 0)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | g_customFBPrizeInfo = {} #自定义副本奖励 {playerID:[mapID, funcLineID, [奖励物品列表], ...}
|
| | |
|
| | | g_crossFuncLineDataCache = {} # 动态分配的跨服虚拟分线数据缓存 {(mapID, copyMapID):funcLineDataCache, ...}
|
| | | g_fbBuyBuffTimeDict = {} # 副本购买buff时间缓存{playerID:{moneyCnt:time}} |
| | |
| | | ClientServerMsg_SetPlayerAttrValue = "SetPlayerAttrValue" # 玩家属性数值更新
|
| | | ClientServerMsg_CollectNPC = "CollectNPC" # 采集NPC
|
| | | ClientServerMsg_EnterFB = "EnterFB" # 请求进入跨服副本
|
| | | ClientServerMsg_AddBuff = "AddBuff" # 添加BUFF
|
| | |
|
| | | #跨服广播类型定义
|
| | | CrossNotify_World = "World"
|
| | |
| | | needBaseAttrID, needBaseAttrValue = stateSkillLV /10000, stateSkillLV%10000
|
| | | if needBaseAttrID and needBaseAttrValue:
|
| | | baseAttrDict = {
|
| | | ShareDefine.Def_Effect_STR:curPlayer.GetSTR(),
|
| | | ShareDefine.Def_Effect_PHY:curPlayer.GetPHY(),
|
| | | ShareDefine.Def_Effect_CON:curPlayer.GetCON(),
|
| | | ShareDefine.Def_Effect_PNE:curPlayer.GetPNE(),
|
| | | ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(),
|
| | | ShareDefine.Def_Effect_Wood:PlayerControl.GetWood(),
|
| | | ShareDefine.Def_Effect_Water:PlayerControl.GetWater(),
|
| | | ShareDefine.Def_Effect_Fire:PlayerControl.GetFire(),
|
| | | ShareDefine.Def_Effect_Earth:PlayerControl.GetEarth(),
|
| | | }
|
| | | if needBaseAttrID not in baseAttrDict:
|
| | | GameWorld.ErrLog(' 天赋技能升级属性点条件配置错误,curSkillTypeID=%s,needBaseAttrID=%s'%(curSkillTypeID, needBaseAttrID))
|