def main(): print("Copyright (C) 2015 Gjum <*****@*****.**>\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions; see LICENSE.txt for details.\n") if len(sys.argv) > 1 and sys.argv[1] in ('-h', '--help'): print("Usage: %s [nick]" % sys.argv[0]) print(" %s party <token> [nick]" % sys.argv[0]) print(" %s <IP:port> <token> [nick]" % sys.argv[0]) return address, token, nick, *_ = sys.argv[1:] + ([None] * 3) if token is None: nick = address address = None if address and address[0] in 'Pp': address, *_ = get_party_address(token) if not address: address, token, *_ = find_server() GtkControl(address, token, nick) gtk_main_loop()
def on_key_pressed(self, val, char): if char == 'q' or val == Gdk.KEY_Escape: self.client.disconnect() Gtk.main_quit() elif char == 's': self.client.send_spectate() elif char == 'r' or val == Gdk.KEY_Return: self.client.send_respawn() elif char == 'c': # reconnect to any server self.client.disconnect() address, token, *_ = find_server() self.client.connect(address, token) self.world_viewer.focus_player(self.client.player)
def donate_thread(): while 1: gcommer_donate(*find_server(region, mode)) time.sleep(interval)