public void gameLoop()
	{
		Scanner s = input;
		boolean done = false;
		MultiRummy nr = null;

		gc = null;
		nr = new MultiRummy();
		System.out.printf("Connect address: %s\n", nr.getConnectString());
		do
		{
			System.out.printf(">> ");
			String cmd = s.nextLine();
			
			int i;
			Matcher m = null;
			
			for (i = 0; i < main_cmds.length; i++)
			{
				m = main_cmds[i].matcher(cmd);
				if (m.matches())
					break;
			}
			
			switch (i)
			{
			case 0:
				gc = nr.join(this);
				break;
			case 1:
				String connect_str = m.group(2);
				gc = nr.join(connect_str, this);
				break;
			case 4:
				String local_str = "tcp://localhost:" + m.group(2);
				gc = nr.join(local_str, this);
				break;
			case 2:
				if (gc != null)
					gc.start();
				//gc = null;
				break;
			case 3:
				done = true;
				nr.close();
				nr = null;
				break;
			default:
				System.out.println("Bad command");	
			}
		} while (!done);
		return;
	}