mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[ANY] Organize imports.
This commit is contained in:
parent
3bfb3881d2
commit
a4d4aa834d
248 changed files with 1457 additions and 1078 deletions
|
@ -1,6 +1,49 @@
|
|||
package pro.gravit.launchserver;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.lang.ProcessBuilder.Redirect;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.security.KeyPair;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.zip.CRC32;
|
||||
|
||||
import io.netty.handler.logging.LogLevel;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.LauncherConfig;
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launcher.config.JsonConfigurable;
|
||||
import pro.gravit.launcher.hasher.HashedDir;
|
||||
import pro.gravit.launcher.managers.ConfigManager;
|
||||
import pro.gravit.launcher.managers.GarbageManager;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.launcher.serialize.signed.SignedObjectHolder;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
import pro.gravit.launchserver.auth.handler.AuthHandler;
|
||||
import pro.gravit.launchserver.auth.handler.MemoryAuthHandler;
|
||||
|
@ -15,47 +58,36 @@
|
|||
import pro.gravit.launchserver.auth.provider.RejectAuthProvider;
|
||||
import pro.gravit.launchserver.auth.texture.RequestTextureProvider;
|
||||
import pro.gravit.launchserver.auth.texture.TextureProvider;
|
||||
import pro.gravit.launchserver.binary.*;
|
||||
import pro.gravit.launchserver.binary.EXEL4JLauncherBinary;
|
||||
import pro.gravit.launchserver.binary.EXELauncherBinary;
|
||||
import pro.gravit.launchserver.binary.JARLauncherBinary;
|
||||
import pro.gravit.launchserver.binary.LauncherBinary;
|
||||
import pro.gravit.launchserver.binary.ProguardConf;
|
||||
import pro.gravit.launchserver.components.AuthLimiterComponent;
|
||||
import pro.gravit.launchserver.components.Component;
|
||||
import pro.gravit.launchserver.config.LaunchServerRuntimeConfig;
|
||||
import pro.gravit.launchserver.legacy.Response;
|
||||
import pro.gravit.launchserver.manangers.*;
|
||||
import pro.gravit.launchserver.manangers.LaunchServerGsonManager;
|
||||
import pro.gravit.launchserver.manangers.MirrorManager;
|
||||
import pro.gravit.launchserver.manangers.ModulesManager;
|
||||
import pro.gravit.launchserver.manangers.ReconfigurableManager;
|
||||
import pro.gravit.launchserver.manangers.ReloadManager;
|
||||
import pro.gravit.launchserver.manangers.SessionManager;
|
||||
import pro.gravit.launchserver.manangers.hook.AuthHookManager;
|
||||
import pro.gravit.launchserver.manangers.hook.BuildHookManager;
|
||||
import pro.gravit.launchserver.manangers.hook.SocketHookManager;
|
||||
import pro.gravit.launchserver.socket.ServerSocketHandler;
|
||||
import pro.gravit.launchserver.websocket.NettyServerSocketHandler;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.LauncherConfig;
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launcher.config.JsonConfigurable;
|
||||
import pro.gravit.launcher.hasher.HashedDir;
|
||||
import pro.gravit.launcher.managers.ConfigManager;
|
||||
import pro.gravit.launcher.managers.GarbageManager;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.launcher.serialize.signed.SignedObjectHolder;
|
||||
import pro.gravit.utils.helper.*;
|
||||
import pro.gravit.utils.Version;
|
||||
import pro.gravit.utils.command.CommandHandler;
|
||||
import pro.gravit.utils.command.JLineCommandHandler;
|
||||
import pro.gravit.utils.command.StdCommandHandler;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.ProcessBuilder.Redirect;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.file.*;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.security.KeyPair;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.zip.CRC32;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.JVMHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
public final class LaunchServer implements Runnable, AutoCloseable, Reloadable {
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,12 @@
|
|||
|
||||
import java.io.IOException;
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import java.nio.file.*;
|
||||
import java.nio.file.FileVisitOption;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.nio.file.attribute.PosixFileAttributeView;
|
||||
import java.nio.file.attribute.PosixFilePermission;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package pro.gravit.launchserver.asm;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -13,6 +8,12 @@
|
|||
import java.util.List;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
/**
|
||||
* Позволяет искать методы внутри незагруженных классов и общие суперклассы для
|
||||
* чего угодно. Работает через поиск class-файлов в classpath.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.asm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* ClassWriter с другой реализацией метода getCommonSuperClass: при его
|
||||
* использовании не происходит загрузки классов.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.auth;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launchserver.auth.handler.AuthHandler;
|
||||
import pro.gravit.launchserver.auth.provider.AuthProvider;
|
||||
import pro.gravit.launchserver.auth.texture.TextureProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class AuthProviderPair {
|
||||
public AuthProvider provider;
|
||||
public AuthHandler handler;
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
package pro.gravit.launchserver.auth;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import com.mysql.cj.jdbc.MysqlDataSource;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public final class MySQLSourceConfig implements AutoCloseable {
|
||||
|
||||
public static final int TIMEOUT = VerifyHelper.verifyInt(
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.launchserver.auth.provider.AuthProviderResult;
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.launchserver.auth.provider.AuthProviderResult;
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
public abstract class AuthHandler implements AutoCloseable {
|
||||
public static ProviderMap<AuthHandler> providers = new ProviderMap<>("AuthHandler");
|
||||
private static boolean registredHandl = false;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.launchserver.auth.provider.AuthProviderResult;
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launchserver.auth.provider.AuthProviderResult;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
public abstract class CachedAuthHandler extends AuthHandler implements NeedGarbageCollection {
|
||||
public static final class Entry {
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.utils.HTTPRequest;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.utils.HTTPRequest;
|
||||
|
||||
public class JsonAuthHandler extends CachedAuthHandler {
|
||||
public URL getUrl;
|
||||
public URL updateAuthUrl;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
public final class MemoryAuthHandler extends CachedAuthHandler {
|
||||
private static String toUsername(UUID uuid) {
|
||||
byte[] bytes = ByteBuffer.allocate(16).
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.launchserver.auth.MySQLSourceConfig;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
|
@ -10,6 +7,9 @@
|
|||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launchserver.auth.MySQLSourceConfig;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class MySQLAuthHandler extends CachedAuthHandler {
|
||||
private MySQLSourceConfig mySQLHolder;
|
||||
private String uuidColumn;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.launchserver.auth.provider.AuthProviderResult;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launchserver.auth.provider.AuthProviderResult;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
public final class NullAuthHandler extends AuthHandler {
|
||||
private volatile AuthHandler handler;
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package pro.gravit.launchserver.auth.handler;
|
||||
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class RequestAuthHandler extends CachedAuthHandler {
|
||||
private String usernameFetch;
|
||||
private String uuidFetch;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.auth.hwid;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
|
||||
public class AcceptHWIDHandler extends HWIDHandler {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.auth.hwid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class HWIDHandler implements AutoCloseable {
|
||||
public static ProviderMap<HWIDHandler> providers = new ProviderMap<>("HWIDHandler");
|
||||
private static boolean registredHandl = false;
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
package pro.gravit.launchserver.auth.hwid;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
|
@ -16,6 +10,13 @@
|
|||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class JsonFileHWIDHandler extends HWIDHandler {
|
||||
public class Entry {
|
||||
public HWID hwid;
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
package pro.gravit.launchserver.auth.hwid;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launcher.OshiHWID;
|
||||
import pro.gravit.utils.HTTPRequest;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launcher.OshiHWID;
|
||||
import pro.gravit.utils.HTTPRequest;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class JsonHWIDHandler extends HWIDHandler {
|
||||
private static final Gson gson = new Gson();
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.auth.hwid;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
|
||||
public class MemoryHWIDHandler extends HWIDHandler {
|
||||
public class Entry {
|
||||
public HWID hwid;
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
package pro.gravit.launchserver.auth.hwid;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launcher.OshiHWID;
|
||||
import pro.gravit.launchserver.auth.MySQLSourceConfig;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
@ -13,6 +7,12 @@
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launcher.OshiHWID;
|
||||
import pro.gravit.launchserver.auth.MySQLSourceConfig;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class MysqlHWIDHandler extends HWIDHandler {
|
||||
private MySQLSourceConfig mySQLHolder;
|
||||
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
package pro.gravit.launchserver.auth.permissions;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.Reloadable;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
|
@ -16,6 +9,14 @@
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.Reloadable;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class JsonFilePermissionsHandler extends PermissionsHandler implements Reloadable {
|
||||
public String filename = "permissions.json";
|
||||
public static Map<String, ClientPermissions> map;
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
package pro.gravit.launchserver.auth.permissions;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.Reloadable;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
|
@ -16,6 +9,14 @@
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.Reloadable;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class JsonLongFilePermissionsHandler extends PermissionsHandler implements Reloadable {
|
||||
public String filename = "permissions.json";
|
||||
public long defaultPerms = 0L;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.auth.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class AuthProvider implements AutoCloseable {
|
||||
public static ProviderMap<AuthProvider> providers = new ProviderMap<>("AuthProvider");
|
||||
private static boolean registredProv = false;
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package pro.gravit.launchserver.auth.provider;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.utils.HTTPRequest;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.utils.HTTPRequest;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
public final class JsonAuthProvider extends AuthProvider {
|
||||
private static Gson gson = new Gson();
|
||||
private URL url;
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package pro.gravit.launchserver.auth.provider;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
|
@ -8,11 +13,6 @@
|
|||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public final class MySQLAuthProvider extends AuthProvider {
|
||||
private MySQLSourceConfig mySQLHolder;
|
||||
private String query;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.auth.provider;
|
||||
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
public final class NullAuthProvider extends AuthProvider {
|
||||
private volatile AuthProvider provider;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.auth.provider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pro.gravit.launchserver.Reconfigurable;
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public final class RejectAuthProvider extends AuthProvider implements Reconfigurable {
|
||||
public RejectAuthProvider() {
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package pro.gravit.launchserver.auth.provider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import pro.gravit.launcher.ClientPermissions;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
|
@ -7,11 +12,6 @@
|
|||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public final class RequestAuthProvider extends AuthProvider {
|
||||
private String url;
|
||||
private transient Pattern pattern;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.auth.texture;
|
||||
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
public final class NullTextureProvider extends TextureProvider {
|
||||
private volatile TextureProvider provider;
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.auth.texture;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class RequestTextureProvider extends TextureProvider {
|
||||
public RequestTextureProvider() {
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.auth.texture;
|
||||
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
import pro.gravit.utils.ProviderMap;
|
||||
|
||||
public abstract class TextureProvider implements AutoCloseable {
|
||||
public static ProviderMap<TextureProvider> providers = new ProviderMap<>("TextureProvider");
|
||||
private static boolean registredProv = false;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package pro.gravit.launchserver.auth.texture;
|
||||
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.profiles.Texture;
|
||||
|
||||
public final class VoidTextureProvider extends TextureProvider {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import pro.gravit.launchserver.binary.tasks.MainBuildTask;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashSet;
|
||||
|
@ -11,6 +8,9 @@
|
|||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import pro.gravit.launchserver.binary.tasks.MainBuildTask;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
public class BuildContext {
|
||||
public final ZipOutputStream output;
|
||||
public final JAConfigurator config;
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import net.sf.launch4j.Builder;
|
||||
import net.sf.launch4j.Log;
|
||||
import net.sf.launch4j.config.*;
|
||||
import net.sf.launch4j.config.Config;
|
||||
import net.sf.launch4j.config.ConfigPersister;
|
||||
import net.sf.launch4j.config.Jre;
|
||||
import net.sf.launch4j.config.LanguageID;
|
||||
import net.sf.launch4j.config.VersionInfo;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.Version;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public final class EXEL4JLauncherBinary extends LauncherBinary {
|
||||
private final static class Launch4JLog extends Log {
|
||||
private static final Launch4JLog INSTANCE = new Launch4JLog();
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
public class EXELauncherBinary extends LauncherBinary {
|
||||
|
||||
public EXELauncherBinary(LaunchServer server) {
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import javassist.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import javassist.CannotCompileException;
|
||||
import javassist.ClassPool;
|
||||
import javassist.CtClass;
|
||||
import javassist.CtConstructor;
|
||||
import javassist.CtMethod;
|
||||
import javassist.NotFoundException;
|
||||
import pro.gravit.launcher.LauncherConfig;
|
||||
import pro.gravit.launchserver.binary.tasks.MainBuildTask;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class JAConfigurator implements AutoCloseable {
|
||||
public ClassPool pool;
|
||||
public CtClass ctClass;
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import pro.gravit.launchserver.binary.tasks.*;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.binary.tasks.*;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
@ -15,6 +7,19 @@
|
|||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.binary.tasks.AdditionalFixesApplyTask;
|
||||
import pro.gravit.launchserver.binary.tasks.AttachJarsTask;
|
||||
import pro.gravit.launchserver.binary.tasks.LauncherBuildTask;
|
||||
import pro.gravit.launchserver.binary.tasks.MainBuildTask;
|
||||
import pro.gravit.launchserver.binary.tasks.PrepareBuildTask;
|
||||
import pro.gravit.launchserver.binary.tasks.ProGuardBuildTask;
|
||||
import pro.gravit.launchserver.binary.tasks.RadonBuildTask;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class JARLauncherBinary extends LauncherBinary {
|
||||
public final AtomicLong count;
|
||||
public final Path runtimeDir;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import pro.gravit.launcher.serialize.signed.DigestBytesHolder;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public abstract class LauncherBinary {
|
||||
public final LaunchServer server;
|
||||
public final Path syncBinaryFile;
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
package pro.gravit.launchserver.binary;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
@ -15,6 +9,12 @@
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
public class ProguardConf {
|
||||
private static final String chars = "1aAbBcC2dDeEfF3gGhHiI4jJkKl5mMnNoO6pPqQrR7sStT8uUvV9wWxX0yYzZ";
|
||||
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
package pro.gravit.launchserver.binary.tasks;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.asm.ClassMetadataReader;
|
||||
import pro.gravit.launchserver.asm.SafeClassWriter;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
@ -19,6 +11,15 @@
|
|||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.asm.ClassMetadataReader;
|
||||
import pro.gravit.launchserver.asm.SafeClassWriter;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
public class AdditionalFixesApplyTask implements LauncherBuildTask {
|
||||
private final LaunchServer server;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package pro.gravit.launchserver.binary.tasks;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
|
@ -12,6 +8,10 @@
|
|||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class AttachJarsTask implements LauncherBuildTask {
|
||||
private final LaunchServer srv;
|
||||
private final List<Path> jars;
|
||||
|
|
|
@ -1,18 +1,6 @@
|
|||
package pro.gravit.launchserver.binary.tasks;
|
||||
|
||||
import javassist.CannotCompileException;
|
||||
import javassist.NotFoundException;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.asm.ClassMetadataReader;
|
||||
import pro.gravit.launchserver.binary.BuildContext;
|
||||
import pro.gravit.launchserver.binary.JAConfigurator;
|
||||
import pro.gravit.launcher.AutogenConfig;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.LauncherConfig;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import static pro.gravit.utils.helper.IOHelper.newZipEntry;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -28,7 +16,19 @@
|
|||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import static pro.gravit.utils.helper.IOHelper.newZipEntry;
|
||||
import javassist.CannotCompileException;
|
||||
import javassist.NotFoundException;
|
||||
import pro.gravit.launcher.AutogenConfig;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.LauncherConfig;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.asm.ClassMetadataReader;
|
||||
import pro.gravit.launchserver.binary.BuildContext;
|
||||
import pro.gravit.launchserver.binary.JAConfigurator;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
public class MainBuildTask implements LauncherBuildTask {
|
||||
private final LaunchServer server;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
package pro.gravit.launchserver.binary.tasks;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
|
@ -13,6 +8,11 @@
|
|||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
public class PrepareBuildTask implements LauncherBuildTask {
|
||||
private final LaunchServer server;
|
||||
private final Path result;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.binary.tasks;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import proguard.Configuration;
|
||||
import proguard.ConfigurationParser;
|
||||
import proguard.ParseException;
|
||||
import proguard.ProGuard;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class ProGuardBuildTask implements LauncherBuildTask {
|
||||
private final LaunchServer server;
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
package pro.gravit.launchserver.binary.tasks;
|
||||
|
||||
import me.itzsomebody.radon.Radon;
|
||||
import me.itzsomebody.radon.SessionInfo;
|
||||
import me.itzsomebody.radon.config.ConfigurationParser;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -14,6 +7,13 @@
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import me.itzsomebody.radon.Radon;
|
||||
import me.itzsomebody.radon.SessionInfo;
|
||||
import me.itzsomebody.radon.config.ConfigurationParser;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.UnpackHelper;
|
||||
|
||||
public class RadonBuildTask implements LauncherBuildTask {
|
||||
private final LaunchServer srv;
|
||||
public final Path config;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package pro.gravit.launchserver.command.auth;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
import pro.gravit.launchserver.auth.provider.AuthProvider;
|
||||
|
@ -7,8 +9,6 @@
|
|||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public final class AuthCommand extends Command {
|
||||
public AuthCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.auth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BanCommand extends Command {
|
||||
public BanCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.command.auth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GetHWIDCommand extends Command {
|
||||
public GetHWIDCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package pro.gravit.launchserver.command.auth;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.command.CommandException;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class UUIDToUsernameCommand extends Command {
|
||||
public UUIDToUsernameCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.auth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.HWID;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UnbanCommand extends Command {
|
||||
public UnbanCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package pro.gravit.launchserver.command.auth;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.command.CommandException;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class UsernameToUUIDCommand extends Command {
|
||||
public UsernameToUUIDCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.basic;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
public class ProguardCleanCommand extends Command {
|
||||
public ProguardCleanCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.command.basic;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RegenProguardDictCommand extends Command {
|
||||
|
||||
public RegenProguardDictCommand(LaunchServer server) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.basic;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
public class RemoveMappingsProguardCommand extends Command {
|
||||
|
||||
public RemoveMappingsProguardCommand(LaunchServer server) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.command.basic;
|
||||
|
||||
import pro.gravit.launchserver.websocket.NettyServerSocketHandler;
|
||||
import pro.gravit.launchserver.websocket.WebSocketFrameHandler;
|
||||
import pro.gravit.launcher.events.PingEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.launchserver.websocket.NettyServerSocketHandler;
|
||||
import pro.gravit.launchserver.websocket.WebSocketFrameHandler;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
|
||||
public class TestCommand extends Command {
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package pro.gravit.launchserver.command.dump;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
|
@ -8,12 +14,6 @@
|
|||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DumpEntryCacheCommand extends Command {
|
||||
public DumpEntryCacheCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
package pro.gravit.launchserver.command.dump;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.lang.reflect.Type;
|
||||
|
@ -15,6 +7,15 @@
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class DumpSessionsCommand extends Command {
|
||||
public DumpSessionsCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,20 +1,46 @@
|
|||
package pro.gravit.launchserver.command.handler;
|
||||
|
||||
import pro.gravit.launchserver.command.auth.*;
|
||||
import pro.gravit.launchserver.command.basic.*;
|
||||
import pro.gravit.launchserver.command.hash.*;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.auth.AuthCommand;
|
||||
import pro.gravit.launchserver.command.auth.BanCommand;
|
||||
import pro.gravit.launchserver.command.auth.GetHWIDCommand;
|
||||
import pro.gravit.launchserver.command.auth.UUIDToUsernameCommand;
|
||||
import pro.gravit.launchserver.command.auth.UnbanCommand;
|
||||
import pro.gravit.launchserver.command.auth.UsernameToUUIDCommand;
|
||||
import pro.gravit.launchserver.command.basic.BuildCommand;
|
||||
import pro.gravit.launchserver.command.basic.LogConnectionsCommand;
|
||||
import pro.gravit.launchserver.command.basic.ProguardCleanCommand;
|
||||
import pro.gravit.launchserver.command.basic.RebindCommand;
|
||||
import pro.gravit.launchserver.command.basic.RegenProguardDictCommand;
|
||||
import pro.gravit.launchserver.command.basic.RemoveMappingsProguardCommand;
|
||||
import pro.gravit.launchserver.command.basic.RestartCommand;
|
||||
import pro.gravit.launchserver.command.basic.StopCommand;
|
||||
import pro.gravit.launchserver.command.basic.TestCommand;
|
||||
import pro.gravit.launchserver.command.basic.VersionCommand;
|
||||
import pro.gravit.launchserver.command.dump.DumpEntryCacheCommand;
|
||||
import pro.gravit.launchserver.command.dump.DumpSessionsCommand;
|
||||
import pro.gravit.launchserver.command.hash.DownloadAssetCommand;
|
||||
import pro.gravit.launchserver.command.hash.DownloadClientCommand;
|
||||
import pro.gravit.launchserver.command.hash.IndexAssetCommand;
|
||||
import pro.gravit.launchserver.command.hash.SyncBinariesCommand;
|
||||
import pro.gravit.launchserver.command.hash.SyncProfilesCommand;
|
||||
import pro.gravit.launchserver.command.hash.SyncUpdatesCommand;
|
||||
import pro.gravit.launchserver.command.hash.UnindexAssetCommand;
|
||||
import pro.gravit.launchserver.command.install.CheckInstallCommand;
|
||||
import pro.gravit.launchserver.command.install.MultiCommand;
|
||||
import pro.gravit.launchserver.command.modules.LoadModuleCommand;
|
||||
import pro.gravit.launchserver.command.modules.ModulesCommand;
|
||||
import pro.gravit.launchserver.command.service.*;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.auth.*;
|
||||
import pro.gravit.launchserver.command.basic.*;
|
||||
import pro.gravit.launchserver.command.dump.DumpEntryCacheCommand;
|
||||
import pro.gravit.launchserver.command.dump.DumpSessionsCommand;
|
||||
import pro.gravit.launchserver.command.hash.*;
|
||||
import pro.gravit.launchserver.command.service.*;
|
||||
import pro.gravit.launchserver.command.service.ComponentCommand;
|
||||
import pro.gravit.launchserver.command.service.ConfigCommand;
|
||||
import pro.gravit.launchserver.command.service.ConfigHelpCommand;
|
||||
import pro.gravit.launchserver.command.service.ConfigListCommand;
|
||||
import pro.gravit.launchserver.command.service.GetModulusCommand;
|
||||
import pro.gravit.launchserver.command.service.GetPermissionsCommand;
|
||||
import pro.gravit.launchserver.command.service.GivePermissionsCommand;
|
||||
import pro.gravit.launchserver.command.service.ReloadAllCommand;
|
||||
import pro.gravit.launchserver.command.service.ReloadCommand;
|
||||
import pro.gravit.launchserver.command.service.ReloadListCommand;
|
||||
import pro.gravit.launchserver.command.service.ServerStatusCommand;
|
||||
import pro.gravit.utils.command.BaseCommandCategory;
|
||||
import pro.gravit.utils.command.basic.ClearCommand;
|
||||
import pro.gravit.utils.command.basic.DebugCommand;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
||||
import pro.gravit.launcher.profiles.ClientProfile.Version;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
@ -7,10 +11,6 @@
|
|||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
||||
public final class DownloadAssetCommand extends Command {
|
||||
|
||||
public DownloadAssetCommand(LaunchServer server) {
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.launcher.profiles.ClientProfile.Version;
|
||||
|
@ -10,13 +17,6 @@
|
|||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
||||
public final class DownloadClientCommand extends Command {
|
||||
|
||||
public DownloadClientCommand(LaunchServer server) {
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.command.CommandException;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper.DigestAlgorithm;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
|
@ -19,6 +9,17 @@
|
|||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.command.CommandException;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper.DigestAlgorithm;
|
||||
|
||||
public final class IndexAssetCommand extends Command {
|
||||
private static Gson gson = new Gson();
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class SyncBinariesCommand extends Command {
|
||||
public SyncBinariesCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class SyncProfilesCommand extends Command {
|
||||
public SyncProfilesCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class SyncUpdatesCommand extends Command {
|
||||
public SyncUpdatesCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
package pro.gravit.launchserver.command.hash;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.command.CommandException;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.command.CommandException;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class UnindexAssetCommand extends Command {
|
||||
private static JsonParser parser = new JsonParser();
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.command.modules;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
import java.net.URI;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
|
||||
public class LoadModuleCommand extends Command {
|
||||
public LoadModuleCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package pro.gravit.launchserver.command.service;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
|
@ -8,9 +11,6 @@
|
|||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class ComponentCommand extends Command {
|
||||
public ComponentCommand(LaunchServer server) {
|
||||
super(server);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.components;
|
||||
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.websocket.json.auth.AuthResponse;
|
||||
import pro.gravit.utils.HookException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.auth.AuthResponse;
|
||||
import pro.gravit.utils.HookException;
|
||||
|
||||
public class AuthLimiterComponent extends Component implements NeedGarbageCollection {
|
||||
@Override
|
||||
public void preInit(LaunchServer launchServer) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.components;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.command.Command;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.command.Command;
|
||||
|
||||
public class CommandRemoverComponent extends Component implements AutoCloseable {
|
||||
public String[] removeList = new String[]{};
|
||||
public transient Map<String, Command> commandsList = new HashMap<>();
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.legacy;
|
||||
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launcher.serialize.HInput;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.launcher.serialize.SerializeLimits;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
|
||||
import java.io.IOException;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
|
||||
public final class PingResponse extends Response {
|
||||
public PingResponse(LaunchServer server, long id, HInput input, HOutput output, String ip, Client clientData) {
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
package pro.gravit.launchserver.legacy;
|
||||
|
||||
import pro.gravit.launchserver.legacy.update.LauncherResponse;
|
||||
import pro.gravit.launchserver.legacy.update.LegacyLauncherResponse;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import pro.gravit.launcher.request.RequestException;
|
||||
import pro.gravit.launcher.request.RequestType;
|
||||
import pro.gravit.launcher.serialize.HInput;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.legacy.update.LauncherResponse;
|
||||
import pro.gravit.launchserver.legacy.update.LegacyLauncherResponse;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public abstract class Response {
|
||||
@FunctionalInterface
|
||||
public interface Factory<R> {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.legacy.update;
|
||||
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import pro.gravit.launcher.serialize.HInput;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.launcher.serialize.SerializeLimits;
|
||||
import pro.gravit.launcher.serialize.signed.DigestBytesHolder;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.legacy.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
|
||||
public final class LauncherResponse extends Response {
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.legacy.update;
|
||||
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import java.io.IOException;
|
||||
|
||||
import pro.gravit.launcher.serialize.HInput;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.binary.LauncherBinary;
|
||||
import pro.gravit.launchserver.legacy.Response;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class LegacyLauncherResponse extends Response {
|
||||
|
||||
public LegacyLauncherResponse(LaunchServer server, long session, HInput input, HOutput output, String ip, Client clientData) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import pro.gravit.launcher.managers.GsonManager;
|
||||
import pro.gravit.launchserver.auth.handler.AuthHandler;
|
||||
import pro.gravit.launchserver.auth.hwid.HWIDHandler;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
public class MirrorManager {
|
||||
public class Mirror {
|
||||
URL url;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import pro.gravit.launcher.managers.SimpleModuleManager;
|
||||
import pro.gravit.launcher.managers.SimpleModulesConfigManager;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
|
@ -7,9 +10,6 @@
|
|||
import pro.gravit.launchserver.modules.LaunchServerModuleContext;
|
||||
import pro.gravit.utils.PublicURLClassLoader;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ModulesManager extends SimpleModuleManager {
|
||||
public SimpleModulesConfigManager configManager;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
import pro.gravit.launchserver.Reconfigurable;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ReconfigurableManager {
|
||||
private final HashMap<String, Reconfigurable> RECONFIGURABLE = new HashMap<>();
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
import pro.gravit.launchserver.Reloadable;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ReloadManager {
|
||||
private final HashMap<String, Reloadable> RELOADABLES = new HashMap<>();
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.manangers;
|
||||
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import pro.gravit.launcher.NeedGarbageCollection;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
|
||||
public class SessionManager implements NeedGarbageCollection {
|
||||
|
||||
public static final long SESSION_TIMEOUT = 3 * 60 * 60 * 1000; // 3 часа
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.manangers.hook;
|
||||
|
||||
import pro.gravit.launcher.AutogenConfig;
|
||||
import pro.gravit.launchserver.binary.BuildContext;
|
||||
import pro.gravit.launchserver.binary.JAConfigurator;
|
||||
import pro.gravit.launchserver.binary.tasks.MainBuildTask;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import pro.gravit.launcher.AutogenConfig;
|
||||
import pro.gravit.launchserver.binary.BuildContext;
|
||||
import pro.gravit.launchserver.binary.JAConfigurator;
|
||||
import pro.gravit.launchserver.binary.tasks.MainBuildTask;
|
||||
|
||||
public class BuildHookManager {
|
||||
|
||||
@FunctionalInterface
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.manangers.hook;
|
||||
|
||||
import pro.gravit.launcher.request.RequestException;
|
||||
import pro.gravit.launchserver.socket.SocketContext;
|
||||
|
||||
import java.net.Socket;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import pro.gravit.launcher.request.RequestException;
|
||||
import pro.gravit.launchserver.socket.SocketContext;
|
||||
|
||||
public class SocketHookManager {
|
||||
@FunctionalInterface
|
||||
public interface SocketPreHook {
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package pro.gravit.launchserver.socket;
|
||||
|
||||
import pro.gravit.launchserver.manangers.SessionManager;
|
||||
import pro.gravit.launchserver.manangers.hook.SocketHookManager;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.request.RequestException;
|
||||
import pro.gravit.launcher.serialize.HInput;
|
||||
import pro.gravit.launcher.serialize.HOutput;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.legacy.Response;
|
||||
import pro.gravit.launchserver.manangers.SessionManager;
|
||||
import pro.gravit.launchserver.manangers.hook.SocketHookManager;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
|
||||
public final class ResponseThread implements Runnable {
|
||||
class Handshake {
|
||||
int type;
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
package pro.gravit.launchserver.socket;
|
||||
|
||||
import pro.gravit.launchserver.manangers.SessionManager;
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.managers.GarbageManager;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.SynchronousQueue;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import pro.gravit.launcher.Launcher;
|
||||
import pro.gravit.launcher.managers.GarbageManager;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.manangers.SessionManager;
|
||||
import pro.gravit.utils.helper.CommonHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public final class ServerSocketHandler implements Runnable, AutoCloseable {
|
||||
public interface Listener {
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package pro.gravit.launchserver.websocket;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
|
@ -20,8 +22,6 @@
|
|||
import pro.gravit.launchserver.websocket.fileserver.FileServerHandler;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
public class LauncherNettyServer implements AutoCloseable {
|
||||
public final ServerBootstrap serverBootstrap;
|
||||
public final EventLoopGroup bossGroup;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package pro.gravit.launchserver.websocket;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||
import io.netty.handler.codec.http.HttpHeaders;
|
||||
|
@ -7,8 +9,6 @@
|
|||
import io.netty.util.ReferenceCounted;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NettyIpForwardHandler extends MessageToMessageDecoder<HttpRequest> {
|
||||
private NettyConnectContext context;
|
||||
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
package pro.gravit.launchserver.websocket;
|
||||
|
||||
import pro.gravit.launcher.ssl.LauncherKeyStore;
|
||||
import pro.gravit.launcher.ssl.LauncherTrustManager;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.legacy.Response;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import javax.net.ssl.KeyManagerFactory;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLServerSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.security.*;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.UnrecoverableKeyException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -25,6 +19,18 @@
|
|||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import javax.net.ssl.KeyManagerFactory;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLServerSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
|
||||
import pro.gravit.launcher.ssl.LauncherKeyStore;
|
||||
import pro.gravit.launcher.ssl.LauncherTrustManager;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.legacy.Response;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
@SuppressWarnings({"unused", "rawtypes"})
|
||||
public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
|
||||
private static SSLServerSocketFactory ssf;
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
package pro.gravit.launchserver.websocket;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import io.netty.channel.group.DefaultChannelGroup;
|
||||
import io.netty.handler.codec.http.websocketx.*;
|
||||
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
|
||||
import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
|
||||
import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
|
||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
|
||||
import io.netty.util.concurrent.GlobalEventExecutor;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
|
@ -12,8 +19,6 @@
|
|||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class WebSocketFrameHandler extends SimpleChannelInboundHandler<WebSocketFrame> {
|
||||
public static LaunchServer server;
|
||||
public static GsonBuilder builder = CommonHelper.newBuilder();
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package pro.gravit.launchserver.websocket;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.group.ChannelGroup;
|
||||
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
|
||||
import pro.gravit.launchserver.websocket.json.JsonResponseAdapter;
|
||||
import pro.gravit.launchserver.websocket.json.JsonResponseInterface;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.*;
|
||||
import pro.gravit.launcher.events.ExceptionEvent;
|
||||
import pro.gravit.launcher.events.RequestEvent;
|
||||
import pro.gravit.launcher.events.request.AuthRequestEvent;
|
||||
|
@ -24,10 +26,19 @@
|
|||
import pro.gravit.launcher.request.admin.ProxyRequest;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.JsonResponseAdapter;
|
||||
import pro.gravit.launchserver.websocket.json.JsonResponseInterface;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launchserver.websocket.json.admin.AddLogListenerResponse;
|
||||
import pro.gravit.launchserver.websocket.json.admin.ExecCommandResponse;
|
||||
import pro.gravit.launchserver.websocket.json.admin.ProxyCommandResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.*;
|
||||
import pro.gravit.launchserver.websocket.json.auth.AuthResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.CheckServerResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.GetAvailabilityAuthResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.JoinServerResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.ProfilesResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.RestoreSessionResponse;
|
||||
import pro.gravit.launchserver.websocket.json.auth.SetProfileResponse;
|
||||
import pro.gravit.launchserver.websocket.json.profile.BatchProfileByUsername;
|
||||
import pro.gravit.launchserver.websocket.json.profile.ProfileByUUIDResponse;
|
||||
import pro.gravit.launchserver.websocket.json.profile.ProfileByUsername;
|
||||
|
@ -39,11 +50,6 @@
|
|||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class WebSocketService {
|
||||
public final ChannelGroup channels;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.websocket.fileserver;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
public class ClosingChannelFutureListener implements ChannelFutureListener {
|
||||
public final Closeable[] close;
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package pro.gravit.launchserver.websocket.fileserver;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.*;
|
||||
import io.netty.handler.codec.http.*;
|
||||
import io.netty.handler.ssl.SslHandler;
|
||||
import io.netty.handler.stream.ChunkedFile;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import static io.netty.handler.codec.http.HttpMethod.GET;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.FORBIDDEN;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.FOUND;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.INTERNAL_SERVER_ERROR;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.NOT_MODIFIED;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
|
||||
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
|
||||
|
||||
import javax.activation.MimetypesFileTypeMap;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.RandomAccessFile;
|
||||
|
@ -16,12 +18,36 @@
|
|||
import java.net.URLDecoder;
|
||||
import java.nio.file.Path;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static io.netty.handler.codec.http.HttpMethod.GET;
|
||||
import static io.netty.handler.codec.http.HttpResponseStatus.*;
|
||||
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1;
|
||||
import javax.activation.MimetypesFileTypeMap;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.DefaultFileRegion;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||
import io.netty.handler.codec.http.DefaultHttpResponse;
|
||||
import io.netty.handler.codec.http.FullHttpRequest;
|
||||
import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpChunkedInput;
|
||||
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||
import io.netty.handler.codec.http.HttpHeaderValues;
|
||||
import io.netty.handler.codec.http.HttpResponse;
|
||||
import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpUtil;
|
||||
import io.netty.handler.codec.http.LastHttpContent;
|
||||
import io.netty.handler.ssl.SslHandler;
|
||||
import io.netty.handler.stream.ChunkedFile;
|
||||
import io.netty.util.CharsetUtil;
|
||||
|
||||
public class FileServerHandler extends SimpleChannelInboundHandler<FullHttpRequest> {
|
||||
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
package pro.gravit.launchserver.websocket.json;
|
||||
|
||||
import com.google.gson.*;
|
||||
import pro.gravit.launchserver.websocket.WebSocketService;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
|
||||
import pro.gravit.launchserver.websocket.WebSocketService;
|
||||
|
||||
public class JsonResponseAdapter implements JsonSerializer<JsonResponseInterface>, JsonDeserializer<JsonResponseInterface> {
|
||||
private final WebSocketService service;
|
||||
private static final String PROP_NAME = "type";
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package pro.gravit.launchserver.websocket.json;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.RequestEvent;
|
||||
import pro.gravit.launcher.events.request.ErrorRequestEvent;
|
||||
|
@ -7,8 +9,6 @@
|
|||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.WebSocketService;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class SimpleResponse implements JsonResponseInterface {
|
||||
public UUID requestUUID;
|
||||
public transient LaunchServer server;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package pro.gravit.launchserver.websocket.json.admin;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.LogEvent;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.events.request.LogEvent;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
public class AddLogListenerResponse extends SimpleResponse {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package pro.gravit.launchserver.websocket.json.admin;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.ExecCommandRequestEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.events.request.ExecCommandRequestEvent;
|
||||
|
||||
public class ExecCommandResponse extends SimpleResponse {
|
||||
public String cmd;
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Collection;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.OshiHWID;
|
||||
import pro.gravit.launcher.events.request.AuthRequestEvent;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
|
@ -10,22 +21,12 @@
|
|||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launchserver.websocket.json.profile.ProfileByUUIDResponse;
|
||||
import pro.gravit.launcher.OshiHWID;
|
||||
import pro.gravit.launcher.events.request.AuthRequestEvent;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.utils.HookException;
|
||||
import pro.gravit.utils.helper.IOHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
import pro.gravit.utils.helper.SecurityHelper;
|
||||
import pro.gravit.utils.helper.VerifyHelper;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Collection;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
public class AuthResponse extends SimpleResponse {
|
||||
public transient static Random random = new SecureRandom();
|
||||
public String login;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.CheckServerRequestEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launchserver.websocket.json.profile.ProfileByUUIDResponse;
|
||||
import pro.gravit.launcher.events.request.CheckServerRequestEvent;
|
||||
import pro.gravit.utils.HookException;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthProviderPair;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.events.request.GetAvailabilityAuthRequestEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GetAvailabilityAuthResponse extends SimpleResponse {
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.JoinServerRequestEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.auth.AuthException;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.events.request.JoinServerRequestEvent;
|
||||
import pro.gravit.utils.HookException;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.ErrorRequestEvent;
|
||||
import pro.gravit.launcher.events.request.ProfilesRequestEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.events.request.ErrorRequestEvent;
|
||||
import pro.gravit.launcher.events.request.ProfilesRequestEvent;
|
||||
|
||||
public class ProfilesResponse extends SimpleResponse {
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.LauncherNetworkAPI;
|
||||
import pro.gravit.launcher.events.request.RestoreSessionRequestEvent;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.WebSocketFrameHandler;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.LauncherNetworkAPI;
|
||||
import pro.gravit.launcher.events.request.RestoreSessionRequestEvent;
|
||||
|
||||
public class RestoreSessionResponse extends SimpleResponse {
|
||||
@LauncherNetworkAPI
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package pro.gravit.launchserver.websocket.json.auth;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import pro.gravit.launcher.events.request.SetProfileRequestEvent;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.socket.Client;
|
||||
import pro.gravit.launchserver.websocket.json.SimpleResponse;
|
||||
import pro.gravit.launcher.events.request.SetProfileRequestEvent;
|
||||
import pro.gravit.launcher.profiles.ClientProfile;
|
||||
import pro.gravit.utils.HookException;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class SetProfileResponse extends SimpleResponse {
|
||||
public String client;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue