refactor: 将 lettuce 转至 HamsterCore 里

This commit is contained in:
2024-01-13 18:49:22 +08:00
parent 0566941e85
commit b7b7f89267
13 changed files with 47 additions and 93 deletions

View File

@@ -1,14 +1,13 @@
package cn.hamster3.mc.plugin.ball.bungee.api;
import cn.hamster3.mc.plugin.ball.bungee.HamsterBallPlugin;
import cn.hamster3.mc.plugin.ball.bungee.util.BallBungeeCordUtils;
import cn.hamster3.mc.plugin.ball.common.api.BallAPI;
import cn.hamster3.mc.plugin.ball.common.config.BallConfig;
import cn.hamster3.mc.plugin.ball.common.entity.BallServerInfo;
import cn.hamster3.mc.plugin.ball.common.entity.BallServerType;
import cn.hamster3.mc.plugin.ball.bungee.HamsterBallPlugin;
import cn.hamster3.mc.plugin.core.bungee.util.CoreBungeeCordUtils;
import cn.hamster3.mc.plugin.core.common.api.CoreAPI;
import io.lettuce.core.RedisClient;
import net.md_5.bungee.config.Configuration;
import org.jetbrains.annotations.NotNull;
@@ -55,7 +54,6 @@ public class BallBungeeCordAPI extends BallAPI {
BallConfig ballConfig = new BallConfig(
config.getBoolean("debug", false),
RedisClient.create(config.getString("redis-url")),
config.getString("channel-prefix", "") + ":",
config.getBoolean("game-server-update-player-info", false),
serverInfo,

View File

@@ -1,18 +1,6 @@
# 是否允许在控制台输出调试信息
debug: false
# redis 连接配置,连接格式如下:
# redis://用户名:密码@主机名:端口/数据库索引?参数名=参数值&参数名=参数值
# 若没有设置 redis 用户名,则可以省略,以下方法三选一:
# 使用默认用户名: redis://default:密码@localhost:6379?clientName=HamsterBall
# 不写用户名: redis://:密码@localhost:6379?clientName=HamsterBall
# 只写密码: redis://密码@localhost:6379?clientName=HamsterBall
# 若没有设置 redis 用户名和密码,则可以省略:
# redis://localhost:6379?clientName=HamsterBall
# 若不设置数据库,则默认使用 0
# 详细信息https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details
redis-url: "redis://localhost:6379?clientName=HamsterBall"
# 频道名前缀
# 使用这个配置选项可以划分子服消息通信分组
# 只有在同一个频道名的子服才能互相通信