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

75 Commits

Author SHA1 Message Date
1decbd6c7b bump to 0.12.0 2024-04-28 15:28:46 +04:00
de3ce79a0e config rename 2024-04-28 15:26:05 +04:00
089c5d8e5f fix pages again..... 2024-04-28 15:17:11 +04:00
294a8a5031 redo the help to be dynamic 2024-04-28 13:39:41 +04:00
e8bacfe0f5 remove remaining build date stuff 2024-04-28 12:44:55 +04:00
dc56a419e7 remove build date 2024-04-28 12:38:57 +04:00
d0ae5d5342 fix 2024-04-26 21:17:38 +04:00
b88202ae38 fix color 2024-04-26 20:36:00 +04:00
3c4e45dfe2 remove debug 2024-04-26 20:10:18 +04:00
abd19c1c3a pageable show command 2024-04-26 20:09:15 +04:00
b406c89406 remove yourkit 2024-04-24 12:17:28 +04:00
91c3845b2e add network id 2024-04-22 16:44:35 +04:00
97e6b5c944 update config / readme 2024-04-21 16:00:03 +04:00
65ac465915 add default values to commands config 2024-04-18 14:23:17 +04:00
32826d843c finsh up command system 2024-04-18 12:48:00 +04:00
78561fa467 improve rb ocmmand 2024-04-15 05:36:52 +04:00
ab441503c7 correctly remove heartbeat on cleanup 2024-04-15 05:23:38 +04:00
51719f13e2 show command 2024-04-15 05:06:36 +04:00
2015d1d0fd remove debug message 2024-04-15 03:36:44 +04:00
70aacc99c0 use continue instead of break 2024-04-15 03:32:30 +04:00
72025bc22c fix wrong use method of inetaddres in player data manager 2024-04-14 13:19:08 +04:00
de65b163e2 finish up the commands 2024-04-14 11:58:04 +04:00
1e7f474a09 adding first batch of commands 2024-04-14 08:40:16 +04:00
19064e0a60 impl: redis clean up task, taken from brains impl. 2024-04-14 08:04:08 +04:00
e76f0d0a00 finish up the version command etc 2024-04-14 07:09:05 +04:00
40c542a50a new command infrastructure 2024-04-14 05:54:08 +04:00
86f64ab019 move all depeneds management into settings.gradle.kts and include acf lib 2024-04-13 23:57:00 +04:00
41b5bde55c insert todo into langauge system 2024-04-13 22:27:26 +04:00
e5b1f9d76e update adventure 2024-04-13 22:22:19 +04:00
ThiagoROX
0b8dc4bde6 provide pt-br translation
Signed-off-by: mohammed jasem alaajel <xrambad@gmail.com>
2024-04-12 22:37:33 +04:00
782f0994c2 [skip ci] Update readme about the transfer packets x3 2024-04-12 22:37:33 +04:00
ca8377ad4c [skip ci] Update readme about the transfer packets 2024-04-12 22:37:33 +04:00
69c3e30344 [skip ci] Update readme about the transfer packets 2024-04-12 22:37:33 +04:00
b3eacbd1c4 typo in redis minimal version 2024-04-12 22:37:33 +04:00
72b2d46dcd update redis wrong version message 2024-04-12 22:37:33 +04:00
44175e8a68 fix redis version detection 2024-04-12 22:37:33 +04:00
6c27228920 fix for lang too 2024-04-12 22:37:33 +04:00
2eb7f3cf9d Fix wrong config version 2024-04-12 22:37:33 +04:00
1c36aa5418 remove lang system for commands
commands will be included in seperate plugins for each platforms.
NOTE: because of this commands `Modules` will be used as example to access
the API
2024-04-12 22:37:33 +04:00
c56a64bbc2 update depends & Gradle 2024-04-12 22:37:33 +04:00
2429cc63d5 load common command messages 2024-04-12 22:37:33 +04:00
46d53fc018 config changes 2024-04-12 22:37:33 +04:00
d70a5de829 Only allow 6.2 or above of redis versions 2024-04-12 22:37:33 +04:00
a6c6916103 remove arabic for now, and finish up the lang file 2024-04-12 22:37:33 +04:00
fa7ca2dacb checkstyle 2024-04-12 22:37:33 +04:00
da255860bd remove debug message 2024-04-12 22:37:33 +04:00
983693b929 Language system implementation, commands still not translatable yet, finish up configs system 2024-04-12 22:37:33 +04:00
32b5e829ba gradle update 2024-04-12 22:37:33 +04:00
383e647c87 split some functions from config loader to be common 2024-04-12 22:37:33 +04:00
9b54ca93db remove old commands system, rename register leagacy command to register commands. 2024-04-12 22:37:33 +04:00
eed91dd73d fix some issues on lang file 2024-04-12 22:37:33 +04:00
b76709c291 change %s to it placeholders 2024-04-12 22:37:33 +04:00
4f6529b295 provide arabic translation 2024-04-12 22:37:33 +04:00
97cdf31cfc provide better info from the wiki 2024-04-12 22:37:33 +04:00
5ea8932ac4 lang file changes 2024-04-12 22:37:33 +04:00
20932d894b addtional stuff for lang config file 2024-04-12 22:37:33 +04:00
6bcba06f7a ignore bungeecord commands override on velocity 2024-04-12 22:37:33 +04:00
76c362cf66 log version / build date 2024-04-12 22:37:33 +04:00
b7433bc9a3 Remove unnecessary public in some methods in plugin interface 2024-04-12 22:37:33 +04:00
7ba54ebfe2 include build date 2024-04-12 22:37:33 +04:00
dd38532501 config log changes, introduction of new env REDISBUNGEE_PROXY_ID 2024-04-12 22:37:33 +04:00
7183e809d0 bungeecord version 2024-04-12 22:37:33 +04:00
d1d848fa8c remove tests as its no longer used 2024-04-12 22:37:33 +04:00
e70a6e305c implement last server connect on join, closes #84 2024-04-12 22:37:33 +04:00
e897a60976 remove all old messages code, new lang file 2024-04-12 22:37:33 +04:00
f6e1ca65bf make varable for depeneds, remove javadocs for adventure from implementations javadocs 2024-04-12 22:37:33 +04:00
11a0d84368 remove weird javadocs 2024-04-12 22:37:33 +04:00
a0fdd6d997 welcome adventure api
MiniMessage is now used for Messages.yml

fix bug when from is null when server change
2024-04-12 22:37:33 +04:00
3c4f0d8c93 oops forgotten to change something for kick when online 2024-04-12 22:37:33 +04:00
6d40c1902a change false to true as default for kick-when-online option 2024-04-12 22:37:33 +04:00
a2f1ec22c6 remove autoclosable interface from proxy data manager 2024-04-12 22:37:33 +04:00
16576ab4c2 new config options: handle-motd, reconnect to last server 2024-04-12 22:37:33 +04:00
f96c5759a2 config changes
jedispool is now disabled by default, some minor config changes
2024-04-12 22:37:33 +04:00
8aaae6702e new data system 2024-04-12 22:37:02 +04:00
006066f66c prepare for 0.12.0 2024-04-12 22:36:07 +04:00
10 changed files with 17 additions and 28 deletions

View File

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

View File

@@ -9,10 +9,6 @@ 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.adventure.plain.get().version val adventureVersion = libs.guava.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

@@ -423,7 +423,7 @@ public abstract class AbstractRedisBungeeAPI {
if (getMode() == RedisBungeeMode.SINGLE) { if (getMode() == RedisBungeeMode.SINGLE) {
JedisPool jedisPool = ((JedisPooledSummoner) this.plugin.getSummoner()).getCompatibilityJedisPool(); JedisPool jedisPool = ((JedisPooledSummoner) this.plugin.getSummoner()).getCompatibilityJedisPool();
if (jedisPool == null) { if (jedisPool == null) {
throw new IllegalStateException("JedisPool compatibility mode is disabled, Please enable it in the RedisBungee config.yml"); throw new IllegalStateException("JedisPool compatibility mode is disabled");
} }
return jedisPool; return jedisPool;
} else { } else {

View File

@@ -37,10 +37,11 @@ import java.util.concurrent.TimeUnit;
public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEvent, SC extends IPlayerChangedServerNetworkEvent, NJE extends IPlayerLeftNetworkEvent, CE> { public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEvent, SC extends IPlayerChangedServerNetworkEvent, NJE extends IPlayerLeftNetworkEvent, CE> {
protected final RedisBungeePlugin<P> plugin; protected final RedisBungeePlugin<P> plugin;
private final LoadingCache<UUID, String> serverCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getServerFromRedis); private final LoadingCache<UUID, String> serverCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getServerFromRedis);
private final LoadingCache<UUID, String> lastServerCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getLastServerFromRedis); private final LoadingCache<UUID, String> lastServerCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getLastServerFromRedis);
private final LoadingCache<UUID, String> proxyCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getProxyFromRedis); private final LoadingCache<UUID, String> proxyCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getProxyFromRedis);
private final LoadingCache<UUID, InetAddress> ipCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getIpAddressFromRedis); private final LoadingCache<UUID, InetAddress> ipCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getIpAddressFromRedis);
private final LoadingCache<UUID, Long> lastOnlineCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getLastOnlineFromRedis);
private final Object SERVERS_TO_PLAYERS_KEY = new Object(); private final Object SERVERS_TO_PLAYERS_KEY = new Object();
private final LoadingCache<Object, Multimap<String, UUID>> serverToPlayersCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES).build(this::serversToPlayersBuilder); private final LoadingCache<Object, Multimap<String, UUID>> serverToPlayersCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES).build(this::serversToPlayersBuilder);
private final UnifiedJedis unifiedJedis; private final UnifiedJedis unifiedJedis;
@@ -79,6 +80,7 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
this.proxyCache.invalidate(event.getUuid()); this.proxyCache.invalidate(event.getUuid());
this.serverCache.invalidate(event.getUuid()); this.serverCache.invalidate(event.getUuid());
this.ipCache.invalidate(event.getUuid()); this.ipCache.invalidate(event.getUuid());
this.lastOnlineCache.invalidate(event.getUuid());
} }
protected void handlePubSubMessageEvent(IPubSubMessageEvent event) { protected void handlePubSubMessageEvent(IPubSubMessageEvent event) {
@@ -159,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 String name, final InetAddress inetAddress) { protected void addPlayer(final UUID uuid, 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);
@@ -226,7 +228,7 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
} }
public long getLastOnline(UUID uuid) { public long getLastOnline(UUID uuid) {
return getLastOnlineFromRedis(uuid); return this.lastOnlineCache.get(uuid);
} }
public Multimap<String, UUID> serversToPlayers() { public Multimap<String, UUID> serversToPlayers() {

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 '/rb clean' to remove expired cache entries"); plugin.logInfo("Looks like you have a really big UUID cache! Run https://github.com/ProxioDev/Brains");
} }
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().getName(), event.getPlayer().getAddress().getAddress()); super.addPlayer(event.getPlayer().getUniqueId(), event.getPlayer().getAddress().getAddress());
} }
@Override @Override

View File

@@ -1,6 +1,5 @@
plugins { plugins {
`java-library` `java-library`
`maven-publish`
} }
dependencies { dependencies {
@@ -23,11 +22,3 @@ tasks {
filteringCharset = Charsets.UTF_8.name() filteringCharset = Charsets.UTF_8.name()
} }
} }
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}

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().getUsername(), event.getPlayer().getRemoteAddress().getAddress()); addPlayer(event.getPlayer().getUniqueId(), event.getPlayer().getRemoteAddress().getAddress());
} }
@Override @Override

View File

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