コード例 #1
0
ファイル: entity.py プロジェクト: mahmoudimus/WOT-0.9.20.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)
コード例 #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)
コード例 #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 {}
コード例 #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)
コード例 #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 {}
コード例 #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
コード例 #7
0
 def getID(self):
     """
     Getter for current unit manager ID
     """
     return prb_getters.getUnitMgrID()
コード例 #8
0
 def getID(self):
     """
     Getter for joined unit index.
     """
     return prb_getters.getUnitMgrID()
コード例 #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)
コード例 #10
0
 def getMatchmakingInfo(self, callback=None):
     ctx = StrongholdMatchmakingInfoCtx(prb_getters.getUnitMgrID())
     self._requestsProcessor.doRequest(ctx, 'matchmakingInfo', callback=callback)
コード例 #11
0
ファイル: unit_ctx.py プロジェクト: webiumsk/WOT0.10.0
 def getID(self):
     return prb_getters.getUnitMgrID()
コード例 #12
0
 def getID(self):
     return prb_getters.getUnitMgrID()