mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-04-08 16:10:26 +00:00
finishup bungeecord, move to mini message as serialzier
This commit is contained in:
@@ -46,7 +46,7 @@ tasks {
|
||||
val jedisVersion = libs.jedis.get().version
|
||||
val configurateVersion = libs.configurateV3.get().version
|
||||
val guavaVersion = libs.guava.get().version
|
||||
val adventureVersion = libs.adventure.plain.get().version
|
||||
val adventureVersion = libs.adventure.api.get().version
|
||||
options.links(
|
||||
"https://configurate.aoeu.xyz/$configurateVersion/apidocs/", // configurate
|
||||
"https://javadoc.io/doc/redis.clients/jedis/$jedisVersion/", // jedis
|
||||
|
||||
@@ -299,6 +299,28 @@ public abstract class AbstractRedisBungeeAPI {
|
||||
return this.plugin.getSummoner();
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicks a player from the network using miniMessage
|
||||
* calls {@link #getUuidFromName(String)} to get uuid
|
||||
* <a href="https://docs.advntr.dev/minimessage/format.html">...</a>
|
||||
* @param playerName player name
|
||||
* @param miniMessage kick message that player will see on kick using minimessage as format
|
||||
* @since 0.13.0
|
||||
*/
|
||||
public void kickPlayer(String playerName, String miniMessage) {
|
||||
kickPlayer(getUuidFromName(playerName), miniMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicks a player from the network
|
||||
* <a href="https://docs.advntr.dev/minimessage/format.html">...</a>
|
||||
* @param player player uuid
|
||||
* @param miniMessage kick message that player will see on kick using minimessage as format
|
||||
* @since 0.13.0
|
||||
*/
|
||||
public void kickPlayer(UUID player, String miniMessage) {
|
||||
plugin.playerDataManager().serializedPlayerKick(player, miniMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* shows what mode is RedisBungee is on
|
||||
|
||||
@@ -139,14 +139,19 @@ public abstract class PlayerDataManager<P> {
|
||||
}
|
||||
|
||||
// must check if player is on the local proxy
|
||||
protected abstract boolean handleSerializedKick(UUID player, String serializedMessage);
|
||||
// https://docs.advntr.dev/minimessage/index.html
|
||||
// implemented downstream in Velocity and Bungeecord
|
||||
protected abstract boolean handleSerializedKick(UUID player, String serializedMiniMessage);
|
||||
|
||||
public void serializedPlayerKick(UUID player, String serializedMessage) {
|
||||
// https://docs.advntr.dev/minimessage/index.html
|
||||
// implemented downstream in Velocity and Bungeecord
|
||||
// called by kickPlayer in each impl of this class `NOT OVERRIDE`
|
||||
public void serializedPlayerKick(UUID player, String serializedMiniMessage) {
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("proxy", this.proxyId);
|
||||
data.put("uuid", player);
|
||||
data.put("serialized-message", serializedMessage);
|
||||
if (!handleSerializedKick(player, serializedMessage))
|
||||
data.put("serialized-message", serializedMiniMessage);
|
||||
if (!handleSerializedKick(player, serializedMiniMessage))
|
||||
plugin.proxyDataManager().sendChannelMessage("redisbungee-player-kick", data.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public abstract class ProxyDataManager implements Runnable {
|
||||
Set<UUID> storedRedisUuids = getProxyMembers(this.proxyId);
|
||||
|
||||
if (!localOnlineUUIDs.equals(storedRedisUuids)) {
|
||||
plugin.logWarn("De-synced playerS set detected correcting....");
|
||||
plugin.logWarn("De-synced players set detected correcting....");
|
||||
Set<UUID> add = new HashSet<>(localOnlineUUIDs);
|
||||
Set<UUID> remove = new HashSet<>(storedRedisUuids);
|
||||
add.removeAll(storedRedisUuids);
|
||||
|
||||
Reference in New Issue
Block a user