Login Daddy
一款用于私人好友服务器(主要是离线模式服务器)的 Fabric 模组。要求玩家必须在客户端安装此模组、被列入本模组的白名单(而非服务器白名单),并在游戏前通过密码进行身份验证。
工作原理
- 玩家连接 → 被传送至一个不可见的过渡维度
- 服务器检查客户端是否安装了 LoginDaddy(握手)。未安装模组 = 踢出
- 提示玩家输入服务器密钥(如果已配置)。密钥错误 = 踢出
- 服务器检查玩家是否在白名单中。不在白名单 = 踢出
- 如果玩家拥有有效会话(在过去 48 小时内从同一 IP 登录过),则自动放行
- 否则,玩家使用密码注册或登录
- 玩家将传送回他们加入时的位置
在身份验证完成之前,加入/离开消息和标签列表将被隐藏。
要求
- Minecraft 1.21.11
- Fabric Loader 0.18.2+
- Fabric API
设置
服务器端
- 将模组 jar 文件放入
mods/ 文件夹
- 启动服务器一次以生成
config/LoginDaddy/logindaddy.properties
- 编辑
logindaddy.properties 填入数据库凭据以及可选的服务器密钥
- 将玩家添加到白名单(见下方命令)
客户端
玩家需要将相同的模组 jar 文件放入其 mods/ 文件夹中。首次加入配置了密钥的服务器时,会出现提示要求输入密钥。密钥会自动保存并在后续加入时复用。
配置
config/LoginDaddy/logindaddy.properties 会在首次启动时生成。
# sqlite (本地文件) 或 mysql
database.type=sqlite
# 仅 MySQL — 使用 sqlite 时将被忽略
mysql.host=localhost
mysql.port=3306
mysql.database=logindaddy
mysql.username=root
mysql.password=
# 可选服务器密钥 — 留空以禁用
# 玩家将在首次加入时被提示输入此密钥
server.key=
⚠️ 切勿将你的 logindaddy.properties 文件分享给任何人。
其中包含你的数据库凭据和服务器密钥。
数据文件
所有模组数据均存储在 config/LoginDaddy/ 下:
| 文件 |
描述 |
logindaddy.properties |
服务器配置 |
logindaddy.db |
SQLite 数据库(仅在使用 SQLite 时存在) |
sessions.json |
活动登录会话(服务器端) |
客户端数据存储在客户端的 config/LoginDaddy/ 下:
| 文件 |
描述 |
serverlist.json |
按服务器地址保存的服务器密钥 |
命令
管理命令需要操作者权限或服务器控制台。
| 命令 |
描述 |
logindaddy whitelist add <username> |
将玩家添加到白名单 |
logindaddy whitelist remove <username> |
将玩家从白名单中移除 |
logindaddy whitelist list |
列出所有白名单中的玩家 |
resetpassword <username> <newpassword> |
重置玩家的密码 |
玩家命令(在游戏中,仅在身份验证期间可用):
| 命令 |
描述 |
/register <password> |
使用密码注册(仅限首次) |
/login <password> |
使用密码登录 |
/changepassword <old> <new> |
更改密码(必须已登录) |
许可证
MIT
Login Daddy
A Fabric mod for private friend servers (Mainly Offline-Mode servers). Requires players to have the mod installed on their client, be on the whitelist of this mod (not the server whitelist) and authenticate with a password before they can play.
How it works
- Player connects → sent to an invisible limbo dimension
- Server checks if the client has LoginDaddy installed (handshake). No mod = kicked
- Client is prompted to enter the server key (if one is configured). Wrong key = kicked
- Server checks if the player is whitelisted. Not whitelisted = kicked
- If the player has a valid session (logged in within the last 48 hours from the same IP), they are released automatically
- Otherwise, player registers or logs in with a password
- Player is teleported back to where they joined from
Join/leave messages and tab list are hidden until authentication is complete.
Requirements
- Minecraft 1.21.11
- Fabric Loader 0.18.2+
- Fabric API
Setup
Server
- Drop the mod jar into your
mods/ folder
- Start the server once to generate
config/LoginDaddy/logindaddy.properties
- Edit
logindaddy.properties with your database credentials and optionally a server key
- Add players to the whitelist (see commands below)
Client
Players need the same mod jar in their mods/ folder. On first join to a server with a key configured, a prompt will appear to enter the key. The key is saved automatically and reused on future joins.
Configuration
config/LoginDaddy/logindaddy.properties is generated on first launch.
# sqlite (local file) or mysql
database.type=sqlite
# MySQL only — ignored if using sqlite
mysql.host=localhost
mysql.port=3306
mysql.database=logindaddy
mysql.username=root
mysql.password=
# Optional server key — leave empty to disable
# Players will be prompted to enter this key on first join
server.key=
⚠️ Never share your logindaddy.properties file with anyone.
It contains your database credentials and server key.
Data Files
All mod data is stored under config/LoginDaddy/:
| File |
Description |
logindaddy.properties |
Server configuration |
logindaddy.db |
SQLite database (only if using SQLite) |
sessions.json |
Active login sessions (server-side) |
Client-side data is stored under the client's config/LoginDaddy/:
| File |
Description |
serverlist.json |
Saved server keys per server address |
Commands
Admin commands require operator permission or the server console.
| Command |
Description |
logindaddy whitelist add <username> |
Add a player to the whitelist |
logindaddy whitelist remove <username> |
Remove a player from the whitelist |
logindaddy whitelist list |
List all whitelisted players |
resetpassword <username> <newpassword> |
Reset a player's password |
Player commands (in-game, only usable during authentication):
| Command |
Description |
/register <password> |
Register with a password (first time only) |
/login <password> |
Log in with your password |
/changepassword <old> <new> |
Change your password (must be logged in) |
License
MIT
评论 0
登录后参与评分
还没有评论,来抢沙发吧