From e168d76d7d1f3cb94e2e3e9f6051dc80986fdc01 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 01 十一月 2018 17:14:21 +0800
Subject: [PATCH] 4399 【后端】【1.2.0】聊天新增支持气泡框选择功能

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py                      |    3 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini                  |    6 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py          |   52 +++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py      |   12 ++++
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py                               |   52 +++++++++++++++++
 ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py                           |    5 -
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py |    7 +
 7 files changed, 127 insertions(+), 10 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 4c5a166..7d701e2 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -4755,6 +4755,58 @@
 
 
 #------------------------------------------------------
+# A2 30 设置聊天气泡框 #tagCMSetChatBubbleBox
+
+class  tagCMSetChatBubbleBox(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("BubbleBoxType", c_ubyte),    #气泡框类型
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xA2
+        self.SubCmd = 0x30
+        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 = 0x30
+        self.BubbleBoxType = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCMSetChatBubbleBox)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// A2 30 设置聊天气泡框 //tagCMSetChatBubbleBox:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                BubbleBoxType:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.BubbleBoxType
+                                )
+        return DumpString
+
+
+m_NAtagCMSetChatBubbleBox=tagCMSetChatBubbleBox()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSetChatBubbleBox.Cmd,m_NAtagCMSetChatBubbleBox.SubCmd))] = m_NAtagCMSetChatBubbleBox
+
+
+#------------------------------------------------------
 # A2 22 设置引导成功 #tagCMSetGuideOK
 
 class  tagCMSetGuideOK(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
index ec1801a..948f08c 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/ChPlayer.py
@@ -612,11 +612,6 @@
         curPlayer.SetFightPower(packValue)
         return
 
-    if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:
-        #设置玩家跨服预赛排位
-        PlayerControl.SetMergeWarRank(curPlayer, packValue)
-        return
-
     if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr2:
         #队伍相关相关审核开关状态
         PlayerTeam.SetTeamCheckState(curPlayer, packValue)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
index d22603a..6fab281 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerControl.py
@@ -178,7 +178,6 @@
 #  @param value: 威望值
 #  @return: 
 def SetMergeWarRank(curPlayer, value):
-    curPlayer.SetExAttr10(value)
     return
 
 
@@ -186,7 +185,7 @@
 #  @param curPlayer: 玩家实例
 #  @return: 威望值
 def GetMergeWarRank(curPlayer):
-    return curPlayer.GetExAttr10()
+    return 0
 
 ## 职业阶数
 def GetJobRank(curPlayer): return curPlayer.GetExAttr1()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 2a16803..f05f5d8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -334,7 +334,7 @@
 Writer = hxp
 Releaser = hxp
 RegType = 0
-RegisterPackCount = 17
+RegisterPackCount = 18
 
 PacketCMD_1 = 0xA5
 PacketSubCMD_1 = 0x04
@@ -404,6 +404,10 @@
 PacketSubCMD_17=0x29
 PacketCallFunc_17=OnSetLittleHelper
 
+PacketCMD_18=0xA2
+PacketSubCMD_18=0x30
+PacketCallFunc_18=OnSetChatBubbleBox
+
 ;购买相关的
 [BuySomething]
 ScriptName = Event\EventSrc\Operate_PlayerBuyZhenQi.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 4c5a166..7d701e2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -4755,6 +4755,58 @@
 
 
 #------------------------------------------------------
+# A2 30 设置聊天气泡框 #tagCMSetChatBubbleBox
+
+class  tagCMSetChatBubbleBox(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ("BubbleBoxType", c_ubyte),    #气泡框类型
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xA2
+        self.SubCmd = 0x30
+        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 = 0x30
+        self.BubbleBoxType = 0
+        return
+
+    def GetLength(self):
+        return sizeof(tagCMSetChatBubbleBox)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// A2 30 设置聊天气泡框 //tagCMSetChatBubbleBox:
+                                Cmd:%s,
+                                SubCmd:%s,
+                                BubbleBoxType:%d
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd,
+                                self.BubbleBoxType
+                                )
+        return DumpString
+
+
+m_NAtagCMSetChatBubbleBox=tagCMSetChatBubbleBox()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSetChatBubbleBox.Cmd,m_NAtagCMSetChatBubbleBox.SubCmd))] = m_NAtagCMSetChatBubbleBox
+
+
+#------------------------------------------------------
 # A2 22 设置引导成功 #tagCMSetGuideOK
 
 class  tagCMSetGuideOK(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 69dbdd4..ba7d046 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -2529,6 +2529,18 @@
     curPlayer.SetSetting(setting)
     return
 
+#// A2 30 设置聊天气泡框 #tagCMSetChatBubbleBox
+#
+#struct    tagCMSetChatBubbleBox
+#{
+#    tagHead         Head;
+#    BYTE        BubbleBoxType;    //气泡框类型
+#};
+def OnSetChatBubbleBox(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    PlayerControl.SetChatBubbleBox(curPlayer, clientData.BubbleBoxType)
+    return
+
 #// A2 29 设置小助手 #tagCMSetLittleHelper
 #
 #struct    tagCMSetLittleHelper
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index b4e5ad1..5b3bbcc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -5641,6 +5641,10 @@
 def GetVIPExpireTime(curPlayer): return curPlayer.GetExAttr9()
 def SetVIPExpireTime(curPlayer, expireTime): return curPlayer.SetExAttr9(expireTime, False, True)
 
+##聊天气泡框
+def GetChatBubbleBox(curPlayer): return curPlayer.GetExAttr10()
+def SetChatBubbleBox(curPlayer, value): return curPlayer.SetExAttr10(value, False, False)
+
 ##获得玩家威望值
 def GetPrestige(curPlayer): return 0
 def SetPrestige(curPlayer, value): return
@@ -5836,7 +5840,6 @@
 #  @param value: 威望值
 #  @return: 
 def SetMergeWarRank(curPlayer, value):
-    curPlayer.SetExAttr10(value, True, True)
     return
 
     
@@ -5844,7 +5847,7 @@
 #  @param curPlayer: 玩家实例
 #  @return: 威望值
 def GetMergeWarRank(curPlayer):
-    return curPlayer.GetExAttr10()
+    return 0
 
 
 ## 设置玩家官爵星级

--
Gitblit v1.8.0