parent
f98811c899
commit
89b9afb3db
@ -35,8 +35,6 @@ public final class ClientConfig extends Config {
|
||||
put("server", "s", identity());
|
||||
put("port", "p", Integer::parseInt);
|
||||
put("localDB", "db", File::new);
|
||||
put("user", "u", identity());
|
||||
put("password", "pw", identity());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,28 +54,4 @@ public final class ClientConfig extends Config {
|
||||
* @since Envoy Client v0.1-alpha
|
||||
*/
|
||||
public File getLocalDB() { return (File) items.get("localDB").get(); }
|
||||
|
||||
/**
|
||||
* @return the user name
|
||||
* @since Envoy Client v0.3-alpha
|
||||
*/
|
||||
public String getUser() {
|
||||
final String user = (String) items.get("user").get();
|
||||
return user.equals("") ? null : user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the password
|
||||
* @since Envoy Client v0.3-alpha
|
||||
*/
|
||||
public String getPassword() {
|
||||
final String password = (String) items.get("password").get();
|
||||
return password.equals("") ? null : password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if user name and password are set
|
||||
* @since Envoy Client v0.3-alpha
|
||||
*/
|
||||
public boolean hasLoginCredentials() { return getUser() != null && getPassword() != null; }
|
||||
}
|
||||
|
@ -79,16 +79,16 @@ public final class Startup extends Application {
|
||||
localDB.loadIDGenerator();
|
||||
context.setLocalDB(localDB);
|
||||
|
||||
// Configure stage
|
||||
stage.setTitle("Envoy");
|
||||
stage.getIcons().add(IconUtil.loadIcon("envoy_logo"));
|
||||
|
||||
// Create scene context
|
||||
final var sceneContext = new SceneContext(stage);
|
||||
context.setSceneContext(sceneContext);
|
||||
|
||||
// Perform automatic login if configured
|
||||
if (config.hasLoginCredentials())
|
||||
performHandshake(new LoginCredentials(config.getUser(), config.getPassword(), false, Startup.VERSION, loadLastSync(config.getUser())));
|
||||
else sceneContext.load(SceneInfo.LOGIN_SCENE);
|
||||
// Load login scene
|
||||
sceneContext.load(SceneInfo.LOGIN_SCENE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user