diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index ec0aa8ea..7cd32351 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -1,7 +1,5 @@ package ru.gravit.launchserver; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherConfig; import ru.gravit.launcher.NeedGarbageCollection; @@ -22,21 +20,19 @@ import ru.gravit.launchserver.auth.protect.ProtectHandler; import ru.gravit.launchserver.auth.provider.AuthProvider; import ru.gravit.launchserver.auth.provider.RejectAuthProvider; +import ru.gravit.launchserver.auth.texture.RequestTextureProvider; +import ru.gravit.launchserver.auth.texture.TextureProvider; import ru.gravit.launchserver.binary.*; import ru.gravit.launchserver.components.AuthLimiterComponent; import ru.gravit.launchserver.components.Component; import ru.gravit.launchserver.config.LaunchServerRuntimeConfig; -import ru.gravit.launchserver.config.adapter.*; +import ru.gravit.launchserver.legacy.Response; import ru.gravit.launchserver.manangers.*; import ru.gravit.launchserver.manangers.hook.AuthHookManager; import ru.gravit.launchserver.manangers.hook.BuildHookManager; import ru.gravit.launchserver.manangers.hook.SocketHookManager; -import ru.gravit.launchserver.legacy.Response; -import ru.gravit.launchserver.websocket.NettyServerSocketHandler; import ru.gravit.launchserver.socket.ServerSocketHandler; -import ru.gravit.launchserver.auth.texture.RequestTextureProvider; -import ru.gravit.launchserver.auth.texture.TextureProvider; -import ru.gravit.utils.UniversalJsonAdapter; +import ru.gravit.launchserver.websocket.NettyServerSocketHandler; import ru.gravit.utils.command.CommandHandler; import ru.gravit.utils.command.JLineCommandHandler; import ru.gravit.utils.command.StdCommandHandler; @@ -601,7 +597,7 @@ public static void initGson() { private LauncherBinary binary() { if (launcherEXEBinaryClass != null) { try { - return (LauncherBinary)launcherEXEBinaryClass.getConstructor(LaunchServer.class).newInstance(this); + return launcherEXEBinaryClass.getConstructor(LaunchServer.class).newInstance(this); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { LogHelper.error(e); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/AuthHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/AuthHandler.java index 6bac735e..931a4cfd 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/AuthHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/AuthHandler.java @@ -3,13 +3,9 @@ import ru.gravit.launchserver.auth.AuthException; import ru.gravit.launchserver.auth.provider.AuthProviderResult; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; import java.io.IOException; -import java.util.Map; -import java.util.Objects; import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; public abstract class AuthHandler implements AutoCloseable { public static ProviderMap providers = new ProviderMap<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/JsonAuthHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/JsonAuthHandler.java index d661a537..f14fa1b4 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/JsonAuthHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/handler/JsonAuthHandler.java @@ -1,7 +1,6 @@ package ru.gravit.launchserver.auth.handler; import ru.gravit.launcher.Launcher; -import ru.gravit.launchserver.LaunchServer; import ru.gravit.utils.HTTPRequest; import java.io.IOException; @@ -75,7 +74,7 @@ protected boolean updateServerID(UUID uuid, String serverID) throws IOException } @Override - public void close() throws IOException { + public void close() { } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/HWIDHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/HWIDHandler.java index 9472871e..47c926c6 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/HWIDHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/HWIDHandler.java @@ -2,12 +2,8 @@ import ru.gravit.launcher.HWID; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; public abstract class HWIDHandler implements AutoCloseable { public static ProviderMap providers = new ProviderMap<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java index 2fb316a2..2a42e881 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonFileHWIDHandler.java @@ -3,7 +3,6 @@ import com.google.gson.reflect.TypeToken; import ru.gravit.launcher.HWID; import ru.gravit.launcher.Launcher; -import ru.gravit.launchserver.LaunchServer; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; @@ -46,7 +45,7 @@ public int hashCode() { public String banMessage = "You banned"; @Override - public void ban(List hwid) throws HWIDException { + public void ban(List hwid) { for (Entry e : list) { for (HWID banHWID : hwid) { if (e.hwid.equals(banHWID)) e.isBanned = true; @@ -89,7 +88,7 @@ public void close() throws Exception { } @Override - public List getHwid(String username) throws HWIDException { + public List getHwid(String username) { LinkedList hwids = new LinkedList<>(); for (Entry e : list) { if (e.username.equals(username)) hwids.add(e.hwid); @@ -98,7 +97,7 @@ public List getHwid(String username) throws HWIDException { } @Override - public void unban(List hwid) throws HWIDException { + public void unban(List hwid) { for (Entry e : list) { for (HWID banHWID : hwid) { if (e.hwid.equals(banHWID)) e.isBanned = false; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java index 3fed522a..91d98e6c 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/MemoryHWIDHandler.java @@ -34,7 +34,7 @@ public int hashCode() { public String banMessage = "You banned"; @Override - public void ban(List hwid) throws HWIDException { + public void ban(List hwid) { for (Entry e : list) { for (HWID banHWID : hwid) { if (e.hwid.equals(banHWID)) e.isBanned = true; @@ -57,7 +57,7 @@ public void check0(HWID hwid, String username) throws HWIDException { } @Override - public void close() throws Exception { + public void close() { } @@ -67,7 +67,7 @@ public void init() { } @Override - public List getHwid(String username) throws HWIDException { + public List getHwid(String username) { LinkedList hwids = new LinkedList<>(); for (Entry e : list) { if (e.username.equals(username)) hwids.add(e.hwid); @@ -76,7 +76,7 @@ public List getHwid(String username) throws HWIDException { } @Override - public void unban(List hwid) throws HWIDException { + public void unban(List hwid) { for (Entry e : list) { for (HWID banHWID : hwid) { if (e.hwid.equals(banHWID)) e.isBanned = false; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java index b9689b38..5622ef81 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java @@ -19,7 +19,7 @@ public void setPermissions(String username, ClientPermissions permissions) { } @Override - public void close() throws Exception { + public void close() { } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java index dbe172f4..a516d2f6 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java @@ -34,7 +34,7 @@ public void reload() { } @Override - public void close() throws Exception { + public void close() { } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java index 8fd82f40..1c3458a9 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java @@ -35,7 +35,7 @@ public void reload() { } @Override - public void close() throws Exception { + public void close() { } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java index bce9ceca..f504a471 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java @@ -2,11 +2,6 @@ import ru.gravit.launcher.ClientPermissions; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; - -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; public abstract class PermissionsHandler implements AutoCloseable { public static ProviderMap providers = new ProviderMap<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/protect/ProtectHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/protect/ProtectHandler.java index abf56f53..9e1aef89 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/protect/ProtectHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/protect/ProtectHandler.java @@ -2,11 +2,6 @@ import ru.gravit.launchserver.websocket.json.auth.AuthResponse; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; - -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; public abstract class ProtectHandler { public static ProviderMap providers = new ProviderMap<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java index 0c157e08..49ed9acd 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java @@ -2,12 +2,8 @@ import ru.gravit.launchserver.auth.AuthException; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; import java.io.IOException; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; public abstract class AuthProvider implements AutoCloseable { public static ProviderMap providers = new ProviderMap<>(); @@ -32,7 +28,7 @@ public static void registerProviders() { public abstract AuthProviderResult auth(String login, String password, String ip) throws Exception; - public void preAuth(String login, String password, String customText, String ip) throws Exception { + public void preAuth(String login, String password, String customText, String ip) { return; } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/texture/TextureProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/texture/TextureProvider.java index 0ced03c5..607f761e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/texture/TextureProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/texture/TextureProvider.java @@ -2,13 +2,9 @@ import ru.gravit.launcher.profiles.Texture; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; import java.io.IOException; -import java.util.Map; -import java.util.Objects; import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; public abstract class TextureProvider implements AutoCloseable { public static ProviderMap providers = new ProviderMap<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/components/CommandRemoverComponent.java b/LaunchServer/src/main/java/ru/gravit/launchserver/components/CommandRemoverComponent.java index 68863341..283bea13 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/components/CommandRemoverComponent.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/components/CommandRemoverComponent.java @@ -30,7 +30,7 @@ public void postInit(LaunchServer launchServer) { } @Override - public void close() throws Exception { + public void close() { for (Map.Entry e : commandsList.entrySet()) { LaunchServer.server.commandHandler.registerCommand(e.getKey(), e.getValue()); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/components/Component.java b/LaunchServer/src/main/java/ru/gravit/launchserver/components/Component.java index 5bb117a6..6c194cb2 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/components/Component.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/components/Component.java @@ -2,11 +2,6 @@ import ru.gravit.launchserver.LaunchServer; import ru.gravit.utils.ProviderMap; -import ru.gravit.utils.helper.VerifyHelper; - -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; public abstract class Component { public static ProviderMap providers = new ProviderMap<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/ResponseThread.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/ResponseThread.java index 91dab3af..ecc22283 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/ResponseThread.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/ResponseThread.java @@ -5,9 +5,9 @@ import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HOutput; import ru.gravit.launchserver.LaunchServer; +import ru.gravit.launchserver.legacy.Response; import ru.gravit.launchserver.manangers.SessionManager; import ru.gravit.launchserver.manangers.hook.SocketHookManager; -import ru.gravit.launchserver.legacy.Response; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.SecurityHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/LauncherNettyServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/LauncherNettyServer.java index b3de5816..29725e9c 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/LauncherNettyServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/LauncherNettyServer.java @@ -53,7 +53,7 @@ public ChannelFuture bind(InetSocketAddress address) } @Override - public void close() throws Exception { + public void close() { workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/NettyServerSocketHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/NettyServerSocketHandler.java index 9b4c79f6..d33ef123 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/NettyServerSocketHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/NettyServerSocketHandler.java @@ -1,25 +1,9 @@ package ru.gravit.launchserver.websocket; -import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; -import io.netty.channel.socket.nio.NioServerSocketChannel; -import io.netty.channel.socket.nio.NioSocketChannel; -import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.HttpServerCodec; -import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; -import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketServerCompressionHandler; -import io.netty.handler.logging.LogLevel; -import io.netty.handler.logging.LoggingHandler; import ru.gravit.launcher.ssl.LauncherKeyStore; import ru.gravit.launcher.ssl.LauncherTrustManager; import ru.gravit.launchserver.LaunchServer; -import ru.gravit.launchserver.websocket.fileserver.FileServerHandler; import ru.gravit.launchserver.legacy.Response; -import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.VerifyHelper; @@ -32,17 +16,12 @@ import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; -import java.nio.channels.Selector; -import java.nio.channels.ServerSocketChannel; import java.security.*; import java.security.cert.CertificateException; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/EchoResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/EchoResponse.java index 9643297d..257af457 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/EchoResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/EchoResponse.java @@ -3,7 +3,6 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launcher.events.request.EchoRequestEvent; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; import ru.gravit.utils.helper.LogHelper; public class EchoResponse extends SimpleResponse { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/JsonResponseInterface.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/JsonResponseInterface.java index ae169826..58f74d51 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/JsonResponseInterface.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/JsonResponseInterface.java @@ -2,7 +2,6 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; public interface JsonResponseInterface { String getType(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/SimpleResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/SimpleResponse.java index e15b8382..9e3e4741 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/SimpleResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/SimpleResponse.java @@ -3,7 +3,6 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.events.request.ErrorRequestEvent; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; import ru.gravit.launchserver.websocket.WebSocketService; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/AddLogListenerResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/AddLogListenerResponse.java index 844ed685..2cd70607 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/AddLogListenerResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/AddLogListenerResponse.java @@ -1,10 +1,8 @@ package ru.gravit.launchserver.websocket.json.admin; import io.netty.channel.ChannelHandlerContext; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.LogEvent; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.utils.helper.LogHelper; @@ -17,7 +15,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { if (!client.isAuth) { sendError("Access denied"); return; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ExecCommandResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ExecCommandResponse.java index 6b79e2ce..50059923 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ExecCommandResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/admin/ExecCommandResponse.java @@ -1,12 +1,9 @@ package ru.gravit.launchserver.websocket.json.admin; import io.netty.channel.ChannelHandlerContext; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.ExecCommandRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; public class ExecCommandResponse extends SimpleResponse { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/AuthResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/AuthResponse.java index 89caf727..1ff9a85f 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/AuthResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/AuthResponse.java @@ -3,7 +3,6 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launcher.OshiHWID; import ru.gravit.launcher.events.request.AuthRequestEvent; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.auth.AuthException; @@ -12,8 +11,6 @@ import ru.gravit.launchserver.auth.provider.AuthProvider; import ru.gravit.launchserver.auth.provider.AuthProviderResult; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.launchserver.websocket.json.profile.ProfileByUUIDResponse; import ru.gravit.utils.helper.IOHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/CheckServerResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/CheckServerResponse.java index e83d6744..f21d8a38 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/CheckServerResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/CheckServerResponse.java @@ -2,12 +2,9 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launcher.events.request.CheckServerRequestEvent; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.auth.AuthException; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.launchserver.websocket.json.profile.ProfileByUUIDResponse; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/GetAvailabilityAuthResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/GetAvailabilityAuthResponse.java index 64a32541..1c2358a6 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/GetAvailabilityAuthResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/GetAvailabilityAuthResponse.java @@ -5,8 +5,6 @@ import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.auth.AuthProviderPair; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import java.util.ArrayList; @@ -19,7 +17,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { List list = new ArrayList<>(); for(AuthProviderPair pair : LaunchServer.server.config.auth) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/JoinServerResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/JoinServerResponse.java index 03fc292c..e0abb1be 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/JoinServerResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/JoinServerResponse.java @@ -1,13 +1,10 @@ package ru.gravit.launchserver.websocket.json.auth; import io.netty.channel.ChannelHandlerContext; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.JoinServerRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.auth.AuthException; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/ProfilesResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/ProfilesResponse.java index 4394154f..6f301057 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/ProfilesResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/ProfilesResponse.java @@ -3,15 +3,10 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.ProfilesRequestEvent; -import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; -import java.util.List; - public class ProfilesResponse extends SimpleResponse { @Override public String getType() { @@ -19,7 +14,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { if (!client.checkSign && !client.isAuth) { service.sendObject(ctx, new ErrorRequestEvent("Access denied")); return; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/RestoreSessionResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/RestoreSessionResponse.java index 3c12ee00..6ba2827e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/RestoreSessionResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/RestoreSessionResponse.java @@ -2,13 +2,10 @@ import io.netty.channel.ChannelHandlerContext; import ru.gravit.launcher.LauncherNetworkAPI; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.RestoreSessionRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; import ru.gravit.launchserver.websocket.WebSocketFrameHandler; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; public class RestoreSessionResponse extends SimpleResponse { @@ -20,7 +17,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { Client rClient = LaunchServer.server.sessionManager.getClient(session); if(rClient == null) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/SetProfileResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/SetProfileResponse.java index ab01f37f..b57986d4 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/SetProfileResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/auth/SetProfileResponse.java @@ -1,13 +1,10 @@ package ru.gravit.launchserver.websocket.json.auth; import io.netty.channel.ChannelHandlerContext; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.SetProfileRequestEvent; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import java.util.Collection; @@ -21,7 +18,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { if (!client.isAuth) { sendError("Access denied"); return; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/BatchProfileByUsername.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/BatchProfileByUsername.java index 1d23aa4e..471fbd2a 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/BatchProfileByUsername.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/BatchProfileByUsername.java @@ -5,8 +5,6 @@ import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUUIDResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUUIDResponse.java index 2a5b0b89..7caa4c65 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUUIDResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUUIDResponse.java @@ -5,10 +5,8 @@ import ru.gravit.launcher.profiles.PlayerProfile; import ru.gravit.launcher.profiles.Texture; import ru.gravit.launchserver.LaunchServer; -import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.auth.texture.TextureProvider; +import ru.gravit.launchserver.socket.Client; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUsername.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUsername.java index bddfb0df..acb3ec20 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUsername.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/profile/ProfileByUsername.java @@ -4,8 +4,6 @@ import ru.gravit.launcher.events.request.ProfileByUsernameRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/GetSecureTokenResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/GetSecureTokenResponse.java index ebddfa74..7203fabd 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/GetSecureTokenResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/GetSecureTokenResponse.java @@ -4,8 +4,6 @@ import ru.gravit.launcher.events.request.GetSecureTokenRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; public class GetSecureTokenResponse extends SimpleResponse { @@ -15,7 +13,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { String secureToken = LaunchServer.server.config.protectHandler.generateClientSecureToken(); client.verifyToken = secureToken; sendResult(new GetSecureTokenRequestEvent(secureToken)); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/VerifySecureTokenResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/VerifySecureTokenResponse.java index 0c6d2172..534c477d 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/VerifySecureTokenResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/secure/VerifySecureTokenResponse.java @@ -4,8 +4,6 @@ import ru.gravit.launcher.events.request.VerifySecureTokenRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; public class VerifySecureTokenResponse extends SimpleResponse { @@ -17,7 +15,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { boolean success = LaunchServer.server.config.protectHandler.verifyClientSecureToken(secureToken, client.verifyToken); if(success) client.isSecure = true; sendResult(new VerifySecureTokenRequestEvent(success)); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/LauncherResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/LauncherResponse.java index 293a308e..f31aa3b9 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/LauncherResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/LauncherResponse.java @@ -1,12 +1,9 @@ package ru.gravit.launchserver.websocket.json.update; import io.netty.channel.ChannelHandlerContext; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.LauncherRequestEvent; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import ru.gravit.utils.Version; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateListResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateListResponse.java index ea15b5ec..437e7ec5 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateListResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateListResponse.java @@ -1,14 +1,11 @@ package ru.gravit.launchserver.websocket.json.update; import io.netty.channel.ChannelHandlerContext; -import ru.gravit.launcher.events.request.ErrorRequestEvent; import ru.gravit.launcher.events.request.UpdateListRequestEvent; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.serialize.signed.SignedObjectHolder; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; import java.util.HashSet; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java index 4a051037..6641e9f0 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/websocket/json/update/UpdateResponse.java @@ -8,8 +8,6 @@ import ru.gravit.launcher.serialize.signed.SignedObjectHolder; import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.socket.Client; -import ru.gravit.launchserver.websocket.WebSocketService; -import ru.gravit.launchserver.websocket.json.JsonResponseInterface; import ru.gravit.launchserver.websocket.json.SimpleResponse; public class UpdateResponse extends SimpleResponse { @@ -21,7 +19,7 @@ public String getType() { } @Override - public void execute(ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(ChannelHandlerContext ctx, Client client) { if (!client.isAuth || client.type != Client.Type.USER || client.profile == null) { sendError("Access denied"); return; diff --git a/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java b/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java index 58b253aa..f42740fc 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java +++ b/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java @@ -1,5 +1,12 @@ package ru.gravit.launcher; +import cpw.mods.fml.SafeExitJVMLegacy; +import net.minecraftforge.fml.SafeExitJVM; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.MethodNode; import ru.gravit.utils.NativeJVMHalt; import ru.gravit.utils.helper.LogHelper; @@ -11,15 +18,6 @@ import java.util.List; import java.util.jar.JarFile; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.ClassNode; -import org.objectweb.asm.tree.InsnNode; -import org.objectweb.asm.tree.MethodNode; - -import cpw.mods.fml.SafeExitJVMLegacy; -import net.minecraftforge.fml.SafeExitJVM; - import static org.objectweb.asm.Opcodes.*; @LauncherAPI diff --git a/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java index 0cfa6f86..ba305697 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/ru/gravit/launcher/LauncherEngine.java @@ -1,14 +1,11 @@ package ru.gravit.launcher; -import com.google.gson.GsonBuilder; import ru.gravit.launcher.client.ClientModuleManager; import ru.gravit.launcher.client.DirBridge; import ru.gravit.launcher.client.FunctionalBridge; import ru.gravit.launcher.guard.LauncherGuardManager; import ru.gravit.launcher.gui.JSRuntimeProvider; import ru.gravit.launcher.gui.RuntimeProvider; -import ru.gravit.launcher.hasher.HashedEntry; -import ru.gravit.launcher.hasher.HashedEntryAdapter; import ru.gravit.launcher.managers.ClientGsonManager; import ru.gravit.launcher.request.Request; import ru.gravit.launcher.request.websockets.StandartClientWebSocketService; diff --git a/Launcher/src/main/java/ru/gravit/launcher/NewLauncherSettings.java b/Launcher/src/main/java/ru/gravit/launcher/NewLauncherSettings.java index 3f7f43bf..7fa38e55 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/NewLauncherSettings.java +++ b/Launcher/src/main/java/ru/gravit/launcher/NewLauncherSettings.java @@ -4,7 +4,9 @@ import ru.gravit.launcher.profiles.ClientProfile; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; public class NewLauncherSettings { @LauncherAPI diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index 8f54ada5..a1b9d968 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -1,11 +1,11 @@ package ru.gravit.launcher.client; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import ru.gravit.launcher.*; import ru.gravit.launcher.guard.LauncherGuardManager; import ru.gravit.launcher.gui.JSRuntimeProvider; -import ru.gravit.launcher.hasher.*; +import ru.gravit.launcher.hasher.DirWatcher; +import ru.gravit.launcher.hasher.FileNameMatcher; +import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.managers.ClientGsonManager; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.profiles.PlayerProfile; diff --git a/Launcher/src/main/java/ru/gravit/launcher/gui/JSRuntimeProvider.java b/Launcher/src/main/java/ru/gravit/launcher/gui/JSRuntimeProvider.java index 8559dd81..9e8e9a31 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/gui/JSRuntimeProvider.java +++ b/Launcher/src/main/java/ru/gravit/launcher/gui/JSRuntimeProvider.java @@ -1,7 +1,10 @@ package ru.gravit.launcher.gui; import ru.gravit.launcher.*; -import ru.gravit.launcher.client.*; +import ru.gravit.launcher.client.ClientLauncher; +import ru.gravit.launcher.client.DirBridge; +import ru.gravit.launcher.client.FunctionalBridge; +import ru.gravit.launcher.client.ServerPinger; import ru.gravit.launcher.hasher.FileNameMatcher; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.hasher.HashedEntry; diff --git a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java index 42c6ee3b..bd1b49ca 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java +++ b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java @@ -10,11 +10,9 @@ import ru.gravit.utils.helper.IOHelper; import java.io.IOException; -import java.io.InputStream; import java.lang.reflect.Type; import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; -import java.util.Map; public class SettingsManager extends JsonConfigurable { public class StoreFileVisitor extends SimpleFileVisitor { diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/StandartClientWebSocketService.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/StandartClientWebSocketService.java index 5564d6f3..22c84ea0 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/StandartClientWebSocketService.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/StandartClientWebSocketService.java @@ -9,7 +9,9 @@ import ru.gravit.utils.helper.LogHelper; import java.io.IOException; -import java.util.concurrent.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; public class StandartClientWebSocketService extends ClientWebSocketService { public WaitEventHandler waitEventHandler = new WaitEventHandler(); diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index fbeb6827..872fc72d 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -1,7 +1,5 @@ package ru.gravit.launcher.server; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import ru.gravit.launcher.ClientPermissions; import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherConfig; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java index f8519c25..aeaf1a88 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/Launcher.java @@ -1,7 +1,5 @@ package ru.gravit.launcher; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import ru.gravit.launcher.managers.GsonManager; import ru.gravit.launcher.modules.ModulesManager; import ru.gravit.launcher.profiles.ClientProfile; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/ExceptionEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/ExceptionEvent.java index 961335aa..5bde798d 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/ExceptionEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/ExceptionEvent.java @@ -1,7 +1,5 @@ package ru.gravit.launcher.events; -import ru.gravit.launcher.events.RequestEvent; - public class ExceptionEvent extends RequestEvent { public ExceptionEvent(Exception e) { this.message = e.getMessage(); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java index d47f9473..0c9eb407 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/AuthRequestEvent.java @@ -4,7 +4,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java index 97f3846a..2ca6fb6f 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/BatchProfileByUsernameRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerRequestEvent.java index 6ed8ee73..0340cda2 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/CheckServerRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/EchoRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/EchoRequestEvent.java index ef914314..6d57bb04 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/EchoRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/EchoRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ErrorRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ErrorRequestEvent.java index dabe290c..e5101a12 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ErrorRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ErrorRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ExecCommandRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ExecCommandRequestEvent.java index 65536551..e75d5bad 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ExecCommandRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ExecCommandRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; public class ExecCommandRequestEvent extends RequestEvent { @Override diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java index ab1798e8..af3f068e 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetAvailabilityAuthRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; import java.util.List; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetSecureTokenRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetSecureTokenRequestEvent.java index 27685edf..936cae82 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetSecureTokenRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/GetSecureTokenRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; public class GetSecureTokenRequestEvent extends RequestEvent { @LauncherNetworkAPI diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java index 0a65ede4..d0a88141 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/JoinServerRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java index 03544636..a8c51c03 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/LauncherRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java index 5b374e48..40b14f05 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUUIDRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java index 6a7ac737..c630f27c 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfileByUsernameRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.PlayerProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java index c51ef256..edfae7b3 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/ProfilesRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.ClientProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.List; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/SetProfileRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/SetProfileRequestEvent.java index 349705a4..a1bde862 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/SetProfileRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/SetProfileRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.profiles.ClientProfile; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.UUID; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java index 4079a4a2..0c851812 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateListRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; import ru.gravit.utils.event.EventInterface; import java.util.HashSet; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateRequestEvent.java index 69523ff5..6f49c758 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/UpdateRequestEvent.java @@ -3,7 +3,6 @@ import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.events.RequestEvent; import ru.gravit.launcher.hasher.HashedDir; -import ru.gravit.launcher.request.ResultInterface; public class UpdateRequestEvent extends RequestEvent { @LauncherNetworkAPI diff --git a/libLauncher/src/main/java/ru/gravit/launcher/events/request/VerifySecureTokenRequestEvent.java b/libLauncher/src/main/java/ru/gravit/launcher/events/request/VerifySecureTokenRequestEvent.java index 7de245de..6eb67e15 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/events/request/VerifySecureTokenRequestEvent.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/events/request/VerifySecureTokenRequestEvent.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.events.RequestEvent; -import ru.gravit.launcher.request.ResultInterface; public class VerifySecureTokenRequestEvent extends RequestEvent { @LauncherAPI diff --git a/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java b/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java index e17840a9..f5373c81 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java +++ b/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java @@ -4,7 +4,9 @@ import ru.gravit.utils.helper.LogHelper; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public abstract class CommandHandler implements Runnable { private final List categories = new ArrayList<>(); diff --git a/libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java b/libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java index e04b5a8e..230b76ac 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java +++ b/libLauncher/src/main/java/ru/gravit/utils/config/JsonConfigurable.java @@ -2,7 +2,6 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherAPI; -import ru.gravit.utils.Version; import ru.gravit.utils.helper.IOHelper; import java.io.BufferedReader; diff --git a/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java b/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java index 46b06276..e1249504 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java +++ b/libLauncher/src/main/java/ru/gravit/utils/helper/IOHelper.java @@ -10,8 +10,8 @@ import java.net.*; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.nio.file.FileSystem; import java.nio.file.*; +import java.nio.file.FileSystem; import java.nio.file.attribute.BasicFileAttributes; import java.util.Collections; import java.util.Set;