Compare commits

..

10 commits

Author SHA1 Message Date
Metall
28b05aa5cd
Merge 05530b6664 into a67fbac8bc 2025-02-24 12:30:00 +03:00
Gravita
a67fbac8bc [ANY] 5.6.11-dev 2025-02-24 15:19:34 +07:00
Gravita
a7abb9cbfc [ANY] IDEA code inspect 2025-02-24 15:19:09 +07:00
Gravita
689478ee0f Merge tag 'v5.6.10' into dev
5.6.10 stable
2025-02-24 14:35:09 +07:00
Gravita
df77a1ebd6 Merge branch 'release/5.6.10' 2025-02-24 14:34:51 +07:00
Gravita
641796b44e [ANY] 5.6.10 stable 2025-02-24 14:34:44 +07:00
Gravita
b7ed56b27e [ANY] Update Hikari 2025-02-24 14:30:41 +07:00
Gravita
f119bd4b30 [ANY] Delete not working modules 2025-02-19 11:51:51 +07:00
Gravita
bbff0eac64 [FEATURE] Support IO_URING mode in netty 2025-02-18 15:14:55 +07:00
Gravita
41f93b9f8d [ANY] Upgrade netty to 4.2.0.RC3 2025-02-18 14:56:16 +07:00
54 changed files with 151 additions and 195 deletions

View file

@ -26,14 +26,11 @@
targetCompatibility = '21' targetCompatibility = '21'
configurations { configurations {
compileOnlyA
bundleOnly bundleOnly
bundle bundle
hikari
pack pack
launch4j
bundleOnly.extendsFrom bundle bundleOnly.extendsFrom bundle
api.extendsFrom bundle, hikari, pack, launch4j api.extendsFrom bundle, pack
} }
jar { jar {
@ -88,6 +85,13 @@ pack project(':LauncherAPI')
bundle group: 'io.netty', name: 'netty-transport-classes-epoll', version: rootProject['verNetty'] bundle group: 'io.netty', name: 'netty-transport-classes-epoll', version: rootProject['verNetty']
bundle group: 'io.netty', name: 'netty-transport-native-epoll', version: rootProject['verNetty'], classifier: 'linux-x86_64' bundle group: 'io.netty', name: 'netty-transport-native-epoll', version: rootProject['verNetty'], classifier: 'linux-x86_64'
bundle group: 'io.netty', name: 'netty-transport-native-epoll', version: rootProject['verNetty'], classifier: 'linux-aarch_64' bundle group: 'io.netty', name: 'netty-transport-native-epoll', version: rootProject['verNetty'], classifier: 'linux-aarch_64'
bundle group: 'io.netty', name: 'netty-transport-classes-io_uring', version: rootProject['verNetty']
bundle group: 'io.netty', name: 'netty-transport-native-io_uring', version: rootProject['verNetty'], classifier: 'linux-x86_64'
bundle group: 'io.netty', name: 'netty-transport-native-io_uring', version: rootProject['verNetty'], classifier: 'linux-aarch_64'
// Netty
bundle 'org.jboss.marshalling:jboss-marshalling:1.4.11.Final'
bundle 'com.google.protobuf.nano:protobuf-javanano:3.1.0'
//
bundle group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j'] bundle group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j']
bundle group: 'com.mysql', name: 'mysql-connector-j', version: rootProject['verMySQLConn'] bundle group: 'com.mysql', name: 'mysql-connector-j', version: rootProject['verMySQLConn']
bundle group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: rootProject['verMariaDBConn'] bundle group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: rootProject['verMariaDBConn']
@ -103,40 +107,26 @@ pack project(':LauncherAPI')
annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j']) annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j'])
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit'] testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
hikari 'io.micrometer:micrometer-core:1.13.1' bundle 'io.micrometer:micrometer-core:1.14.4'
hikari('com.zaxxer:HikariCP:5.1.0') { bundle('com.zaxxer:HikariCP:6.2.1') {
exclude group: 'javassist' exclude group: 'javassist'
exclude group: 'io.micrometer' exclude group: 'io.micrometer'
exclude group: 'org.slf4j' exclude group: 'org.slf4j'
} }
} }
tasks.register('hikari', Copy) {
duplicatesStrategy = 'EXCLUDE'
into "$buildDir/libs/libraries/hikaricp"
from configurations.hikari
}
tasks.register('dumpLibs', Copy) { tasks.register('dumpLibs', Copy) {
duplicatesStrategy = 'EXCLUDE' duplicatesStrategy = 'EXCLUDE'
dependsOn tasks.hikari
into "$buildDir/libs/libraries" into "$buildDir/libs/libraries"
from configurations.bundleOnly from configurations.bundleOnly
} }
tasks.register('dumpCompileOnlyLibs', Copy) {
duplicatesStrategy = 'EXCLUDE'
into "$buildDir/libs/launcher-libraries-compile"
from configurations.compileOnlyA
}
tasks.register('bundle', Zip) { tasks.register('bundle', Zip) {
duplicatesStrategy = 'EXCLUDE' duplicatesStrategy = 'EXCLUDE'
dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.jar dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.jar
archiveFileName = 'LaunchServer.zip' archiveFileName = 'LaunchServer.zip'
destinationDirectory = file("$buildDir") destinationDirectory = file("$buildDir")
from(tasks.dumpLibs.destinationDir) { into 'libraries' } from(tasks.dumpLibs.destinationDir) { into 'libraries' }
from(tasks.dumpCompileOnlyLibs.destinationDir) { into 'launcher-libraries-compile' }
from(tasks.jar) from(tasks.jar)
from(parent.childProjects.Launcher.tasks.dumpLibs) { into 'launcher-libraries' } from(parent.childProjects.Launcher.tasks.dumpLibs) { into 'launcher-libraries' }
} }
@ -147,7 +137,7 @@ pack project(':LauncherAPI')
from parent.childProjects.Launcher.tasks.dumpLibs from parent.childProjects.Launcher.tasks.dumpLibs
} }
assemble.dependsOn tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.dumpClientLibs, tasks.bundle, tasks.cleanjar assemble.dependsOn tasks.dumpLibs, tasks.dumpClientLibs, tasks.bundle, tasks.cleanjar
publishing { publishing {

View file

@ -2,7 +2,6 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import pro.gravit.launcher.base.Launcher;
import pro.gravit.launcher.base.events.RequestEvent; import pro.gravit.launcher.base.events.RequestEvent;
import pro.gravit.launcher.base.events.request.ProfilesRequestEvent; import pro.gravit.launcher.base.events.request.ProfilesRequestEvent;
import pro.gravit.launcher.base.modules.events.ClosePhase; import pro.gravit.launcher.base.modules.events.ClosePhase;
@ -23,20 +22,16 @@
import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.Client;
import pro.gravit.launchserver.socket.SocketCommandServer; import pro.gravit.launchserver.socket.SocketCommandServer;
import pro.gravit.launchserver.socket.handlers.NettyServerSocketHandler; import pro.gravit.launchserver.socket.handlers.NettyServerSocketHandler;
import pro.gravit.launchserver.socket.response.auth.ProfilesResponse;
import pro.gravit.launchserver.socket.response.auth.RestoreResponse; import pro.gravit.launchserver.socket.response.auth.RestoreResponse;
import pro.gravit.utils.command.Command; import pro.gravit.utils.command.Command;
import pro.gravit.utils.command.CommandHandler; import pro.gravit.utils.command.CommandHandler;
import pro.gravit.utils.command.SubCommand; import pro.gravit.utils.command.SubCommand;
import pro.gravit.utils.helper.CommonHelper; import pro.gravit.utils.helper.CommonHelper;
import pro.gravit.utils.helper.IOHelper;
import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.JVMHelper;
import pro.gravit.utils.helper.SecurityHelper; import pro.gravit.utils.helper.SecurityHelper;
import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.nio.file.*; import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.KeyStore; import java.security.KeyStore;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;

View file

@ -36,7 +36,6 @@
import java.nio.file.Path; import java.nio.file.Path;
import java.security.Security; import java.security.Security;
import java.security.cert.CertificateException; import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class LaunchServerStarter { public class LaunchServerStarter {

View file

@ -18,7 +18,7 @@
import java.util.stream.Stream; import java.util.stream.Stream;
public class Main { public class Main {
private static final List<String> classpathOnly = List.of("proguard", "jline", "progressbar", "kotlin", "epoll"); private static final List<String> classpathOnly = List.of("proguard", "jline", "progressbar", "kotlin");
private static final String LOG4J_PROPERTY = "log4j2.configurationFile"; private static final String LOG4J_PROPERTY = "log4j2.configurationFile";
private static final String DEBUG_PROPERTY = "launchserver.main.debug"; private static final String DEBUG_PROPERTY = "launchserver.main.debug";
private static final String LIBRARIES_PROPERTY = "launchserver.dir.libraries"; private static final String LIBRARIES_PROPERTY = "launchserver.dir.libraries";

View file

@ -174,7 +174,7 @@ public AuthManager.AuthReport sudo(User user, boolean shadow) throws IOException
} }
@Override @Override
public User checkServer(Client client, String username, String serverID) throws IOException { public User checkServer(Client client, String username, String serverID) {
SQLUser user = (SQLUser) getUserByUsername(username); SQLUser user = (SQLUser) getUserByUsername(username);
if (user == null) { if (user == null) {
return null; return null;

View file

@ -1,6 +1,5 @@
package pro.gravit.launchserver.auth.core; package pro.gravit.launchserver.auth.core;
import pro.gravit.launcher.base.ClientPermissions;
import pro.gravit.launcher.base.request.secure.HardwareReportRequest; import pro.gravit.launcher.base.request.secure.HardwareReportRequest;
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.auth.AuthProviderPair; import pro.gravit.launchserver.auth.AuthProviderPair;

View file

@ -41,12 +41,12 @@ public AuthManager.AuthReport authorize(String login, AuthResponse.AuthContext c
} }
@Override @Override
public User checkServer(Client client, String username, String serverID) throws IOException { public User checkServer(Client client, String username, String serverID) {
return null; return null;
} }
@Override @Override
public boolean joinServer(Client client, String username, UUID uuid, String accessToken, String serverID) throws IOException { public boolean joinServer(Client client, String username, UUID uuid, String accessToken, String serverID) {
return false; return false;
} }

View file

@ -11,9 +11,7 @@
import pro.gravit.launchserver.auth.core.interfaces.provider.AuthSupportHardware; import pro.gravit.launchserver.auth.core.interfaces.provider.AuthSupportHardware;
import pro.gravit.launchserver.auth.core.interfaces.session.UserSessionSupportHardware; import pro.gravit.launchserver.auth.core.interfaces.session.UserSessionSupportHardware;
import pro.gravit.launchserver.socket.Client; import pro.gravit.launchserver.socket.Client;
import pro.gravit.utils.helper.IOHelper;
import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.sql.*; import java.sql.*;
import java.util.Base64; import java.util.Base64;
@ -85,7 +83,7 @@ protected SQLUser constructUser(ResultSet set) throws SQLException {
set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), set.getLong(hardwareIdColumn)) : null; set.getString(accessTokenColumn), set.getString(serverIDColumn), set.getString(passwordColumn), set.getLong(hardwareIdColumn)) : null;
} }
private SQLUserHardware fetchHardwareInfo(ResultSet set) throws SQLException, IOException { private SQLUserHardware fetchHardwareInfo(ResultSet set) throws SQLException {
HardwareReportRequest.HardwareInfo hardwareInfo = new HardwareReportRequest.HardwareInfo(); HardwareReportRequest.HardwareInfo hardwareInfo = new HardwareReportRequest.HardwareInfo();
hardwareInfo.hwDiskId = set.getString("hwDiskId"); hardwareInfo.hwDiskId = set.getString("hwDiskId");
hardwareInfo.baseboardSerialNumber = set.getString("baseboardSerialNumber"); hardwareInfo.baseboardSerialNumber = set.getString("baseboardSerialNumber");
@ -126,7 +124,7 @@ public UserHardware getHardwareInfoByPublicKey(byte[] publicKey) {
return null; return null;
} }
} }
} catch (SQLException | IOException throwables) { } catch (SQLException throwables) {
logger.error("SQL Error", throwables); logger.error("SQL Error", throwables);
return null; return null;
} }
@ -149,7 +147,7 @@ public UserHardware getHardwareInfoByData(HardwareReportRequest.HardwareInfo inf
} }
} }
} }
} catch (SQLException | IOException throwables) { } catch (SQLException throwables) {
logger.error("SQL Error", throwables); logger.error("SQL Error", throwables);
} }
return null; return null;
@ -170,7 +168,7 @@ public UserHardware getHardwareInfoById(String id) {
return null; return null;
} }
} }
} catch (SQLException | IOException throwables) { } catch (SQLException throwables) {
logger.error("SQL Error", throwables); logger.error("SQL Error", throwables);
return null; return null;
} }
@ -294,7 +292,7 @@ protected AbstractSQLCoreProvider.SQLUserSession createSession(AbstractSQLCorePr
} }
@Override @Override
public UserSession extendedCheckServer(Client client, String username, String serverID) throws IOException { public UserSession extendedCheckServer(Client client, String username, String serverID) {
AbstractSQLCoreProvider.SQLUser user = (AbstractSQLCoreProvider.SQLUser) getUserByUsername(username); AbstractSQLCoreProvider.SQLUser user = (AbstractSQLCoreProvider.SQLUser) getUserByUsername(username);
if (user == null) { if (user == null) {
return null; return null;

View file

@ -6,5 +6,5 @@
import java.io.IOException; import java.io.IOException;
public interface AuthSupportExtendedCheckServer { public interface AuthSupportExtendedCheckServer {
UserSession extendedCheckServer(Client client, String username, String serverID) throws IOException; UserSession extendedCheckServer(Client client, String username, String serverID);
} }

View file

@ -143,7 +143,7 @@ public void init(LaunchServer server, AuthProviderPair pair) {
} }
@Override @Override
public User checkServer(Client client, String username, String serverID) throws IOException { public User checkServer(Client client, String username, String serverID) {
var savedServerId = sqlSessionStore.getServerIdByUsername(username); var savedServerId = sqlSessionStore.getServerIdByUsername(username);
if (!serverID.equals(savedServerId)) { if (!serverID.equals(savedServerId)) {
return null; return null;
@ -153,7 +153,7 @@ public User checkServer(Client client, String username, String serverID) throws
} }
@Override @Override
public boolean joinServer(Client client, String username, UUID uuid, String accessToken, String serverID) throws IOException { public boolean joinServer(Client client, String username, UUID uuid, String accessToken, String serverID) {
User user; User user;
try { try {
user = createUserFromMinecraftToken(accessToken); user = createUserFromMinecraftToken(accessToken);

View file

@ -3,8 +3,6 @@
import pro.gravit.launchserver.auth.SQLSourceConfig; import pro.gravit.launchserver.auth.SQLSourceConfig;
import pro.gravit.utils.helper.LogHelper; import pro.gravit.utils.helper.LogHelper;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.UUID; import java.util.UUID;

View file

@ -4,9 +4,7 @@
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import pro.gravit.launchserver.binary.tasks.LauncherBuildTask; import pro.gravit.launchserver.binary.tasks.LauncherBuildTask;
import pro.gravit.utils.helper.CommonHelper; import pro.gravit.utils.helper.CommonHelper;
import pro.gravit.utils.helper.IOHelper;
import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -56,7 +56,7 @@ public final byte[] getDigest() {
public void init() { public void init() {
} }
public final boolean sync() throws IOException { public final boolean sync() {
try { try {
var target = syncBinaryFile.toString(); var target = syncBinaryFile.toString();
var path = server.config.updatesProvider.download(null, List.of(target)).get(target); var path = server.config.updatesProvider.download(null, List.of(target)).get(target);

View file

@ -13,7 +13,6 @@
import pro.gravit.utils.command.CommandException; import pro.gravit.utils.command.CommandException;
import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.IOHelper;
import java.io.BufferedWriter;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Collections; import java.util.Collections;

View file

@ -2,17 +2,13 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import pro.gravit.launcher.base.Launcher;
import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launcher.base.profiles.ClientProfile;
import pro.gravit.launcher.base.profiles.ClientProfileBuilder; import pro.gravit.launcher.base.profiles.ClientProfileBuilder;
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.command.Command;
import pro.gravit.utils.helper.CommonHelper;
import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.IOHelper;
import java.io.IOException; import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.List; import java.util.List;

View file

@ -5,9 +5,7 @@
import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launcher.base.profiles.ClientProfile;
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.command.Command;
import pro.gravit.utils.helper.IOHelper;
import java.nio.file.Files;
import java.util.UUID; import java.util.UUID;
public class DeleteProfileCommand extends Command { public class DeleteProfileCommand extends Command {

View file

@ -22,7 +22,7 @@ public String getUsageDescription() {
} }
@Override @Override
public void invoke(String... args) throws Exception { public void invoke(String... args) {
for(var profile : server.getProfiles()) { for(var profile : server.getProfiles()) {
logger.info("{} ({}) {}", profile.getTitle(), profile.getVersion().toString(), profile.isLimited() ? "limited" : ""); logger.info("{} ({}) {}", profile.getTitle(), profile.getVersion().toString(), profile.isLimited() ? "limited" : "");
} }

View file

@ -2,14 +2,10 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import pro.gravit.launcher.base.Launcher;
import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launcher.base.profiles.ClientProfile;
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.command.Command;
import pro.gravit.launchserver.helper.MakeProfileHelper; import pro.gravit.launchserver.helper.MakeProfileHelper;
import pro.gravit.utils.helper.IOHelper;
import java.io.Writer;
public class MakeProfileCommand extends Command { public class MakeProfileCommand extends Command {
private transient final Logger logger = LogManager.getLogger(); private transient final Logger logger = LogManager.getLogger();

View file

@ -2,17 +2,10 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import pro.gravit.launcher.base.Launcher;
import pro.gravit.launcher.base.profiles.ClientProfile; import pro.gravit.launcher.base.profiles.ClientProfile;
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.command.Command; import pro.gravit.launchserver.command.Command;
import pro.gravit.utils.helper.IOHelper;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.UUID; import java.util.UUID;
public class SaveProfilesCommand extends Command { public class SaveProfilesCommand extends Command {

View file

@ -1,6 +1,5 @@
package pro.gravit.launchserver.config; package pro.gravit.launchserver.config;
import io.netty.channel.epoll.Epoll;
import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LogLevel;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -19,6 +18,7 @@
import pro.gravit.launchserver.components.AuthLimiterComponent; import pro.gravit.launchserver.components.AuthLimiterComponent;
import pro.gravit.launchserver.components.Component; import pro.gravit.launchserver.components.Component;
import pro.gravit.launchserver.components.ProGuardComponent; import pro.gravit.launchserver.components.ProGuardComponent;
import pro.gravit.launchserver.socket.NettyObjectFactory;
import java.util.*; import java.util.*;
@ -64,12 +64,7 @@ public static LaunchServerConfig getDefault(LaunchServer.LaunchServerEnv env) {
newConfig.netty.fileServerEnabled = true; newConfig.netty.fileServerEnabled = true;
newConfig.netty.binds = new NettyBindAddress[]{new NettyBindAddress("0.0.0.0", 9274)}; newConfig.netty.binds = new NettyBindAddress[]{new NettyBindAddress("0.0.0.0", 9274)};
newConfig.netty.performance = new NettyPerformanceConfig(); newConfig.netty.performance = new NettyPerformanceConfig();
try { newConfig.netty.performance.mode = NettyObjectFactory.NettyFactoryMode.AUTO;
newConfig.netty.performance.usingEpoll = Epoll.isAvailable();
} catch (Throwable e) {
// Epoll class line 51+ catch (Exception) but Error will be thrown by System.load
newConfig.netty.performance.usingEpoll = false;
} // such as on ARM
newConfig.netty.performance.bossThread = 2; newConfig.netty.performance.bossThread = 2;
newConfig.netty.performance.workerThread = 8; newConfig.netty.performance.workerThread = 8;
newConfig.netty.performance.schedulerThread = 2; newConfig.netty.performance.schedulerThread = 2;
@ -277,7 +272,7 @@ public static class NettyConfig {
} }
public static class NettyPerformanceConfig { public static class NettyPerformanceConfig {
public boolean usingEpoll; public NettyObjectFactory.NettyFactoryMode mode = NettyObjectFactory.NettyFactoryMode.AUTO;
public int bossThread; public int bossThread;
public int workerThread; public int workerThread;
public int schedulerThread; public int schedulerThread;

View file

@ -1,20 +1,10 @@
package pro.gravit.launchserver.manangers; package pro.gravit.launchserver.manangers;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import pro.gravit.launcher.core.hasher.HashedDir; import pro.gravit.launcher.core.hasher.HashedDir;
import pro.gravit.launcher.core.serialize.HInput;
import pro.gravit.launcher.core.serialize.HOutput;
import pro.gravit.launchserver.LaunchServer; import pro.gravit.launchserver.LaunchServer;
import pro.gravit.launchserver.modules.events.LaunchServerUpdatesSyncEvent;
import pro.gravit.utils.helper.IOHelper;
import java.io.IOException; import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*; import java.util.*;
import java.util.stream.Stream;
public class UpdatesManager { public class UpdatesManager {
private final LaunchServer server; private final LaunchServer server;
@ -24,12 +14,12 @@ public UpdatesManager(LaunchServer server) {
} }
@Deprecated @Deprecated
public void readUpdatesFromCache() throws IOException { public void readUpdatesFromCache() {
} }
@Deprecated @Deprecated
public void readUpdatesDir() throws IOException { public void readUpdatesDir() {
} }

View file

@ -4,7 +4,6 @@
import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline; import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup; import io.netty.channel.EventLoopGroup;
import io.netty.channel.epoll.Epoll;
import io.netty.channel.group.DefaultChannelGroup; import io.netty.channel.group.DefaultChannelGroup;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpObjectAggregator; import io.netty.handler.codec.http.HttpObjectAggregator;
@ -36,14 +35,9 @@ public class LauncherNettyServer implements AutoCloseable {
public LauncherNettyServer(LaunchServer server) { public LauncherNettyServer(LaunchServer server) {
LaunchServerConfig.NettyConfig config = server.config.netty; LaunchServerConfig.NettyConfig config = server.config.netty;
NettyObjectFactory.setUsingEpoll(config.performance.usingEpoll); NettyObjectFactory.setMode(config.performance.mode);
Logger logger = LogManager.getLogger(); Logger logger = LogManager.getLogger();
if (config.performance.usingEpoll) { logger.info("Netty usage {} transport mode", NettyObjectFactory.getMode());
logger.debug("Netty: Epoll enabled");
}
if (config.performance.usingEpoll && !Epoll.isAvailable()) {
logger.error("Epoll is not available: (netty,perfomance.usingEpoll configured wrongly)", Epoll.unavailabilityCause());
}
bossGroup = NettyObjectFactory.newEventLoopGroup(config.performance.bossThread, "LauncherNettyServer.bossGroup"); bossGroup = NettyObjectFactory.newEventLoopGroup(config.performance.bossThread, "LauncherNettyServer.bossGroup");
workerGroup = NettyObjectFactory.newEventLoopGroup(config.performance.workerThread, "LauncherNettyServer.workerGroup"); workerGroup = NettyObjectFactory.newEventLoopGroup(config.performance.workerThread, "LauncherNettyServer.workerGroup");
serverBootstrap = new ServerBootstrap(); serverBootstrap = new ServerBootstrap();

View file

@ -2,30 +2,58 @@
import io.netty.channel.ChannelFactory; import io.netty.channel.ChannelFactory;
import io.netty.channel.EventLoopGroup; import io.netty.channel.EventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.ServerChannel; import io.netty.channel.ServerChannel;
import io.netty.channel.epoll.EpollEventLoopGroup; import io.netty.channel.epoll.Epoll;
import io.netty.channel.epoll.EpollIoHandler;
import io.netty.channel.epoll.EpollServerSocketChannel; import io.netty.channel.epoll.EpollServerSocketChannel;
import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.uring.IoUring;
import io.netty.channel.uring.IoUringIoHandler;
import io.netty.channel.uring.IoUringServerSocketChannel;
public class NettyObjectFactory { public class NettyObjectFactory {
private static boolean epoll = false; private static NettyFactoryMode mode;
public static void setUsingEpoll(boolean value) { public static void setMode(NettyFactoryMode mode) {
epoll = value; NettyObjectFactory.mode = mode;
if(mode == NettyFactoryMode.AUTO) {
if(IoUring.isAvailable()) {
NettyObjectFactory.mode = NettyFactoryMode.IO_URING;
return;
}
if(Epoll.isAvailable()) {
NettyObjectFactory.mode = NettyFactoryMode.EPOLL;
return;
}
NettyObjectFactory.mode = NettyFactoryMode.NIO;
}
}
public static NettyFactoryMode getMode() {
return mode;
} }
public static EventLoopGroup newEventLoopGroup(int threads, String poolName) { public static EventLoopGroup newEventLoopGroup(int threads, String poolName) {
if (epoll) return switch (mode) {
return new EpollEventLoopGroup(threads); case AUTO -> null;
else case NIO -> new MultiThreadIoEventLoopGroup(threads, NioIoHandler.newFactory());
return new NioEventLoopGroup(threads); case EPOLL -> new MultiThreadIoEventLoopGroup(threads, EpollIoHandler.newFactory());
case IO_URING -> new MultiThreadIoEventLoopGroup(threads, IoUringIoHandler.newFactory());
};
} }
public static ChannelFactory<? extends ServerChannel> getServerSocketChannelFactory() { public static ChannelFactory<? extends ServerChannel> getServerSocketChannelFactory() {
if (epoll) return switch (mode) {
return EpollServerSocketChannel::new; case AUTO -> null;
else case NIO -> NioServerSocketChannel::new;
return NioServerSocketChannel::new; case EPOLL -> EpollServerSocketChannel::new;
case IO_URING -> IoUringServerSocketChannel::new;
};
}
public enum NettyFactoryMode {
AUTO, NIO, EPOLL, IO_URING
} }
} }

View file

@ -5,7 +5,6 @@
import pro.gravit.launchserver.config.log4j.LogAppender; import pro.gravit.launchserver.config.log4j.LogAppender;
import pro.gravit.utils.command.CommandHandler; import pro.gravit.utils.command.CommandHandler;
import java.io.IOException;
import java.net.StandardProtocolFamily; import java.net.StandardProtocolFamily;
import java.net.UnixDomainSocketAddress; import java.net.UnixDomainSocketAddress;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
@ -64,29 +63,28 @@ public void run() {
ByteBuffer buffer = ByteBuffer.allocate(1024); ByteBuffer buffer = ByteBuffer.allocate(1024);
while (true) { while (true) {
SocketChannel channel = serverChannel.accept(); SocketChannel channel = serverChannel.accept();
channel.configureBlocking(true); try (channel) {
String command = null; channel.configureBlocking(true);
try { String command = null;
mark: mark:
while (true) { while (true) {
int bytesRead = channel.read(buffer); int bytesRead = channel.read(buffer);
if (bytesRead < 0) { if (bytesRead < 0) {
break; break;
} }
for (var i=0;i<buffer.limit();i++) { for (var i = 0; i < buffer.limit(); i++) {
if(buffer.get(i) == '\n') { if (buffer.get(i) == '\n') {
command = new String(buffer.array(), 0, i); command = new String(buffer.array(), 0, i);
break mark; break mark;
} }
} }
} }
if(command != null) { if (command != null) {
runCommand(channel, command); runCommand(channel, command);
} }
} finally { } finally {
buffer.clear(); buffer.clear();
channel.close();
} }
} }
} catch (Throwable e) { } catch (Throwable e) {

View file

@ -22,7 +22,6 @@
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoField; import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAccessor;
import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.UnsupportedTemporalTypeException;
import java.util.Arrays; import java.util.Arrays;

View file

@ -7,7 +7,7 @@
public interface WebSocketServerResponse extends WebSocketRequest { public interface WebSocketServerResponse extends WebSocketRequest {
String getType(); String getType();
void execute(ChannelHandlerContext ctx, Client client) throws Exception; void execute(ChannelHandlerContext ctx, Client client);
default ThreadSafeStatus getThreadSafeStatus() { default ThreadSafeStatus getThreadSafeStatus() {
return ThreadSafeStatus.READ; return ThreadSafeStatus.READ;

View file

@ -23,7 +23,7 @@ public String getType() {
} }
@Override @Override
public void execute(ChannelHandlerContext ctx, Client client) throws Exception { public void execute(ChannelHandlerContext ctx, Client client) {
sendResult(new CurrentUserRequestEvent(collectUserInfoFromClient(server, client))); sendResult(new CurrentUserRequestEvent(collectUserInfoFromClient(server, client)));
} }
} }

View file

@ -44,7 +44,7 @@ public String getType() {
} }
@Override @Override
public void execute(ChannelHandlerContext ctx, Client client) throws Exception { public void execute(ChannelHandlerContext ctx, Client client) {
if (accessToken == null && !client.isAuth && needUserInfo) { if (accessToken == null && !client.isAuth && needUserInfo) {
sendError("Invalid request"); sendError("Invalid request");
return; return;

View file

@ -12,7 +12,7 @@ public String getType() {
} }
@Override @Override
public void execute(ChannelHandlerContext ctx, Client client) throws Exception { public void execute(ChannelHandlerContext ctx, Client client) {
if(!client.isAuth || client.auth == null || client.getUser() == null) { if(!client.isAuth || client.auth == null || client.getUser() == null) {
sendError("Access denied"); sendError("Access denied");
return; return;

View file

@ -14,7 +14,7 @@ public String getType() {
} }
@Override @Override
public void execute(ChannelHandlerContext ctx, Client client) throws Exception { public void execute(ChannelHandlerContext ctx, Client client) {
if(!client.isAuth || client.auth == null || client.getUser() == null) { if(!client.isAuth || client.auth == null || client.getUser() == null) {
sendError("Access denied"); sendError("Access denied");
return; return;

View file

@ -12,7 +12,7 @@ public String getType() {
} }
@Override @Override
public void execute(ChannelHandlerContext ctx, Client client) throws Exception { public void execute(ChannelHandlerContext ctx, Client client) {
sendResult(new GetConnectUUIDRequestEvent(connectUUID, server.shardId)); sendResult(new GetConnectUUIDRequestEvent(connectUUID, server.shardId));
} }
} }

View file

@ -28,7 +28,6 @@
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
public class ClientLauncherProcess { public class ClientLauncherProcess {
public final List<String> pre = new LinkedList<>(); public final List<String> pre = new LinkedList<>();

View file

@ -12,7 +12,6 @@
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.nio.file.Path;
import java.util.*; import java.util.*;
public final class ClientProfile implements Comparable<ClientProfile> { public final class ClientProfile implements Comparable<ClientProfile> {

View file

@ -3,7 +3,6 @@
import java.io.IOException; import java.io.IOException;
public final class RequestException extends IOException { public final class RequestException extends IOException {
private static final long serialVersionUID = 7558237657082664821L;
public RequestException(String message) { public RequestException(String message) {

View file

@ -6,7 +6,7 @@
public interface RequestService { public interface RequestService {
<T extends WebSocketEvent> CompletableFuture<T> request(Request<T> request) throws IOException; <T extends WebSocketEvent> CompletableFuture<T> request(Request<T> request) throws IOException;
void open() throws Exception; void open();
void registerEventHandler(EventHandler handler); void registerEventHandler(EventHandler handler);

View file

@ -33,7 +33,7 @@ public abstract class ClientJSONPoint implements WebSocket.Listener {
private final Object sendSyncObject = new Object(); private final Object sendSyncObject = new Object();
private volatile StringBuilder builder = new StringBuilder(); private volatile StringBuilder builder = new StringBuilder();
public ClientJSONPoint(final String uri) throws SSLException { public ClientJSONPoint(final String uri) {
this(URI.create(uri)); this(URI.create(uri));
} }
@ -114,7 +114,7 @@ public void send(String text) {
abstract void onOpen(); abstract void onOpen();
public void close() throws InterruptedException { public void close() {
webSocket.abort(); webSocket.abort();
} }

View file

@ -33,7 +33,7 @@ public abstract class ClientWebSocketService extends ClientJSONPoint {
public OnCloseCallback onCloseCallback; public OnCloseCallback onCloseCallback;
public ReconnectCallback reconnectCallback; public ReconnectCallback reconnectCallback;
public ClientWebSocketService(String address) throws SSLException { public ClientWebSocketService(String address) {
super(createURL(address)); super(createURL(address));
this.gson = Launcher.gsonManager.gson; this.gson = Launcher.gsonManager.gson;
this.onConnect = true; this.onConnect = true;

View file

@ -40,11 +40,7 @@ public static CompletableFuture<StdWebSocketService> initWebSockets(String addre
service.openAsync(() -> { service.openAsync(() -> {
future.complete(service); future.complete(service);
JVMHelper.RUNTIME.addShutdownHook(new Thread(() -> { JVMHelper.RUNTIME.addShutdownHook(new Thread(() -> {
try { service.close();
service.close();
} catch (InterruptedException e) {
LogHelper.error(e);
}
})); }));
}, future::completeExceptionally); }, future::completeExceptionally);
return future; return future;

View file

@ -7,9 +7,9 @@
public class ClientVersionTest { public class ClientVersionTest {
@Test @Test
public void parseTest() { public void parseTest() {
Assertions.assertEquals(ClientProfile.Version.of("1.0.0").toCleanString(), "1.0.0"); Assertions.assertEquals("1.0.0", ClientProfile.Version.of("1.0.0").toCleanString());
Assertions.assertEquals(ClientProfile.Version.of("1.0.0-1").toCleanString(), "1.0.0.1"); Assertions.assertEquals("1.0.0.1", ClientProfile.Version.of("1.0.0-1").toCleanString());
Assertions.assertEquals(ClientProfile.Version.of("-----1.0.0").toCleanString(), "1.0.0"); Assertions.assertEquals("1.0.0", ClientProfile.Version.of("-----1.0.0").toCleanString());
} }
@Test @Test

View file

@ -49,12 +49,12 @@ public void dependenciesTest() {
moduleManager.loadModule(new Depend3Module()); moduleManager.loadModule(new Depend3Module());
moduleManager.loadModule(new MainModule()); moduleManager.loadModule(new MainModule());
moduleManager.initModules(null); moduleManager.initModules(null);
Assertions.assertEquals(moduleManager.getModule("depend1").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("depend1").getInitStatus());
Assertions.assertEquals(moduleManager.getModule("depend2").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("depend2").getInitStatus());
Assertions.assertEquals(moduleManager.getModule("depend3").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("depend3").getInitStatus());
Assertions.assertEquals(moduleManager.getModule("internal").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("internal").getInitStatus());
Assertions.assertEquals(moduleManager.getModule("virtual").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("virtual").getInitStatus());
Assertions.assertEquals(moduleManager.getModule("main").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("main").getInitStatus());
} }
@Test @Test
@ -62,7 +62,7 @@ public void cyclicTest() {
moduleManager.loadModule(new CyclicDependModule()); moduleManager.loadModule(new CyclicDependModule());
moduleManager.loadModule(new Cyclic2DependModule()); moduleManager.loadModule(new Cyclic2DependModule());
moduleManager.initModules(null); moduleManager.initModules(null);
Assertions.assertEquals(moduleManager.getModule("cyclic1").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("cyclic1").getInitStatus());
Assertions.assertEquals(moduleManager.getModule("cyclic2").getInitStatus(), LauncherModule.InitStatus.FINISH); Assertions.assertEquals(LauncherModule.InitStatus.FINISH, moduleManager.getModule("cyclic2").getInitStatus());
} }
} }

View file

@ -16,10 +16,10 @@ public Depend1Module() {
@Override @Override
public void init(LauncherInitContext initContext) { public void init(LauncherInitContext initContext) {
InternalModule module = modulesManager.getModule(InternalModule.class); InternalModule module = modulesManager.getModule(InternalModule.class);
Assertions.assertEquals(module.getInitStatus(), InitStatus.FINISH); Assertions.assertEquals(InitStatus.FINISH, module.getInitStatus());
Depend3Module module1 = modulesManager.getModule(Depend3Module.class); Depend3Module module1 = modulesManager.getModule(Depend3Module.class);
Assertions.assertEquals(module1.getInitStatus(), InitStatus.FINISH); Assertions.assertEquals(InitStatus.FINISH, module1.getInitStatus());
VirtualInterface virtualInterface = modulesManager.getModuleByInterface(VirtualInterface.class); VirtualInterface virtualInterface = modulesManager.getModuleByInterface(VirtualInterface.class);
Assertions.assertEquals(((LauncherModule) virtualInterface).getInitStatus(), InitStatus.FINISH); Assertions.assertEquals(InitStatus.FINISH, ((LauncherModule) virtualInterface).getInitStatus());
} }
} }

View file

@ -17,8 +17,8 @@ public MainModule() {
@Override @Override
public void init(LauncherInitContext initContext) { public void init(LauncherInitContext initContext) {
Depend1Module module = modulesManager.getModule(Depend1Module.class); Depend1Module module = modulesManager.getModule(Depend1Module.class);
Assertions.assertEquals(module.getInitStatus(), InitStatus.FINISH); Assertions.assertEquals(InitStatus.FINISH, module.getInitStatus());
Depend2Module module2 = modulesManager.getModule(Depend2Module.class); Depend2Module module2 = modulesManager.getModule(Depend2Module.class);
Assertions.assertEquals(module2.getInitStatus(), InitStatus.FINISH); Assertions.assertEquals(InitStatus.FINISH, module2.getInitStatus());
} }
} }

View file

@ -124,7 +124,7 @@ private static void realMain(String[] args) throws Throwable {
LogHelper.dev("Classpath entry %s", e); LogHelper.dev("Classpath entry %s", e);
} }
} }
List<URL> classpathURLs = classpath.stream().map(IOHelper::toURL).collect(Collectors.toList()); List<URL> classpathURLs = classpath.stream().map(IOHelper::toURL).toList();
// Start client with WatchService monitoring // Start client with WatchService monitoring
RequestService service; RequestService service;
if (params.offlineMode) { if (params.offlineMode) {

View file

@ -282,7 +282,7 @@ public enum WalkAction {
@FunctionalInterface @FunctionalInterface
public interface WalkCallback { public interface WalkCallback {
WalkAction walked(String path, String name, HashedEntry entry) throws IOException; WalkAction walked(String path, String name, HashedEntry entry);
} }
public static class FindRecursiveResult { public static class FindRecursiveResult {

View file

@ -1,7 +1,6 @@
package pro.gravit.utils; package pro.gravit.utils;
public class HookException extends RuntimeException { public class HookException extends RuntimeException {
private static final long serialVersionUID = -529141998961943161L;
public HookException(String message) { public HookException(String message) {
super(message); super(message);

View file

@ -6,9 +6,9 @@ public final class Version implements Comparable<Version> {
public static final int MAJOR = 5; public static final int MAJOR = 5;
public static final int MINOR = 6; public static final int MINOR = 6;
public static final int PATCH = 9; public static final int PATCH = 11;
public static final int BUILD = 1; public static final int BUILD = 1;
public static final Version.Type RELEASE = Type.STABLE; public static final Version.Type RELEASE = Type.DEV;
public final int major; public final int major;
public final int minor; public final int minor;
public final int patch; public final int patch;

View file

@ -1,7 +1,6 @@
package pro.gravit.utils.command; package pro.gravit.utils.command;
public final class CommandException extends Exception { public final class CommandException extends Exception {
private static final long serialVersionUID = -6588814993972117772L;
public CommandException(String message) { public CommandException(String message) {

View file

@ -221,37 +221,39 @@ public static ArgsParseResult parseJavaArgs(List<String> args) {
continue; continue;
} }
} }
if(arg.equals("--module-path") || arg.equals("-p")) { switch (arg) {
prevArgType = PrevArgType.MODULE_PATH; case "--module-path", "-p" -> {
continue; prevArgType = PrevArgType.MODULE_PATH;
} continue;
if(arg.equals("--classpath") || arg.equals("-cp")) { }
prevArgType = PrevArgType.CLASSPATH; case "--classpath", "-cp" -> {
continue; prevArgType = PrevArgType.CLASSPATH;
} continue;
if(arg.equals("--add-modules")) { }
prevArgType = PrevArgType.ADD_MODULES; case "--add-modules" -> {
continue; prevArgType = PrevArgType.ADD_MODULES;
} continue;
if(arg.equals("--add-opens")) { }
prevArgType = PrevArgType.ADD_OPENS; case "--add-opens" -> {
continue; prevArgType = PrevArgType.ADD_OPENS;
} continue;
if(arg.equals("--add-exports")) { }
prevArgType = PrevArgType.ADD_EXPORTS; case "--add-exports" -> {
continue; prevArgType = PrevArgType.ADD_EXPORTS;
} continue;
if(arg.equals("--add-reads")) { }
prevArgType = PrevArgType.ADD_READS; case "--add-reads" -> {
continue; prevArgType = PrevArgType.ADD_READS;
} continue;
if(arg.equals("--module") || arg.equals("-m")) { }
prevArgType = PrevArgType.MODULE; case "--module", "-m" -> {
continue; prevArgType = PrevArgType.MODULE;
} continue;
if(arg.equals("-jar")) { }
prevArgType = PrevArgType.JAR; case "-jar" -> {
continue; prevArgType = PrevArgType.JAR;
continue;
}
} }
jvmArgs.add(arg); jvmArgs.add(arg);
} }

View file

@ -83,7 +83,7 @@ public static byte[] getClassBytes(Class<?> clazz, ClassLoader classLoader) thro
return IOHelper.read(classLoader.getResourceAsStream(getClassFile(clazz))); return IOHelper.read(classLoader.getResourceAsStream(getClassFile(clazz)));
} }
public static InputStream getClassBytesStream(Class<?> clazz) throws IOException { public static InputStream getClassBytesStream(Class<?> clazz) {
return getClassBytesStream(clazz, clazz.getClassLoader()); return getClassBytesStream(clazz, clazz.getClassLoader());
} }

View file

@ -68,7 +68,7 @@ public void addTransformer(ClassTransformer transformer) {
} }
instrumentation.addTransformer(new ClassFileTransformer() { instrumentation.addTransformer(new ClassFileTransformer() {
@Override @Override
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
if(transformer.filter(null, className)) { if(transformer.filter(null, className)) {
return transformer.transform(null, className, protectionDomain, classfileBuffer); return transformer.transform(null, className, protectionDomain, classfileBuffer);
} }

View file

@ -30,8 +30,8 @@ public void main() {
String json2 = gson.toJson(new MyTestClass2("BBBB"), TestInterface.class); String json2 = gson.toJson(new MyTestClass2("BBBB"), TestInterface.class);
TestInterface test1 = gson.fromJson(json, TestInterface.class); TestInterface test1 = gson.fromJson(json, TestInterface.class);
TestInterface test2 = gson.fromJson(json2, TestInterface.class); TestInterface test2 = gson.fromJson(json2, TestInterface.class);
Assertions.assertEquals(test1.get(), "AAAA"); Assertions.assertEquals("AAAA", test1.get());
Assertions.assertEquals(test2.get(), "BBBB"); Assertions.assertEquals("BBBB", test2.get());
} }
public interface TestInterface { public interface TestInterface {

View file

@ -5,7 +5,7 @@
id 'org.openjfx.javafxplugin' version '0.1.0' apply false id 'org.openjfx.javafxplugin' version '0.1.0' apply false
} }
group = 'pro.gravit.launcher' group = 'pro.gravit.launcher'
version = '5.6.9' version = '5.6.10'
apply from: 'props.gradle' apply from: 'props.gradle'

@ -1 +1 @@
Subproject commit 803846d9c4db29fb64ad96e45e46b1e9f64b2e03 Subproject commit 00b275f82f52b9bbfebe4649b8c96a438365aecd

View file

@ -1,6 +1,6 @@
project.ext { project.ext {
verAsm = '9.7.1' verAsm = '9.7.1'
verNetty = '4.1.114.Final' verNetty = '4.2.0.RC3'
verOshiCore = '6.6.6' verOshiCore = '6.6.6'
verJunit = '5.11.4' verJunit = '5.11.4'
verJansi = '2.4.1' verJansi = '2.4.1'