mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +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>
|
<dependency>
|
||||||
<groupId>net.ME1312.Galaxi</groupId>
|
<groupId>net.ME1312.Galaxi</groupId>
|
||||||
<artifactId>GalaxiBase</artifactId>
|
<artifactId>GalaxiBase</artifactId>
|
||||||
<version>23w08b</version>
|
<version>23w14a</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -126,9 +126,9 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptors>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptor>../SubServers.Client/Common/jar-with-some-dependencies.xml</descriptor>
|
||||||
</descriptorRefs>
|
</descriptors>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
@ -120,6 +120,7 @@ public class ExternalHost extends Host implements ClientHandler {
|
|||||||
if (!served.contains(server.getName())) {
|
if (!served.contains(server.getName())) {
|
||||||
client.sendPacket(new PacketExAddServer((ExternalSubServer) server, (server.isRunning())?((ExternalSubLogger) server.getLogger()).getExternalAddress():null, data -> {
|
client.sendPacket(new PacketExAddServer((ExternalSubServer) server, (server.isRunning())?((ExternalSubLogger) server.getLogger()).getExternalAddress():null, data -> {
|
||||||
if (data.contains(0x0002)) ((ExternalSubServer) server).started(data.getUUID(0x0002));
|
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;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
private void stopped(Boolean allowrestart) {
|
void stopped(Boolean allowrestart) {
|
||||||
logger.stop();
|
logger.stop();
|
||||||
history.clear();
|
history.clear();
|
||||||
started = false;
|
started = false;
|
||||||
|
@ -15,6 +15,7 @@ import net.ME1312.SubServers.Bungee.SubProxy;
|
|||||||
|
|
||||||
import com.dosse.upnp.UPnP;
|
import com.dosse.upnp.UPnP;
|
||||||
import com.google.common.collect.Range;
|
import com.google.common.collect.Range;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
@ -185,7 +186,7 @@ public class InternalHost extends Host {
|
|||||||
}
|
}
|
||||||
if (!to.exists()) to.mkdirs();
|
if (!to.exists()) to.mkdirs();
|
||||||
FileWriter writer = new FileWriter(new File(to, "info.json"), false);
|
FileWriter writer = new FileWriter(new File(to, "info.json"), false);
|
||||||
writer.write(info.toJSON().toString());
|
writer.write(new Gson().toJson(info.get()));
|
||||||
writer.close();
|
writer.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -606,7 +606,7 @@ public class InternalSubCreator extends SubCreator {
|
|||||||
YAMLSection config = new YAMLSection();
|
YAMLSection config = new YAMLSection();
|
||||||
FileWriter writer = new FileWriter(new File(dir, "subdata.json"), false);
|
FileWriter writer = new FileWriter(new File(dir, "subdata.json"), false);
|
||||||
config.setAll(getSubData());
|
config.setAll(getSubData());
|
||||||
writer.write(config.toJSON().toString());
|
writer.write(new Gson().toJson(config.get()));
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
||||||
if (!new File(dir, "subdata.rsa.key").exists() && new File("SubServers/subdata.rsa.key").exists()) {
|
if (!new File(dir, "subdata.rsa.key").exists() && new File("SubServers/subdata.rsa.key").exists()) {
|
||||||
|
@ -121,9 +121,9 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptors>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
|
||||||
</descriptorRefs>
|
</descriptors>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<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>
|
<dependency>
|
||||||
<groupId>net.ME1312.Galaxi</groupId>
|
<groupId>net.ME1312.Galaxi</groupId>
|
||||||
<artifactId>GalaxiBase</artifactId>
|
<artifactId>GalaxiBase</artifactId>
|
||||||
<version>23w08b</version>
|
<version>23w14a</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -84,9 +84,11 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<finalName>SubServers.Client.Common</finalName>
|
<finalName>SubServers.Client.Common</finalName>
|
||||||
<outputDirectory>../../Artifacts/Modulized</outputDirectory>
|
<outputDirectory>../../Artifacts/Modulized</outputDirectory>
|
||||||
<descriptorRefs>
|
<descriptors>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptor>jar-with-some-dependencies.xml</descriptor>
|
||||||
</descriptorRefs>
|
</descriptors>
|
||||||
|
<descriptor>
|
||||||
|
</descriptor>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
@ -91,9 +91,9 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
<manifestFile>src/META-INF/MANIFEST.MF</manifestFile>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptors>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
|
||||||
</descriptorRefs>
|
</descriptors>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
@ -44,9 +44,9 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifestFile>MANIFEST.MF</manifestFile>
|
<manifestFile>MANIFEST.MF</manifestFile>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptors>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptor>../Common/jar-with-some-dependencies.xml</descriptor>
|
||||||
</descriptorRefs>
|
</descriptors>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.fusesource.jansi</groupId>
|
<groupId>org.fusesource.jansi</groupId>
|
||||||
<artifactId>jansi</artifactId> <!--suppress MavenPackageUpdate-->
|
<artifactId>jansi</artifactId>
|
||||||
<version>1.18</version>
|
<version>2.4.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -30,13 +30,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.ME1312.Galaxi</groupId>
|
<groupId>net.ME1312.Galaxi</groupId>
|
||||||
<artifactId>GalaxiEngine</artifactId>
|
<artifactId>GalaxiEngine</artifactId>
|
||||||
<version>23w08b</version>
|
<version>23w14a</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.ME1312.Galaxi</groupId>
|
<groupId>net.ME1312.Galaxi</groupId>
|
||||||
<artifactId>GalaxiUI</artifactId>
|
<artifactId>GalaxiUI</artifactId>
|
||||||
<version>23w08b</version>
|
<version>23w14a</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -34,16 +34,6 @@ public class PacketExAddServer implements PacketObjectIn<Integer>, PacketObjectO
|
|||||||
this.host = host;
|
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)
|
* 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);
|
init(client.getConnection(), new SubServerImpl(host, name, enabled, port, log, dir, exec, stopcmd), running, tracker, logger);
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
client.sendPacket(new PacketExAddServer(2, tracker));
|
client.sendPacket(new PacketExAddServer(2, null, tracker));
|
||||||
host.log.error.println(e);
|
host.log.error.println(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(SubDataClient client, SubServerImpl server, UUID running, UUID tracker, Logger logger) {
|
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);
|
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());
|
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());
|
logger.info("Added SubServer: " + server.getName());
|
||||||
if (running != null) server.start(running);
|
if (running != null) server.start(running);
|
||||||
client.sendPacket(new PacketExAddServer(0, tracker));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -124,9 +124,9 @@
|
|||||||
<archive>
|
<archive>
|
||||||
<manifestFile>../src/META-INF/MANIFEST.MF</manifestFile>
|
<manifestFile>../src/META-INF/MANIFEST.MF</manifestFile>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptors>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptor>../../SubServers.Client/Common/jar-with-some-dependencies.xml</descriptor>
|
||||||
</descriptorRefs>
|
</descriptors>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
Loading…
Reference in New Issue
Block a user