def __setup(self, defHour, offDay, peripheryID):
     defHourUTC = adjustDefenceHourToUTC(defHour)
     offDayUTC = offDay
     if offDay != NOT_ACTIVATED:
         offDayUTC = adjustOffDayToUTC(offDay, defHour)
     result = yield self.fortProvider.sendRequest(SettingsCtx(defHourUTC, offDayUTC, peripheryID, waitingID='fort/settings'))
     if result:
         g_fortSoundController.playDefencePeriodActivated()
     self.destroy()
 def __setup(self, offDay):
     offDayUTC = offDay
     if offDay != NOT_ACTIVATED:
         offDayUTC = adjustOffDayToUTC(offDay, self.fortCtrl.getFort().getLocalDefenceHour()[0])
     result = yield self.fortProvider.sendRequest(OffDayCtx(offDayUTC, waitingID='fort/settings'))
     if result:
         if offDay == NOT_ACTIVATED:
             SystemMessages.g_instance.pushI18nMessage(SYSTEM_MESSAGES.FORTIFICATION_DEFENCEHOURSET_NOOFFDAY, type=SystemMessages.SM_TYPE.Warning)
         else:
             dayOffString = i18n.makeString(MENU.datetime_weekdays_full(str(offDay + 1)))
             SystemMessages.g_instance.pushI18nMessage(SYSTEM_MESSAGES.FORTIFICATION_DEFENCEHOURSET_OFFDAY, offDay=dayOffString, type=SystemMessages.SM_TYPE.Warning)
Beispiel #3
0
 def __setup(self, defHour, offDay, peripheryID):
     defHourUTC = adjustDefenceHourToUTC(defHour)
     offDayUTC = offDay
     if offDay != NOT_ACTIVATED:
         offDayUTC = adjustOffDayToUTC(offDay, defHour)
     result = yield self.fortProvider.sendRequest(
         SettingsCtx(defHourUTC,
                     offDayUTC,
                     peripheryID,
                     waitingID='fort/settings'))
     if result:
         g_fortSoundController.playDefencePeriodActivated()
     self.destroy()
 def __setup(self, offDay):
     offDayUTC = offDay
     if offDay != NOT_ACTIVATED:
         offDayUTC = adjustOffDayToUTC(
             offDay,
             self.fortCtrl.getFort().getLocalDefenceHour()[0])
     result = yield self.fortProvider.sendRequest(
         OffDayCtx(offDayUTC, waitingID='fort/settings'))
     if result:
         if offDay == NOT_ACTIVATED:
             SystemMessages.g_instance.pushI18nMessage(
                 SYSTEM_MESSAGES.FORTIFICATION_DEFENCEHOURSET_NOOFFDAY,
                 type=SystemMessages.SM_TYPE.Warning)
         else:
             dayOffString = i18n.makeString(
                 MENU.datetime_weekdays_full(str(offDay + 1)))
             SystemMessages.g_instance.pushI18nMessage(
                 SYSTEM_MESSAGES.FORTIFICATION_DEFENCEHOURSET_OFFDAY,
                 offDay=dayOffString,
                 type=SystemMessages.SM_TYPE.Warning)