sys.exit(1) sessionid = loginResponse['SessionID'] user = loginResponse['Username'] print "Logged in as " + loginResponse['Username'] + "! Your session id is: " + sessionid else: sessionid = None if(options.server != ""): serverAddress = options.server else: serverAddress = raw_input("Enter host and port if any: ") if ':' in serverAddress: StuffEnteredIntoBox = serverAddress.split(":") host = StuffEnteredIntoBox[0] port = int(StuffEnteredIntoBox[1]) else: host = serverAddress port = 25565 connection = NetworkManager.ServerConnection(user, sessionid, host, port, options) connection.start() while True: try: chat_input = raw_input() if (connection.isConnected): PacketSenderManager.send03(connection.grabSocket(), chat_input) else: pass except KeyboardInterrupt, e: connection.disconnect() sys.exit(1)
def sendChat(socket, message): PacketSenderManager.send03(socket, message)
else: sessionid = None if (options.server != ""): serverAddress = options.server else: serverAddress = raw_input("Enter host and port if any: ") if ':' in serverAddress: StuffEnteredIntoBox = serverAddress.split(":") host = StuffEnteredIntoBox[0] port = int(StuffEnteredIntoBox[1]) else: host = serverAddress port = 25565 connection = NetworkManager.ServerConnection(pluginLoader, user, sessionid, host, port, options) connection.setDaemon(True) connection.start() while True: try: chat_input = raw_input() if (connection.isConnected): PacketSenderManager.send03(connection.grabSocket(), chat_input.decode('utf-8')[:100]) else: pass except KeyboardInterrupt, e: connection.disconnect() pluginLoader.disablePlugins() sys.exit(1)
print "Logged in as " + loginResponse['Username'] + "! Your session id is: " + sessionid else: sessionid = None if (options.server != ""): serverAddress = options.server else: serverAddress = raw_input("Enter host and port if any: ") if ':' in serverAddress: StuffEnteredIntoBox = serverAddress.split(":") host = StuffEnteredIntoBox[0] port = int(StuffEnteredIntoBox[1]) else: host = serverAddress port = 25565 connection = NetworkManager.ServerConnection(pluginLoader, user, sessionid, host, port, options) connection.setDaemon(True) connection.start() while True: try: chat_input = raw_input() if (connection.isConnected): PacketSenderManager.send03(connection.grabSocket(), chat_input.decode('utf-8')[:100]) else: pass except KeyboardInterrupt, e: connection.disconnect() pluginLoader.disablePlugins() sys.exit(1)