コード例 #1
0
ファイル: itemsrequester.py プロジェクト: kblw/wot_client
 def __getTankmanDossierDescr(self, tmanInvID):
     """
     @param tmanInvID: tankman inventory id
     @return: tankman dossier descriptor
     """
     tmanData = self.inventory.getTankmanData(tmanInvID)
     if tmanData is not None:
         return dossiers2.getTankmanDossierDescr(tmanData.descriptor.dossierCompactDescr)
     return dossiers2.getTankmanDossierDescr()
コード例 #2
0
 def __getTankmanDossierDescr(self, tmanInvID):
     """
     @param tmanInvID: tankman inventory id
     @return: tankman dossier descriptor
     """
     tmanData = self.inventory.getTankmanData(tmanInvID)
     if tmanData is not None:
         return dossiers2.getTankmanDossierDescr(
             tmanData.descriptor.dossierCompactDescr)
     return dossiers2.getTankmanDossierDescr()
コード例 #3
0
def updateDossierCompDescr(compDescr):
    data = {}
    verDescr = __getVersion(compDescr)
    recordsLayout = __TANKMAN_LAYOUT_14
    record_packing = __RECORD_PACKING_14
    if verDescr == 10:
        recordsLayout = __TANKMAN_LAYOUT_10
        record_packing = __RECORD_PACKING_10
    elif verDescr == 11:
        recordsLayout = __TANKMAN_LAYOUT_11
        record_packing = __RECORD_PACKING_11
    elif verDescr == 12:
        recordsLayout = __TANKMAN_LAYOUT_12
        record_packing = __RECORD_PACKING_12
    elif verDescr == 13:
        recordsLayout = __TANKMAN_LAYOUT_13
        record_packing = __RECORD_PACKING_13
    fmt = __buildRecordsFmt(recordsLayout, record_packing)
    values = struct.unpack(fmt, compDescr)
    for index, record in enumerate(recordsLayout):
        data[record] = values[index]

    d2 = dossiers2.getTankmanDossierDescr()
    total = d2.expand('total')
    total.eventsEnabled = False
    total['battlesCount'] = data['battlesCount']
    achievements = d2.expand('achievements')
    achievements.eventsEnabled = False
    for record in ['warrior',
     'invader',
     'sniper',
     'defender',
     'steelwall',
     'supporter',
     'scout',
     'evileye',
     'medalWittmann',
     'medalOrlik',
     'medalOskin',
     'medalHalonen',
     'medalBurda',
     'medalBillotte',
     'medalKolobanov',
     'medalFadin',
     'medalRadleyWalters',
     'medalBrunoPietro',
     'medalTarczay',
     'medalPascucci',
     'medalDumitru',
     'medalLehvaslaiho',
     'medalNikolas',
     'medalLafayettePool',
     'heroesOfRassenay',
     'medalDeLanglade',
     'medalTamadaYoshio']:
        achievements[record] = data.get(record, 0)

    return d2.makeCompDescr()
コード例 #4
0
def updateDossierCompDescr(compDescr):
    data = {}
    verDescr = __getVersion(compDescr)
    recordsLayout = __TANKMAN_LAYOUT_14
    record_packing = __RECORD_PACKING_14
    if verDescr == 10:
        recordsLayout = __TANKMAN_LAYOUT_10
        record_packing = __RECORD_PACKING_10
    elif verDescr == 11:
        recordsLayout = __TANKMAN_LAYOUT_11
        record_packing = __RECORD_PACKING_11
    elif verDescr == 12:
        recordsLayout = __TANKMAN_LAYOUT_12
        record_packing = __RECORD_PACKING_12
    elif verDescr == 13:
        recordsLayout = __TANKMAN_LAYOUT_13
        record_packing = __RECORD_PACKING_13
    fmt = __buildRecordsFmt(recordsLayout, record_packing)
    values = struct.unpack(fmt, compDescr)
    for index, record in enumerate(recordsLayout):
        data[record] = values[index]

    d2 = dossiers2.getTankmanDossierDescr()
    total = d2.expand('total')
    total.eventsEnabled = False
    total['battlesCount'] = data['battlesCount']
    achievements = d2.expand('achievements')
    achievements.eventsEnabled = False
    for record in ['warrior',
     'invader',
     'sniper',
     'defender',
     'steelwall',
     'supporter',
     'scout',
     'evileye',
     'medalWittmann',
     'medalOrlik',
     'medalOskin',
     'medalHalonen',
     'medalBurda',
     'medalBillotte',
     'medalKolobanov',
     'medalFadin',
     'medalRadleyWalters',
     'medalBrunoPietro',
     'medalTarczay',
     'medalPascucci',
     'medalDumitru',
     'medalLehvaslaiho',
     'medalNikolas',
     'medalLafayettePool',
     'heroesOfRassenay',
     'medalDeLanglade',
     'medalTamadaYoshio']:
        achievements[record] = data.get(record, 0)

    return d2.makeCompDescr()
コード例 #5
0
ファイル: statsrequester.py プロジェクト: kblw/wot_client
 def __tankmanDossierResponse(self, tankmanID, resultID, data):
     if resultID < 0:
         LOG_ERROR('Server return error for inventory tankman dossier request: responseCode=%s' % resultID)
         return
     if self.__callback and data is not None:
         dossier = ''
         tankman = data.get('compDescr', None)
         if tankman is not None:
             tmenCompDescr = tankman.get(tankmanID, None)
             if tmenCompDescr is not None:
                 dossier = tankmen.TankmanDescr(tmenCompDescr).dossierCompactDescr
         self.__callback(dossiers2.getTankmanDossierDescr(dossier))
コード例 #6
0
 def __tankmanDossierResponse(self, tankmanID, resultID, data):
     if resultID < 0:
         LOG_ERROR(
             'Server return error for inventory tankman dossier request: responseCode=%s'
             % resultID)
         return
     if self.__callback and data is not None:
         dossier = ''
         tankman = data.get('compDescr', None)
         if tankman is not None:
             tmenCompDescr = tankman.get(tankmanID, None)
             if tmenCompDescr is not None:
                 dossier = tankmen.TankmanDescr(
                     tmenCompDescr).dossierCompactDescr
         self.__callback(dossiers2.getTankmanDossierDescr(dossier))
コード例 #7
0
ファイル: __init__.py プロジェクト: v3ss0n/WOTDecompiled
def getTankmanDossierDescr(compDescr = ''):
    if compDescr == '':
        return dossiers1.getTankmanDossierDescr()
    version = struct.unpack_from('<H', compDescr)[0]
    if version < 64:
        return dossiers1.getTankmanDossierDescr(compDescr)
    d2 = dossiers2.getTankmanDossierDescr(compDescr)
    d = dossiers1.getTankmanDossierDescr()
    d.expand()
    total = d2.expand('a15x15')
    for record in ['battlesCount']:
        d[record] = total[record]

    achievements = d2.expand('achievements')
    for record in ['warrior',
     'invader',
     'sniper',
     'defender',
     'steelwall',
     'supporter',
     'scout',
     'evileye',
     'medalWittmann',
     'medalOrlik',
     'medalOskin',
     'medalHalonen',
     'medalBurda',
     'medalBillotte',
     'medalKolobanov',
     'medalFadin',
     'medalRadleyWalters',
     'medalBrunoPietro',
     'medalTarczay',
     'medalPascucci',
     'medalDumitru',
     'medalLehvaslaiho',
     'medalNikolas',
     'medalLafayettePool',
     'heroesOfRassenay',
     'medalDeLanglade',
     'medalTamadaYoshio']:
        d[record] = achievements[record]

    return d
コード例 #8
0
 def __getTankmanDossierDescr(self, tmanInvID):
     tmanData = self.__inventory.getTankmanData(tmanInvID)
     return dossiers2.getTankmanDossierDescr(
         tmanData.descriptor.dossierCompactDescr
     ) if tmanData is not None else dossiers2.getTankmanDossierDescr()
コード例 #9
0
ファイル: __init__.py プロジェクト: krzcho/WOTDecompiled
 def unpack(tmanCompDescr, dossierCD, extDossierDump):
     return TankmanDossier(tankmen.TankmanDescr(tmanCompDescr), dossiers2.getTankmanDossierDescr(dossierCD), loadDossier(extDossierDump))
コード例 #10
0
 def unpack(tmanCompDescr, dossierCD, extDossierDump):
     return TankmanDossier(tankmen.TankmanDescr(tmanCompDescr),
                           dossiers2.getTankmanDossierDescr(dossierCD),
                           loadDossier(extDossierDump))