2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2025-04-19 09:07:06 +00:00

send startup / shutdown logs for both Bungeecord and Velocity

This commit is contained in:
mohammed jasem alaajel 2023-04-25 10:59:44 +04:00
parent eac00e1cd2
commit 6eceec4425
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View File

@ -198,6 +198,7 @@ public class RedisBungee extends Plugin implements RedisBungeePlugin<ProxiedPlay
@Override
public void initialize() {
logInfo("Initializing RedisBungee.....");
ThreadFactory factory = ((ThreadPoolExecutor) getExecutorService()).getThreadFactory();
ScheduledExecutorService service = Executors.newScheduledThreadPool(24, factory);
try {
@ -266,10 +267,12 @@ public class RedisBungee extends Plugin implements RedisBungeePlugin<ProxiedPlay
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlayerProxyCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlistCommand(this));
}
logInfo("RedisBungee initialized successfully ");
}
@Override
public void stop() {
logInfo("Turning off redis connections.....");
// Poison the PubSub listener
if (psl != null) {
psl.poison();
@ -287,7 +290,7 @@ public class RedisBungee extends Plugin implements RedisBungeePlugin<ProxiedPlay
} catch (IOException e) {
throw new RuntimeException(e);
}
logInfo("RedisBungee shutdown");
}
@Override

View File

@ -245,6 +245,7 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
@Override
public void initialize() {
logInfo("Initializing RedisBungee.....");
updateProxiesIds();
// start heartbeat task
heartbeatTask = getProxy().getScheduler().buildTask(this, new HeartbeatTask(this, this.globalPlayerCount)).repeat(HeartbeatTask.INTERVAL, HeartbeatTask.REPEAT_INTERVAL_TIME_UNIT).schedule();
@ -283,10 +284,12 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
getProxy().getCommandManager().register("ip", new RedisBungeeCommands.IpCommand(this), "playerip", "rip", "rplayerip");
getProxy().getCommandManager().register("find", new RedisBungeeCommands.FindCommand(this), "rfind");
}
logInfo("RedisBungee initialized successfully ");
}
@Override
public void stop() {
logInfo("Turning off redis connections.....");
// Poison the PubSub listener
if (psl != null) {
psl.poison();
@ -306,10 +309,12 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
this.httpClient.getDispatcher().getExecutorService().shutdown();
try {
logInfo("waiting for httpclient thread-pool termination.....");
this.httpClient.getDispatcher().getExecutorService().awaitTermination(20, TimeUnit.SECONDS);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
logInfo("RedisBungee shutdown complete");
}
@Override