mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-04-08 16:10:26 +00:00
new config options: handle-motd, reconnect to last server
This commit is contained in:
@@ -41,9 +41,9 @@ public class RedisBungeeListener {
|
||||
|
||||
@Subscribe(order = PostOrder.LAST) // some plugins changes it online players so we need to be executed as last
|
||||
public void onPing(ProxyPingEvent event) {
|
||||
if (plugin.configuration().getExemptAddresses().contains(event.getConnection().getRemoteAddress().getAddress())) {
|
||||
return;
|
||||
}
|
||||
if (!plugin.configuration().handleMotd()) return;
|
||||
if (plugin.configuration().getExemptAddresses().contains(event.getConnection().getRemoteAddress().getAddress())) return;
|
||||
|
||||
ServerPing.Builder ping = event.getPing().asBuilder();
|
||||
ping.onlinePlayers(plugin.proxyDataManager().totalNetworkPlayers());
|
||||
event.setPing(ping.build());
|
||||
|
||||
@@ -71,7 +71,7 @@ public class VelocityPlayerDataManager extends PlayerDataManager<Player, PostLog
|
||||
public void onLoginEvent(LoginEvent event, Continuation continuation) {
|
||||
// check if online
|
||||
if (getLastOnline(event.getPlayer().getUniqueId()) == 0) {
|
||||
if (!plugin.configuration().restoreOldKickBehavior()) {
|
||||
if (!plugin.configuration().kickWhenOnline()) {
|
||||
kickPlayer(event.getPlayer().getUniqueId(), plugin.configuration().getMessages().get(RedisBungeeConfiguration.MessageType.LOGGED_IN_OTHER_LOCATION));
|
||||
// wait 3 seconds before releasing the event
|
||||
plugin.executeAsyncAfter(continuation::resume, TimeUnit.SECONDS, 3);
|
||||
|
||||
Reference in New Issue
Block a user