mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-13 05:54:32 +01:00
Update SubData
This commit is contained in:
parent
80da5f7b27
commit
bcd7f4f3c3
@ -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>
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>net.ME1312.SubData</groupId>
|
||||
<artifactId>Client</artifactId>
|
||||
<version>20w46d</version>
|
||||
<version>20w48a</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user