def sendClanInvite(self): profile = g_clanCtrl.getAccountProfile() context = CreateInviteCtx(profile.getClanDbID(), [self.databaseID]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(profile.getClanName(), profile.getClanAbbrev())) else: SystemMessages.pushMessage(clans_fmts.getInvitesNotSentSysMsg([self.userName or '']), type=SystemMessages.SM_TYPE.Error)
def userAddToClan(self): self.as_showWaitingS(WAITING.CLANS_INVITES_SEND, {}) profile = g_clanCtrl.getAccountProfile() context = CreateInviteCtx(profile.getClanDbID(), [self.__databaseID]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) showClanInviteSystemMsg(self.__userName, result.isSuccess(), result.getCode()) self.__updateAddToClanBtn() self.as_hideWaitingS()
def userAddToClan(self): self.as_showWaitingS(WAITING.CLANS_INVITES_SEND, {}) profile = g_clanCtrl.getAccountProfile() context = CreateInviteCtx(profile.getClanDbID(), [self.__databaseID]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(profile.getClanName(), profile.getClanAbbrev())) self.as_hideWaitingS()
def sendRequest(self): self.as_setWaitingVisibleS(True) context = CreateApplicationCtx([self.__selectedClan.getClanDbID()]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(self.__selectedClan.getClanName(), self.__selectedClan.getClanAbbrev())) self._updateSetaledState() self.as_setWaitingVisibleS(False)
def _sendApplication(self): self.as_showWaitingS(True) context = CreateApplicationCtx([self._clanDossier.getDbID()]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): clanInfo = yield self._clanDossier.requestClanInfo() SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(clanInfo.getClanName(), clanInfo.getTag())) self._onAppSuccessfullySent() self.as_showWaitingS(False)
def handleAction(self, model, entityID, action): super(_AcceptClanInviteHandler, self).handleAction(model, entityID, action) entity = model.getNotification(self.getNotType(), entityID).getEntity() clanName = entity.getClanName() clanTag = entity.getClanTag() result = yield showAcceptClanInviteDialog(clanName, clanTag) if result: reqResult = yield g_clanCtrl.sendRequest(clan_ctxs.AcceptInviteCtx(self._getInviteID(model, entityID)), allowDelay=True) if reqResult.isSuccess(): showClanJoinAward(clanName, clanTag, entity.getClanId())
def _sendApplication(self): self.as_showWaitingS(True) context = CreateApplicationCtx([self._clanDossier.getDbID()]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): clanInfo = yield self._clanDossier.requestClanInfo() SystemMessages.pushMessage( clans_fmts.getAppSentSysMsg(clanInfo.getClanName(), clanInfo.getTag())) self._onAppSuccessfullySent() self.as_showWaitingS(False)
def sendRequest(self): self.as_setWaitingVisibleS(True) context = CreateApplicationCtx([self.__selectedClan.getClanDbID()]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): SystemMessages.pushMessage( clans_fmts.getAppSentSysMsg( self.__selectedClan.getClanName(), self.__selectedClan.getClanAbbrev())) self._updateSetaledState() self.as_setWaitingVisibleS(False)
def handleAction(self, model, entityID, action): super(_AcceptClanInviteHandler, self).handleAction(model, entityID, action) entity = model.getNotification(self.getNotType(), entityID).getEntity() clanName = entity.getClanName() clanTag = entity.getClanTag() result = yield showAcceptClanInviteDialog(clanName, clanTag) if result: reqResult = yield g_clanCtrl.sendRequest(clan_ctxs.AcceptInviteCtx( self._getInviteID(model, entityID)), allowDelay=True) if reqResult.isSuccess(): showClanJoinAward(clanName, clanTag, entity.getClanId())
def sendClanInvite(self): profile = g_clanCtrl.getAccountProfile() userName = self.userName context = CreateInviteCtx(profile.getClanDbID(), [self.databaseID]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) showClanInviteSystemMsg(userName, result.isSuccess(), result.getCode())
def handleAction(self, model, entityID, action): super(_DeclineClanInviteHandler, self).handleAction(model, entityID, action) yield g_clanCtrl.sendRequest(clan_ctxs.DeclineInviteCtx( self._getInviteID(model, entityID)), allowDelay=True)
def handleAction(self, model, entityID, action): super(_DeclineClanAppHandler, self).handleAction(model, entityID, action) yield g_clanCtrl.sendRequest(clan_ctxs.DeclineApplicationCtx( self._getApplicationID(model, entityID)), allowDelay=True)
def handleAction(self, model, entityID, action): super(_DeclineClanInviteHandler, self).handleAction(model, entityID, action) yield g_clanCtrl.sendRequest(clan_ctxs.DeclineInviteCtx(self._getInviteID(model, entityID)), allowDelay=True)
def handleAction(self, model, entityID, action): super(_AcceptClanInviteHandler, self).handleAction(model, entityID, action) entity = model.getNotification(self.getNotType(), entityID).getEntity() result = yield showAcceptClanInviteDialog(entity.getClanName(), entity.getClanTag()) if result: yield g_clanCtrl.sendRequest(clan_ctxs.AcceptInviteCtx(self._getInviteID(model, entityID)), allowDelay=True)
def handleAction(self, model, entityID, action): super(_DeclineClanAppHandler, self).handleAction(model, entityID, action) yield g_clanCtrl.sendRequest(clan_ctxs.DeclineApplicationCtx(self._getApplicationID(model, entityID)), allowDelay=True)