From ecfe8b45ee59dcc926fec0ece5a4b6b2b583121d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 15 一月 2019 23:35:03 +0800
Subject: [PATCH] 5722 【后端】【1.5】跨服BOSS开发(跨服聊天名字默认使用跨服名字格式)

---
 ServerPython/CoreServerGroup/GameServer/Script/ChNetSendPack.py |   98 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChNetSendPack.py
index ab92081..2048de1 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChNetSendPack.py
@@ -227,3 +227,101 @@
 
 m_NAtagTalkMi=tagTalkMi()
 ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTalkMi.Head.Cmd,m_NAtagTalkMi.Head.SubCmd))] = m_NAtagTalkMi
+
+#------------------------------------------------------
+#02 08 国家频道#tagTalkCountry
+
+class  tagTalkCountry(Structure):
+    Head = tagHead()
+    NameLen = 0    #(BYTE NameLen)
+    Name = ""    #(String Name)//size = NameLen
+    PlayerID = 0    #(DWORD PlayerID)
+    Len = 0    #(WORD Len)
+    Content = ""    #(String Content)//size = Len
+    ExtraValue = 0    #(DWORD ExtraValue)//附加值
+    Extras = ""    #(char Extras[256])//附加值列表
+    data = None
+
+    def __init__(self):
+        self.Clear()
+        self.Head.Cmd = 0x02
+        self.Head.SubCmd = 0x08
+        return
+
+    def ReadData(self, _lpData, _pos=0, _Len=0):
+        self.Clear()
+        _pos = self.Head.ReadData(_lpData, _pos)
+        self.NameLen,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+        self.Name,_pos = CommFunc.ReadString(_lpData, _pos,self.NameLen)
+        self.PlayerID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.Len,_pos = CommFunc.ReadWORD(_lpData, _pos)
+        self.Content,_pos = CommFunc.ReadString(_lpData, _pos,self.Len)
+        self.ExtraValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+        self.Extras,_pos = CommFunc.ReadString(_lpData, _pos,256)
+        return _pos
+
+    def Clear(self):
+        self.Head = tagHead()
+        self.Head.Clear()
+        self.Head.Cmd = 0x02
+        self.Head.SubCmd = 0x08
+        self.NameLen = 0
+        self.Name = ""
+        self.PlayerID = 0
+        self.Len = 0
+        self.Content = ""
+        self.ExtraValue = 0
+        self.Extras = ""
+        return
+
+    def GetLength(self):
+        length = 0
+        length += self.Head.GetLength()
+        length += 1
+        length += len(self.Name)
+        length += 4
+        length += 2
+        length += len(self.Content)
+        length += 4
+        length += 256
+
+        return length
+
+    def GetBuffer(self):
+        data = ''
+        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+        data = CommFunc.WriteBYTE(data, self.NameLen)
+        data = CommFunc.WriteString(data, self.NameLen, self.Name)
+        data = CommFunc.WriteDWORD(data, self.PlayerID)
+        data = CommFunc.WriteWORD(data, self.Len)
+        data = CommFunc.WriteString(data, self.Len, self.Content)
+        data = CommFunc.WriteDWORD(data, self.ExtraValue)
+        data = CommFunc.WriteString(data, 256, self.Extras)
+        return data
+
+    def OutputString(self):
+        DumpString = '''
+                                Head:%s,
+                                NameLen:%d,
+                                Name:%s,
+                                PlayerID:%d,
+                                Len:%d,
+                                Content:%s,
+                                ExtraValue:%d,
+                                Extras:%s
+                                '''\
+                                %(
+                                self.Head.OutputString(),
+                                self.NameLen,
+                                self.Name,
+                                self.PlayerID,
+                                self.Len,
+                                self.Content,
+                                self.ExtraValue,
+                                self.Extras
+                                )
+        return DumpString
+
+
+m_NAtagTalkCountry=tagTalkCountry()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTalkCountry.Head.Cmd,m_NAtagTalkCountry.Head.SubCmd))] = m_NAtagTalkCountry

--
Gitblit v1.8.0