hxp
2019-02-25 905bad6a43c7ed07a436781600c8fe7ad41dd887
ServerPython/CoreServerGroup/GameServer/Script/PyGameDataStruct.py
@@ -79,6 +79,7 @@
class tagDBAuctionRecord(Structure):
    _pack_ = 1
    _fields_ = [
        ('ItemGUID', ctypes.c_char * 40),
        ('PlayerID', ctypes.c_ulong),
        ('FamilyID', ctypes.c_ulong),
        ('RecordType', ctypes.c_ubyte),
@@ -96,6 +97,7 @@
        self.clear()
    def clear(self):
        self.ItemGUID = ''
        self.PlayerID = 0
        self.FamilyID = 0
        self.RecordType = 0
@@ -112,6 +114,7 @@
        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)
@@ -126,6 +129,7 @@
    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)
@@ -139,6 +143,7 @@
    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)
@@ -152,6 +157,7 @@
    def outputString(self):
        output = '''// 拍卖记录表 #tagDBAuctionRecord:
            ItemGUID = %s,
            PlayerID = %s,
            FamilyID = %s,
            RecordType = %s,
@@ -163,6 +169,7 @@
            UserData = %s,
            ADOResult = %s,
            '''%(
                self.ItemGUID,
                self.PlayerID,
                self.FamilyID,
                self.RecordType,
@@ -177,6 +184,12 @@
        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
@@ -193,6 +206,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 +234,7 @@
        self.FamilyID = 0
        self.ItemID = 0
        self.Count = 0
        self.AuctionType = 0
        self.AddTime = ''
        self.BiddingTime = ''
        self.BidderID = 0
@@ -246,6 +261,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 +288,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 +312,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 +336,7 @@
            FamilyID = %s,
            ItemID = %s,
            Count = %s,
            AuctionType = %s,
            AddTime = %s,
            BiddingTime = %s,
            BidderID = %s,
@@ -339,6 +358,7 @@
                self.FamilyID,
                self.ItemID,
                self.Count,
                self.AuctionType,
                self.AddTime,
                self.BiddingTime,
                self.BidderID,