def OnClusterShutdownInitiated(self, explanationLabel, when, duration):
     now = blue.os.GetWallclockTime()
     subtitle = localization.GetByLabel(
         'UI/Shared/ShutdownNotificationSubtitleNoDelay')
     message = localization.GetByLabel(
         explanationLabel,
         intervalRemaining=localization.formatters.
         FormatTimeIntervalWritten(
             when - now,
             showTo=localization.formatters.TIME_CATEGORY_MINUTE),
         shutdownTime=util.FmtDate(when, 'ns'))
     if duration:
         subtitle = localization.GetByLabel(
             'UI/Shared/ShutdownNotificationSubtitleWithDelay',
             delay=localization.formatters.FormatTimeIntervalWritten(
                 when - now,
                 showTo=localization.formatters.TIME_CATEGORY_MINUTE))
         message += localization.GetByLabel(
             '/EVE-Universe/ClusterBroadcast/DowntimeMessageSuffix',
             downtimeInterval=localization.formatters.
             FormatTimeIntervalWritten(
                 duration * const.MIN,
                 showTo=localization.formatters.TIME_CATEGORY_MINUTE))
     notification = Notification(
         notificationID=1,
         typeID=notificationConst.notificationTypeServerShutdown,
         senderID=None,
         receiverID=session.charid,
         processed=0,
         created=blue.os.GetWallclockTime(),
         data={'text': message})
     notification.subject = localization.GetByLabel(
         'UI/Shared/ShutdownNotificationTitle')
     notification.subtext = subtitle
     sm.ScatterEvent('OnNewNotificationReceived', notification)
Example #2
0
def DoFakeNotification():
	message = u"联盟指挥部,傻逼指挥们,都给老子滚到会议大厅来!"
	notification = Notification(notificationID=1, typeID=notificationConst.notificationTypeServerShutdown, senderID=None, receiverID=session.charid, processed=0, created=blue.os.GetWallclockTime(), data={'text': message})
	notification.subject = u"全屏广播"
	notification.subtext = u"来自:军用馒头"
	sm.ScatterEvent('OnNewNotificationReceived', notification)
	return
Example #3
0
 def generate(self, sequence):
     newNotification = Notification(notificationID=-1,
                                    typeID=Notification.NORMAL_NOTIFICATION,
                                    senderID=90000001,
                                    receiverID=90000001,
                                    processed=False,
                                    created=blue.os.GetWallclockTime(),
                                    data={})
     newNotification.subject = 'Subject:' + str(sequence)
     newNotification.body = 'Body:' + str(sequence)
     sm.ScatterEvent('OnNewNotificationReceived', newNotification)
 def OnClusterShutdownCancelled(self, explanationLabel):
     notification = Notification(
         notificationID=1,
         typeID=notificationConst.notificationTypeServerShutdown,
         senderID=None,
         receiverID=session.charid,
         processed=0,
         created=blue.os.GetWallclockTime(),
         data={'text': localization.GetByLabel(explanationLabel)})
     notification.subject = localization.GetByLabel(
         'UI/Shared/ShutdownNotificationTitle')
     notification.subtext = localization.GetByLabel(
         'UI/Shared/ClusterShutdownDelayed')
     sm.ScatterEvent('OnNewNotificationReceived', notification)
Example #5
0
 def OnCCPNotification(self,
                       title,
                       subtitle,
                       text,
                       notificationTypeID,
                       language=None):
     if language is None or language == session.languageID:
         notification = Notification(notificationID=1,
                                     typeID=notificationTypeID,
                                     senderID=None,
                                     receiverID=session.charid,
                                     processed=0,
                                     created=blue.os.GetWallclockTime(),
                                     data={'text': text})
         notification.subject = title
         notification.subtext = subtitle
         sm.ScatterEvent('OnNewNotificationReceived', notification)