From 321404e348a4b11c5389fd3f3e3dd5d3fee7cdc5 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 21 一月 2019 19:24:21 +0800
Subject: [PATCH] 5999 【主干】优化上线通知玩家技能
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 13 ++++
2 files changed, 176 insertions(+), 1 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 6612111..02be180 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -27413,6 +27413,58 @@
#------------------------------------------------------
+# B2 13 诛仙塔通关层数 #tagMCZhuXianTowerInfo
+
+class tagMCZhuXianTowerInfo(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("Floor", c_int), # 已通关层
+ ]
+
+ def __init__(self):
+ self.Clear()
+ self.Cmd = 0xB2
+ 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 = 0xB2
+ self.SubCmd = 0x13
+ self.Floor = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagMCZhuXianTowerInfo)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B2 13 诛仙塔通关层数 //tagMCZhuXianTowerInfo:
+ Cmd:%s,
+ SubCmd:%s,
+ Floor:%d
+ '''\
+ %(
+ self.Cmd,
+ self.SubCmd,
+ self.Floor
+ )
+ return DumpString
+
+
+m_NAtagMCZhuXianTowerInfo=tagMCZhuXianTowerInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCZhuXianTowerInfo.Cmd,m_NAtagMCZhuXianTowerInfo.SubCmd))] = m_NAtagMCZhuXianTowerInfo
+
+
+#------------------------------------------------------
# B4 11 新增恶意攻击玩家 #tagMCAddMaliciousAtkPlayer
class tagMCAddMaliciousAtkPlayer(Structure):
@@ -28005,6 +28057,118 @@
#------------------------------------------------------
+# B4 13 通知玩家所有已学技能 #tagMCPlayerSkills
+
+class tagPlayerSkill(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("SkillID", c_int), #技能ID
+ ("RemainTime", c_int), #剩余时间
+ ("Proficiency", 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.SkillID = 0
+ self.RemainTime = 0
+ self.Proficiency = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagPlayerSkill)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// B4 13 通知玩家所有已学技能 //tagMCPlayerSkills:
+ SkillID:%d,
+ RemainTime:%d,
+ Proficiency:%d
+ '''\
+ %(
+ self.SkillID,
+ self.RemainTime,
+ self.Proficiency
+ )
+ return DumpString
+
+
+class tagMCPlayerSkills(Structure):
+ Head = tagHead()
+ Count = 0 #(WORD Count)//技能个数
+ Skills = list() #(vector<tagPlayerSkill> Skills)// 技能数据
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xB4
+ self.Head.SubCmd = 0x13
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ for i in range(self.Count):
+ temSkills = tagPlayerSkill()
+ _pos = temSkills.ReadData(_lpData, _pos)
+ self.Skills.append(temSkills)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xB4
+ self.Head.SubCmd = 0x13
+ self.Count = 0
+ self.Skills = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 2
+ for i in range(self.Count):
+ length += self.Skills[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteWORD(data, self.Count)
+ for i in range(self.Count):
+ data = CommFunc.WriteString(data, self.Skills[i].GetLength(), self.Skills[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ Count:%d,
+ Skills:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.Count,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagMCPlayerSkills=tagMCPlayerSkills()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPlayerSkills.Head.Cmd,m_NAtagMCPlayerSkills.Head.SubCmd))] = m_NAtagMCPlayerSkills
+
+
+#------------------------------------------------------
#B4 0A 玩家移动 #tagMCPYPlayerMove
class tagMCPYPlayerMove(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index d27e877..3daaf34 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -924,11 +924,22 @@
#@return 返回值无意义
#@remarks 通知玩家技能信息
def __Sync_ClientSkill(curPlayer):
+ sendPack = ChPyNetSendPack.tagMCPlayerSkills()
+ sendPack.Clear()
+ sendPack.Skills = []
skillManager = curPlayer.GetSkillManager()
for i in range(skillManager.GetSkillCount()):
curSkill = skillManager.GetSkillByIndex(i)
- curSkill.Sync_Skill()
+ #curSkill.Sync_Skill()
+ skillInfo = ChPyNetSendPack.tagPlayerSkill()
+ skillInfo.SkillID = curSkill.GetSkillID()
+ skillInfo.RemainTime = curSkill.GetRemainTime()
+ skillInfo.Proficiency = curSkill.GetProficiency()
+
+ sendPack.Skills.append(skillInfo)
+ sendPack.Count = len(sendPack.Skills)
+ NetPackCommon.SendFakePack(curPlayer, sendPack)
return
#---------------------------------------------------------------------
--
Gitblit v1.8.0