@Override
	public void keyPressed(KeyEvent ke) {
		int keyCode = ke.getKeyCode();
		int[] direction = g.getKeyCode(keyCode);
		
		if (direction == null)
			return;
		
		try {
			service.move(g.getOwnId(), direction);
			g.repaint();
		} catch (RemoteException e1) {
			String serverObjectName = "rmi://localhost:" + CONSTANTS.b_servicePort
					+ "/" + CONSTANTS.b_ServiceName;
			try {
				Registry registry = LocateRegistry.getRegistry(null, CONSTANTS.b_servicePort);
				service = (ServerService) registry.lookup(serverObjectName);
				service.reconnect(gameManager, g.getOwnId());
			} catch (RemoteException | NotBoundException e) {
				
			}
		}

	}