SecPlayer 为你的 Minecraft 服务器添加了注册与登录功能。玩家必须在能够移动或进行游戏之前先完成一次注册(或在后续加入时登录)。该模组提供了服务条款和年龄确认界面、可选的忘记密码邮件、IP 和地理位置记录、自定义登录界面 Logo、仅限 OP 的管理面板(包含新注册的可选审批模式、时区分组以及批准/拒绝功能),以及一个允许用户更改密码、更新邮箱或删除账号(附带邮件通知并断开连接)的玩家个人资料页面。
此模组的功能
- 注册: 新玩家在看到服务条款(TOS)界面后,会进入注册表单。全名字段预填了你的 Minecraft 用户名且不可编辑。你还需要输入邮箱、可选的显示名称和密码。点击“服务条款与隐私”按钮可打开一个可滚动的数据/隐私政策(来自客户端的
config/secplayer_privacy.txt)。密码会被掩码处理。勾选“I agree to the Terms of Service”复选框以确认年龄(最低年龄要求可配置)。
- 登录: 回归玩家在加入时输入密码。可选的“记住我”会在每个服务器端安全存储密码,以便下次自动登录。“忘记密码?”会在 SMTP 配置完成后通过电子邮件发送重置代码。点击“输入重置代码”按钮,你可以在不请求另一封邮件的情况下打开输入代码和新密码的界面(例如,如果你关闭了菜单或重新打开了游戏)。
- 玩家资料: 运行
/secplayer info 打开个人资料界面。你可以查看你的信息(用户名、掩码处理的邮箱、备用名称)、更改密码、更新邮箱或删除你的账号。删除账号会移除所有数据,向你发送确认邮件(包含服务器名称),并断开你的连接;重新加入需要再次注册。
- 服务条款文本: 服务器运营者可以编辑
config/secplayer_tos.txt 中的确切服务条款内容(如果文件缺失,会在服务器启动时创建)。
- IP 与地理位置: 模组在注册和登录时记录 IP、国家、地区、城市,以及可选的 ISP(ASN)。使用
config/ 目录中的 GeoLite2 数据库文件(你需要手动放置这些文件;可从免费的 MaxMind 账户获取)。在管理员玩家详情中,仅显示国家和最后登录(按时区格式化的时间);完整的地理数据仍存储在数据库中,直到账号被删除。
- 管理面板: OP 运行
/secplayer admin 打开按时区分组的已注册玩家列表(可按玩家或时区搜索;没有时区的玩家显示在“本地”下)。打开某位玩家可查看详细信息(用户名、UUID、掩码处理的邮箱、备用名称、出生年份、状态、国家、最后登录),封禁/解封(Minecraft 的封禁列表)、重置密码、设置备用用户名、批准/拒绝(当启用审批模式时),或删除该玩家(向其发送邮件并移除账号)。所有滚动条均支持点击拖拽。
- 审批模式: 在配置文件中设置
requireApproval=true,使新注册处于“待定”状态,直到管理员批准。在管理员列表中使用待定过滤器,或在玩家详情中点击批准 / 拒绝,或使用命令 /secplayer approve <player> / /secplayer deny <player>。拒绝会将玩家添加到封禁列表;批准时可发送可选邮件(如果配置了 SMTP)。
- 显示名称: 玩家可以选择一个可选的“备用用户名”并将其用作游戏中的名称(聊天、标签页列表)。使用
/secplayer setAlt <name> 设置或清除它;设置非空名称会自动启用“作为游戏内名称使用”,因此你无需在注册时勾选该选项。
- 登录 Logo: 你可以在登录界面上显示自定义 Logo。服务器可以向所有客户端发送一张图片(无需为每个客户端单独配置),或者客户端可以使用本地图片。Logo 会缩放以适应面板。
- 数据存储: 所有账号数据都存储在服务器上的 SQLite 数据库中。不需要单独的数据库服务器。文件
config/secplayer.db 在首次运行时创建,并保存账号、登录历史(IP、地理位置、时间戳)和密码重置令牌。你可以使用任何 SQLite 工具进行备份或检查。
安装
- 为 Minecraft 1.18.2 安装 Forge。
- 将模组的 JAR 文件放入服务器和每个客户端的
mods/ 文件夹中。
注册和登录功能仅在专用服务器上运行。单人游戏/集成服务器不使用注册流程。
使用方法(玩家)
- 首次加入: 加入时你会看到服务条款界面。勾选同意框并点击继续注册。你的名字会预填为你的 Minecraft 用户名。填写邮箱、可选的显示名称和密码,然后提交。使用断开连接可在不注册的情况下离开。
- 后续加入: 在登录界面输入密码。可选地勾选记住我以便下次自动登录。使用忘记密码?接收重置代码邮件(如果服务器配置了 SMTP)。你也可以点击输入重置代码来输入已有的代码和新密码,而无需请求另一封邮件。
- 个人资料: 运行
/secplayer info 打开你的个人资料。在那里你可以更改密码、更新邮箱或删除你的账号(你会收到一封邮件并被断开连接)。
- 显示名称: 使用
/secplayer setAlt <name> 设置或清除你的游戏内显示名称(不能有空格)。设置名称会自动开启“作为游戏内名称使用”,如果你在注册时未启用该选项。
使用方法(服务器运营者)
-
管理员列表: 运行 /secplayer admin(需要 OP 权限)。你将看到按时区分组的已注册玩家(搜索框可按玩家或时区进行筛选)。当启用审批模式时,请使用 Pending(待处理)过滤器。打开某位玩家可查看其详细信息(显示国家和最后登录时间;完整的地理位置信息已存储但不在 UI 中展示),你可以执行 封禁/解封、重置密码、设置备用用户名、批准/拒绝(针对待处理的玩家),或者 删除该玩家(将向其发送电子邮件并移除账户)。你也可以从聊天窗口或控制台使用 /secplayer approve <玩家> 和 /secplayer deny <玩家> 命令。
-
服务条款(TOS): 编辑服务器上的 config/secplayer_tos.txt 文件。在文本中使用 %d 作为最小年龄占位符。如果该文件不存在,将在首次启动服务器时以默认文本创建。
配置
主配置文件:config/secplayer.properties(首次运行时创建)。
| 选项 |
功能说明 |
默认值 |
| minAge |
TOS(服务条款)文本中的最低年龄限制(例如 13) |
13 |
| requireApproval |
为 true 时,新注册需要管理员审批后才能登录 |
false |
| smtpHost, smtpPort, smtpUseTls |
用于“忘记密码?”和账户删除通知邮件的 SMTP 服务器 |
(空), 587, true |
| smtpUsername, smtpPassword |
SMTP 登录凭据 |
(空) |
| smtpFromAddress, smtpFromName |
邮件的发件人地址和名称 |
(空), SecPlayer |
| smtpPasswordFile |
可选:指向包含 SMTP 密码的文件路径(相对于 config/ 目录),可避免 .properties 文件中特殊字符引发的问题 |
(空) |
| smtpDebug |
设为 true 可将 SMTP 交互日志记录到服务器日志中(用于故障排查) |
false |
| loginLogoPath |
位于服务器 config/ 文件夹中的 Logo 文件名(例如 mylogo.png)。服务器会将其发送给客户端,确保所有玩家看到相同的 Logo。 |
(空) |
| bannedAltNames |
玩家禁止使用的显示名称列表,以逗号分隔(例如 herobrine) |
herobrine |
| displayTimezone |
管理面板列表中“最后登录”时间所使用的时区(例如 America/New_York, UTC) |
UTC |
登录 Logo(仅客户端覆盖): 创建 config/secplayer_client.properties 并设置 loginLogoPath=filename.png,然后将 PNG 文件放入 config/ 目录。当服务器未发送 Logo 时使用此配置。
地理位置(可选): 如需获取国家/地区/城市信息,请将 GeoLite2-City.mmdb 放入服务器 config/ 文件夹。如需获取 ISP(ASN)信息,请添加 GeoLite2-ASN.mmdb。请从 MaxMind(免费账户)获取这些文件,并将其放入服务器的 config/ 文件夹中。
故障排除
/secplayer admin 命令无反应: 你必须拥有 OP 权限(例如在服务器控制台中执行 /op YourName)。游戏内没有菜单按钮;该命令用于打开管理员列表。
- 注册/登录界面从未出现: 该模组仅在专用服务器上运行流程。请使用专用服务器或局域网主机进行测试。
- 崩溃或退出代码 1: 请检查
crash-reports/ 中的最新文件(客户端或服务器)。确保模组与 Forge 版本匹配(例如 1.18.2 对应 Forge 40.x)。
需要 Minecraft 1.18.2 和 Forge 40.x。保留所有权利。
SecPlayer adds registration and login to your Minecraft server. Players must register once (or log in on later joins) before they can move or play. The mod provides a Terms of Service and age-confirmation screen, optional forgot-password emails, IP and geolocation logging, a custom login-screen logo, an OP-only admin panel (with optional approval mode for new registrations, timezone grouping, and approve/deny), and a player profile where users can change their password, update their email, or delete their account (with an email notification and disconnect).
What This Mod Does
- Registration: New players see a TOS screen, then a registration form. The full-name field is pre-filled with your Minecraft username and cannot be edited. You also enter email, optional display name, and password. A "Terms of Service & Privacy" button opens a scrollable data/privacy policy (from
config/secplayer_privacy.txt on the client). Passwords are masked. One "I agree to the Terms of Service" checkbox confirms age (minimum configurable).
- Login: Returning players enter their password on join. Optional "Remember me" stores the password securely per server for auto-login next time. "Forgot password?" sends a reset code by email (when SMTP is configured). An "Enter reset code" button lets you open the code + new password screen without requesting another email (e.g. if you closed the menu or reopened the game).
- Player profile: Run
/secplayer info to open a profile screen. You can view your info (username, masked email, alternative name), change password, update email, or delete your account. Deleting your account removes all data, sends you a confirmation email (including the server name), and disconnects you; re-joining requires registering again.
- TOS text: Server operators can edit the exact Terms of Service in
config/secplayer_tos.txt (file is created on server start if missing).
- IP & geolocation: The mod records IP, country, region, city, and optionally ISP (ASN) on registration and login. Uses GeoLite2 database files in
config/ (you place the files manually; obtain them from a free MaxMind account). In the admin player detail, only country and last login (timezone-formatted) are shown; full geo data is still stored in the database until the account is deleted.
- Admin panel: OPs run
/secplayer admin to open a list of registered players grouped by timezone (search by player or timezone; players with no timezone appear under "Local"). Open a player to view details (username, UUID, masked email, alternative name, birth year, status, country, last login), ban/unban (Minecraft's ban list), reset password, set alternative username, approve/deny (when approval mode is on), or delete the player (sends them an email and removes the account). All scrollbars support click-and-drag.
- Approval mode: Set
requireApproval=true in config so new registrations are "pending" until an admin approves. Use the Pending filter in the admin list, or Approve / Deny in player detail, or /secplayer approve <player> / /secplayer deny <player>. Deny adds the player to the ban list; optional email when approved (if SMTP is configured).
- Display names: Players can choose an optional "alternative username" and use it as their in-game name (chat, tab list). Use
/secplayer setAlt <name> to set or clear it; setting a non-empty name automatically enables "use as in-game name," so you don't need to have checked the box at registration.
- Login logo: You can show a custom logo on the login screen. The server can send one image to all clients (no per-client config), or clients can use a local image. Logo is scaled to fit the panel.
- Data storage: All account data is stored in a SQLite database on the server. No separate database server is required. The file
config/secplayer.db is created on first run and holds accounts, login history (IP, geolocation, timestamps), and password-reset tokens. You can back up or inspect it with any SQLite tool.
Installation
- Install Forge for Minecraft 1.18.2.
- Place the mod JAR in the
mods/ folder on both the server and every client.
Registration and login only run on dedicated servers. Single-player / integrated server does not use the registration flow.
How to Use (Players)
- First time: On join you see the TOS screen. Check the agreement box and click Continue to Registration. Your name is pre-filled with your Minecraft username. Fill in email, optional display name, and password, then submit. Use Disconnect to leave without registering.
- Later joins: Enter your password on the login screen. Optionally check Remember me for auto-login next time. Use Forgot password? to receive a reset code by email (if the server has SMTP configured). You can also click Enter reset code to type an existing code and new password without requesting another email.
- Profile: Run
/secplayer info to open your profile. From there you can change your password, update your email, or delete your account (you'll get an email and be disconnected).
- Display name: Use
/secplayer setAlt <name> to set or clear your in-game display name (no spaces). Setting a name automatically turns on "use as in-game name" if you didn't enable it at registration.
How to Use (Server Ops)
- Admin list: Run
/secplayer admin (requires OP). You’ll see registered players grouped by timezone (search box filters by player or timezone). Use the Pending filter when approval mode is on. Open a player to view details (country and last login are shown; full geo is stored but not shown in the UI), ban/unban, reset password, set alternative username, approve/deny (for pending players), or delete the player (sends them an email and removes the account). You can also use /secplayer approve <player> and /secplayer deny <player> from chat or console.
- TOS: Edit
config/secplayer_tos.txt on the server. Use %d in the text for the minimum age number. The file is created with default text on first server start if missing.
Configuration
Main config: config/secplayer.properties (created on first run).
| Option |
What it does |
Default |
| minAge |
Minimum age in the TOS text (e.g. 13) |
13 |
| requireApproval |
When true, new registrations need admin approval before they can log in |
false |
| smtpHost, smtpPort, smtpUseTls |
SMTP server for "Forgot password?" and account-deleted emails |
(empty), 587, true |
| smtpUsername, smtpPassword |
SMTP login |
(empty) |
| smtpFromAddress, smtpFromName |
Sender address and name for emails |
(empty), SecPlayer |
| smtpPasswordFile |
Optional: path to a file (relative to config/) containing the SMTP password; avoids special-character issues in .properties |
(empty) |
| smtpDebug |
Set to true to log the SMTP dialog to the server log (for troubleshooting) |
false |
| loginLogoPath |
Logo filename in the server config/ folder (e.g. mylogo.png). Server sends it to clients so everyone sees the same logo. |
(empty) |
| bannedAltNames |
Comma-separated display names players cannot use (e.g. herobrine) |
herobrine |
| displayTimezone |
Timezone for "last login" in the admin list (e.g. America/New_York, UTC) |
UTC |
Login logo (client-only override): Create config/secplayer_client.properties and set loginLogoPath=filename.png, then put the PNG in config/. Used when the server does not send a logo.
Geolocation (optional): For country/region/city, place GeoLite2-City.mmdb in the server config/ folder. For ISP (ASN), add GeoLite2-ASN.mmdb. Obtain these from MaxMind (free account) and place them in your server config/ folder.
Troubleshooting
/secplayer admin does nothing: You must be OP (e.g. /op YourName in the server console). There is no in-game menu button; the command opens the admin list.
- Registration/login never appears: The mod only runs the flow on dedicated servers. Use a dedicated server or LAN host to test.
- Crashes or exit code 1: Check the latest file in
crash-reports/ (client or server). Ensure the mod and Forge versions match (e.g. Forge 40.x for 1.18.2).
Requires Minecraft 1.18.2 and Forge 40.x. All Rights Reserved.
评论 0
登录后参与评分
还没有评论,来抢沙发吧