Changed NoHashSphere to NoHashSphereInterface, allow for default
constructor with setup() or to feed new NHSI.
This commit is contained in:
@@ -23,7 +23,8 @@ import java.io.File;
|
|||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
|
|
||||||
import nodash.core.spheres.NoByteSetSphere;
|
import nodash.core.spheres.NoByteSetSphere;
|
||||||
import nodash.core.spheres.NoHashSphere;
|
import nodash.core.spheres.NoHashSphereDefault;
|
||||||
|
import nodash.core.spheres.NoHashSphereInterface;
|
||||||
import nodash.core.spheres.NoSessionSphere;
|
import nodash.core.spheres.NoSessionSphere;
|
||||||
import nodash.exceptions.NoDashSessionBadUUIDException;
|
import nodash.exceptions.NoDashSessionBadUUIDException;
|
||||||
import nodash.exceptions.NoSessionAlreadyAwaitingConfirmationException;
|
import nodash.exceptions.NoSessionAlreadyAwaitingConfirmationException;
|
||||||
@@ -39,8 +40,9 @@ import nodash.models.NoSession.NoState;
|
|||||||
|
|
||||||
public final class NoCore {
|
public final class NoCore {
|
||||||
public static NoConfig config;
|
public static NoConfig config;
|
||||||
|
private static NoHashSphereInterface hashSphere;
|
||||||
|
|
||||||
public static void setup() {
|
public static void setup(NoHashSphereInterface hashSphere) {
|
||||||
File configFile = new File(NoConfig.CONFIG_FILENAME);
|
File configFile = new File(NoConfig.CONFIG_FILENAME);
|
||||||
if (configFile.exists()) {
|
if (configFile.exists()) {
|
||||||
config = NoConfig.getNoConfigFromFile(configFile);
|
config = NoConfig.getNoConfigFromFile(configFile);
|
||||||
@@ -48,8 +50,12 @@ public final class NoCore {
|
|||||||
config = new NoConfig();
|
config = new NoConfig();
|
||||||
config.saveNoConfigToFile(configFile);
|
config.saveNoConfigToFile(configFile);
|
||||||
}
|
}
|
||||||
|
NoCore.hashSphere = hashSphere;
|
||||||
NoHashSphere.setup();
|
hashSphere.setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setup() {
|
||||||
|
NoCore.setup(new NoHashSphereDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] login(byte[] data, char[] password) throws NoUserNotValidException, NoUserAlreadyOnlineException, NoSessionExpiredException {
|
public static byte[] login(byte[] data, char[] password) throws NoUserNotValidException, NoUserAlreadyOnlineException, NoSessionExpiredException {
|
||||||
|
|||||||
Reference in New Issue
Block a user