Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
 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()
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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())
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 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)
Exemplo n.º 10
0
 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())
Exemplo n.º 11
0
 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())
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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)
Exemplo n.º 14
0
 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)
Exemplo n.º 15
0
 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)
Exemplo n.º 16
0
 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)
Exemplo n.º 17
0
 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())