Example #1
0
def do_abort_shutdown(obj):
 """
 Abort a running shutdown.
 
 Synopsis:
  abort-shutdown
  @abort-shutdown
 """
 if hasattr(do_shutdown, 'delay'):
  do_shutdown.delay.cancel()
  db.notify_players('Shutdown aborted.')
  del do_shutdown.delay
 else:
  obj.notify('There is no shutdown in progress.')
 return True
Example #2
0
def do_shout(obj, text):
 """
 Shout text to everyone in the game.
 
 Synopsis:
  shout <text>
  !<text>
 
 <text> will be announced to everyone currently connected.
 """
 if text:
  db.notify_players('%s shouts, "%s"' % (obj.title(), text))
 else:
  obj.notify('Shout what?')
 return True
Example #3
0
 def f1(when, reason):
  db.notify_players('The server will be shutting down for %s in %s second%s.' % (reason, when, '' if when== 1 else 's'))
  if when > 5:
   do_shutdown.delay = reactor.callLater(when - 5, f2)
  else:
   do_shutdown.delay = reactor.callLater(when, reactor.stop)
Example #4
0
 def f2():
  """Actually perform the shutdown."""
  db.notify_players('The server will be shutting down in 5 seconds.')
  do_shutdown.delay = reactor.callLater(5, reactor.stop)