From fbbacd8aee0a85823476267de499c350ce85d0f0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 11 五月 2019 10:21:48 +0800
Subject: [PATCH] 6647 【2.0】【开发】查看聊天信息、广播信息和掉落记录里的装备需求(增加查询广播装备详细信息支持)
---
ServerPython/CoreServerGroup/GameServer/PyNetPack.ini | 11 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py | 67 ++---
ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldItem.py | 79 +++++++
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py | 7
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 57 +++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 184 ++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py | 5
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 57 +++++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 184 ++++++++++++++++
9 files changed, 608 insertions(+), 43 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini b/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
index 3606b16..ab46a7a 100644
--- a/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
+++ b/ServerPython/CoreServerGroup/GameServer/PyNetPack.ini
@@ -330,6 +330,17 @@
PacketSubCMD_4=0x04
PacketCallFunc_4=OnQueryBossInfo
+[GameWorldItem]
+ScriptName = GameWorldLogic\GameWorldItem.py
+Writer = hxp
+Releaser = hxp
+RegType = 0
+RegisterPackCount = 1
+
+PacketCMD_1=0xA9
+PacketSubCMD_1=0x05
+PacketCallFunc_1=OnQueryNotifyEquipDetailInfo
+
[CrossRealmPK]
ScriptName = GameWorldLogic\CrossRealmPK.py
Writer = hxp
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index a81caef..6181b13 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -1363,6 +1363,63 @@
#------------------------------------------------------
+# A9 05 查询广播装备详细信息 #tagCGQueryNotifyEquipDetailInfo
+
+class tagCGQueryNotifyEquipDetailInfo(Structure):
+ Head = tagHead()
+ ItemGUID = "" #(char ItemGUID[40])
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ self.ItemGUID = ""
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 40
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteString(data, 40, self.ItemGUID)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ItemGUID:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ItemGUID
+ )
+ return DumpString
+
+
+m_NAtagCGQueryNotifyEquipDetailInfo=tagCGQueryNotifyEquipDetailInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryNotifyEquipDetailInfo.Head.Cmd,m_NAtagCGQueryNotifyEquipDetailInfo.Head.SubCmd))] = m_NAtagCGQueryNotifyEquipDetailInfo
+
+
+#------------------------------------------------------
# A9 A3 查看推荐好友 #tagCGQueryRecommendFriends
class tagCGQueryRecommendFriends(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 3afc13f..4431972 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -3371,6 +3371,190 @@
#------------------------------------------------------
+# A9 05 通知广播装备详细信息 #tagGCNotifyEquipDetailInfo
+
+class tagGCNotifyEquipClassEquip(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("ItemID", c_int),
+ ("Star", c_ubyte),
+ ]
+
+ 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.ItemID = 0
+ self.Star = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagGCNotifyEquipClassEquip)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// A9 05 通知广播装备详细信息 //tagGCNotifyEquipDetailInfo:
+ ItemID:%d,
+ Star:%d
+ '''\
+ %(
+ self.ItemID,
+ self.Star
+ )
+ return DumpString
+
+
+class tagGCNotifyEquipDetailInfo(Structure):
+ Head = tagHead()
+ ItemGUID = "" #(char ItemGUID[40])
+ ItemID = 0 #(DWORD ItemID)
+ Star = 0 #(BYTE Star)//星级
+ PlusLV = 0 #(WORD PlusLV)//强化等级
+ EvolveLV = 0 #(BYTE EvolveLV)//进化等级
+ WashLV = 0 #(BYTE WashLV)//洗练等级
+ WashValueCount = 0 #(BYTE WashValueCount)
+ WashValueList = list() #(vector<WORD> WashValueList)//洗练值
+ StoneIDCount = 0 #(BYTE StoneIDCount)
+ StoneIDList = list() #(vector<DWORD> StoneIDList)//宝石
+ ClassEquipCount = 0 #(BYTE ClassEquipCount)
+ ClassEquipList = list() #(vector<tagGCNotifyEquipClassEquip> ClassEquipList)//本境界穿戴的装备
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
+ self.ItemID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.Star,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.PlusLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.EvolveLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.WashLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.WashValueCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.WashValueCount):
+ value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+ self.WashValueList.append(value)
+ self.StoneIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.StoneIDCount):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.StoneIDList.append(value)
+ self.ClassEquipCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.ClassEquipCount):
+ temClassEquipList = tagGCNotifyEquipClassEquip()
+ _pos = temClassEquipList.ReadData(_lpData, _pos)
+ self.ClassEquipList.append(temClassEquipList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ self.ItemGUID = ""
+ self.ItemID = 0
+ self.Star = 0
+ self.PlusLV = 0
+ self.EvolveLV = 0
+ self.WashLV = 0
+ self.WashValueCount = 0
+ self.WashValueList = list()
+ self.StoneIDCount = 0
+ self.StoneIDList = list()
+ self.ClassEquipCount = 0
+ self.ClassEquipList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 40
+ length += 4
+ length += 1
+ length += 2
+ length += 1
+ length += 1
+ length += 1
+ length += 2 * self.WashValueCount
+ length += 1
+ length += 4 * self.StoneIDCount
+ length += 1
+ for i in range(self.ClassEquipCount):
+ length += self.ClassEquipList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteString(data, 40, self.ItemGUID)
+ data = CommFunc.WriteDWORD(data, self.ItemID)
+ data = CommFunc.WriteBYTE(data, self.Star)
+ data = CommFunc.WriteWORD(data, self.PlusLV)
+ data = CommFunc.WriteBYTE(data, self.EvolveLV)
+ data = CommFunc.WriteBYTE(data, self.WashLV)
+ data = CommFunc.WriteBYTE(data, self.WashValueCount)
+ for i in range(self.WashValueCount):
+ data = CommFunc.WriteWORD(data, self.WashValueList[i])
+ data = CommFunc.WriteBYTE(data, self.StoneIDCount)
+ for i in range(self.StoneIDCount):
+ data = CommFunc.WriteDWORD(data, self.StoneIDList[i])
+ data = CommFunc.WriteBYTE(data, self.ClassEquipCount)
+ for i in range(self.ClassEquipCount):
+ data = CommFunc.WriteString(data, self.ClassEquipList[i].GetLength(), self.ClassEquipList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ItemGUID:%s,
+ ItemID:%d,
+ Star:%d,
+ PlusLV:%d,
+ EvolveLV:%d,
+ WashLV:%d,
+ WashValueCount:%d,
+ WashValueList:%s,
+ StoneIDCount:%d,
+ StoneIDList:%s,
+ ClassEquipCount:%d,
+ ClassEquipList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ItemGUID,
+ self.ItemID,
+ self.Star,
+ self.PlusLV,
+ self.EvolveLV,
+ self.WashLV,
+ self.WashValueCount,
+ "...",
+ self.StoneIDCount,
+ "...",
+ self.ClassEquipCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagGCNotifyEquipDetailInfo=tagGCNotifyEquipDetailInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCNotifyEquipDetailInfo.Head.Cmd,m_NAtagGCNotifyEquipDetailInfo.Head.SubCmd))] = m_NAtagGCNotifyEquipDetailInfo
+
+
+#------------------------------------------------------
#A9 03 开服活动奖励数量刷新#tagGCOpenServerCampaignAwardCount
class tagGCOpenServerCampaignAwardCount(Structure):
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldItem.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldItem.py
new file mode 100644
index 0000000..1af298d
--- /dev/null
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldItem.py
@@ -0,0 +1,79 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package GameWorldItem
+#
+# @todo:世界物品管理
+# @author hxp
+# @date 2019-05-11
+# @version 1.0
+#
+# 详细描述: 世界物品管理
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-05-11 10:30"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+import PlayerControl
+import ChPyNetSendPack
+import NetPackCommon
+
+MaxCacheNotifyEquipCount = 100 # 最大缓存个数
+g_notifyEquipDetailInfoCache = {} # 装备广播详细信息缓存
+g_notifyEquipDetailGUIDList = []
+
+def OnCacheNotifyEquipDetailInfo(cacheInfo, tick):
+ ## 装备广播详细信息缓存
+ global g_notifyEquipDetailGUIDList
+ global g_notifyEquipDetailInfoCache
+
+ guid = cacheInfo[0]
+ if guid in g_notifyEquipDetailGUIDList:
+ g_notifyEquipDetailGUIDList.remove(guid)
+ g_notifyEquipDetailGUIDList.append(guid)
+ g_notifyEquipDetailInfoCache[guid] = cacheInfo[1:]
+
+ if len(g_notifyEquipDetailGUIDList) > MaxCacheNotifyEquipCount:
+ removeGUID = g_notifyEquipDetailGUIDList[0]
+ g_notifyEquipDetailGUIDList.remove(removeGUID)
+ g_notifyEquipDetailInfoCache.pop(removeGUID, None)
+
+ return
+
+#// A9 05 查询广播装备详细信息 #tagCGQueryNotifyEquipDetailInfo
+#
+#struct tagCGQueryNotifyEquipDetailInfo
+#{
+# tagHead Head;
+# char ItemGUID[40];
+#};
+def OnQueryNotifyEquipDetailInfo(index, clientData, tick):
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ guid = clientData.ItemGUID
+ if guid not in g_notifyEquipDetailInfoCache:
+ PlayerControl.NotifyCode(curPlayer, "CheckEquip")
+ return
+ itemID, equipStar, plusLV, plusEvolveLV, washLV, washValueList, stoneIDList, classItems = g_notifyEquipDetailInfoCache[guid]
+ equipDetail = ChPyNetSendPack.tagGCNotifyEquipDetailInfo()
+ equipDetail.ItemGUID = guid
+ equipDetail.ItemID = itemID
+ equipDetail.Star = equipStar
+ equipDetail.PlusLV = plusLV
+ equipDetail.EvolveLV = plusEvolveLV
+ equipDetail.WashLV = washLV
+ equipDetail.WashValueList = washValueList
+ equipDetail.WashValueCount = len(equipDetail.WashValueList)
+ equipDetail.StoneIDList = stoneIDList
+ equipDetail.StoneIDCount = len(equipDetail.StoneIDList)
+ for classItemID, classStar in classItems:
+ classEquip = ChPyNetSendPack.tagGCNotifyEquipClassEquip()
+ classEquip.ItemID = classItemID
+ classEquip.Star = classStar
+ equipDetail.ClassEquipList.append(classEquip)
+ equipDetail.ClassEquipCount = len(equipDetail.ClassEquipList)
+ NetPackCommon.SendFakePack(curPlayer, equipDetail)
+ return
+
+
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
index 5f7136e..b934983 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerQuery.py
@@ -73,9 +73,11 @@
import NetPackCommon
import AuctionHouse
import PlayerFairyDomain
+import GameWorldItem
import time
import datetime
+import json
#---------------------------------------------------------------------
#全局变量
#---------------------------------------------------------------------
@@ -713,6 +715,11 @@
GameWorldProcess.UpdGlobalKillCount(eval(resultName))
return
+ # 缓存装备广播信息中的装备明细信息
+ if callName == "NotifyEquipDetailInfo":
+ GameWorldItem.OnCacheNotifyEquipDetailInfo(json.loads(resultName), tick)
+ return
+
#生成仙盟红包
if callName == "MapServer_CreatRedPacket":
PlayerFamilyRedPacket.MapServer_CreatRedPacket(eval(resultName))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index a81caef..6181b13 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -1363,6 +1363,63 @@
#------------------------------------------------------
+# A9 05 查询广播装备详细信息 #tagCGQueryNotifyEquipDetailInfo
+
+class tagCGQueryNotifyEquipDetailInfo(Structure):
+ Head = tagHead()
+ ItemGUID = "" #(char ItemGUID[40])
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ self.ItemGUID = ""
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 40
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteString(data, 40, self.ItemGUID)
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ItemGUID:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ItemGUID
+ )
+ return DumpString
+
+
+m_NAtagCGQueryNotifyEquipDetailInfo=tagCGQueryNotifyEquipDetailInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGQueryNotifyEquipDetailInfo.Head.Cmd,m_NAtagCGQueryNotifyEquipDetailInfo.Head.SubCmd))] = m_NAtagCGQueryNotifyEquipDetailInfo
+
+
+#------------------------------------------------------
# A9 A3 查看推荐好友 #tagCGQueryRecommendFriends
class tagCGQueryRecommendFriends(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 3afc13f..4431972 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -3371,6 +3371,190 @@
#------------------------------------------------------
+# A9 05 通知广播装备详细信息 #tagGCNotifyEquipDetailInfo
+
+class tagGCNotifyEquipClassEquip(Structure):
+ _pack_ = 1
+ _fields_ = [
+ ("ItemID", c_int),
+ ("Star", c_ubyte),
+ ]
+
+ 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.ItemID = 0
+ self.Star = 0
+ return
+
+ def GetLength(self):
+ return sizeof(tagGCNotifyEquipClassEquip)
+
+ def GetBuffer(self):
+ return string_at(addressof(self), self.GetLength())
+
+ def OutputString(self):
+ DumpString = '''// A9 05 通知广播装备详细信息 //tagGCNotifyEquipDetailInfo:
+ ItemID:%d,
+ Star:%d
+ '''\
+ %(
+ self.ItemID,
+ self.Star
+ )
+ return DumpString
+
+
+class tagGCNotifyEquipDetailInfo(Structure):
+ Head = tagHead()
+ ItemGUID = "" #(char ItemGUID[40])
+ ItemID = 0 #(DWORD ItemID)
+ Star = 0 #(BYTE Star)//星级
+ PlusLV = 0 #(WORD PlusLV)//强化等级
+ EvolveLV = 0 #(BYTE EvolveLV)//进化等级
+ WashLV = 0 #(BYTE WashLV)//洗练等级
+ WashValueCount = 0 #(BYTE WashValueCount)
+ WashValueList = list() #(vector<WORD> WashValueList)//洗练值
+ StoneIDCount = 0 #(BYTE StoneIDCount)
+ StoneIDList = list() #(vector<DWORD> StoneIDList)//宝石
+ ClassEquipCount = 0 #(BYTE ClassEquipCount)
+ ClassEquipList = list() #(vector<tagGCNotifyEquipClassEquip> ClassEquipList)//本境界穿戴的装备
+ data = None
+
+ def __init__(self):
+ self.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ return
+
+ def ReadData(self, _lpData, _pos=0, _Len=0):
+ self.Clear()
+ _pos = self.Head.ReadData(_lpData, _pos)
+ self.ItemGUID,_pos = CommFunc.ReadString(_lpData, _pos,40)
+ self.ItemID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
+ self.Star,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.PlusLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
+ self.EvolveLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.WashLV,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ self.WashValueCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.WashValueCount):
+ value,_pos=CommFunc.ReadWORD(_lpData,_pos)
+ self.WashValueList.append(value)
+ self.StoneIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.StoneIDCount):
+ value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
+ self.StoneIDList.append(value)
+ self.ClassEquipCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
+ for i in range(self.ClassEquipCount):
+ temClassEquipList = tagGCNotifyEquipClassEquip()
+ _pos = temClassEquipList.ReadData(_lpData, _pos)
+ self.ClassEquipList.append(temClassEquipList)
+ return _pos
+
+ def Clear(self):
+ self.Head = tagHead()
+ self.Head.Clear()
+ self.Head.Cmd = 0xA9
+ self.Head.SubCmd = 0x05
+ self.ItemGUID = ""
+ self.ItemID = 0
+ self.Star = 0
+ self.PlusLV = 0
+ self.EvolveLV = 0
+ self.WashLV = 0
+ self.WashValueCount = 0
+ self.WashValueList = list()
+ self.StoneIDCount = 0
+ self.StoneIDList = list()
+ self.ClassEquipCount = 0
+ self.ClassEquipList = list()
+ return
+
+ def GetLength(self):
+ length = 0
+ length += self.Head.GetLength()
+ length += 40
+ length += 4
+ length += 1
+ length += 2
+ length += 1
+ length += 1
+ length += 1
+ length += 2 * self.WashValueCount
+ length += 1
+ length += 4 * self.StoneIDCount
+ length += 1
+ for i in range(self.ClassEquipCount):
+ length += self.ClassEquipList[i].GetLength()
+
+ return length
+
+ def GetBuffer(self):
+ data = ''
+ data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
+ data = CommFunc.WriteString(data, 40, self.ItemGUID)
+ data = CommFunc.WriteDWORD(data, self.ItemID)
+ data = CommFunc.WriteBYTE(data, self.Star)
+ data = CommFunc.WriteWORD(data, self.PlusLV)
+ data = CommFunc.WriteBYTE(data, self.EvolveLV)
+ data = CommFunc.WriteBYTE(data, self.WashLV)
+ data = CommFunc.WriteBYTE(data, self.WashValueCount)
+ for i in range(self.WashValueCount):
+ data = CommFunc.WriteWORD(data, self.WashValueList[i])
+ data = CommFunc.WriteBYTE(data, self.StoneIDCount)
+ for i in range(self.StoneIDCount):
+ data = CommFunc.WriteDWORD(data, self.StoneIDList[i])
+ data = CommFunc.WriteBYTE(data, self.ClassEquipCount)
+ for i in range(self.ClassEquipCount):
+ data = CommFunc.WriteString(data, self.ClassEquipList[i].GetLength(), self.ClassEquipList[i].GetBuffer())
+ return data
+
+ def OutputString(self):
+ DumpString = '''
+ Head:%s,
+ ItemGUID:%s,
+ ItemID:%d,
+ Star:%d,
+ PlusLV:%d,
+ EvolveLV:%d,
+ WashLV:%d,
+ WashValueCount:%d,
+ WashValueList:%s,
+ StoneIDCount:%d,
+ StoneIDList:%s,
+ ClassEquipCount:%d,
+ ClassEquipList:%s
+ '''\
+ %(
+ self.Head.OutputString(),
+ self.ItemGUID,
+ self.ItemID,
+ self.Star,
+ self.PlusLV,
+ self.EvolveLV,
+ self.WashLV,
+ self.WashValueCount,
+ "...",
+ self.StoneIDCount,
+ "...",
+ self.ClassEquipCount,
+ "..."
+ )
+ return DumpString
+
+
+m_NAtagGCNotifyEquipDetailInfo=tagGCNotifyEquipDetailInfo()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCNotifyEquipDetailInfo.Head.Cmd,m_NAtagGCNotifyEquipDetailInfo.Head.SubCmd))] = m_NAtagGCNotifyEquipDetailInfo
+
+
+#------------------------------------------------------
#A9 03 开服活动奖励数量刷新#tagGCOpenServerCampaignAwardCount
class tagGCOpenServerCampaignAwardCount(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
index e670e3c..b0c79ba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_EquipPlus.py
@@ -164,8 +164,9 @@
#GameWorld.DebugLog("PlusLVChange index=%s,updPlusLV=%s,broadCastLVList=%s" % (index, updPlusLV, broadCastLVList))
if updPlusLV in broadCastLVList:
itemID = curEquip.GetItemTypeID()
- superItemInfo = ItemCommon.GetNotifySuperItemInfo(curPlayer, curEquip, index)
- msgParamList = [curPlayer.GetPlayerName(), itemID, superItemInfo, updPlusLV]
+ userData = curEquip.GetUserData()
+ guid = ItemCommon.CacheNotifyEquipDetailInfo(curPlayer, curEquip)
+ msgParamList = [curPlayer.GetPlayerName(), itemID, userData, guid, updPlusLV]
PlayerControl.WorldNotify(0, "StrengthenCongratulation", msgParamList)
# 成就
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index 7cd332a..772cbfb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -709,56 +709,41 @@
def NotifyItemDropByKill(curPlayer, curItem, npcID, notifyMark='', mapID=0):
return #吕超说此处屏蔽
-def GetNotifySuperItemInfo(curPlayer, curEquip, place=None):
- '''装备提示超链接信息汇总
- <a><Word info=item id=%s0/>|showitem=%s0 itemPlus=%s0</a>
- {"ItemID":物品ID, "UserData":..., "Star":星级, "EvolveLV":进化等级,"PlusLV":强化等级,"Stone":[宝石ID,...], "Wash":{"LV":洗练等级,"Value":[洗练值, ...]}, "Equips":[itemID, itemID, ...]}
+def CacheNotifyEquipDetailInfo(curPlayer, curEquip):
+ ''' 缓存装备广播信息中的装备明细信息
+ 因为本版本需要的查看的内容相对较多,为了减少全服广播流量消耗,所以先进行缓存,玩家点击查看时再进行查询
'''
+ guid = curEquip.GetGUID()
packType = curEquip.GetItemPlaceType()
packIndex = curEquip.GetItemPlaceIndex()
if packType != IPY_GameWorld.rptEquip:
- return "{}"
+ return guid
classLV = GetItemClassLV(curEquip)
if not classLV:
- return "{}"
+ return guid
- packType = IPY_GameWorld.rptEquip
- itemDict = {}
- itemDict["ItemID"] = curEquip.GetItemTypeID()
- userData = curEquip.GetUserData()
- if userData and userData != "{}":
- itemDict["UserData"] = userData
-
- #部位升星数据
+ itemID = curEquip.GetItemTypeID()
+ #部位星级
equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, packIndex, curEquip)
- if equipStar:
- itemDict["Star"] = equipStar
-
+
#部位强化数据
- equipPartPlusLV = ChEquip.GetEquipPartPlusLVByRank(curPlayer, packType, packIndex, curEquip)
- equipPartPlusEvolveLV = ChEquip.GetEquipPartPlusEvolveLVByEquip(curPlayer, packType, packIndex, curEquip)
- if equipPartPlusLV:
- itemDict["PlusLV"] = equipPartPlusLV
- if equipPartPlusEvolveLV:
- itemDict["EvolveLV"] = equipPartPlusEvolveLV
+ plusLV = ChEquip.GetEquipPartPlusLVByRank(curPlayer, packType, packIndex, curEquip)
+ plusEvolveLV = ChEquip.GetEquipPartPlusEvolveLVByEquip(curPlayer, packType, packIndex, curEquip)
+
+ #部位洗练数据
+ washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex)
+ washValueList = []
+ for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
+ value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (packIndex, attrNum))
+ washValueList.append(value)
#部位宝石数据
stoneIDList = Operate_EquipStone.GetEquipIndexStoneIDList(curPlayer, packIndex)
- if stoneIDList and stoneIDList.count(0) != len(stoneIDList):
- itemDict["Stone"] = stoneIDList
-
- #部位洗练数据
- washLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashLV % packIndex)
- valueList = []
- for attrNum in xrange(1, Operate_EquipWash.Def_EquipWashMaxAttrCount + 1):
- value = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipWashValue % (packIndex, attrNum))
- valueList.append(value)
- if valueList and valueList.count(0) != len(valueList):
- itemDict["Wash"] = {"LV":washLV, "Value":valueList}
-
- classItems = [] # 本阶已穿装备ID
+
+ #本阶已穿装备ID [[itemID,star], ...]
+ classItems = []
ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('EquipPlaceIndexMap', {'ClassLV':classLV}, True)
if ipyDataList:
equipPack = curPlayer.GetItemManager().GetPack(packType)
@@ -770,11 +755,11 @@
equipID = classEquip.GetItemTypeID()
equipStar = ChEquip.GetEquipPartStarByRank(curPlayer, index, classEquip)
classItems.append([equipID, equipStar])
- if classItems:
- itemDict["Equips"] = classItems
-
- return json.dumps(itemDict, ensure_ascii=False).replace(" ", "")
-
+
+ cacheInfo = [guid, itemID, equipStar, plusLV, plusEvolveLV, washLV, washValueList, stoneIDList, classItems]
+ cacheInfo = json.dumps(cacheInfo, ensure_ascii=False)
+ GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "NotifyEquipDetailInfo", cacheInfo, len(cacheInfo))
+ return guid
## 使用物品的特殊提示
# @param curPlayer 当前玩家
--
Gitblit v1.8.0