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

7 Commits

8 changed files with 13 additions and 9 deletions

View File

@@ -5,9 +5,9 @@ name: RedisBungee Build
on: on:
push: push:
branches: [ develop ] branches: [ main ]
pull_request: pull_request:
branches: [ develop ] branches: [ main ]
jobs: jobs:
build: build:

View File

@@ -9,6 +9,10 @@ or [Velocity*](https://github.com/PaperMC/Velocity) proxies
[![](https://raw.githubusercontent.com/Prospector/badges/master/modrinth-badge-72h-padded.png)](https://modrinth.com/plugin/redisbungee) [![](https://raw.githubusercontent.com/Prospector/badges/master/modrinth-badge-72h-padded.png)](https://modrinth.com/plugin/redisbungee)
## Wiki
https://github.com/ProxioDev/RedisBungee/wiki
## Support ## Support
open an issue with question button open an issue with question button

View File

@@ -52,7 +52,7 @@ tasks {
val jedisVersion = libs.jedis.get().version val jedisVersion = libs.jedis.get().version
val configurateVersion = libs.configurate.get().version val configurateVersion = libs.configurate.get().version
val guavaVersion = libs.guava.get().version val guavaVersion = libs.guava.get().version
val adventureVersion = libs.guava.get().version val adventureVersion = libs.adventure.plain.get().version
options.links( options.links(
"https://configurate.aoeu.xyz/$configurateVersion/apidocs/", // configurate "https://configurate.aoeu.xyz/$configurateVersion/apidocs/", // configurate
"https://javadoc.io/doc/redis.clients/jedis/$jedisVersion/", // jedis "https://javadoc.io/doc/redis.clients/jedis/$jedisVersion/", // jedis

View File

@@ -161,13 +161,13 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
unifiedJedis.hset("redis-bungee::" + this.networkId + "::player::" + uuid + "::data", data); unifiedJedis.hset("redis-bungee::" + this.networkId + "::player::" + uuid + "::data", data);
} }
protected void addPlayer(final UUID uuid, final InetAddress inetAddress) { protected void addPlayer(final UUID uuid, final String name, final InetAddress inetAddress) {
Map<String, String> redisData = new HashMap<>(); Map<String, String> redisData = new HashMap<>();
redisData.put("last-online", String.valueOf(0)); redisData.put("last-online", String.valueOf(0));
redisData.put("proxy", this.proxyId); redisData.put("proxy", this.proxyId);
redisData.put("ip", inetAddress.getHostAddress()); redisData.put("ip", inetAddress.getHostAddress());
unifiedJedis.hset("redis-bungee::" + this.networkId + "::player::" + uuid + "::data", redisData); unifiedJedis.hset("redis-bungee::" + this.networkId + "::player::" + uuid + "::data", redisData);
plugin.getUuidTranslator().persistInfo(name, uuid, this.unifiedJedis);
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
data.put("proxy", this.proxyId); data.put("proxy", this.proxyId);
data.put("uuid", uuid); data.put("uuid", uuid);

View File

@@ -34,7 +34,7 @@ public class InitialUtils {
} }
long uuidCacheSize = unifiedJedis.hlen("uuid-cache"); long uuidCacheSize = unifiedJedis.hlen("uuid-cache");
if (uuidCacheSize > 750000) { if (uuidCacheSize > 750000) {
plugin.logInfo("Looks like you have a really big UUID cache! Run https://github.com/ProxioDev/Brains"); plugin.logInfo("Looks like you have a really big UUID cache! Run '/rb clean' to remove expired cache entries");
} }
break; break;
} }

View File

@@ -84,7 +84,7 @@ public class BungeePlayerDataManager extends PlayerDataManager<ProxiedPlayer, Po
@Override @Override
@EventHandler @EventHandler
public void onLoginEvent(PostLoginEvent event) { public void onLoginEvent(PostLoginEvent event) {
super.addPlayer(event.getPlayer().getUniqueId(), event.getPlayer().getAddress().getAddress()); super.addPlayer(event.getPlayer().getUniqueId(), event.getPlayer().getName(), event.getPlayer().getAddress().getAddress());
} }
@Override @Override

View File

@@ -84,7 +84,7 @@ public class VelocityPlayerDataManager extends PlayerDataManager<Player, PostLog
@Override @Override
@Subscribe @Subscribe
public void onLoginEvent(PostLoginEvent event) { public void onLoginEvent(PostLoginEvent event) {
addPlayer(event.getPlayer().getUniqueId(), event.getPlayer().getRemoteAddress().getAddress()); addPlayer(event.getPlayer().getUniqueId(), event.getPlayer().getUsername(), event.getPlayer().getRemoteAddress().getAddress());
} }
@Override @Override

View File

@@ -1,2 +1,2 @@
group=com.imaginarycode.minecraft group=com.imaginarycode.minecraft
version=0.12.0 version=0.12.1