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>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Server</artifactId>
<version>20w46d</version>
<version>20w48a</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -85,11 +85,13 @@ public class PacketLinkExHost implements InitialPacket, PacketObjectIn<Integer>,
private void queue(String name, Runnable action) {
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
public void run() {
action.run();
--req;
timer.cancel();
}
}, (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) {
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
public void run() {
action.run();
--req;
timer.cancel();
}
}, (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();
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
public void run() {
register.run();
timer.cancel();
}
}, ((server instanceof SubServer && !((SubServer) server).isRunning()) ? TimeUnit.SECONDS.toMillis(5) : 0) + ((now - last < 500) ? (req * 500) : 0));

View File

@ -992,15 +992,19 @@ 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() {
@Override
public void run() {
if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) {
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()));
if (fallbackLimbo.keySet().contains(e.getPlayer().getUniqueId())) {
Timer timer = new Timer("SubServers.Bungee::Fallback_Limbo_Timer(" + e.getPlayer().getUniqueId() + ')');
timer.schedule(new TimerTask() {
@Override
public void run() {
if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) {
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()));
}
timer.cancel();
}
}
}, 1000);
}, 1000);
}
}
}

View File

@ -62,7 +62,7 @@
<dependency>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId>
<version>20w46d</version>
<version>20w48a</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -26,7 +26,7 @@
<dependency>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId>
<version>20w46d</version>
<version>20w48a</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -44,7 +44,7 @@
<dependency>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId>
<version>20w46d</version>
<version>20w48a</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -34,7 +34,7 @@
<dependency>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId>
<version>20w46d</version>
<version>20w48a</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -544,11 +544,13 @@ public class SubCommand {
PacketInExRunEvent.callback("SubStoppedEvent", this);
String name = json.getString("server").toLowerCase();
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
public void run() {
starter.run(listening.get(name));
listening.remove(name);
timer.cancel();
}
}, 100);
}

View File

@ -57,7 +57,7 @@
<dependency>
<groupId>net.ME1312.SubData</groupId>
<artifactId>Client</artifactId>
<version>20w46d</version>
<version>20w48a</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>

View File

@ -525,15 +525,19 @@ 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() {
@Override
public void run() {
if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) {
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()));
if (fallbackLimbo.keySet().contains(e.getPlayer().getUniqueId())) {
Timer timer = new Timer("SubServers.Sync::Fallback_Limbo_Timer(" + e.getPlayer().getUniqueId() + ')');
timer.schedule(new TimerTask() {
@Override
public void run() {
if (e.getPlayer().getServer() != null && !((UserConnection) e.getPlayer()).isDimensionChange() && e.getPlayer().getServer().getInfo().getAddress().equals(e.getServer().getInfo().getAddress())) {
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()));
}
timer.cancel();
}
}
}, 1000);
}, 1000);
}
}
}

View File

@ -453,11 +453,13 @@ public final class SubCommand extends CommandX {
PacketInExRunEvent.callback("SubStoppedEvent", this);
String name = json.getString("server").toLowerCase();
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
public void run() {
starter.run(listening.get(name));
listening.remove(name);
timer.cancel();
}
}, 100);
}