From fdebf36f0d9201c6a6949a08cdfeebb718c25ce2 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 23 五月 2025 19:35:53 +0800
Subject: [PATCH] 16 卡牌服务端(聊天、广播、通用记录、查看玩家;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py |  401 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 400 insertions(+), 1 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py
index c258a1a..b6b8e0c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/DBStruct.py
@@ -10,6 +10,7 @@
 # @version 1.0
 #
 # 详细描述: CodeMaker PyGameServerSaveData.py生成
+# 注: 修改表结构、增删表时需同步修改 GAMEWORLD_DATA_VERSION_NO
 #
 #-------------------------------------------------------------------------------
 #"""Version = 2025-05-09 12:20"""
@@ -666,7 +667,67 @@
         else:
             self.Operate = Str[:15]
 
-            
+
+# 事件触发表 #tagDBEventTrig
+class tagDBEventTrig(Structure):
+    _pack_ = 1
+    _fields_ = [
+        ('EventLen', ctypes.c_ulong),
+        ('EventID', ctypes.c_char_p),
+        ('EventValue', ctypes.c_ulong),
+        ('ADOResult', ctypes.c_ulong),
+    ]
+
+    def __init__(self):
+        Structure.__init__(self)
+        self.clear()
+
+    def clear(self):
+        self.EventLen = 0
+        self.EventID = ''
+        self.EventValue = 0
+
+    def readData(self, buf, pos = 0, length = 0):
+        if not pos <= length:
+            return -1
+        if len(buf) < pos + self.getLength():
+            return -1
+        self.clear()
+        self.EventLen, pos = CommFunc.ReadDWORD(buf, pos)
+        tmp, pos = CommFunc.ReadString(buf, pos, self.EventLen)
+        self.EventID = ctypes.c_char_p(tmp)
+        self.EventValue, pos = CommFunc.ReadDWORD(buf, pos)
+        return self.getLength()
+
+    def getBuffer(self):
+        buf = ''
+        buf = CommFunc.WriteDWORD(buf, self.EventLen)
+        buf = CommFunc.WriteString(buf, self.EventLen, self.EventID)
+        buf = CommFunc.WriteDWORD(buf, self.EventValue)
+        return buf
+
+    def getLength(self):
+        length = 0
+        length += sizeof(ctypes.c_ulong)
+        length += self.EventLen
+        length += sizeof(ctypes.c_ulong)
+        return length
+
+    def outputString(self):
+        output = '''// 事件触发表 #tagDBEventTrig:
+            EventLen = %s,
+            EventID = %s,
+            EventValue = %s,
+            ADOResult = %s,
+            '''%(
+                self.EventLen,
+                self.EventID,
+                self.EventValue,
+                self.ADOResult,
+            )
+        return output
+
+
 # 家族表 #tagDBFamily
 class tagDBFamily(Structure):
     _pack_ = 1
@@ -1638,3 +1699,341 @@
         else:
             self.GUID = Str[:36]
             
+
+# 排行榜表 #tagDBBillboard
+class tagDBBillboard(Structure):
+    _pack_ = 1
+    _fields_ = [
+        ('GroupValue1', ctypes.c_ulong),
+        ('GroupValue2', ctypes.c_ulong),
+        ('BillboardType', ctypes.c_ubyte),
+        ('ID', ctypes.c_ulong),
+        ('ID2', ctypes.c_ulong),
+        ('Name1', ctypes.c_char * 33),
+        ('Name2', ctypes.c_char * 65),
+        ('Type2', ctypes.c_ubyte),
+        ('Value1', ctypes.c_ulong),
+        ('Value2', ctypes.c_ulong),
+        ('Value3', ctypes.c_ulong),
+        ('Value4', ctypes.c_ulong),
+        ('Value5', ctypes.c_ulong),
+        ('Value6', ctypes.c_ulong),
+        ('Value7', ctypes.c_ulong),
+        ('Value8', ctypes.c_ulong),
+        ('CmpValue', ctypes.c_ulong),
+        ('CmpValue2', ctypes.c_ulong),
+        ('CmpValue3', ctypes.c_ulong),
+        ('DataLen', ctypes.c_ushort),
+        ('UserData', ctypes.c_char_p),
+        ('ADOResult', ctypes.c_ulong),
+    ]
+
+    def __init__(self):
+        Structure.__init__(self)
+        self.clear()
+
+    def clear(self):
+        self.GroupValue1 = 0
+        self.GroupValue2 = 0
+        self.BillboardType = 0
+        self.ID = 0
+        self.ID2 = 0
+        self.Name1 = ''
+        self.Name2 = ''
+        self.Type2 = 0
+        self.Value1 = 0
+        self.Value2 = 0
+        self.Value3 = 0
+        self.Value4 = 0
+        self.Value5 = 0
+        self.Value6 = 0
+        self.Value7 = 0
+        self.Value8 = 0
+        self.CmpValue = 0
+        self.CmpValue2 = 0
+        self.CmpValue3 = 0
+        self.DataLen = 0
+        self.UserData = ''
+
+    def readData(self, buf, pos = 0, length = 0):
+        if not pos <= length:
+            return -1
+        if len(buf) < pos + self.getLength():
+            return -1
+        self.clear()
+        self.GroupValue1, pos = CommFunc.ReadDWORD(buf, pos)
+        self.GroupValue2, pos = CommFunc.ReadDWORD(buf, pos)
+        self.BillboardType, pos = CommFunc.ReadBYTE(buf, pos)
+        self.ID, pos = CommFunc.ReadDWORD(buf, pos)
+        self.ID2, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Name1, pos = CommFunc.ReadString(buf, pos, 33)
+        self.Name2, pos = CommFunc.ReadString(buf, pos, 65)
+        self.Type2, pos = CommFunc.ReadBYTE(buf, pos)
+        self.Value1, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value2, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value3, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value4, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value5, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value6, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value7, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value8, pos = CommFunc.ReadDWORD(buf, pos)
+        self.CmpValue, pos = CommFunc.ReadDWORD(buf, pos)
+        self.CmpValue2, pos = CommFunc.ReadDWORD(buf, pos)
+        self.CmpValue3, pos = CommFunc.ReadDWORD(buf, pos)
+        self.DataLen, pos = CommFunc.ReadWORD(buf, pos)
+        tmp, pos = CommFunc.ReadString(buf, pos, self.DataLen)
+        self.UserData = ctypes.c_char_p(tmp)
+        return self.getLength()
+
+    def getBuffer(self):
+        buf = ''
+        buf = CommFunc.WriteDWORD(buf, self.GroupValue1)
+        buf = CommFunc.WriteDWORD(buf, self.GroupValue2)
+        buf = CommFunc.WriteBYTE(buf, self.BillboardType)
+        buf = CommFunc.WriteDWORD(buf, self.ID)
+        buf = CommFunc.WriteDWORD(buf, self.ID2)
+        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.Name1)
+        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 65, self.Name2)
+        buf = CommFunc.WriteBYTE(buf, self.Type2)
+        buf = CommFunc.WriteDWORD(buf, self.Value1)
+        buf = CommFunc.WriteDWORD(buf, self.Value2)
+        buf = CommFunc.WriteDWORD(buf, self.Value3)
+        buf = CommFunc.WriteDWORD(buf, self.Value4)
+        buf = CommFunc.WriteDWORD(buf, self.Value5)
+        buf = CommFunc.WriteDWORD(buf, self.Value6)
+        buf = CommFunc.WriteDWORD(buf, self.Value7)
+        buf = CommFunc.WriteDWORD(buf, self.Value8)
+        buf = CommFunc.WriteDWORD(buf, self.CmpValue)
+        buf = CommFunc.WriteDWORD(buf, self.CmpValue2)
+        buf = CommFunc.WriteDWORD(buf, self.CmpValue3)
+        buf = CommFunc.WriteWORD(buf, self.DataLen)
+        buf = CommFunc.WriteString(buf, self.DataLen, self.UserData)
+        return buf
+
+    def getLength(self):
+        length = 0
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ubyte)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_char) * 33
+        length += sizeof(ctypes.c_char) * 65
+        length += sizeof(ctypes.c_ubyte)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ushort)
+        length += self.DataLen
+        return length
+
+    def outputString(self):
+        output = '''// 排行榜表 #tagDBBillboard:
+            GroupValue1 = %s,
+            GroupValue2 = %s,
+            BillboardType = %s,
+            ID = %s,
+            ID2 = %s,
+            Name1 = %s,
+            Name2 = %s,
+            Type2 = %s,
+            Value1 = %s,
+            Value2 = %s,
+            Value3 = %s,
+            Value4 = %s,
+            Value5 = %s,
+            Value6 = %s,
+            Value7 = %s,
+            Value8 = %s,
+            CmpValue = %s,
+            CmpValue2 = %s,
+            CmpValue3 = %s,
+            DataLen = %s,
+            UserData = %s,
+            ADOResult = %s,
+            '''%(
+                self.GroupValue1,
+                self.GroupValue2,
+                self.BillboardType,
+                self.ID,
+                self.ID2,
+                self.Name1,
+                self.Name2,
+                self.Type2,
+                self.Value1,
+                self.Value2,
+                self.Value3,
+                self.Value4,
+                self.Value5,
+                self.Value6,
+                self.Value7,
+                self.Value8,
+                self.CmpValue,
+                self.CmpValue2,
+                self.CmpValue3,
+                self.DataLen,
+                self.UserData,
+                self.ADOResult,
+            )
+        return output
+
+    #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
+    def SetName1(self,Str):
+        if len(Str)<=33:
+            self.Name1 = Str
+        else:
+            self.Name1 = Str[:33]
+            
+    def SetName2(self,Str):
+        if len(Str)<=65:
+            self.Name2 = Str
+        else:
+            self.Name2 = Str[:65]
+            
+
+# 通用记录表新 #tagDBGameRec
+class tagDBGameRec(Structure):
+    _pack_ = 1
+    _fields_ = [
+        ('RecType', ctypes.c_ushort),
+        ('RecID', ctypes.c_ulong),
+        ('Time', ctypes.c_double),
+        ('Value1', ctypes.c_ulong),
+        ('Value2', ctypes.c_ulong),
+        ('Value3', ctypes.c_ulong),
+        ('Value4', ctypes.c_ulong),
+        ('Value5', ctypes.c_ulong),
+        ('Value6', ctypes.c_ulong),
+        ('Value7', ctypes.c_ulong),
+        ('Value8', ctypes.c_ulong),
+        ('UserDataLen', ctypes.c_ushort),
+        ('UserData', ctypes.c_char_p),
+        ('ADOResult', ctypes.c_ulong),
+    ]
+
+    def __init__(self):
+        Structure.__init__(self)
+        self.clear()
+
+    def clear(self):
+        self.RecType = 0
+        self.RecID = 0
+        self.Time = 0.0
+        self.Value1 = 0
+        self.Value2 = 0
+        self.Value3 = 0
+        self.Value4 = 0
+        self.Value5 = 0
+        self.Value6 = 0
+        self.Value7 = 0
+        self.Value8 = 0
+        self.UserDataLen = 0
+        self.UserData = ''
+
+    def readData(self, buf, pos = 0, length = 0):
+        if not pos <= length:
+            return -1
+        if len(buf) < pos + self.getLength():
+            return -1
+        self.clear()
+        self.RecType, pos = CommFunc.ReadWORD(buf, pos)
+        self.RecID, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Time, pos = CommFunc.ReadDouble(buf, pos)
+        self.Value1, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value2, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value3, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value4, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value5, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value6, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value7, pos = CommFunc.ReadDWORD(buf, pos)
+        self.Value8, pos = CommFunc.ReadDWORD(buf, pos)
+        self.UserDataLen, pos = CommFunc.ReadWORD(buf, pos)
+        tmp, pos = CommFunc.ReadString(buf, pos, self.UserDataLen)
+        self.UserData = ctypes.c_char_p(tmp)
+        return self.getLength()
+
+    def getBuffer(self):
+        buf = ''
+        buf = CommFunc.WriteWORD(buf, self.RecType)
+        buf = CommFunc.WriteDWORD(buf, self.RecID)
+        buf = CommFunc.WriteDouble(buf, self.Time)
+        buf = CommFunc.WriteDWORD(buf, self.Value1)
+        buf = CommFunc.WriteDWORD(buf, self.Value2)
+        buf = CommFunc.WriteDWORD(buf, self.Value3)
+        buf = CommFunc.WriteDWORD(buf, self.Value4)
+        buf = CommFunc.WriteDWORD(buf, self.Value5)
+        buf = CommFunc.WriteDWORD(buf, self.Value6)
+        buf = CommFunc.WriteDWORD(buf, self.Value7)
+        buf = CommFunc.WriteDWORD(buf, self.Value8)
+        buf = CommFunc.WriteWORD(buf, self.UserDataLen)
+        buf = CommFunc.WriteString(buf, self.UserDataLen, self.UserData)
+        return buf
+
+    def getLength(self):
+        length = 0
+        length += sizeof(ctypes.c_ushort)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_double)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ushort)
+        length += self.UserDataLen
+        return length
+
+    def outputString(self):
+        output = '''// 通用记录表新 #tagDBGameRec:
+            RecType = %s,
+            RecID = %s,
+            Time = %s,
+            Value1 = %s,
+            Value2 = %s,
+            Value3 = %s,
+            Value4 = %s,
+            Value5 = %s,
+            Value6 = %s,
+            Value7 = %s,
+            Value8 = %s,
+            UserDataLen = %s,
+            UserData = %s,
+            ADOResult = %s,
+            '''%(
+                self.RecType,
+                self.RecID,
+                self.Time,
+                self.Value1,
+                self.Value2,
+                self.Value3,
+                self.Value4,
+                self.Value5,
+                self.Value6,
+                self.Value7,
+                self.Value8,
+                self.UserDataLen,
+                self.UserData,
+                self.ADOResult,
+            )
+        return output
+
+
+
+#服务器世界数据表版本号
+GAMEWORLD_DATA_VERSION_NO = ctypes.c_ulong (\
+    sizeof(tagDBEventTrig) + sizeof(tagDBFamily) + sizeof(tagDBFamilyMem) + sizeof(tagDBFamilyAction) + 
+    sizeof(tagDBPlayerViewCache) + sizeof(tagDBMailPersonal) + sizeof(tagDBMailServer) + sizeof(tagDBMailItem) + 
+    sizeof(tagDBMailPlayerRec) + sizeof(tagDBBillboard) + sizeof(tagDBGameRec)
+    ).value
+    
\ No newline at end of file

--
Gitblit v1.8.0