mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
Вывод информации о лицензии в консоль при запуске
This commit is contained in:
parent
3cd15a6168
commit
07eaa0c691
5 changed files with 31 additions and 3 deletions
|
@ -275,6 +275,7 @@ public static void main(String... args) throws Throwable {
|
|||
JVMHelper.verifySystemProperties(LaunchServer.class, true);
|
||||
LogHelper.addOutput(IOHelper.WORKING_DIR.resolve("LaunchServer.log"));
|
||||
LogHelper.printVersion("LaunchServer");
|
||||
LogHelper.printLicense("LauncherServer");
|
||||
|
||||
// Start LaunchServer
|
||||
Instant start = Instant.now();
|
||||
|
|
|
@ -17,6 +17,9 @@ public class ClientLauncherWrapper {
|
|||
@LauncherAPI
|
||||
public static void main(String[] arguments) throws IOException, InterruptedException {
|
||||
LogHelper.printVersion("Launcher");
|
||||
LogHelper.printLicense("Launcher");
|
||||
LogHelper.info("Restart Launcher witch JavaAgent...");
|
||||
LogHelper.info("If need debug output use -Dlauncher.debug=true");
|
||||
JVMHelper.checkStackTrace(ClientLauncherWrapper.class);
|
||||
JVMHelper.verifySystemProperties(Launcher.class, true);
|
||||
EnvHelper.checkDangerousParams();
|
||||
|
@ -39,7 +42,11 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
|||
if (!LogHelper.isDebugEnabled()) {
|
||||
Thread.sleep(3000);
|
||||
if (!process.isAlive()) {
|
||||
LogHelper.error("Process error code: %d", process.exitValue());
|
||||
int errorcode = process.exitValue();
|
||||
if(errorcode != 0)
|
||||
LogHelper.error("Process exit witch error code: %d", errorcode);
|
||||
else
|
||||
LogHelper.info("Process exit witch code 0");
|
||||
} else {
|
||||
LogHelper.debug("Process started success");
|
||||
}
|
||||
|
|
|
@ -163,6 +163,7 @@ public static void main(String... args) throws Throwable {
|
|||
EnvHelper.checkDangerousParams();
|
||||
//if(!LauncherAgent.isStarted()) throw new SecurityException("JavaAgent not set");
|
||||
LogHelper.printVersion("Launcher");
|
||||
LogHelper.printLicense("Launcher");
|
||||
// Start Launcher
|
||||
Instant start = Instant.now();
|
||||
try {
|
||||
|
|
|
@ -76,6 +76,8 @@ public static boolean loopAuth(ServerWrapper wrapper, int count, int sleeptime)
|
|||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
ServerWrapper wrapper = new ServerWrapper();
|
||||
LogHelper.printVersion("ServerWrapper");
|
||||
LogHelper.printLicense("ServerWrapper");
|
||||
modulesManager = new ModulesManager(wrapper);
|
||||
modulesManager.autoload(Paths.get("srv_modules")); //BungeeCord using modules dir
|
||||
Launcher.modulesManager = modulesManager;
|
||||
|
|
|
@ -117,6 +117,10 @@ public static void log(Level level, String message, boolean sub) {
|
|||
public static void printVersion(String product) {
|
||||
println(JANSI ? ansiFormatVersion(product) : formatVersion(product));
|
||||
}
|
||||
@LauncherAPI
|
||||
public static void printLicense(String product) {
|
||||
println(JANSI ? ansiFormatLicense(product) : formatLicense(product));
|
||||
}
|
||||
|
||||
@LauncherAPI
|
||||
public static synchronized void println(String message) {
|
||||
|
@ -234,13 +238,23 @@ private static String ansiFormatLog(Level level, String dateTime, String message
|
|||
|
||||
private static String ansiFormatVersion(String product) {
|
||||
return new Ansi().bold(). // Setup
|
||||
fgBright(Color.MAGENTA).a("sashok724's "). // sashok724's
|
||||
fgBright(Color.MAGENTA).a("GravitLauncher "). // sashok724's
|
||||
fgBright(Color.BLUE).a("(fork sashok724's Launcher) ").
|
||||
fgBright(Color.CYAN).a(product). // Product
|
||||
fgBright(Color.WHITE).a(" v").fgBright(Color.BLUE).a(Launcher.getVersion().toString()). // Version
|
||||
fgBright(Color.WHITE).a(" (build #").fgBright(Color.RED).a(Launcher.getVersion().build).fgBright(Color.WHITE).a(')'). // Build#
|
||||
reset().toString(); // To string
|
||||
}
|
||||
|
||||
private static String ansiFormatLicense(String product) {
|
||||
return new Ansi().bold(). // Setup
|
||||
fgBright(Color.MAGENTA).a("License for "). // sashok724's
|
||||
fgBright(Color.CYAN).a(product). // Product
|
||||
fgBright(Color.WHITE).a(" GPLv3").fgBright(Color.WHITE).a(". SourceCode: "). // Version
|
||||
fgBright(Color.YELLOW).a("https://github.com/GravitLauncher/Launcher").
|
||||
reset().toString(); // To string
|
||||
}
|
||||
|
||||
private static String formatLog(Level level, String message, String dateTime, boolean sub) {
|
||||
if (sub) {
|
||||
message = ' ' + message;
|
||||
|
@ -249,7 +263,10 @@ private static String formatLog(Level level, String message, String dateTime, bo
|
|||
}
|
||||
|
||||
private static String formatVersion(String product) {
|
||||
return String.format("sashok724's %s v%s", product, Launcher.getVersion().toString());
|
||||
return String.format("GravitLauncher (fork sashok724's Launcher) %s v%s", product, Launcher.getVersion().toString());
|
||||
}
|
||||
private static String formatLicense(String product) {
|
||||
return String.format("License for %s GPLv3. SourceCode: https://github.com/GravitLauncher/Launcher", product);
|
||||
}
|
||||
|
||||
static {
|
||||
|
|
Loading…
Reference in a new issue