SubData API updates & usage optimizations

This commit is contained in:
ME1312 2021-01-29 19:06:23 -05:00
parent 6d32f1b6a0
commit b0340b498e
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
13 changed files with 9 additions and 16 deletions

View File

@ -50,7 +50,7 @@
<dependency> <dependency>
<groupId>net.ME1312.SubData</groupId> <groupId>net.ME1312.SubData</groupId>
<artifactId>Server</artifactId> <artifactId>Server</artifactId>
<version>21w05b</version> <version>21w05d</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -38,10 +38,8 @@ public class PacketExDownloadTemplates implements PacketIn, PacketStreamOut {
@Override @Override
public void send(SubDataClient client, OutputStream stream) throws Throwable { public void send(SubDataClient client, OutputStream stream) throws Throwable {
try { try {
int initial = client.getBlockSize(); if (client.getBlockSize() < DataSize.MBB) client.tempBlockSize(DataSize.MBB);
client.setBlockSize(DataSize.MBB);
Util.zip(new UniversalFile(plugin.dir, "SubServers:Templates"), stream); Util.zip(new UniversalFile(plugin.dir, "SubServers:Templates"), stream);
client.setBlockSize(initial);
stream.close(); stream.close();
Util.isException(() -> Util.reflect(ExternalSubCreator.class.getDeclaredField("enableRT"), host.getCreator(), true)); Util.isException(() -> Util.reflect(ExternalSubCreator.class.getDeclaredField("enableRT"), host.getCreator(), true));

View File

@ -30,7 +30,6 @@ public class SubProtocol extends SubDataProtocol {
setName("SubServers 2"); setName("SubServers 2");
setVersion(new Version("2.16a+")); setVersion(new Version("2.16a+"));
setBlockSize(DataSize.MB);
// 00-0F: Object Link Packets // 00-0F: Object Link Packets

View File

@ -62,7 +62,7 @@
<dependency> <dependency>
<groupId>net.ME1312.SubData</groupId> <groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId> <artifactId>Client</artifactId>
<version>21w05b</version> <version>21w05d</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -36,7 +36,6 @@ public class SubProtocol extends SubDataProtocol {
setName("SubServers 2"); setName("SubServers 2");
addVersion(new Version("2.16a+")); addVersion(new Version("2.16a+"));
setBlockSize(DataSize.MB);
// 00-0F: Object Link Packets // 00-0F: Object Link Packets

View File

@ -26,7 +26,7 @@
<dependency> <dependency>
<groupId>net.ME1312.SubData</groupId> <groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId> <artifactId>Client</artifactId>
<version>21w05b</version> <version>21w05d</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -44,7 +44,7 @@
<dependency> <dependency>
<groupId>net.ME1312.SubData</groupId> <groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId> <artifactId>Client</artifactId>
<version>21w05b</version> <version>21w05d</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -39,7 +39,6 @@ public class SubProtocol extends SubDataProtocol {
setName("SubServers 2"); setName("SubServers 2");
addVersion(new Version("2.16a+")); addVersion(new Version("2.16a+"));
setBlockSize(DataSize.MB);
// 00-0F: Object Link Packets // 00-0F: Object Link Packets

View File

@ -34,7 +34,7 @@
<dependency> <dependency>
<groupId>net.ME1312.SubData</groupId> <groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId> <artifactId>Client</artifactId>
<version>21w05b</version> <version>21w05d</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -78,7 +78,7 @@ public class SubLoggerImpl {
Process process = this.process; Process process = this.process;
ExHost host = SubAPI.getInstance().getInternals(); ExHost host = SubAPI.getInstance().getInternals();
if (logn) Util.isException(() -> { if (logn) Util.isException(() -> {
channel = (SubDataClient) SubAPI.getInstance().getSubDataNetwork()[0].openChannel(); channel = (SubDataClient) SubAPI.getInstance().getSubDataNetwork()[0].newChannel();
channel.on.closed(new Callback<Pair<DisconnectReason, DataClient>>() { channel.on.closed(new Callback<Pair<DisconnectReason, DataClient>>() {
@Override @Override
public void run(Pair<DisconnectReason, DataClient> client) { public void run(Pair<DisconnectReason, DataClient> client) {
@ -95,7 +95,7 @@ public class SubLoggerImpl {
if (!started || SubLoggerImpl.this.process == null || process != SubLoggerImpl.this.process || !process.isAlive()) { if (!started || SubLoggerImpl.this.process == null || process != SubLoggerImpl.this.process || !process.isAlive()) {
timer.cancel(); timer.cancel();
} else try { } else try {
SubDataClient open = (SubDataClient) SubAPI.getInstance().getSubDataNetwork()[0].openChannel(); SubDataClient open = (SubDataClient) SubAPI.getInstance().getSubDataNetwork()[0].newChannel();
open.on.closed(run); open.on.closed(run);
channel = open; channel = open;
timer.cancel(); timer.cancel();

View File

@ -34,7 +34,6 @@ public class SubProtocol extends SubDataProtocol {
setName("SubServers 2"); setName("SubServers 2");
addVersion(new Version("2.16a+")); addVersion(new Version("2.16a+"));
setBlockSize(DataSize.MB);
// 00-0F: Object Link Packets // 00-0F: Object Link Packets

View File

@ -57,7 +57,7 @@
<dependency> <dependency>
<groupId>net.ME1312.SubData</groupId> <groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId> <artifactId>Client</artifactId>
<version>21w05b</version> <version>21w05d</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -43,7 +43,6 @@ public class SubProtocol extends SubDataProtocol {
setName("SubServers 2"); setName("SubServers 2");
addVersion(new Version("2.16a+")); addVersion(new Version("2.16a+"));
setBlockSize(DataSize.MB);
// 00-0F: Object Link Packets // 00-0F: Object Link Packets