| | |
| | |
|
| | |
|
| | | #----------------------------------------------------------------------
|
| | | #------------------------------------------------------
|
| | | #鐜╁璐︽埛淇℃伅#tagDSAccount
|
| | | class tagDSAccount(Structure):
|
| | | _pack_ = 1
|
| | |
| | | ('AccountID', ctypes.c_ulong),
|
| | | ('TokenExpire', ctypes.c_char * 20),
|
| | | ('Phone', ctypes.c_ubyte),
|
| | | ('DeviceFlag', ctypes.c_char * 33),
|
| | | ('ADOResult', ctypes.c_ulong),
|
| | | ('SID', ctypes.c_int), #鐢ㄤ簬鏍¢獙
|
| | | ('VerNO', ctypes.c_ulong) #鐢ㄤ簬SID鏍¢獙鏃舵瘮杈冪増鏈彿
|
| | |
| | | def clear(self):
|
| | | memset(addressof(self), 0, self.getLength())
|
| | |
|
| | |
|
| | | def readData(self, buf, pos = 0, length = 0):
|
| | | if not pos <= length:
|
| | | msg = error.formatMsg('error', error.ERROR_NO_150, '(pos = %s)> (length = %s)'%(pos, length))
|
| | | msg = error.formatMsg('error', error.ERROR_NO_148, '(pos = %s) > (length = %s)'%(pos, length))
|
| | | mylog.error(msg)
|
| | | return -1
|
| | | if len(buf) < pos + self.getLength():
|
| | | msg = error.formatMsg('error', error.ERROR_NO_151, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
|
| | | msg = error.formatMsg('error', error.ERROR_NO_149, 'len = %s while %s expected!'%(len(buf) - pos, self.getLength()))
|
| | | mylog.error(msg)
|
| | | return -1
|
| | | self.clear()
|
| | | memmove(addressof(self), buf[pos:], self.getLength())
|
| | | self.ACCID, pos = CommFunc.ReadString(buf, pos, 65)
|
| | | self.Psw, pos = CommFunc.ReadString(buf, pos, 33)
|
| | | self.PswLV2, pos = CommFunc.ReadString(buf, pos, 33)
|
| | | self.LogNum, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.Adult, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.RegIP, pos = CommFunc.ReadString(buf, pos, 20)
|
| | | self.Presentee, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.TelLockState, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.GeTuiClientID, pos = CommFunc.ReadString(buf, pos, 33)
|
| | | self.TotalSavePoint, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.BalanceInfo, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.AppID, pos = CommFunc.ReadString(buf, pos, 20)
|
| | | self.AreaID, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.fobbiddenAccount, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.ApplyingAdult, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.SpreadedUser, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.Spreader, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.onlineSMSNotice, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.EkeyType, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.EkeyBindFlag, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.IPBan, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.RegisterTime, pos = CommFunc.ReadString(buf, pos, 20)
|
| | | self.LastLoginTime, pos = CommFunc.ReadString(buf, pos, 20)
|
| | | self.Operator, pos = CommFunc.ReadString(buf, pos, 15)
|
| | | self.AccountID, pos = CommFunc.ReadDWORD(buf, pos)
|
| | | self.TokenExpire, pos = CommFunc.ReadString(buf, pos, 20)
|
| | | self.Phone, pos = CommFunc.ReadBYTE(buf, pos)
|
| | | self.DeviceFlag, pos = CommFunc.ReadString(buf, pos, 33)
|
| | | return self.getLength()
|
| | |
|
| | |
|
| | |
| | | rec[u'AccountID'] = self.AccountID
|
| | | rec[u'TokenExpire'] = fix_incomingText(self.TokenExpire)
|
| | | rec[u'Phone'] = self.Phone
|
| | | rec[u'DeviceFlag'] = fix_incomingText(self.DeviceFlag)
|
| | | rec[u'SID'] = self.SID
|
| | | rec[u'VerNO'] = self.VerNO
|
| | | return rec
|
| | |
| | | self.AccountID = rec.get(u'AccountID', 0)
|
| | | self.TokenExpire = fix_outgoingText(rec.get(u'TokenExpire', u''))
|
| | | self.Phone = rec.get(u'Phone', 0)
|
| | | self.DeviceFlag = fix_outgoingText(rec.get(u'DeviceFlag', u''))
|
| | | self.SID = rec['SID']
|
| | | self.VerNO = rec.get(u'VerNO', 0)
|
| | |
|
| | |
| | | AccountID = %s,
|
| | | TokenExpire = %s,
|
| | | Phone = %s,
|
| | | DeviceFlag = %s,
|
| | | ADOResult = %s,
|
| | | SID = %s,
|
| | | VerNO = %s,
|
| | |
| | | self.AccountID,
|
| | | self.TokenExpire,
|
| | | self.Phone,
|
| | | self.DeviceFlag,
|
| | | self.ADOResult,
|
| | | self.SID,
|
| | | self.VerNO
|
| | |
| | | return output
|
| | |
|
| | | def dumpString(self):
|
| | | output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
|
| | | output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
|
| | | self.ACCID,
|
| | | self.Psw,
|
| | | self.PswLV2,
|
| | |
| | | self.AccountID,
|
| | | self.TokenExpire,
|
| | | self.Phone,
|
| | | self.DeviceFlag,
|
| | | )
|
| | | return output
|
| | |
|
| | |
| | | else:
|
| | | self.TokenExpire = Str[:20]
|
| | |
|
| | | def SetDeviceFlag(self,Str):
|
| | | if len(Str)<=33:
|
| | | self.DeviceFlag = Str
|
| | | else:
|
| | | self.DeviceFlag = Str[:33]
|
| | |
|
| | | #------------------------------------------------------
|
| | | #浜虹墿鐗╁搧#tagRoleItem
|