public void ShowMainMenu() throws NotBoundException, MalformedURLException, RemoteException {
        boolean menuSelected = false;
        attemptNumber = 0;
        if (p == null) {
            p = (ServerInterface) Naming.lookup("//localhost/PID");
        }

        try {
            do {
                Scanner s = new Scanner(System.in);
                ShowMenuOptions();
                int option = ReadMenuOption(s);
                switch (option) {
                    case 0:
                        if (p != null)
                            DestroyGame(p);
                        
                        System.exit(0);
                        break;
                    case 1:
                        InitGame(p);
                        menuSelected = true;
                        break;
                    case 2:
                        Helpers.ShowMessage.showMessage("client", p.GetLeaderBoard());
                        break;
                    case 3:
                        InitHackGame(p);
                        menuSelected = true;
                        break;
                }
            } while (!menuSelected);
        } catch (Exception e) {
            Helpers.ShowMessage.showMessage("client", e.getMessage());
        }
    }