[FIX] Фикс автогенерации конфига

This commit is contained in:
Gravit 2019-03-22 11:08:21 +07:00
parent c9c867d8f3
commit 8329823f7a
2 changed files with 8 additions and 4 deletions

View file

@ -617,9 +617,7 @@ private void generateConfigIfNotExists() throws IOException {
newConfig.env = LauncherConfig.LauncherEnvironment.STD; newConfig.env = LauncherConfig.LauncherEnvironment.STD;
newConfig.startScript = JVMHelper.OS_TYPE.equals(JVMHelper.OS.MUSTDIE) ? "." + File.separator + "start.bat" : "." + File.separator + "start.sh"; newConfig.startScript = JVMHelper.OS_TYPE.equals(JVMHelper.OS.MUSTDIE) ? "." + File.separator + "start.bat" : "." + File.separator + "start.sh";
newConfig.hwidHandler = new AcceptHWIDHandler(); newConfig.hwidHandler = new AcceptHWIDHandler();
newConfig.auth = new AuthProviderPair[]{ new AuthProviderPair() }; newConfig.auth = new AuthProviderPair[]{ new AuthProviderPair(new RejectAuthProvider("Настройте authProvider"), new MemoryAuthHandler(), "std") };
newConfig.auth[0].provider = new RejectAuthProvider("Настройте authProvider");
newConfig.auth[0].handler = new MemoryAuthHandler();
newConfig.textureProvider = new RequestTextureProvider("http://example.com/skins/%username%.png", "http://example.com/cloaks/%username%.png"); newConfig.textureProvider = new RequestTextureProvider("http://example.com/skins/%username%.png", "http://example.com/cloaks/%username%.png");
newConfig.permissionsHandler = new JsonFilePermissionsHandler(); newConfig.permissionsHandler = new JsonFilePermissionsHandler();
newConfig.port = 7240; newConfig.port = 7240;

View file

@ -9,7 +9,13 @@ public class AuthProviderPair {
public AuthProvider provider; public AuthProvider provider;
public AuthHandler handler; public AuthHandler handler;
public String name; public String name;
public boolean isDefault; public boolean isDefault = true;
public AuthProviderPair(AuthProvider provider, AuthHandler handler, String name) {
this.provider = provider;
this.handler = handler;
this.name = name;
}
public void init() public void init()
{ {