Beispiel #1
0
 def __getTimeFormated(self, utc, pattern):
     """
     @param pattern: <str> see Settings.scriptConfig.timeFormated
     """
     timeFormated = Settings.g_instance.scriptConfig.timeFormated.get(pattern, None)
     if timeFormated is not None:
         return getFormattedTime(utc, timeFormated)
     else:
         return getFormattedTime(utc)
Beispiel #2
0
 def show(self, reason, isBan=None, expiryTime=None):
     BigWorld.disconnect()
     Cursor.forceShowCursor(True)
     message = ''
     if isBan:
         if reason.upper().startswith('#'):
             if len(reason) == 0:
                 reason = 'connection_lost'
             reason = makeString(reason.upper())
             if not isinstance(reason, unicode):
                 convert(reason)
         if expiryTime:
             strExpireTime = getFormattedTime(expiryTime)
             message = localizeMenu('LOGIN/STATUS/LOGIN_REJECTED_BAN')
             message = message % {'time': strExpireTime, 'reason': reason}
         else:
             message = localizeMenu(
                 'LOGIN/STATUS/LOGIN_REJECTED_BAN_UNLIMITED')
             message = message % {'reason': reason}
     else:
         message = localizeMessages('DISCONNECT/' + reason)
     self.call_1('setMessage', message,
                 localizeMessages('DISCONNECT_TITLE'),
                 localizeMessages('DISCONNECT_ENTER_BUTTON'))
     self.active(True)
     BigWorld.worldDrawEnabled(False)
Beispiel #3
0
 def __call__(self, account, ob, **kw):
     stats = ob['stats']
     lastGameTime = stats['lastGameTime']
     ob['lastGameTime'] = getFormattedTime(
         lastGameTime, Settings.g_instance.scriptConfig.
         timeFormated['dmYHM']) if lastGameTime > 0 else ''
     ob['stats'] = _convertPlaneStats(stats)
     return ob
Beispiel #4
0
 def __call__(self, account, ob, **kw):
     stats = ob['stats']
     lastGameTime = stats['lastGameTime']
     ob['lastGameTime'] = getFormattedTime(
         lastGameTime, Settings.g_instance.scriptConfig.
         timeFormated['dmYHM']) if lastGameTime > 0 else ''
     ob['flighttime'] = stats['flighttime']
     ob['flighttimeStr'] = localizeTimeIntervalHM(stats['flighttime'])
     ob['createdAt'] = strftime(
         Settings.g_instance.scriptConfig.timeFormated['dmYHM'],
         localtime(float(stats['createdAt']))).decode(
             getpreferredencoding()) if stats['createdAt'] > 0 else ''
     ob['stats'] = _convertSummeryStats(stats)
     return ob
 def __call__(self, account, ob, **kw):
     ob['birthdayTimeStr'] = getFormattedTime(
         ob['birthdayTime'],
         Settings.g_instance.scriptConfig.timeFormated['dmY'])
     return ob