高级、安全且完全可定制的认证系统
LoginSystem 是一款现代化的、高性能的认证插件,从头开始设计以最大化您服务器的安全性。厌倦了老旧笨重的插件吗?LoginSystem 将通过其 多数据库支持、高级哈希选项 和 完全可翻译的结构 为您的服务器增添专业感。
所有数据库操作均以 异步 方式运行,这意味着您的服务器不会出现任何延迟。
广泛的数据库支持: SQLite、H2、MySQL、MariaDB、PostgreSQL,甚至 MongoDB!
顶级安全性: 默认使用 SHA256 哈希,自动从旧算法(SHA1、MD5 等)迁移,并防止使用不安全的密码。
100% 可翻译: 所有消息均通过语言文件管理。新语言可以从 GitHub 自动下载。
高度可定制: 登录超时时间、每个 IP 的注册限制、登录前的移动/聊天/命令限制等等。
管理员命令: 许多有用的命令,如强制注册玩家、更改密码、注销账户以及重新加载插件。
开发者 API: 一个强大的 API,允许其他插件与 LoginSystem 集成。
自动更新检查器: 在 SpigotMC(资源 ID: 74894)上检查新版本并通知管理员。
GUI 支持: API 允许创建现代的 Anvil GUI 登录界面,而不是使用聊天窗口。

玩家命令
/login <password> - 允许您登录服务器。
/register <password> <confirmPassword> - 允许您在服务器上注册。
/changepassword <oldPassword> <newPassword> - 更改您的密码。
/unregister <password> - 从服务器上删除您的注册信息。
/logout - 允许您安全登出。
/email add <email> - 添加或更改您账户的电子邮件地址。
/email remove - 从您的账户中移除电子邮件地址。
管理员命令 (/ls)
/ls help - 列出所有管理员命令。
/ls reload - 重新加载插件的配置和语言文件。
/ls lang <language> - 更改插件的语言并重新加载它。
/ls register <player> <password> - 强制注册一名玩家。
/ls unregister <player> - 删除一名玩家的注册信息。
/ls changepass <player> <newPassword> - 更改一名玩家的密码。
/ls forcelogin <player> - 强制在线玩家登录。
loginsystem.admin - 授予所有管理员命令的访问权限。(默认:OP)
loginsystem.admin.help - /ls help 的权限。
loginsystem.admin.reload - /ls reload 的权限。
loginsystem.admin.lang - /ls lang 的权限。
loginsystem.admin.register - /ls register 的权限。
loginsystem.admin.unregister - /ls unregister 的权限。
loginsystem.admin.changepass - /ls changepass 的权限。
loginsystem.admin.forcelogin - /ls forcelogin 的权限。
loginsystem.admin.update - 加入时接收更新通知。

配置
该插件几乎完全可以通过 config.yml 文件进行自定义。
# LoginSystem 插件配置
# 指定用于数据存储的方法。
# 可用选项:sqlite, h2, mysql, mariadb, postgresql, mongodb
storage:
type: sqlite
# H2 设置(当类型设置为 h2 时使用)
h2:
# 要在插件文件夹中创建的数据库文件的名称(不带扩展名)。
# 例如:'loginsystem_data' -> 创建 plugins/LoginSystem/loginsystem_data.mv.db
filename: "loginsystem_data"
# MySQL/MariaDB 设置
database:
host: "localhost"
port: 3306
dbname: "loginsystem"
user: "root"
password: "password"
# PostgreSQL 设置
postgresql:
host: "localhost"
port: 5432
dbname: "loginsystem"
user: "postgres"
password: "password"
# MongoDB 设置
mongodb:
# 示例连接 URI。请根据您的服务器信息进行编辑。
# 简单结构:"mongodb://host:port"
# 带身份验证:"mongodb://user:password@host:port/?authSource=admin"
connection-uri: "mongodb://localhost:27017"
database: "loginsystem"
settings:
# 在服务器启动时检查 SpigotMC 上的新版本。
update_checker:
enabled: true
# 指定要使用的语言文件。
# 示例:en, tr, az, de
# 所有可用语言的列表可在以下位置找到:https://github.com/BartuAbiHD/LoginSystem/tree/main/messages
messagesLanguage: "en"
security:
# 最小密码长度。
minPasswordLength: 6
# 最大密码长度。
passwordMaxLength: 32
# 要使用的哈希算法。
# 选项:SHA256, BCRYPT, MD5
# 警告:避免使用 MD5 等过时且不安全的算法。
passwordHash: "SHA256"
# 如果密码检查失败,LoginSystem 还将尝试使用以下算法进行检查。
# 此设置在从一种哈希方法迁移到另一种方法时非常有用。
# 如果匹配旧版哈希,LoginSystem 将自动将密码更新为新哈希方法。
# legacyHashes:
# - 'SHA1'
# - 'MD5'
legacyHashes: []
# 防止使用不安全(容易被猜到)的密码。
# 列表不区分大小写。
unsafePasswords:
- '123456'
- 'password'
- 'qwerty'
- '12345'
- '54321'
- '123456789'
- 'help'
- 'test'
- 'deneme'
restrictions:
# 未认证的玩家能聊天吗?
# 此设置还会阻止下面列出的所有命令。
allowChat: false
# 是否对未认证的玩家隐藏聊天内容?
hideChat: false
# 未认证玩家允许的指令。
allowCommands:
- /login
- /register
- /l
- /reg
- /giris
- /girisyap
- /oturumac
- /kayit
- /kayitol
- /kaydol
# 每个 IP 允许的最大注册次数。
# 值为 0 表示无限制!
maxRegPerIp: 2
# 允许的用户名最小长度。
minNicknameLength: 3
# 允许的用户名最大长度。
maxNicknameLength: 16
# 启用此设置后,由于“从其他位置登录”而已经在线的玩家不会被踢出。
# 这可以防止潜在的安全漏洞。
ForceSingleSession: true
ForceSpawnLocOnJoin:
# 如果启用,所有在以下列出的世界中加入游戏的玩家将在成功认证后被传送
# 到该世界的出生点。
# 玩家的退出位置将被覆盖。
enabled: false
# 需要强制出生点的世界名称(区分大小写!)
worlds:
- world
- world_nether
# 是否立即踢出不已注册的玩家?
kickNonRegistered: false
# 密码错误时是否踢出玩家?
kickOnWrongPassword: true
# 未能登录或注册的玩家应在多少秒后被踢出?
# 设置为 0 以禁用。
timeout: 30
# 玩家名称中允许字符的正则表达式模式。
allowedNicknameCharacters: "[a-zA-Z0-9_]*"
# 密码中允许字符的正则表达式模式。
allowedPasswordCharacters: "[!-~]*"
# 电子邮件中允许字符的正则表达式模式。
allowedEmailCharacters: "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z]{2,}$"
开发者文档
LoginSystem 提供了一个强大的 v2 API 以促进与其他插件的集成。
API 示例
访问 API:
LoginSystemAPI api = LoginSystem.getApi();
检查玩家是否已登录:
if (api.isLoggedIn(player)) {
// ...
}
监听成功登录事件:
import me.bartuabihd.loginsystem.api.v2.event.LoginEvent;
@EventHandler
public void onPlayerAuthLogin(LoginEvent event) {
Player player = event.getPlayer();
player.sendMessage("Welcome back via API!");
}
Advanced, Secure, and Fully Customizable Authentication
LoginSystem is a modern, high-performance authentication plugin designed from the ground up to maximize your server's security. Tired of old and clunky plugins? LoginSystem will add a professional touch to your server with its multi-database support, advanced hashing options, and fully translatable structure.
All database operations run asynchronously, meaning your server will not experience any lag.
Wide Database Support: SQLite, H2, MySQL, MariaDB, PostgreSQL, and even MongoDB!
Top-Tier Security: SHA256 hashing by default, automatic migration from legacy algorithms (SHA1, MD5, etc.), and unsafe password prevention.
100% Translatable: All messages are managed through language files. New languages can be downloaded automatically from GitHub.
Highly Customizable: Login timeout, registration limit per IP, movement/chat/command restrictions before login, and much more.
Admin Commands: Many useful commands like force-registering players, changing passwords, unregistering accounts, and reloading the plugin.
Developer API: A powerful API that allows other plugins to integrate with LoginSystem.
Automatic Update Checker: Checks for new versions on SpigotMC (Resource ID: 74894) and notifies admins.
GUI Support: The API allows for the creation of modern Anvil GUI login screens instead of using chat.

Player Commands
/login <password> - Allows you to log in to the server.
/register <password> <confirmPassword> - Allows you to register on the server.
/changepassword <oldPassword> <newPassword> - Changes your password.
/unregister <password> - Deletes your registration from the server.
/logout - Allows you to log out securely.
/email add <email> - Adds or changes the email address for your account.
/email remove - Removes the email address from your account.
Admin Commands (/ls)
/ls help - Lists all admin commands.
/ls reload - Reloads the plugin's configuration and language files.
/ls lang <language> - Changes the plugin's language and reloads it.
/ls register <player> <password> - Forcibly registers a player.
/ls unregister <player> - Deletes a player's registration.
/ls changepass <player> <newPassword> - Changes a player's password.
/ls forcelogin <player> - Forces an online player to log in.
loginsystem.admin - Grants access to all admin commands. (Default: OP)
loginsystem.admin.help - Permission for /ls help.
loginsystem.admin.reload - Permission for /ls reload.
loginsystem.admin.lang - Permission for /ls lang.
loginsystem.admin.register - Permission for /ls register.
loginsystem.admin.unregister - Permission for /ls unregister.
loginsystem.admin.changepass - Permission for /ls changepass.
loginsystem.admin.forcelogin - Permission for /ls forcelogin.
loginsystem.admin.update - Receive update notifications upon joining.

Configuration
The plugin is almost entirely customizable through the config.yml file.
# LoginSystem Plugin Configuration
# Specify which method to use for data storage.
# Available options: sqlite, h2, mysql, mariadb, postgresql, mongodb
storage:
type: sqlite
# H2 settings (used if type is set to h2)
h2:
# The name of the database file to be created in the plugin's folder (without extension).
# For example: 'loginsystem_data' -> creates plugins/LoginSystem/loginsystem_data.mv.db
filename: "loginsystem_data"
# MySQL/MariaDB settings
database:
host: "localhost"
port: 3306
dbname: "loginsystem"
user: "root"
password: "password"
# PostgreSQL settings
postgresql:
host: "localhost"
port: 5432
dbname: "loginsystem"
user: "postgres"
password: "password"
# MongoDB settings
mongodb:
# Example connection URI. Edit according to your own server information.
# Simple structure: "mongodb://host:port"
# With authentication: "mongodb://user:password@host:port/?authSource=admin"
connection-uri: "mongodb://localhost:27017"
database: "loginsystem"
settings:
# Check for new updates on SpigotMC when the server starts.
update_checker:
enabled: true
# Specifies the language file to be used.
# Example: en, tr, az, de
# A list of all available languages can be found at: https://github.com/BartuAbiHD/LoginSystem/tree/main/messages
messagesLanguage: "en"
security:
# Minimum password length.
minPasswordLength: 6
# Maximum password length.
passwordMaxLength: 32
# The hashing algorithm to be used.
# Options: SHA256, BCRYPT, MD5
# WARNING: Avoid using old and insecure algorithms like MD5.
passwordHash: "SHA256"
# If a password check fails, LoginSystem will also try to check with the following algorithms.
# This setting is useful when migrating from one hashing method to another.
# LoginSystem will automatically update the password to the new hash method if it matches a legacy one.
# legacyHashes:
# - 'SHA1'
# - 'MD5'
legacyHashes: []
# Prevent unsafe (easily guessable) passwords from being used.
# The list is case-insensitive.
unsafePasswords:
- '123456'
- 'password'
- 'qwerty'
- '12345'
- '54321'
- '123456789'
- 'help'
- 'test'
- 'deneme'
restrictions:
# Can unauthenticated players chat?
# This setting also blocks all commands not listed below.
allowChat: false
# Should chat be hidden from unauthenticated players?
hideChat: false
# Allowed commands for unauthenticated players.
allowCommands:
- /login
- /register
- /l
- /reg
- /giris
- /girisyap
- /oturumac
- /kayit
- /kayitol
- /kaydol
# Maximum number of allowed registrations per IP.
# A value of 0 means unlimited registrations!
maxRegPerIp: 2
# Minimum allowed username length.
minNicknameLength: 3
# Maximum allowed username length.
maxNicknameLength: 16
# When this setting is enabled, an already online player cannot be kicked due to "Logged in from another location".
# This prevents potential security exploits.
ForceSingleSession: true
ForceSpawnLocOnJoin:
# If enabled, every player that joins in one of the worlds listed below will be teleported
# to the world's spawn point after successful authentication.
# The player's quit location will be overwritten.
enabled: false
# World names where forcing the spawn location is required (Case-sensitive!)
worlds:
- world
- world_nether
# Should non-registered players be kicked immediately?
kickNonRegistered: false
# Should players be kicked on wrong password?
kickOnWrongPassword: true
# After how many seconds should players who fail to login or register be kicked?
# Set to 0 to disable.
timeout: 30
# Regex pattern for allowed characters in player names.
allowedNicknameCharacters: "[a-zA-Z0-9_]*"
# Regex pattern for allowed characters in passwords.
allowedPasswordCharacters: "[!-~]*"
# Regex pattern for allowed characters in emails.
allowedEmailCharacters: "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z]{2,}$"
For Developers
LoginSystem provides a powerful v2 API to facilitate integration with other plugins.
API Example
Accessing the API:
LoginSystemAPI api = LoginSystem.getApi();
Checking if a player is logged in:
if (api.isLoggedIn(player)) {
// ...
}
Listening for a successful login event:
import me.bartuabihd.loginsystem.api.v2.event.LoginEvent;
@EventHandler
public void onPlayerAuthLogin(LoginEvent event) {
Player player = event.getPlayer();
player.sendMessage("Welcome back via API!");
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧