예제 #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)
예제 #2
0
    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()}
예제 #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
예제 #7
0
 def getLocalDefHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     return adjustDefenceHourToLocal(self.getStartDefHour())
예제 #8
0
 def getLocalDefenceHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     if not self.isDefenceHourEnabled():
         return (NOT_ACTIVATED, 0)
     return adjustDefenceHourToLocal(self.defenceHour)
예제 #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)
예제 #10
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)
예제 #11
0
 def getLocalDefHour(self):
     from gui.shared.fortifications.fort_helpers import adjustDefenceHourToLocal
     return adjustDefenceHourToLocal(self.getStartDefHour())
예제 #12
0
파일: fort_seqs.py 프로젝트: webiumsk/WoT
 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)