Skip to content

Commit

Permalink
Merge pull request JamzTheMan#9 from cwisniew/no-password-fix
Browse files Browse the repository at this point in the history
Force user to enter password on connect to server dialog.
  • Loading branch information
cwisniew authored Feb 9, 2021
2 parents 1bbad68 + f3edb00 commit 27da997
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ public JTextField getUsernameTextField() {
return (JTextField) getComponent("@username");
}

public JTextField getPasswordTextField() {
return (JTextField) getComponent("@password");
}

public JTextField getPortTextField() {
return (JTextField) getComponent("@port");
}
Expand All @@ -263,6 +267,10 @@ private void handleOK() {
MapTool.showError("ServerDialog.error.username"); // $NON-NLS-1$
return;
}
if (getPasswordTextField().getText().length() == 0) {
MapTool.showError("ServerDialog.error.noConnectPassword"); // $NON-NLS-1$
return;
}
getUsernameTextField().setText(username);

String externalAddress = "Unknown";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ ServerDialog.error.portNumberException = Port from RPTools registry is not numer
ServerDialog.error.server = You must enter a server name or IP address.
ServerDialog.error.serverNotFound = Server "{0}" not found.
ServerDialog.error.username = A username must be provided.
ServerDialog.error.noConnectPassword = You must enter a password to connect to a server.
ServerDialog.error.passwordMissing = Both Player and GM Password must be provided.
ServerDialog.error.passwordMustDiffer = Player and GM Password can not be the same.

Expand Down

0 comments on commit 27da997

Please sign in to comment.