コード例 #1
0
ファイル: ClientChat.py プロジェクト: webiumsk/WOT-0.9.17-CT
 def __systemMessageTimeProcessor(self, actionData):
     isSystemMessage = CHAT_ACTIONS[actionData['action']] in (
         CHAT_ACTIONS.personalSysMessage, CHAT_ACTIONS.sysMessage)
     if isSystemMessage:
         if actionData.has_key('data'):
             messageData = actionData['data']
             messageType = messageData['type']
             if 'created_at' in messageData:
                 messageData['created_at'] = tm.makeLocalServerDatetime(
                     messageData['created_at'])
             if 'finished_at' in messageData:
                 messageData['finished_at'] = tm.makeLocalServerDatetime(
                     messageData['finished_at'])
             if 'started_at' in messageData:
                 messageData['started_at'] = tm.makeLocalServerDatetime(
                     messageData['started_at'])
             if messageType == SYS_MESSAGE_TYPE.serverReboot.index():
                 messageData['data'] = tm.makeLocalServerDatetime(
                     messageData['data'])
             elif messageType == SYS_MESSAGE_TYPE.battleResults.index():
                 messageData['data'][
                     'arenaCreateTime'] = tm.makeLocalServerTime(
                         messageData['data']['arenaCreateTime'])
             elif messageType == SYS_MESSAGE_TYPE.goldReceived.index():
                 messageData['data']['date'] = tm.makeLocalServerTime(
                     messageData['data']['date'])
             elif messageType in (
                     SYS_MESSAGE_TYPE.accountTypeChanged.index(),
                     SYS_MESSAGE_TYPE.premiumBought.index(),
                     SYS_MESSAGE_TYPE.premiumExtended.index(),
                     SYS_MESSAGE_TYPE.premiumExpired.index()):
                 if 'expiryTime' in messageData['data']:
                     messageData['data'][
                         'expiryTime'] = tm.makeLocalServerTime(
                             messageData['data']['expiryTime'])
コード例 #2
0
ファイル: clientchat.py プロジェクト: krzcho/WOTDecompiled
    def __systemMessageTimeProcessor(self, actionData):
        isSystemMessage = CHAT_ACTIONS[actionData['action']] in (CHAT_ACTIONS.personalSysMessage, CHAT_ACTIONS.sysMessage)
        if isSystemMessage:
            if actionData.has_key('data'):
                messageData = actionData['data']
                messageType = messageData['type']
                if 'created_at' in messageData:
                    messageData['created_at'] = tm.makeLocalServerDatetime(messageData['created_at'])
                if 'finished_at' in messageData:
                    messageData['finished_at'] = tm.makeLocalServerDatetime(messageData['finished_at'])
                if 'started_at' in messageData:
                    messageData['started_at'] = tm.makeLocalServerDatetime(messageData['started_at'])
                if messageType == SYS_MESSAGE_TYPE.serverReboot.index():
                    messageData['data'] = tm.makeLocalServerDatetime(messageData['data'])
                elif messageType == SYS_MESSAGE_TYPE.battleResults.index():
                    for value in messageData['data'].itervalues():
                        value['arenaCreateTime'] = tm.makeLocalServerTime(value['arenaCreateTime'])

                elif messageType == SYS_MESSAGE_TYPE.goldReceived.index():
                    messageData['data']['date'] = tm.makeLocalServerTime(messageData['data']['date'])
                elif messageType in (SYS_MESSAGE_TYPE.accountTypeChanged.index(),
                 SYS_MESSAGE_TYPE.premiumBought.index(),
                 SYS_MESSAGE_TYPE.premiumExtended.index(),
                 SYS_MESSAGE_TYPE.premiumExpired.index()):
                    if 'expiryTime' in messageData['data']:
                        messageData['data']['expiryTime'] = tm.makeLocalServerTime(messageData['data']['expiryTime'])
コード例 #3
0
ファイル: clientchat.py プロジェクト: webiumsk/WOT-0.9.15-CT
 def __inviteDataTimeProcessor(self, actionData):
     isInviteAction = CHAT_ACTIONS[actionData['action']] in (CHAT_ACTIONS.createInvite, CHAT_ACTIONS.receiveInvite, CHAT_ACTIONS.receiveArchiveInvite)
     if isInviteAction:
         if actionData.has_key('data'):
             inviteData = actionData['data']
             if 'sent_at' in inviteData:
                 inviteData['sent_at'] = tm.utcToLocalDatetime(tm.makeLocalServerDatetime(inviteData['sent_at']))
             if 'received_at' in inviteData:
                 inviteData['received_at'] = tm.utcToLocalDatetime(tm.makeLocalServerDatetime(inviteData['received_at']))
             if 'processed_at' in inviteData:
                 inviteData['processed_at'] = tm.utcToLocalDatetime(tm.makeLocalServerDatetime(inviteData['processed_at']))
コード例 #4
0
 def __inviteDataTimeProcessor(self, actionData):
     isInviteAction = CHAT_ACTIONS[actionData['action']] in (CHAT_ACTIONS.createInvite, CHAT_ACTIONS.receiveInvite, CHAT_ACTIONS.receiveArchiveInvite)
     if isInviteAction:
         if actionData.has_key('data'):
             inviteData = actionData['data']
             if 'sent_at' in inviteData:
                 inviteData['sent_at'] = tm.utcToLocalDatetime(tm.makeLocalServerDatetime(inviteData['sent_at']))
             if 'received_at' in inviteData:
                 inviteData['received_at'] = tm.utcToLocalDatetime(tm.makeLocalServerDatetime(inviteData['received_at']))
             if 'processed_at' in inviteData:
                 inviteData['processed_at'] = tm.utcToLocalDatetime(tm.makeLocalServerDatetime(inviteData['processed_at']))