package dotsboxes;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import dotsboxes.players.PlayerDesc;
import dotsboxes.rmi.ConnectionManager;
import dotsboxes.rmi.exceptions.ConnectionAlreadyEstablished;
import dotsboxes.utils.Configuration;
import dotsboxes.utils.Debug;

public class DotsBoxes {

	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{
		System.out.println("Hello World");
		int port = Integer.parseInt(args[0]);
		Configuration.setPort(port);
		Configuration.setKnownPlayersFilepath( args[1] );
		SessionManager smanager = new SessionManager();
		EventManager.Init();
		try {
			ConnectionManager.Init(port);
			
			PlayerDesc remote_player = new PlayerDesc();
			remote_player.setInetAdress(InetAddress.getLocalHost());
			remote_player.setPort(10000);
			
			ConnectionManager.connect(remote_player);
			
		} catch (RemoteException | AlreadyBoundException | NotBoundException | ConnectionAlreadyEstablished e) {
			e.printStackTrace();
			System.exit(1);
		} catch (UnknownHostException e) {
			System.exit(2);
			Debug.log("Exception: host not found");
		}
			
		smanager.Delete();
		System.exit(0);
	}

}

@@ -772,450 +772,102 @@
 ;%0A%09%09
-%09%0A%09%09%09PlayerDesc remote_player = new PlayerDesc();%0A%09%09%09remote_player.setInetAdress(InetAddress.getLocalHost());%0A%09%09%09remote_player.setPort(10000);%0A%09%09%09%0A%09%09%09ConnectionManager.connect(remote_player);%0A%09%09%09%0A%09%09%7D catch (RemoteException %7C AlreadyBoundException %7C NotBoundException %7C ConnectionAlreadyEstablished e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%09System.exit(1);%0A%09%09%7D catch (UnknownHostException e) %7B%0A%09%09%09System.exit(2);%0A%09%09%09Debug.log(%22Exception: host not found%22
+%7D catch (RemoteException %7C AlreadyBoundException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%09System.exit(1
 );%0A%09

remove test calls from main()