Skip to content

Commit

Permalink
First work on forwarding protocol support and also implement hints an…
Browse files Browse the repository at this point in the history
…d first run message
  • Loading branch information
AlexProgrammerDE committed Oct 22, 2023
1 parent b872127 commit 95d4e68
Show file tree
Hide file tree
Showing 18 changed files with 908 additions and 29 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ dependencies {
implementation(libs.flatlaf.intellij.themes)
implementation(libs.flatlaf.extras)
implementation(libs.xchart)
implementation(libs.miglayout.swing)

// For JavaFX file editor in GUI
val javaFXVersion = "20"
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ flatlaf = "com.formdev:flatlaf:3.2.2"
flatlaf-extras = "com.formdev:flatlaf-extras:3.2.2"
flatlaf-intellij-themes = "com.formdev:flatlaf-intellij-themes:3.2.2"
xchart = "org.knowm.xchart:xchart:3.8.5"
miglayout-swing = "com.miglayout:miglayout-swing:5.3"
mcprotocollib = "com.github.GeyserMC:MCProtocolLib:2f05a23"
velocity-native = "com.velocitypowered:velocity-native:3.1.2-SNAPSHOT"
netty-raknet = "org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR1-SNAPSHOT"
Expand Down
10 changes: 10 additions & 0 deletions settings.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ServerWrecker GUI Settings
#Sun Oct 22 09:58:07 CEST 2023
firstRun=false
hint.addonsButton=true
hint.proxyButton=true
hint.accountsButton=true
hint.controls=true
hint.settingsButton=true
hint.logPanel=true
hint.commandInput=true
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class ServerWrecker {
).build();
}

private final Gson gson = new Gson();
public static final Gson GENERAL_GSON = new Gson();
private final Injector injector = new InjectorBuilder()
.addDefaultHandlers("net.pistonmaster.serverwrecker")
.create();
Expand Down Expand Up @@ -266,7 +266,7 @@ private boolean checkForUpdates() {

JsonObject response;
try (var stream = connection.getInputStream()) {
response = gson.fromJson(new InputStreamReader(stream), JsonObject.class);
response = GENERAL_GSON.fromJson(new InputStreamReader(stream), JsonObject.class);
}

var latestVersion = response.get("tag_name").getAsString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static void main(String[] args) {
ServerWreckerLoader.runHeadless(port, args);
} else {
ServerWreckerLoader.injectTheme();
ServerWreckerLoader.loadGUIProperties();

ServerWreckerLoader.loadInternalAddons();
ServerWreckerLoader.runGUI(port);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.pistonmaster.serverwrecker.cli.SWCommandDefinition;
import net.pistonmaster.serverwrecker.common.OperationMode;
import net.pistonmaster.serverwrecker.grpc.RPCClient;
import net.pistonmaster.serverwrecker.gui.GUIClientProps;
import net.pistonmaster.serverwrecker.gui.GUIManager;
import net.pistonmaster.serverwrecker.gui.theme.ThemeUtil;
import net.pistonmaster.serverwrecker.settings.DevSettings;
Expand Down Expand Up @@ -62,6 +63,10 @@ public static void injectTheme() {
ThemeUtil.setLookAndFeel();
}

public static void loadGUIProperties() {
GUIClientProps.loadSettings();
}

public static void loadInternalAddons() {
var addons = List.of(
new BotTicker(), new ClientBrand(), new ClientSettings(),
Expand Down
Loading

0 comments on commit 95d4e68

Please sign in to comment.