From ecd4902dbe88da0cacfb04f7dab90760d0e7a68f Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Tue, 17 May 2022 14:26:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E7=9A=84=20trusted-readers-of-dinner=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=92=8C=20version=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../cc/sukazyo/cono/morny/GradleProjectConfigures.java | 4 ++-- src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java | 7 +++++-- src/main/java/cc/sukazyo/cono/morny/MornyTrusted.java | 6 +++++- src/main/java/cc/sukazyo/cono/morny/ServerMain.java | 6 ++++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 6094b3a..8d5c313 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ ## Core -VERSION = 0.6.4.0 +VERSION = 0.6.5.0 # dependencies diff --git a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java index edcbadd..db94338 100644 --- a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java +++ b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java @@ -4,6 +4,6 @@ package cc.sukazyo.cono.morny; * the final field that will be updated by gradle automatically. */ public class GradleProjectConfigures { - public static final String VERSION = "0.6.4.0"; - public static final long COMPILE_TIMESTAMP = 1652197269644L; + public static final String VERSION = "0.6.5.0"; + public static final long COMPILE_TIMESTAMP = 1652768698515L; } diff --git a/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java b/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java index 90ae3e1..84101b9 100644 --- a/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java +++ b/src/main/java/cc/sukazyo/cono/morny/MornyCoeur.java @@ -94,13 +94,16 @@ public class MornyCoeur { this.account = loginResult.account; this.username = loginResult.username; this.trusted = new MornyTrusted(master, trustedChat, trustedRDinner); + StringBuilder trustedReadersDinnerIds = new StringBuilder(); + trusted.getTrustedReadersOfDinnerSet().forEach(id -> trustedReadersDinnerIds.append("\n ").append(id)); logger.info(String.format(""" trusted param set: - master (id) %d - trusted chat (id) - %d""", - master, trustedChat + %d + - trusted reader-of-dinner (id)%s""", + master, trustedChat, trustedReadersDinnerIds )); } catch (Exception e) { diff --git a/src/main/java/cc/sukazyo/cono/morny/MornyTrusted.java b/src/main/java/cc/sukazyo/cono/morny/MornyTrusted.java index 1c7009a..ba93789 100644 --- a/src/main/java/cc/sukazyo/cono/morny/MornyTrusted.java +++ b/src/main/java/cc/sukazyo/cono/morny/MornyTrusted.java @@ -21,7 +21,7 @@ public class MornyTrusted { */ public final long MASTER; - public final Set TRUSTED_READERS_OF_DINNER; + private final Set TRUSTED_READERS_OF_DINNER; public MornyTrusted (long master, long trustedChatId, Set trustedRDinner) { this.TRUSTED_CHAT_ID = trustedChatId; @@ -51,4 +51,8 @@ public class MornyTrusted { return TRUSTED_READERS_OF_DINNER.contains(userId); } + public Set getTrustedReadersOfDinnerSet () { + return Set.copyOf(TRUSTED_READERS_OF_DINNER); + } + } diff --git a/src/main/java/cc/sukazyo/cono/morny/ServerMain.java b/src/main/java/cc/sukazyo/cono/morny/ServerMain.java index f809434..a0fa6ea 100644 --- a/src/main/java/cc/sukazyo/cono/morny/ServerMain.java +++ b/src/main/java/cc/sukazyo/cono/morny/ServerMain.java @@ -168,6 +168,12 @@ public class ServerMain { if (showWelcome) logger.info(MornyHello.MORNY_PREVIEW_IMAGE_ASCII); if (welcomeEchoMode) return; + logger.info(String.format(""" + ServerMain.java Loaded >>> + - version %s(%s)(%d)""", + MornySystem.VERSION, MornySystem.getJarMd5(), GradleProjectConfigures.COMPILE_TIMESTAMP + )); + if (key == null) { logger.info("Parameter required has no value:\n --token."); return;