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>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Server</artifactId>
<version>21w05b</version>
<version>21w05d</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -38,10 +38,8 @@ public class PacketExDownloadTemplates implements PacketIn, PacketStreamOut {
@Override
public void send(SubDataClient client, OutputStream stream) throws Throwable {
try {
int initial = client.getBlockSize();
client.setBlockSize(DataSize.MBB);
if (client.getBlockSize() < DataSize.MBB) client.tempBlockSize(DataSize.MBB);
Util.zip(new UniversalFile(plugin.dir, "SubServers:Templates"), stream);
client.setBlockSize(initial);
stream.close();
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");
setVersion(new Version("2.16a+"));
setBlockSize(DataSize.MB);
// 00-0F: Object Link Packets

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -78,7 +78,7 @@ public class SubLoggerImpl {
Process process = this.process;
ExHost host = SubAPI.getInstance().getInternals();
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>>() {
@Override
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()) {
timer.cancel();
} else try {
SubDataClient open = (SubDataClient) SubAPI.getInstance().getSubDataNetwork()[0].openChannel();
SubDataClient open = (SubDataClient) SubAPI.getInstance().getSubDataNetwork()[0].newChannel();
open.on.closed(run);
channel = open;
timer.cancel();

View File

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

View File

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

View File

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