def on_command_enter(self, *args): process_line(self.chat_input.text.encode('utf-8')) self.chat_input.text = '' Clock.schedule_once(self._focus_chat_input, 0.1) # dirty hack :^)
def input_thread(): while True: s = raw_input(PROMPT) commands.process_line(s)
def on_command_enter(self, *args): process_line(self.chat_input.text) self.chat_input.text = '' Clock.schedule_once(self._focus_chat_input, 0.1) # dirty hack :^)
if config.getboolean('Other', 'log_network_packets'): from loggers import netlog netlog.setLevel(logging.INFO) fh = logging.FileHandler('/tmp/netlog.txt', mode="w") fmt = logging.Formatter("[%(asctime)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S") fh.setFormatter(fmt) netlog.addHandler(fh) load_itemdb('itemdb.txt') read_monster_db('monsterdb.txt') plugins.load_plugins(config) net.login(host=config.get('Server', 'host'), port=config.getint('Server', 'port'), username=config.get('Player', 'username'), password=config.get('Player', 'password'), charname=config.get('Player', 'charname')) thread.start_new_thread(input_thread, ()) while True: if len(input_buffer) > 0: for l in input_buffer: commands.process_line(l) input_buffer.clear() asyncore.loop(timeout=0.2, count=5) logic_manager.tick()
def do_POST(self): cmd = self.rfile.getvalue() commands.process_line(cmd) self.send_response(200)