def unitMgr_onUnitNotifyReceived(self, unitMgrID, notifyCode, notifyString, argsList): if notifyCode in UNIT_NOTIFICATION_TO_DISPLAY: msgType, msgBody = messages.getUnitMessage(notifyCode, notifyString) SystemMessages.pushMessage(msgBody, type=msgType) self.__requestCtx.stopProcessing()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, errorCode, errorString): if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) self.__requestCtx.stopProcessing() if errorCode in ENTER_UNIT_MGR_ERRORS: self.restorePrevious()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS: self.__unitFunctional.setExit(FUNCTIONAL_EXIT.INTRO_UNIT) self.__requestCtx.stopProcessing(result=False) events_dispatcher.updateUI()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS: self.__unitFunctional.setExit(FUNCTIONAL_EXIT.INTRO_UNIT) self.__requestCtx.stopProcessing(result=False) events_dispatcher.updateUI()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): unitFunctional = self.getFunctional(CTRL_ENTITY_TYPE.UNIT) if unitFunctional: unitFunctional.setLastError(errorCode) else: LOG_ERROR('Unit functional is not found') if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS and unitFunctional: unitFunctional.setExit(FUNCTIONAL_EXIT.INTRO_UNIT) self.__requestCtx.stopProcessing(result=False) g_eventDispatcher.updateUI()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): unitFunctional = self.getFunctional(CTRL_ENTITY_TYPE.UNIT) if unitFunctional: unitFunctional.setLastError(errorCode) else: LOG_ERROR('Unit functional is not found') if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS and unitFunctional: unitFunctional.setExit(FUNCTIONAL_EXIT.INTRO_UNIT) self.__requestCtx.stopProcessing(result=False) g_eventDispatcher.updateUI()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): unitFunctional = self.getFunctional(_CTRL_TYPE.UNIT) if unitFunctional is not None: unitFunctional.setLastError(errorCode) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS and unitFunctional.canSwitchToIntro(): self.__requestCtx.addFlags(FUNCTIONAL_FLAG.SWITCH) else: LOG_ERROR('Unit functional is not found') if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) self.__requestCtx.stopProcessing(result=False) g_eventDispatcher.updateUI() return
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): """ Unit manager event listener for unit request error. Pushes system message. Args: requestID: request identifier unitMgrID: unit manager identifier unitIdx: unit index errorCode: request error code errorString: request error message """ if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) self.__requestCtx.stopProcessing()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): unitFunctional = self.getFunctional(_CTRL_TYPE.UNIT) if unitFunctional is not None: unitFunctional.setLastError(errorCode) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS and unitFunctional.canSwitchToIntro( ): self.__requestCtx.addFlags(FUNCTIONAL_FLAG.SWITCH) if errorCode == UNIT_ERROR.CANT_PICK_LEADER: self.__requestCtx.removeFlags(FUNCTIONAL_FLAG.SWITCH) elif errorCode == UNIT_ERROR.REMOVED_PLAYER: if self.__requestCtx.getCtrlType( ) == _CTRL_TYPE.UNIT and unitFunctional.getEntityType( ) != self.__requestCtx.getEntityType(): self.__requestCtx.removeFlags(FUNCTIONAL_FLAG.SWITCH) else: LOG_ERROR('Unit functional is not found') if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) self.__requestCtx.stopProcessing(result=False) g_eventDispatcher.updateUI() return