Remove ExecutionEnvironment & authlibinjector.side

'authlibinjector.side' option becomes unnecessary now.
This commit discards 'authlibinjector.side' option defined in proposal #16.
This commit is contained in:
yushijinhun 2020-08-13 20:27:36 +08:00
parent b12dd75fa5
commit 059dc2641d
No known key found for this signature in database
GPG key ID: 5BC167F73EA558E4
2 changed files with 0 additions and 53 deletions

View file

@ -112,12 +112,6 @@ public final class AuthlibInjector {
*/
public static final String PROP_IGNORED_PACKAGES = "authlibinjector.ignoredPackages";
/**
* The side that authlib-injector runs on.
* Possible values: client, server.
*/
public static final String PROP_SIDE = "authlibinjector.side";
public static final String PROP_DISABLE_HTTPD = "authlibinjector.httpd.disable";
// ====
@ -233,9 +227,6 @@ public final class AuthlibInjector {
String apiRoot = System.getProperty(PROP_API_ROOT);
if (apiRoot == null) return empty();
ExecutionEnvironment side = detectSide();
Logging.LAUNCH.fine("Detected side: " + side);
apiRoot = addHttpsIfMissing(apiRoot);
Logging.CONFIG.info("API root: " + apiRoot);
warnIfHttp(apiRoot);
@ -322,29 +313,6 @@ public final class AuthlibInjector {
return a.equals(b);
}
private static ExecutionEnvironment detectSide() {
String specifiedSide = System.getProperty(PROP_SIDE);
if (specifiedSide != null) {
switch (specifiedSide) {
case "client":
return ExecutionEnvironment.CLIENT;
case "server":
return ExecutionEnvironment.SERVER;
default:
Logging.LAUNCH.warning("Invalid value [" + specifiedSide + "] for parameter " + PROP_SIDE + ", ignoring.");
break;
}
}
// fallback
if (System.getProperty(PROP_PREFETCHED_DATA) != null || System.getProperty(PROP_PREFETCHED_DATA_OLD) != null) {
Logging.LAUNCH.warning("Prefetched configuration must be used along with parameter " + PROP_SIDE);
return ExecutionEnvironment.CLIENT;
} else {
return ExecutionEnvironment.SERVER;
}
}
private static List<URLFilter> createFilters(YggdrasilConfiguration config) {
if (Boolean.getBoolean(PROP_DISABLE_HTTPD)) {
return emptyList();

View file

@ -1,21 +0,0 @@
/*
* Copyright (C) 2019 Haowei Wen <yushijinhun@gmail.com> and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package moe.yushi.authlibinjector;
public enum ExecutionEnvironment {
CLIENT, SERVER;
}