Exemplo n.º 1
0
 def requestUpdateStronghold(self):
     if self._requestsProcessor:
         unitMgrId = prb_getters.getUnitMgrID()
         ctx = contexts.StrongholdUpdateCtx(unitMgrId=unitMgrId,
                                            waitingID='')
         self._requestsProcessor.doRequest(
             ctx, 'updateStronghold', callback=self.__onStrongholdUpdate)
Exemplo n.º 2
0
 def requestSlotVehicleFilters(self):
     if not self.isCommander():
         return
     if self._requestsProcessor:
         unitMgrId = prb_getters.getUnitMgrID()
         ctx = SlotVehicleFiltersUpdateCtx(unitMgrId=unitMgrId, waitingID='')
         self._requestsProcessor.doRequest(ctx, 'getSlotVehicleFilters', callback=self._onPlayersMatchingDataUpdated)
Exemplo n.º 3
0
 def getActiveConsumables(self):
     key = (getUnitMgrID(), connectionManager.peripheryID)
     if key in self.consumables:
         consumablesByRev = self.consumables[key]
         revs = consumablesByRev.keys()
         if revs:
             consumables = consumablesByRev[max(revs)]
             return dict(((slotIdx, (orderTypeID, level)) for orderTypeID, level, slotIdx in consumables))
     return {}
Exemplo n.º 4
0
 def requestUpdateTournament(self):
     if self._requestsProcessor:
         unitMgrId = prb_getters.getUnitMgrID()
         rev = self._getUnitRevision()
         ctx = TournamentUpdateCtx(unitMgrId=unitMgrId,
                                   rev=rev,
                                   waitingID='')
         self._requestsProcessor.doRequest(
             ctx, 'updateTournament', callback=self.__onTournamentUpdate)
Exemplo n.º 5
0
 def getActiveConsumables(self):
     key = (getUnitMgrID(), connectionManager.peripheryID)
     if key in self.consumables:
         consumablesByRev = self.consumables[key]
         revs = consumablesByRev.keys()
         if revs:
             consumables = consumablesByRev[max(revs)]
             return dict(((slotIdx, (orderTypeID, level))
                          for orderTypeID, level, slotIdx in consumables))
     return {}
Exemplo n.º 6
0
 def _sendRequest(self, ctx, methodName, chain, callback, *args, **kwargs):
     if isinstance(ctx, PrbCtrlRequestCtx):
         requestType = ctx.getRequestType()
         if requestType in self.__unitContextRemap:
             clazz = self.__unitContextRemap[requestType]
             ctx = clazz.fromPrbCtx(ctx, prb_getters.getUnitMgrID())
         else:
             LOG_ERROR('Remaped context not found', ctx)
             callback(False)
     result = yield self.clansCtrl.sendRequest(ctx, allowDelay=True)
     if callable(callback):
         callback(result)
     if ctx is not None:
         if result and chain:
             self._sendNextRequest(ctx, chain)
     return
Exemplo n.º 7
0
 def getID(self):
     """
     Getter for current unit manager ID
     """
     return prb_getters.getUnitMgrID()
Exemplo n.º 8
0
 def getID(self):
     """
     Getter for joined unit index.
     """
     return prb_getters.getUnitMgrID()
Exemplo n.º 9
0
 def requestUpdateStronghold(self):
     if self._requestsProcessor:
         unitMgrId = prb_getters.getUnitMgrID()
         rev = self._getUnitRevision()
         ctx = StrongholdUpdateCtx(unitMgrId=unitMgrId, rev=rev, waitingID='')
         self._requestsProcessor.doRequest(ctx, 'updateStronghold', callback=self.__onStrongholdUpdate)
Exemplo n.º 10
0
 def getMatchmakingInfo(self, callback=None):
     ctx = StrongholdMatchmakingInfoCtx(prb_getters.getUnitMgrID())
     self._requestsProcessor.doRequest(ctx, 'matchmakingInfo', callback=callback)
Exemplo n.º 11
0
 def getID(self):
     return prb_getters.getUnitMgrID()
Exemplo n.º 12
0
 def getID(self):
     return prb_getters.getUnitMgrID()