def __init__(self, target, name = None): self.target = target self.name = name if name else utils.randStr() self.health = logic.getSystemVitality(self.target) self.next_question = time.time() + 5 self.start_time = self.next_question self.defenders = {} self.offenders = {} self.cooldowns = {} self.questions = logic.getQuestions(self.target) self.question = None self.registry = Registry()
def clearQuestions(): try: questions = getQuestions() #Questions.query.all() print "...queried successfully........." for q in questions: db.session.delete(q) print "...deleted successfully.........." db.session.commit() print "...Questions successfully cleared.................." except: db.session.rollback() print "...Failed to clear Questions......................." finally: db.session.close() return
def __init__(self, target, name = None): self.target = target self.name = name if name else utils.randStr() self.health = logic.getSystemVitality(self.target) self.next_question = None self.start_time = None self.defenders = {} self.offenders = {} # self.cooldowns = {} self.questions = logic.getQuestions(self.target) self.question = None self.registry = Registry() self.print_queue = Queue() self.defeated_commands = None self.defeated_timeout = None self.reward_person = None self.reward_timeout = None self.saved_message = None