mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 02:08:27 +01:00
Reduced and updated dependancies
Also includes potential fixes for external host state desyncing
This commit is contained in:
parent
01456fd964
commit
ecf76a97de
@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiBase</artifactId>
|
||||
<version>23w08b</version>
|
||||
<version>23w14a</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -126,9 +126,9 @@
|
||||
<archive>
|
||||
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<descriptors>
|
||||
<descriptor>../SubServers.Client/Common/jar-with-some-dependencies.xml</descriptor>
|
||||
</descriptors>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
@ -120,6 +120,7 @@ public class ExternalHost extends Host implements ClientHandler {
|
||||
if (!served.contains(server.getName())) {
|
||||
client.sendPacket(new PacketExAddServer((ExternalSubServer) server, (server.isRunning())?((ExternalSubLogger) server.getLogger()).getExternalAddress():null, data -> {
|
||||
if (data.contains(0x0002)) ((ExternalSubServer) server).started(data.getUUID(0x0002));
|
||||
else if (server.isRunning()) ((ExternalSubServer) server).stopped(false);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ public class ExternalSubServer extends SubServerImpl {
|
||||
} else return false;
|
||||
} else return false;
|
||||
}
|
||||
private void stopped(Boolean allowrestart) {
|
||||
void stopped(Boolean allowrestart) {
|
||||
logger.stop();
|
||||
history.clear();
|
||||
started = false;
|
||||
|
@ -15,6 +15,7 @@ import net.ME1312.SubServers.Bungee.SubProxy;
|
||||
|
||||
import com.dosse.upnp.UPnP;
|
||||
import com.google.common.collect.Range;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
@ -185,7 +186,7 @@ public class InternalHost extends Host {
|
||||
}
|
||||
if (!to.exists()) to.mkdirs();
|
||||
FileWriter writer = new FileWriter(new File(to, "info.json"), false);
|
||||
writer.write(info.toJSON().toString());
|
||||
writer.write(new Gson().toJson(info.get()));
|
||||
writer.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -606,7 +606,7 @@ public class InternalSubCreator extends SubCreator {
|
||||
YAMLSection config = new YAMLSection();
|
||||
FileWriter writer = new FileWriter(new File(dir, "subdata.json"), false);
|
||||
config.setAll(getSubData());
|
||||
writer.write(config.toJSON().toString());
|
||||
writer.write(new Gson().toJson(config.get()));
|
||||
writer.close();
|
||||
|
||||
if (!new File(dir, "subdata.rsa.key").exists() && new File("SubServers/subdata.rsa.key").exists()) {
|
||||
|
@ -121,9 +121,9 @@
|
||||
<archive>
|
||||
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<descriptors>
|
||||
<descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
|
||||
</descriptors>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
20
SubServers.Client/Common/jar-with-some-dependencies.xml
Normal file
20
SubServers.Client/Common/jar-with-some-dependencies.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 https://maven.apache.org/xsd/assembly-2.1.1.xsd">
|
||||
<id>jar-with-some-dependencies</id>
|
||||
<formats>
|
||||
<format>jar</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<unpack>true</unpack>
|
||||
<scope>runtime</scope>
|
||||
<excludes>
|
||||
<exclude>org.json:json</exclude>
|
||||
<exclude>org.yaml:snakeyaml</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiBase</artifactId>
|
||||
<version>23w08b</version>
|
||||
<version>23w14a</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -84,9 +84,11 @@
|
||||
<configuration>
|
||||
<finalName>SubServers.Client.Common</finalName>
|
||||
<outputDirectory>../../Artifacts/Modulized</outputDirectory>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<descriptors>
|
||||
<descriptor>jar-with-some-dependencies.xml</descriptor>
|
||||
</descriptors>
|
||||
<descriptor>
|
||||
</descriptor>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
@ -91,9 +91,9 @@
|
||||
<archive>
|
||||
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<descriptors>
|
||||
<descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
|
||||
</descriptors>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
@ -44,9 +44,9 @@
|
||||
<archive>
|
||||
<manifestFile>MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<descriptors>
|
||||
<descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
|
||||
</descriptors>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
@ -17,8 +17,8 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.fusesource.jansi</groupId>
|
||||
<artifactId>jansi</artifactId> <!--suppress MavenPackageUpdate-->
|
||||
<version>1.18</version>
|
||||
<artifactId>jansi</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -30,13 +30,13 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiEngine</artifactId>
|
||||
<version>23w08b</version>
|
||||
<version>23w14a</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.ME1312.Galaxi</groupId>
|
||||
<artifactId>GalaxiUI</artifactId>
|
||||
<version>23w08b</version>
|
||||
<version>23w14a</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -34,16 +34,6 @@ public class PacketExAddServer implements PacketObjectIn<Integer>, PacketObjectO
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
/**
|
||||
* New PacketExAddServer (Out)
|
||||
*
|
||||
* @param response Response ID
|
||||
* @param tracker Receiver ID
|
||||
*/
|
||||
public PacketExAddServer(int response, UUID tracker) {
|
||||
this(response, null, tracker);
|
||||
}
|
||||
|
||||
/**
|
||||
* New PacketExAddServer (Out)
|
||||
*
|
||||
@ -102,16 +92,16 @@ public class PacketExAddServer implements PacketObjectIn<Integer>, PacketObjectO
|
||||
init(client.getConnection(), new SubServerImpl(host, name, enabled, port, log, dir, exec, stopcmd), running, tracker, logger);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
client.sendPacket(new PacketExAddServer(2, tracker));
|
||||
client.sendPacket(new PacketExAddServer(2, null, tracker));
|
||||
host.log.error.println(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void init(SubDataClient client, SubServerImpl server, UUID running, UUID tracker, Logger logger) {
|
||||
client.sendPacket(new PacketExAddServer(0, running, tracker));
|
||||
host.servers.put(server.getName().toLowerCase(), server);
|
||||
if (UPnP.isUPnPAvailable() && host.config.get().getMap("Settings").getMap("UPnP", new ObjectMap<String>()).getBoolean("Forward-Servers", false)) UPnP.openPortTCP(server.getPort());
|
||||
logger.info("Added SubServer: " + server.getName());
|
||||
if (running != null) server.start(running);
|
||||
client.sendPacket(new PacketExAddServer(0, tracker));
|
||||
}
|
||||
}
|
@ -124,9 +124,9 @@
|
||||
<archive>
|
||||
<manifestFile>../src/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<descriptors>
|
||||
<descriptor>../../SubServers.Client/Common/jar-with-some-dependencies.xml</descriptor>
|
||||
</descriptors>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
Loading…
Reference in New Issue
Block a user