invalidate clarifcation, remove unified jedis method from ProxyDataManager

This commit is contained in:
mohammed jasem alaajel 2024-05-18 16:46:35 +04:00
parent d6b3956a96
commit 3314c5e54b
Signed by: ham1255
GPG Key ID: EF343502046229F4
2 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
public PlayerDataManager(RedisBungeePlugin<P> plugin) {
this.plugin = plugin;
this.unifiedJedis = plugin.proxyDataManager().unifiedJedis();
this.unifiedJedis = plugin.getSummoner().obtainResource();
this.proxyId = plugin.proxyDataManager().proxyId();
this.networkId = plugin.proxyDataManager().networkId();
}
@ -83,6 +83,8 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
}
protected void handleNetworkPlayerQuit(IPlayerLeftNetworkEvent event) {
// reason we don't set the data here because in-case of failure in redis etc,
// events won't reach the proxy so data would be incorrect.
this.proxyCache.invalidate(event.getUuid());
this.serverCache.invalidate(event.getUuid());
this.ipCache.invalidate(event.getUuid());
@ -93,6 +95,8 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
}
protected void handleNetworkPlayerJoin(IPlayerJoinedNetworkEvent event) {
// reason we don't set the data here because in-case of failure in redis etc,
// events won't reach the proxy so data would be incorrect.
this.proxyCache.invalidate(event.getUuid());
this.serverCache.invalidate(event.getUuid());
this.ipCache.invalidate(event.getUuid());

View File

@ -392,10 +392,6 @@ public abstract class ProxyDataManager implements Runnable {
return proxyId;
}
public UnifiedJedis unifiedJedis() {
return unifiedJedis;
}
public String networkId() {
return networkId;
}