Update SubData

This commit is contained in:
ME1312 2020-11-23 00:25:00 -05:00
parent 80da5f7b27
commit bcd7f4f3c3
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
13 changed files with 45 additions and 27 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>20w46d</version> <version>20w48a</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -85,11 +85,13 @@ public class PacketLinkExHost implements InitialPacket, PacketObjectIn<Integer>,
private void queue(String name, Runnable action) { private void queue(String name, Runnable action) {
final long now = Calendar.getInstance().getTime().getTime(); final long now = Calendar.getInstance().getTime().getTime();
new Timer("SubServers.Bungee::ExHost_Linker(" + name + ")").schedule(new TimerTask() { Timer timer = new Timer("SubServers.Bungee::ExHost_Linker(" + name + ")");
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
action.run(); action.run();
--req; --req;
timer.cancel();
} }
}, (now - last < 500) ? (req * 500) : 0); }, (now - last < 500) ? (req * 500) : 0);

View File

@ -91,11 +91,13 @@ public class PacketLinkProxy implements InitialPacket, PacketObjectIn<Integer>,
private void queue(String name, Runnable action) { private void queue(String name, Runnable action) {
final long now = Calendar.getInstance().getTime().getTime(); final long now = Calendar.getInstance().getTime().getTime();
new Timer("SubServers.Bungee::Proxy_Linker(" + name + ")").schedule(new TimerTask() { Timer timer = new Timer("SubServers.Bungee::Proxy_Linker(" + name + ")");
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
action.run(); action.run();
--req; --req;
timer.cancel();
} }
}, (now - last < 500) ? (req * 500) : 0); }, (now - last < 500) ? (req * 500) : 0);

View File

@ -129,10 +129,12 @@ public class PacketLinkServer implements InitialPacket, PacketObjectIn<Integer>,
}; };
final long now = Calendar.getInstance().getTime().getTime(); final long now = Calendar.getInstance().getTime().getTime();
new Timer("SubServers.Bungee::Server_Linker(" + server.getName() + ")").schedule(new TimerTask() { Timer timer = new Timer("SubServers.Bungee::Server_Linker(" + server.getName() + ")");
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
register.run(); register.run();
timer.cancel();
} }
}, ((server instanceof SubServer && !((SubServer) server).isRunning()) ? TimeUnit.SECONDS.toMillis(5) : 0) + ((now - last < 500) ? (req * 500) : 0)); }, ((server instanceof SubServer && !((SubServer) server).isRunning()) ? TimeUnit.SECONDS.toMillis(5) : 0) + ((now - last < 500) ? (req * 500) : 0));

View File

@ -992,17 +992,21 @@ public final class SubProxy extends BungeeCommon implements Listener {
} }
if (fallbackLimbo.keySet().contains(e.getPlayer().getUniqueId())) new Timer("SubServers.Bungee::Fallback_Limbo_Timer(" + e.getPlayer().getUniqueId() + ')').schedule(new TimerTask() { if (fallbackLimbo.keySet().contains(e.getPlayer().getUniqueId())) {
Timer timer = new Timer("SubServers.Bungee::Fallback_Limbo_Timer(" + e.getPlayer().getUniqueId() + ')');
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) { if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) {
fallbackLimbo.remove(e.getPlayer().getUniqueId()); fallbackLimbo.remove(e.getPlayer().getUniqueId());
e.getPlayer().sendMessage(api.getLang("SubServers", "Bungee.Feature.Smart-Fallback.Result").replace("$str$", (e.getServer().getInfo() instanceof Server)?((Server) e.getServer().getInfo()).getDisplayName():e.getServer().getInfo().getName())); e.getPlayer().sendMessage(api.getLang("SubServers", "Bungee.Feature.Smart-Fallback.Result").replace("$str$", (e.getServer().getInfo() instanceof Server)?((Server) e.getServer().getInfo()).getDisplayName():e.getServer().getInfo().getName()));
} }
timer.cancel();
} }
}, 1000); }, 1000);
} }
} }
}
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@EventHandler(priority = Byte.MAX_VALUE) @EventHandler(priority = Byte.MAX_VALUE)

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>20w46d</version> <version>20w48a</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

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>20w46d</version> <version>20w48a</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>20w46d</version> <version>20w48a</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

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>20w46d</version> <version>20w48a</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -544,11 +544,13 @@ public class SubCommand {
PacketInExRunEvent.callback("SubStoppedEvent", this); PacketInExRunEvent.callback("SubStoppedEvent", this);
String name = json.getString("server").toLowerCase(); String name = json.getString("server").toLowerCase();
if (listening.keySet().contains(name)) { if (listening.keySet().contains(name)) {
new Timer("SubServers.Sync::Server_Restart_Command_Handler(" + name + ")").schedule(new TimerTask() { Timer timer = new Timer("SubServers.Host::Server_Restart_Command_Handler(" + name + ")");
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
starter.run(listening.get(name)); starter.run(listening.get(name));
listening.remove(name); listening.remove(name);
timer.cancel();
} }
}, 100); }, 100);
} }

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>20w46d</version> <version>20w48a</version>
<scope>compile</scope> <scope>compile</scope>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>

View File

@ -525,17 +525,21 @@ public final class ExProxy extends BungeeCommon implements Listener {
} }
if (fallbackLimbo.keySet().contains(e.getPlayer().getUniqueId())) new Timer("SubServers.Sync::Fallback_Limbo_Timer(" + e.getPlayer().getUniqueId() + ')').schedule(new TimerTask() { if (fallbackLimbo.keySet().contains(e.getPlayer().getUniqueId())) {
Timer timer = new Timer("SubServers.Sync::Fallback_Limbo_Timer(" + e.getPlayer().getUniqueId() + ')');
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) { if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) {
fallbackLimbo.remove(e.getPlayer().getUniqueId()); fallbackLimbo.remove(e.getPlayer().getUniqueId());
e.getPlayer().sendMessage(api.getLang("SubServers", "Bungee.Feature.Smart-Fallback.Result").replace("$str$", (e.getServer().getInfo() instanceof ServerImpl)?((ServerImpl) e.getServer().getInfo()).getDisplayName():e.getServer().getInfo().getName())); e.getPlayer().sendMessage(api.getLang("SubServers", "Bungee.Feature.Smart-Fallback.Result").replace("$str$", (e.getServer().getInfo() instanceof ServerImpl)?((ServerImpl) e.getServer().getInfo()).getDisplayName():e.getServer().getInfo().getName()));
} }
timer.cancel();
} }
}, 1000); }, 1000);
} }
} }
}
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@EventHandler(priority = Byte.MAX_VALUE) @EventHandler(priority = Byte.MAX_VALUE)

View File

@ -453,11 +453,13 @@ public final class SubCommand extends CommandX {
PacketInExRunEvent.callback("SubStoppedEvent", this); PacketInExRunEvent.callback("SubStoppedEvent", this);
String name = json.getString("server").toLowerCase(); String name = json.getString("server").toLowerCase();
if (listening.keySet().contains(name)) { if (listening.keySet().contains(name)) {
new Timer("SubServers.Sync::Server_Restart_Command_Handler(" + name + ")").schedule(new TimerTask() { Timer timer = new Timer("SubServers.Sync::Server_Restart_Command_Handler(" + name + ")");
timer.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
starter.run(listening.get(name)); starter.run(listening.get(name));
listening.remove(name); listening.remove(name);
timer.cancel();
} }
}, 100); }, 100);
} }