From c0146533c921960d5ce6640446b42c1e38df3629 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 15 三月 2019 19:54:22 +0800
Subject: [PATCH] 6332 【后端】【2.0】主要是拍品相关规则调整及背包优化(掉落的暂时默认拍品)

---
 ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py |   52 ++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py b/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
index 1330232..b28d109 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
@@ -79,11 +79,14 @@
 class tagDBAuctionRecord(Structure):
     _pack_ = 1
     _fields_ = [
+        ('ItemGUID', ctypes.c_char * 40),
         ('PlayerID', ctypes.c_ulong),
         ('FamilyID', ctypes.c_ulong),
         ('RecordType', ctypes.c_ubyte),
+        ('RecordResult', ctypes.c_ubyte),
         ('RecordTime', ctypes.c_char * 19),
-        ('RecordPrice', ctypes.c_ulong),
+        ('BidderPrice', ctypes.c_ulong),
+        ('BidderName', ctypes.c_char * 33),
         ('ItemID', ctypes.c_ulong),
         ('Count', ctypes.c_ushort),
         ('UserDataLen', ctypes.c_ushort),
@@ -96,11 +99,14 @@
         self.clear()
 
     def clear(self):
+        self.ItemGUID = ''
         self.PlayerID = 0
         self.FamilyID = 0
         self.RecordType = 0
+        self.RecordResult = 0
         self.RecordTime = ''
-        self.RecordPrice = 0
+        self.BidderPrice = 0
+        self.BidderName = ''
         self.ItemID = 0
         self.Count = 0
         self.UserDataLen = 0
@@ -112,11 +118,14 @@
         if len(buf) < pos + self.getLength():
             return -1
         self.clear()
+        self.ItemGUID, pos = CommFunc.ReadString(buf, pos, 40)
         self.PlayerID, pos = CommFunc.ReadDWORD(buf, pos)
         self.FamilyID, pos = CommFunc.ReadDWORD(buf, pos)
         self.RecordType, pos = CommFunc.ReadBYTE(buf, pos)
+        self.RecordResult, pos = CommFunc.ReadBYTE(buf, pos)
         self.RecordTime, pos = CommFunc.ReadString(buf, pos, 19)
-        self.RecordPrice, pos = CommFunc.ReadDWORD(buf, pos)
+        self.BidderPrice, pos = CommFunc.ReadDWORD(buf, pos)
+        self.BidderName, pos = CommFunc.ReadString(buf, pos, 33)
         self.ItemID, pos = CommFunc.ReadDWORD(buf, pos)
         self.Count, pos = CommFunc.ReadWORD(buf, pos)
         self.UserDataLen, pos = CommFunc.ReadWORD(buf, pos)
@@ -126,11 +135,14 @@
 
     def getBuffer(self):
         buf = ''
+        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 40, self.ItemGUID)
         buf = CommFunc.WriteDWORD(buf, self.PlayerID)
         buf = CommFunc.WriteDWORD(buf, self.FamilyID)
         buf = CommFunc.WriteBYTE(buf, self.RecordType)
+        buf = CommFunc.WriteBYTE(buf, self.RecordResult)
         buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 19, self.RecordTime)
-        buf = CommFunc.WriteDWORD(buf, self.RecordPrice)
+        buf = CommFunc.WriteDWORD(buf, self.BidderPrice)
+        buf = CommFunc.WriteString(buf, sizeof(ctypes.c_char) * 33, self.BidderName)
         buf = CommFunc.WriteDWORD(buf, self.ItemID)
         buf = CommFunc.WriteWORD(buf, self.Count)
         buf = CommFunc.WriteWORD(buf, self.UserDataLen)
@@ -139,11 +151,14 @@
 
     def getLength(self):
         length = 0
+        length += sizeof(ctypes.c_char) * 40
         length += sizeof(ctypes.c_ulong)
         length += sizeof(ctypes.c_ulong)
         length += sizeof(ctypes.c_ubyte)
+        length += sizeof(ctypes.c_ubyte)
         length += sizeof(ctypes.c_char) * 19
         length += sizeof(ctypes.c_ulong)
+        length += sizeof(ctypes.c_char) * 33
         length += sizeof(ctypes.c_ulong)
         length += sizeof(ctypes.c_ushort)
         length += sizeof(ctypes.c_ushort)
@@ -152,22 +167,28 @@
 
     def outputString(self):
         output = '''// 拍卖记录表 #tagDBAuctionRecord:
+            ItemGUID = %s,
             PlayerID = %s,
             FamilyID = %s,
             RecordType = %s,
+            RecordResult = %s,
             RecordTime = %s,
-            RecordPrice = %s,
+            BidderPrice = %s,
+            BidderName = %s,
             ItemID = %s,
             Count = %s,
             UserDataLen = %s,
             UserData = %s,
             ADOResult = %s,
             '''%(
+                self.ItemGUID,
                 self.PlayerID,
                 self.FamilyID,
                 self.RecordType,
+                self.RecordResult,
                 self.RecordTime,
-                self.RecordPrice,
+                self.BidderPrice,
+                self.BidderName,
                 self.ItemID,
                 self.Count,
                 self.UserDataLen,
@@ -177,11 +198,23 @@
         return output
 
     #Char数组类型Set接口,使用该接口对此类型数据赋值,防止赋值的数据过长报错
+    def SetItemGUID(self,Str):
+        if len(Str)<=40:
+            self.ItemGUID = Str
+        else:
+            self.ItemGUID = Str[:40]
+            
     def SetRecordTime(self,Str):
         if len(Str)<=19:
             self.RecordTime = Str
         else:
             self.RecordTime = Str[:19]
+            
+    def SetBidderName(self,Str):
+        if len(Str)<=33:
+            self.BidderName = Str
+        else:
+            self.BidderName = Str[:33]
             
 
 # 拍卖物品表 #tagDBAuctionItem
@@ -193,6 +226,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),
@@ -220,6 +254,7 @@
         self.FamilyID = 0
         self.ItemID = 0
         self.Count = 0
+        self.AuctionType = 0
         self.AddTime = ''
         self.BiddingTime = ''
         self.BidderID = 0
@@ -246,6 +281,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)
@@ -272,6 +308,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)
@@ -295,6 +332,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)
@@ -318,6 +356,7 @@
             FamilyID = %s,
             ItemID = %s,
             Count = %s,
+            AuctionType = %s,
             AddTime = %s,
             BiddingTime = %s,
             BidderID = %s,
@@ -339,6 +378,7 @@
                 self.FamilyID,
                 self.ItemID,
                 self.Count,
+                self.AuctionType,
                 self.AddTime,
                 self.BiddingTime,
                 self.BidderID,

--
Gitblit v1.8.0