Exemple #1
0
    def getDefHourFor(self, timestamp):
        if self.getTimeNewDefHour() and timestamp >= self.getTimeNewDefHour():
            from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal

            return adjustDefenceHourToLocal(self.getNewDefHour(), timestamp)
        from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal

        return adjustDefenceHourToLocal(self.getStartDefHour(), timestamp)
    def __createData(self):
        fort = self.fortCtrl.getFort()
        skipValues = []
        if constants.IS_KOREA:
            skipValues = [0, 7]
        peripheryList = self.__getPeripheryList()
        currentPeripheryID = fort.peripheryID
        isServerValid = False
        for i in xrange(len(peripheryList)):
            if peripheryList[i]['id'] == currentPeripheryID:
                isServerValid = True
                break

        if not isServerValid:
            currentPeripheryID = -1
        _, defenceMin = adjustDefenceHourToLocal(0)
        return {'peripheryData': peripheryList,
         'peripherySelectedID': currentPeripheryID,
         'holidayData': self._getDayoffsList(),
         'holidaySelectedID': fort.getLocalOffDay(),
         'hour': -1,
         'minutes': defenceMin,
         'isWrongLocalTime': self._isWrongLocalTime(),
         'skipValues': skipValues,
         'isTwelveHoursFormat': self.app.utilsManager.isTwelveHoursFormat()}
Exemple #3
0
    def __createData(self):
        fort = self.fortCtrl.getFort()
        peripheryList = self.__getPeripheryList()
        currentPeripheryID = fort.peripheryID
        isServerValid = False
        for i in xrange(len(peripheryList)):
            if peripheryList[i]['id'] == currentPeripheryID:
                isServerValid = True
                break

        if not isServerValid:
            currentPeripheryID = -1
        _, defenceMin = adjustDefenceHourToLocal(0)
        return {
            'peripheryData':
            peripheryList,
            'peripherySelectedID':
            currentPeripheryID,
            'holidayData':
            self._getDayoffsList(),
            'holidaySelectedID':
            fort.getLocalOffDay(),
            'hour':
            -1,
            'minutes':
            defenceMin,
            'isWrongLocalTime':
            self._isWrongLocalTime(),
            'skipValues':
            adjustDefenceHoursListToLocal(g_lobbyContext.getServerSettings().
                                          getForbiddenFortDefenseHours()),
            'isTwelveHoursFormat':
            self.app.utilsManager.isTwelveHoursFormat()
        }
    def __createData(self):
        fort = self.fortCtrl.getFort()
        peripheryList = self.__getPeripheryList()
        currentPeripheryID = fort.peripheryID
        isServerValid = False
        for i in xrange(len(peripheryList)):
            if peripheryList[i]['id'] == currentPeripheryID:
                isServerValid = True
                break

        if not isServerValid:
            currentPeripheryID = -1
        _, defenceMin = adjustDefenceHourToLocal(0)
        return {
            'peripheryData':
            peripheryList,
            'peripherySelectedID':
            currentPeripheryID,
            'holidayData':
            self._getDayoffsList(),
            'holidaySelectedID':
            fort.getLocalOffDay(),
            'hour':
            -1,
            'minutes':
            defenceMin,
            'isWrongLocalTime':
            self._isWrongLocalTime(),
            'skipValues':
            adjustDefenceHoursListToLocal(g_lobbyContext.getServerSettings().
                                          getForbiddenFortDefenseHours()),
            'isTwelveHoursFormat':
            self.app.utilsManager.isTwelveHoursFormat()
        }
 def __calculateDefencePeriod(self):
     currentDefencePeriod = time_utils.getTimeForLocal(
         self.__selectedDayStart,
         *adjustDefenceHourToLocal(self.__item.getStartDefHour()))
     self.__selectedDefencePeriodStart = time_utils.getTimeForLocal(
         self.__selectedDayStart,
         *self.__item.getDefHourFor(currentDefencePeriod))
     self.__selectedDefencePeriodEnd = self.__selectedDefencePeriodStart + time_utils.ONE_HOUR
 def __calculateDefencePeriod(self):
     currentDefencePeriod = time_utils.getTimeForLocal(self.__selectedDayStart, *adjustDefenceHourToLocal(self.__item.getStartDefHour()))
     self.__selectedDefencePeriodStart = time_utils.getTimeForLocal(self.__selectedDayStart, *self.__item.getDefHourFor(currentDefencePeriod))
     self.__selectedDefencePeriodEnd = self.__selectedDefencePeriodStart + time_utils.ONE_HOUR
Exemple #7
0
 def getLocalDefHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     return adjustDefenceHourToLocal(self.getStartDefHour())
 def getLocalDefenceHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     if not self.isDefenceHourEnabled():
         return (NOT_ACTIVATED, 0)
     return adjustDefenceHourToLocal(self.defenceHour)
Exemple #9
0
 def getLocalDefenceHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     if not self.isDefenceHourEnabled():
         return (NOT_ACTIVATED, 0)
     return adjustDefenceHourToLocal(self.defenceHour)
 def getDefHourFor(self, timestamp):
     if self.getTimeNewDefHour() and timestamp >= self.getTimeNewDefHour():
         from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
         return adjustDefenceHourToLocal(self.getNewDefHour(), timestamp)
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     return adjustDefenceHourToLocal(self.getStartDefHour(), timestamp)
 def getLocalDefHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     return adjustDefenceHourToLocal(self.getStartDefHour())
Exemple #12
0
 def getDefHourFor(self, timestamp):
     if self.getTimeNewDefHour() and timestamp >= self.getTimeNewDefHour():
         from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
         return adjustDefenceHourToLocal(self.getNewDefHour(), timestamp)
     return super(ClanCardItem, self).getDefHourFor(timestamp)