Exemplo n.º 1
0
 def setRosterSlot(self,
                   rosterSlotIdx,
                   vehTypeID=None,
                   nationNames=[],
                   levels=(1, 8),
                   vehClassNames=[]):
     LOG_DEBUG(
         'setRosterSlot: slot=%s, vehTypeID=%s, nationNames=%s, levels=%s, vehClassNames=%s'
         % (rosterSlotIdx, vehTypeID, repr(nationNames), repr(levels),
            repr(vehClassNames)))
     rSlot = UnitRosterSlot(vehTypeID, nationNames, levels, vehClassNames)
     return self._doUnitCmd(CLIENT_UNIT_CMD.SET_ROSTER_SLOT, 0,
                            rosterSlotIdx, rSlot.pack())
Exemplo n.º 2
0
    def setAllRosterSlots(self, rosterDefsDict, unitIdx = 0):
        LOG_DEBUG('setAllRosterSlots: rosterDefsDict=%r' % rosterDefsDict)
        rosterSlots = {}
        for rosterSlotIdx, rosterDict in rosterDefsDict.iteritems():
            vehTypeID = rosterDict.get('vehTypeID', None)
            nationNames = rosterDict.get('nationNames', [])
            levels = rosterDict.get('levels', None)
            vehClassNames = rosterDict.get('vehClassNames', [])
            rSlot = UnitRosterSlot(vehTypeID, nationNames, levels, vehClassNames)
            rosterSlots[rosterSlotIdx] = rSlot.pack()

        requestID = self.__getNextRequestID()
        LOG_DEBUG('unit.setAllRosterSlots: rosterSlots=%r' % rosterSlots, requestID, self.id)
        self.__account.base.setAllRosterSlots(requestID, self.id, rosterSlots.keys(), rosterSlots.values())
        return requestID
Exemplo n.º 3
0
    def setAllRosterSlots(self, rosterDefsDict):
        LOG_DEBUG('setAllRosterSlots: rosterDefsDict=%r' % rosterDefsDict)
        rosterSlots = {}
        for rosterSlotIdx, rosterDict in rosterDefsDict.iteritems():
            vehTypeID = rosterDict.get('vehTypeID', None)
            nationNames = rosterDict.get('nationNames', [])
            levels = rosterDict.get('levels', None)
            vehClassNames = rosterDict.get('vehClassNames', [])
            rSlot = UnitRosterSlot(vehTypeID, nationNames, levels,
                                   vehClassNames)
            rosterSlots[rosterSlotIdx] = rSlot.pack()

        LOG_DEBUG('unit.setAllRosterSlots: rosterSlots=%r' % rosterSlots,
                  self.id)
        return self._callAPI('setRosterSlots', self.id, rosterSlots.keys(),
                             rosterSlots.values())
Exemplo n.º 4
0
 def setRosterSlot(self, rosterSlotIdx, vehTypeID = None, nationNames = [], levels = (1, 8), vehClassNames = [], unitIdx = 0):
     LOG_DEBUG('setRosterSlot: slot=%s, vehTypeID=%s, nationNames=%s, levels=%s, vehClassNames=%s' % (rosterSlotIdx,
      vehTypeID,
      repr(nationNames),
      repr(levels),
      repr(vehClassNames)))
     rSlot = UnitRosterSlot(vehTypeID, nationNames, levels, vehClassNames)
     return self.__doUnitCmd(CLIENT_UNIT_CMD.SET_ROSTER_SLOT, self.id, 0, rosterSlotIdx, rSlot.pack())
Exemplo n.º 5
0
    def setAllRosterSlots(self, rosterDefsDict, unitIdx=0):
        LOG_DEBUG('setAllRosterSlots: rosterDefsDict=%r' % rosterDefsDict)
        rosterSlots = {}
        for rosterSlotIdx, rosterDict in rosterDefsDict.iteritems():
            vehTypeID = rosterDict.get('vehTypeID', None)
            nationNames = rosterDict.get('nationNames', [])
            levels = rosterDict.get('levels', None)
            vehClassNames = rosterDict.get('vehClassNames', [])
            rSlot = UnitRosterSlot(vehTypeID, nationNames, levels,
                                   vehClassNames)
            rosterSlots[rosterSlotIdx] = rSlot.pack()

        requestID = self.__getNextRequestID()
        LOG_DEBUG('unit.setAllRosterSlots: rosterSlots=%r' % rosterSlots,
                  requestID, self.id)
        self.__account.base.setAllRosterSlots(requestID, self.id,
                                              rosterSlots.keys(),
                                              rosterSlots.values())
        return requestID