* 界面标题描述纠正 * 新增有效期getValidAt #1727 * fix err * fix-err-again * fix-err * fix * fix-4 * rename * fix * fix * code clean
This commit is contained in:
committed by
GitHub
parent
2028b0ef9c
commit
3ed6e38ad3
@@ -215,6 +215,7 @@ public final class MultiplayerManager {
|
|||||||
public static class HiperSession extends ManagedProcess {
|
public static class HiperSession extends ManagedProcess {
|
||||||
private final EventManager<HiperExitEvent> onExit = new EventManager<>();
|
private final EventManager<HiperExitEvent> onExit = new EventManager<>();
|
||||||
private final EventManager<HiperIPEvent> onIPAllocated = new EventManager<>();
|
private final EventManager<HiperIPEvent> onIPAllocated = new EventManager<>();
|
||||||
|
private final EventManager<HiperShowValidAtEvent> onValidAt = new EventManager<>();
|
||||||
private final BufferedWriter writer;
|
private final BufferedWriter writer;
|
||||||
private int error = 0;
|
private int error = 0;
|
||||||
|
|
||||||
@@ -251,6 +252,10 @@ public final class MultiplayerManager {
|
|||||||
if (msg.contains("Failed to load certificate from config")) {
|
if (msg.contains("Failed to load certificate from config")) {
|
||||||
error = HiperExitEvent.FAILED_LOAD_CONFIG;
|
error = HiperExitEvent.FAILED_LOAD_CONFIG;
|
||||||
}
|
}
|
||||||
|
if (msg.contains("Validity of client certificate")) {
|
||||||
|
Optional<String> validAt = tryCast(logJson.get("valid"), String.class);
|
||||||
|
validAt.ifPresent(s -> onValidAt.fireEvent(new HiperShowValidAtEvent(this, s)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logJson.containsKey("network")) {
|
if (logJson.containsKey("network")) {
|
||||||
@@ -295,6 +300,10 @@ public final class MultiplayerManager {
|
|||||||
return onIPAllocated;
|
return onIPAllocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EventManager<HiperShowValidAtEvent> onValidAt() {
|
||||||
|
return onValidAt;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HiperExitEvent extends Event {
|
public static class HiperExitEvent extends Event {
|
||||||
@@ -329,6 +338,19 @@ public final class MultiplayerManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class HiperShowValidAtEvent extends Event {
|
||||||
|
private final String validAt;
|
||||||
|
|
||||||
|
public HiperShowValidAtEvent(Object source, String validAt) {
|
||||||
|
super(source);
|
||||||
|
this.validAt = validAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidAt() {
|
||||||
|
return validAt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class HiperExitException extends RuntimeException {
|
public static class HiperExitException extends RuntimeException {
|
||||||
private final int exitCode;
|
private final int exitCode;
|
||||||
private final boolean ready;
|
private final boolean ready;
|
||||||
|
|||||||
Reference in New Issue
Block a user