From 16113852678bbba1fc7597b73d4a779588436fcc Mon Sep 17 00:00:00 2001 From: AleaJactaEst Date: Thu, 30 May 2019 19:37:42 +0200 Subject: [PATCH] update comment --- client.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/client.py b/client.py index ed106e4..5085cdf 100755 --- a/client.py +++ b/client.py @@ -144,6 +144,10 @@ class BitStream(): self.pushChar(x) #y = ord(x) #self.internalSerial(y, 8) + def pushArrayChar(self, valeur, size): + ' ex.: pushArrayChar([0,1,3,4]) ' + for i in valeur: + self.pushChar(i) # ------------------------------------ def readSerial(self, nbits): @@ -272,6 +276,10 @@ class BitStream(): self._read = readBefore return ret +def getTextMD5(dataRawXml): + for data in dataRawXml: + pass + def Test(): a = BitStream() a.pushBool(True) @@ -1478,6 +1486,8 @@ class ClientNetworkConnection: self._LatestProbe = 0 self._LastReceivedNumber = 0 self._LastAckInLongAck = 0 + self._MsgXmlMD5 = None + self._DatabaseXmlMD5 = None def cookiesInit(self, UserAddr, UserKey, UserId): self.UserAddr = UserAddr @@ -1581,7 +1591,15 @@ class ClientNetworkConnection: def disconnect(self): pass - def EmulateFirst(self): + def EmulateFirst(self, msgRawXml, databaseRawXml): + msgXml = ET.fromstring(msgRawXml) + ET.dump(msgXml) + databaseXml = ET.fromstring(databaseRawXml) + ET.dump(databaseXml) + + self._MsgXmlMD5 = getTextMD5(msgRawXml) + self._DatabaseXmlMD5 = getTextMD5(databaseRawXml) + self.log.info("Client Login") self.sendSystemLogin() @@ -1901,13 +1919,9 @@ class ClientKhanat: self.DownloadMinimum() self.cFileContainer = CFileContainer() self.cFileContainer.addSearchPath(self.tempdir.name) - data = self.cFileContainer.getdata("msg.xml").decode() - msgXml = ET.fromstring(data) - ET.dump(msgXml) - data = self.cFileContainer.getdata("database.xml").decode() - databaseXml = ET.fromstring(data) - ET.dump(databaseXml) - self.clientNetworkConnection.EmulateFirst() + msgRawXml = self.cFileContainer.getdata("msg.xml").decode() + databaseRawXml = self.cFileContainer.getdata("database.xml").decode() + self.clientNetworkConnection.EmulateFirst(msgRawXml, databaseRawXml) def main():