Example #1
0
def handle_adminstop(bot, ievent):
    """ no arguments - stop the bot. """
    ievent.untildone = True
    if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown)
    else:
        ievent.reply("you are not the owner of the bot")
        return
    ievent.done(silent=True)
Example #2
0
def handle_reboot(bot, ievent):
    """ reboot the bot. """
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    ievent.reply("rebooting")
    time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        bot.exit()
        mainhandler.put(0, reboot)
Example #3
0
def handle_reboot(bot, ievent):
    """ no arguments - reboot the bot. """
    ievent.reply("rebooting")
    #time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        if bot.type == "tornado": 
            callback = functools.partial(reboot_stateful, bot, ievent, getfleet(), partyline)
            bot.server.io_loop.add_callback(callback)
        else: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        getfleet().exit()
        mainhandler.put(0, reboot)
Example #4
0
def handle_reboot(bot, ievent):
    """ reboot the bot. """
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    ievent.reply("rebooting")
    time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        bot.exit()
        mainhandler.put(0, reboot)
Example #5
0
File: core.py Project: code2u/jsb
def handle_reboot(bot, ievent):
    """ no arguments - reboot the bot. """
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    ievent.reply("rebooting")
    time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        if bot.type == "tornado": bot.ioloop.add_callback(lambda: reboot_stateful(bot, ievent, getfleet(), partyline))
        else: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        getfleet().exit()
        mainhandler.put(0, reboot)
Example #6
0
def handle_reboot(bot, ievent):
    """ no arguments - reboot the bot. """
    ievent.reply("rebooting")
    #time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        if bot.type == "tornado":
            callback = functools.partial(reboot_stateful, bot, ievent,
                                         getfleet(), partyline)
            bot.server.io_loop.add_callback(callback)
        else:
            mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(),
                            partyline)
    else:
        getfleet().exit()
        mainhandler.put(0, reboot)
Example #7
0
def handle_adminstop(bot, ievent):
    if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return
    mainhandler.put(0, globalshutdown)
Example #8
0
def handle_adminstop(bot, ievent):
    """ no arguments - stop the bot. """
    if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return
    if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown)
    else: ievent.reply("you are not the owner of the bot")
Example #9
0
def handle_adminstop(bot, ievent):
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    mainhandler.put(0, globalshutdown)
Example #10
0
def handle_adminstop(bot, ievent):
    """ no arguments - stop the bot. """
    ievent.untildone = True
    if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown)
    else: ievent.reply("you are not the owner of the bot") ; return
    ievent.done(silent=True)