[ANY] Deprecated old features

This commit is contained in:
Gravita 2021-11-10 23:44:19 +07:00
parent f30daab0f7
commit fbb24bb904
18 changed files with 18 additions and 15 deletions

View file

@ -102,6 +102,7 @@ public final class LaunchServer implements Runnable, AutoCloseable, Reconfigurab
public final AuthManager authManager;
public final ReconfigurableManager reconfigurableManager;
public final ConfigManager configManager;
@Deprecated
public final PingServerManager pingServerManager;
public final FeaturesManager featuresManager;
public final KeyAgreementManager keyAgreementManager;
@ -403,14 +404,12 @@ public void restart() {
}
}
@SuppressWarnings("deprecation")
public void registerObject(String name, Object object) {
if (object instanceof Reconfigurable) {
reconfigurableManager.registerReconfigurable(name, (Reconfigurable) object);
}
}
@SuppressWarnings("deprecation")
public void unregisterObject(String name, Object object) {
if (object instanceof Reconfigurable) {
reconfigurableManager.unregisterReconfigurable(name);

View file

@ -16,6 +16,7 @@
import pro.gravit.utils.command.basic.HelpCommand;
public abstract class CommandHandler extends pro.gravit.utils.command.CommandHandler {
@SuppressWarnings("deprecation")
public static void registerCommands(pro.gravit.utils.command.CommandHandler handler, LaunchServer server) {
BaseCommandCategory basic = new BaseCommandCategory();
// Register basic commands

View file

@ -6,6 +6,7 @@
import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.command.Command;
@Deprecated
public class PingServersCommand extends Command {
private transient final Logger logger = LogManager.getLogger();

View file

@ -85,12 +85,6 @@ public void invoke(String... args) {
printCheckResult("netty.address", "", true);
}
if (config.netty.sendExceptionEnabled) {
printCheckResult("netty.sendExceptionEnabled", "recommend \"false\" in production", false);
} else {
printCheckResult("netty.sendExceptionEnabled", "", true);
}
if (config.netty.launcherURL.startsWith("http://")) {
printCheckResult("netty.launcherUrl", "launcher jar download connection not secure", false);
} else if (config.netty.launcherURL.startsWith("https://")) {

View file

@ -77,7 +77,6 @@ public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) {
newConfig.netty = new NettyConfig();
newConfig.netty.fileServerEnabled = true;
newConfig.netty.sendExceptionEnabled = false;
newConfig.netty.binds = new NettyBindAddress[]{new NettyBindAddress("0.0.0.0", 9274)};
newConfig.netty.performance = new NettyPerformanceConfig();
try {
@ -286,6 +285,7 @@ public static class LauncherConf {
public static class NettyConfig {
public boolean fileServerEnabled;
@Deprecated
public boolean sendExceptionEnabled;
public boolean ipForwarding;
public boolean disableWebApiInterface;

View file

@ -7,6 +7,7 @@
import java.util.HashMap;
import java.util.Map;
@Deprecated
public class PingServerManager {
public static final long REPORT_EXPIRED_TIME = 20 * 1000;
public final Map<String, ServerInfoEntry> map = new HashMap<>();

View file

@ -65,6 +65,7 @@ public WebSocketService(ChannelGroup channels, LaunchServer server) {
this.gson = Launcher.gsonManager.gson;
}
@SuppressWarnings("deprecation")
public static void registerResponses() {
providers.register("auth", AuthResponse.class);
providers.register("checkServer", CheckServerResponse.class);
@ -165,11 +166,7 @@ void process(ChannelHandlerContext ctx, WebSocketServerResponse response, Client
} catch (Exception e) {
logger.error("WebSocket request processing failed", e);
RequestEvent event;
if (server.config.netty.sendExceptionEnabled) {
event = new ExceptionEvent(e);
} else {
event = new ErrorRequestEvent("Fatal server error. Contact administrator");
}
event = new ErrorRequestEvent("Fatal server error. Contact administrator");
if (response instanceof SimpleResponse) {
event.requestUUID = ((SimpleResponse) response).requestUUID;
}

View file

@ -6,6 +6,7 @@
import pro.gravit.launchserver.socket.Client;
import pro.gravit.launchserver.socket.response.SimpleResponse;
@Deprecated
public class PingServerReportResponse extends SimpleResponse {
public PingServerReportRequest.PingServerReport data;
public String name;

View file

@ -11,6 +11,7 @@
import java.util.List;
import java.util.Map;
@Deprecated
public class PingServerResponse extends SimpleResponse {
public List<String> serverNames; //May be null

View file

@ -2,6 +2,7 @@
import pro.gravit.launcher.LauncherNetworkAPI;
@Deprecated
public class ExceptionEvent extends RequestEvent {
@LauncherNetworkAPI
public final String message;

View file

@ -2,5 +2,6 @@
//Пустое событие
//Все обработчики обязаны его игнорировать
@Deprecated
public final class PingEvent {
}

View file

@ -4,6 +4,7 @@
import pro.gravit.launcher.request.WebSocketEvent;
//Используется, что бы послать короткое сообщение, которое вмещается в int
@Deprecated
public class SignalEvent implements WebSocketEvent {
@LauncherNetworkAPI
public final int signal;

View file

@ -3,6 +3,7 @@
import pro.gravit.launcher.LauncherNetworkAPI;
import pro.gravit.launcher.request.WebSocketEvent;
@Deprecated
public class LogEvent implements WebSocketEvent {
@LauncherNetworkAPI
public final String string;

View file

@ -2,6 +2,7 @@
import pro.gravit.launcher.events.RequestEvent;
@Deprecated
public class PingServerReportRequestEvent extends RequestEvent {
@Override
public String getType() {

View file

@ -5,6 +5,7 @@
import java.util.Map;
@Deprecated
public class PingServerRequestEvent extends RequestEvent {
public Map<String, PingServerReportRequest.PingServerReport> serverMap;

View file

@ -2,6 +2,7 @@
import pro.gravit.launcher.events.RequestEvent;
@Deprecated
public class RegisterRequestEvent extends RequestEvent {
@Override
public String getType() {

View file

@ -81,6 +81,7 @@ public void registerRequests() {
}
@SuppressWarnings("deprecation")
public void registerResults() {
results.register("auth", AuthRequestEvent.class);
results.register("checkServer", CheckServerRequestEvent.class);

View file

@ -71,7 +71,7 @@ public <T extends WebSocketEvent> void processEventHandlers(T event) {
}
}
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "deprecation"})
public <T extends WebSocketEvent> void eventHandle(T webSocketEvent) {
if (webSocketEvent instanceof RequestEvent) {
RequestEvent event = (RequestEvent) webSocketEvent;