2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-05-05 12:40:27 +00:00

properly cache last online and its invalidation

This commit is contained in:
2024-05-18 16:37:31 +04:00
committed by Mohammed Alteneiji
parent 9fd1da5f92
commit c633f1a106
6 changed files with 35 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
}
@Override
public PlayerDataManager<Player, ?, ?, ?, ?, ?, ?> playerDataManager() {
public PlayerDataManager<Player, ?, ?, ?, ?, ?, ?, ?> playerDataManager() {
return this.playerDataManager;
}

View File

@@ -14,6 +14,7 @@ import com.imaginarycode.minecraft.redisbungee.api.PlayerDataManager;
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
import com.imaginarycode.minecraft.redisbungee.api.config.RedisBungeeConfiguration;
import com.imaginarycode.minecraft.redisbungee.events.PlayerChangedServerNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PlayerJoinedNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PlayerLeftNetworkEvent;
import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent;
import com.velocitypowered.api.event.Continuation;
@@ -28,7 +29,7 @@ import net.kyori.adventure.text.Component;
import java.util.concurrent.TimeUnit;
public class VelocityPlayerDataManager extends PlayerDataManager<Player, PostLoginEvent, DisconnectEvent, PubSubMessageEvent, PlayerChangedServerNetworkEvent, PlayerLeftNetworkEvent, ServerConnectedEvent> {
public class VelocityPlayerDataManager extends PlayerDataManager<Player, PostLoginEvent, DisconnectEvent, PubSubMessageEvent, PlayerChangedServerNetworkEvent, PlayerLeftNetworkEvent, ServerConnectedEvent, PlayerJoinedNetworkEvent> {
public VelocityPlayerDataManager(RedisBungeePlugin<Player> plugin) {
super(plugin);
}
@@ -43,6 +44,11 @@ public class VelocityPlayerDataManager extends PlayerDataManager<Player, PostLog
handleNetworkPlayerQuit(event);
}
@Subscribe
public void onNetworkPlayerJoin(PlayerJoinedNetworkEvent event) {
handleNetworkPlayerJoin(event);
}
@Subscribe
public void onPubSubMessageEvent(PubSubMessageEvent event) {
handlePubSubMessageEvent(event);