2020-04-29 20:01:53 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org
|
|
|
|
*
|
2020-07-30 20:10:15 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2020-04-29 20:01:53 +00:00
|
|
|
*
|
2020-07-30 20:10:15 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
2020-04-29 20:01:53 +00:00
|
|
|
*
|
2020-07-30 20:10:15 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
2020-04-29 20:01:53 +00:00
|
|
|
*
|
2020-07-30 20:10:15 +00:00
|
|
|
* @author GeyserMC
|
|
|
|
* @link https://github.com/GeyserMC/Geyser
|
2020-04-29 20:01:53 +00:00
|
|
|
*/
|
|
|
|
|
2020-06-10 22:58:29 +00:00
|
|
|
package org.geysermc.connector.configuration;
|
|
|
|
|
2020-07-30 15:59:42 +00:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
2020-06-10 22:58:29 +00:00
|
|
|
import org.geysermc.connector.GeyserLogger;
|
2020-04-29 20:01:53 +00:00
|
|
|
|
2020-07-05 23:35:51 +00:00
|
|
|
import org.geysermc.connector.utils.LanguageUtils;
|
|
|
|
|
2020-04-29 20:01:53 +00:00
|
|
|
import java.nio.file.Path;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
public interface GeyserConfiguration {
|
|
|
|
|
2020-05-21 03:43:22 +00:00
|
|
|
// Modify this when you update the config
|
2020-05-23 21:50:04 +00:00
|
|
|
int CURRENT_CONFIG_VERSION = 3;
|
2020-05-21 03:43:22 +00:00
|
|
|
|
2020-04-29 20:01:53 +00:00
|
|
|
IBedrockConfiguration getBedrock();
|
|
|
|
|
|
|
|
IRemoteConfiguration getRemote();
|
|
|
|
|
|
|
|
Map<String, ? extends IUserAuthenticationInfo> getUserAuths();
|
|
|
|
|
2020-05-21 03:43:22 +00:00
|
|
|
boolean isCommandSuggestions();
|
|
|
|
|
2020-07-30 15:59:42 +00:00
|
|
|
@JsonIgnore
|
2020-05-23 21:50:04 +00:00
|
|
|
boolean isPassthroughMotd();
|
|
|
|
|
2020-07-30 15:59:42 +00:00
|
|
|
@JsonIgnore
|
2020-05-23 21:50:04 +00:00
|
|
|
boolean isPassthroughPlayerCounts();
|
|
|
|
|
2020-07-30 15:59:42 +00:00
|
|
|
@JsonIgnore
|
2020-05-23 21:50:04 +00:00
|
|
|
boolean isLegacyPingPassthrough();
|
|
|
|
|
|
|
|
int getPingPassthroughInterval();
|
2020-04-29 20:01:53 +00:00
|
|
|
|
|
|
|
int getMaxPlayers();
|
|
|
|
|
|
|
|
boolean isDebugMode();
|
|
|
|
|
|
|
|
int getGeneralThreadPool();
|
|
|
|
|
|
|
|
boolean isAllowThirdPartyCapes();
|
|
|
|
|
2020-05-23 21:06:34 +00:00
|
|
|
boolean isAllowThirdPartyEars();
|
|
|
|
|
2020-06-17 00:03:28 +00:00
|
|
|
boolean isShowCooldown();
|
|
|
|
|
2020-04-29 20:01:53 +00:00
|
|
|
String getDefaultLocale();
|
|
|
|
|
|
|
|
Path getFloodgateKeyFile();
|
|
|
|
|
2020-05-23 21:02:51 +00:00
|
|
|
boolean isAboveBedrockNetherBuilding();
|
|
|
|
|
2020-04-29 20:01:53 +00:00
|
|
|
boolean isCacheChunks();
|
|
|
|
|
|
|
|
IMetricsInfo getMetrics();
|
|
|
|
|
|
|
|
interface IBedrockConfiguration {
|
|
|
|
|
|
|
|
String getAddress();
|
|
|
|
|
|
|
|
int getPort();
|
|
|
|
|
2020-07-30 20:09:40 +00:00
|
|
|
boolean isCloneRemotePort();
|
|
|
|
|
2020-04-29 20:01:53 +00:00
|
|
|
String getMotd1();
|
|
|
|
|
|
|
|
String getMotd2();
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IRemoteConfiguration {
|
|
|
|
|
|
|
|
String getAddress();
|
|
|
|
|
|
|
|
int getPort();
|
2020-07-25 17:42:43 +00:00
|
|
|
|
|
|
|
void setAddress(String address);
|
|
|
|
|
|
|
|
void setPort(int port);
|
2020-04-29 20:01:53 +00:00
|
|
|
|
|
|
|
String getAuthType();
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IUserAuthenticationInfo {
|
|
|
|
String getEmail();
|
|
|
|
|
|
|
|
String getPassword();
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IMetricsInfo {
|
|
|
|
|
|
|
|
boolean isEnabled();
|
|
|
|
|
|
|
|
String getUniqueId();
|
|
|
|
}
|
2020-05-21 03:43:22 +00:00
|
|
|
|
|
|
|
int getConfigVersion();
|
|
|
|
|
|
|
|
static void checkGeyserConfiguration(GeyserConfiguration geyserConfig, GeyserLogger geyserLogger) {
|
|
|
|
if (geyserConfig.getConfigVersion() < CURRENT_CONFIG_VERSION) {
|
2020-07-05 23:35:51 +00:00
|
|
|
geyserLogger.warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.config.outdated"));
|
2020-05-21 03:43:22 +00:00
|
|
|
} else if (geyserConfig.getConfigVersion() > CURRENT_CONFIG_VERSION) {
|
2020-07-05 23:35:51 +00:00
|
|
|
geyserLogger.warning(LanguageUtils.getLocaleStringLog("geyser.bootstrap.config.too_new"));
|
2020-05-21 03:43:22 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-29 20:01:53 +00:00
|
|
|
}
|