From 7144eee263494fb574a03d629a2b7fc8b6827f42 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 25 二月 2019 14:16:45 +0800
Subject: [PATCH] 6250 【后端】【2.0】拍卖行开发单(封包)

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

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
index 7f461cc..ced9f6a 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
@@ -15,6 +15,66 @@
 from ctypes import (Structure, memset, memmove, sizeof, addressof, create_string_buffer, string_at)
 import CommFunc
 
+# 拍卖关注表 #tagDBAuctionAttention
+class tagDBAuctionAttention(Structure):
+    _pack_ = 1
+    _fields_ = [
+        ('PlayerID', ctypes.c_ulong),
+        ('AttentionLen', ctypes.c_ubyte),
+        ('AttentionInfo', ctypes.c_char_p),
+        ('ADOResult', ctypes.c_ulong),
+    ]
+
+    def __init__(self):
+        Structure.__init__(self)
+        self.clear()
+
+    def clear(self):
+        self.PlayerID = 0
+        self.AttentionLen = 0
+        self.AttentionInfo = ''
+
+    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.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
+        self.AttentionLen, pos = CommFunc.ReadBYTE(buf, pos)
+        tmp, pos = CommFunc.ReadString(buf, pos, self.AttentionLen)
+        self.AttentionInfo = ctypes.c_char_p(tmp)
+        return self.getLength()
+
+    def getBuffer(self):
+        buf = ''
+        buf = CommFunc.WriteDWORD(buf, self.PlayerID)
+        buf = CommFunc.WriteBYTE(buf, self.AttentionLen)
+        buf = CommFunc.WriteString(buf, self.AttentionLen, self.AttentionInfo)
+        return buf
+
+    def getLength(self):
+        length = 0
+        length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_ubyte)
+        length += self.AttentionLen
+        return length
+
+    def outputString(self):
+        output = '''// 拍卖关注表 #tagDBAuctionAttention:
+            PlayerID = %s,
+            AttentionLen = %s,
+            AttentionInfo = %s,
+            ADOResult = %s,
+            '''%(
+                self.PlayerID,
+                self.AttentionLen,
+                self.AttentionInfo,
+                self.ADOResult,
+            )
+        return output
+
+
 # 拍卖记录表 #tagDBAuctionRecord
 class tagDBAuctionRecord(Structure):
     _pack_ = 1
@@ -133,6 +193,7 @@
         ('FamilyID', ctypes.c_ulong),
         ('ItemID', ctypes.c_ulong),
         ('Count', ctypes.c_ushort),
+        ('AuctionType', ctypes.c_ubyte),
         ('AddTime', ctypes.c_char * 19),
         ('BiddingTime', ctypes.c_char * 19),
         ('BidderID', ctypes.c_ulong),
@@ -145,6 +206,8 @@
         ('UserData', ctypes.c_char_p),
         ('FamilyPlayerIDLen', ctypes.c_ushort),
         ('FamilyPlayerIDInfo', ctypes.c_char_p),
+        ('BidderIDLen', ctypes.c_ubyte),
+        ('BidderIDInfo', ctypes.c_char_p),
         ('ADOResult', ctypes.c_ulong),
     ]
 
@@ -158,6 +221,7 @@
         self.FamilyID = 0
         self.ItemID = 0
         self.Count = 0
+        self.AuctionType = 0
         self.AddTime = ''
         self.BiddingTime = ''
         self.BidderID = 0
@@ -170,6 +234,8 @@
         self.UserData = ''
         self.FamilyPlayerIDLen = 0
         self.FamilyPlayerIDInfo = ''
+        self.BidderIDLen = 0
+        self.BidderIDInfo = ''
 
     def readData(self, buf, pos = 0, length = 0):
         if not pos <= length:
@@ -182,6 +248,7 @@
         self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
         self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
         self.Count, pos = CommFunc.ReadWORD(buf, pos)
+        self.AuctionType, pos = CommFunc.ReadBYTE(buf, pos)
         self.AddTime, pos = CommFunc.ReadString(buf, pos, 19)
         self.BiddingTime, pos = CommFunc.ReadString(buf, pos, 19)
         self.BidderID, pos = CommFunc.ReadDWORD(buf, pos)
@@ -196,6 +263,9 @@
         self.FamilyPlayerIDLen, pos = CommFunc.ReadWORD(buf, pos)
         tmp, pos = CommFunc.ReadString(buf, pos, self.FamilyPlayerIDLen)
         self.FamilyPlayerIDInfo = ctypes.c_char_p(tmp)
+        self.BidderIDLen, pos = CommFunc.ReadBYTE(buf, pos)
+        tmp, pos = CommFunc.ReadString(buf, pos, self.BidderIDLen)
+        self.BidderIDInfo = ctypes.c_char_p(tmp)
         return self.getLength()
 
     def getBuffer(self):
@@ -205,6 +275,7 @@
         buf = CommFunc.WriteDWORD(buf, self.FamilyID)
         buf = CommFunc.WriteDWORD(buf, self.ItemID)
         buf = CommFunc.WriteWORD(buf, self.Count)
+        buf = CommFunc.WriteBYTE(buf, self.AuctionType)
         buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.AddTime)
         buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.BiddingTime)
         buf = CommFunc.WriteDWORD(buf, self.BidderID)
@@ -217,6 +288,8 @@
         buf = CommFunc.WriteString(buf, self.UserDataLen, self.UserData)
         buf = CommFunc.WriteWORD(buf, self.FamilyPlayerIDLen)
         buf = CommFunc.WriteString(buf, self.FamilyPlayerIDLen, self.FamilyPlayerIDInfo)
+        buf = CommFunc.WriteBYTE(buf, self.BidderIDLen)
+        buf = CommFunc.WriteString(buf, self.BidderIDLen, self.BidderIDInfo)
         return buf
 
     def getLength(self):
@@ -226,6 +299,7 @@
         length += sizeof(ctypes.c_ulong)
         length += sizeof(ctypes.c_ulong)
         length += sizeof(ctypes.c_ushort)
+        length += sizeof(ctypes.c_ubyte)
         length += sizeof(ctypes.c_char) * 19
         length += sizeof(ctypes.c_char) * 19
         length += sizeof(ctypes.c_ulong)
@@ -238,6 +312,8 @@
         length += self.UserDataLen
         length += sizeof(ctypes.c_ushort)
         length += self.FamilyPlayerIDLen
+        length += sizeof(ctypes.c_ubyte)
+        length += self.BidderIDLen
         return length
 
     def outputString(self):
@@ -247,6 +323,7 @@
             FamilyID = %s,
             ItemID = %s,
             Count = %s,
+            AuctionType = %s,
             AddTime = %s,
             BiddingTime = %s,
             BidderID = %s,
@@ -259,6 +336,8 @@
             UserData = %s,
             FamilyPlayerIDLen = %s,
             FamilyPlayerIDInfo = %s,
+            BidderIDLen = %s,
+            BidderIDInfo = %s,
             ADOResult = %s,
             '''%(
                 self.ItemGUID,
@@ -266,6 +345,7 @@
                 self.FamilyID,
                 self.ItemID,
                 self.Count,
+                self.AuctionType,
                 self.AddTime,
                 self.BiddingTime,
                 self.BidderID,
@@ -278,6 +358,8 @@
                 self.UserData,
                 self.FamilyPlayerIDLen,
                 self.FamilyPlayerIDInfo,
+                self.BidderIDLen,
+                self.BidderIDInfo,
                 self.ADOResult,
             )
         return output

--
Gitblit v1.8.0