Alpha Register,简单却全面!
Alpha Register 是一个非常简单的插件,允许用户通过密码进行注册,并将密码存储到 MySQL 数据库中。这可以用于多种用途。(例如作为移动应用或 Web 应用的登录方式)
主要理念
由于我们正在为服务器开发一款 Android 应用,我们需要一种来自 Minecraft 内部的注册形式。我决定自己制作一个插件。当然,你也可以将它用于其他应用程序/解决方案。
功能
- 安装和配置简单
- 游戏内命令使用简单,人人都能理解!
- 相当广泛的配置能力(从 MySQL 列名到所有设置均可自定义)
- /register 命令供玩家注册自己。
- /changepass 命令供玩家更改自己的密码。
安装
步骤 1:下载
- 下载该插件,并将 AlphaRegister.jar 放入 'plugins' 文件夹中。
步骤 2:生成默认配置文件
- 启动你的服务器并等待其加载完成,你会看到来自 AlphaRegister 的关于无法连接 MySQL 的错误提示。(这是正常的,无需担心;在配置完成后这些错误会消失。)
步骤 3:配置
停止你的服务器,然后导航至服务器的 'plugins/AlphaRegister' 目录。到达后,使用你选择的文本编辑器打开 'config.yml' 文件。
内容如下所示:
MySQL:
host: localhost
port: 3306
user: yourUser
password: yourPassword
Database:
dbName: dbToSaveTo
tableName: tableToSaveTo
columnUser: columnNameToSaveUsernamesTo
columnPassword: columnNameToSavePasswordsTo
Debug: false
说明:
- MySQL:
- host: MySQL 服务器的主机名(或 IP 地址)。
- port: MySQL 服务器监听的端口。
- user: 要使用的 MySQL 用户。
- password: 登录指定用户时要使用的密码。
- Database:
- dbName: 保存所有数据的数据库名称。(数据库将为你自动生成!)
- tableName: 保存所有数据的数据表名称。(与数据库一样,这将为你自动生成,自行操作可能会导致错误)
- columnUser: 保存用户名的列名称。(将与数据表一起生成)
- columnPassword: 保存密码的列名称。(密码将以 MD5 格式哈希处理)
- Debug: <true/false> - 是否在控制台中显示调试消息。仅在出现错误或感觉不对劲时才应启用,默认为 false。(如果开启,由于存在大量调试消息,控制台会被刷屏)
步骤 4:权限
只有几个权限:
- AlphaRegister.register - 允许玩家注册自己(默认所有人可用)
- AlphaRegister.register - 允许玩家更改自己的密码(默认仅管理员可用)
- AlphaRegister.* - 允许 AlphaRegister 的所有权限。
步骤 5:检查
如果你认为一切都已正确完成,可以重新启动服务器。如果确实做对了,错误应该消失且插件应已启用!玩得开心!
即将推出的功能/更多想法
- 管理命令,例如:'/deluser <name>' 和 '/resetpass <user> <password>'。(即将推出)
- 可配置的选项,要求在注册前提供电子邮件地址。(想法)
错误报告
如果你发现了一个 bug 或其他可能不正确的问题,请 kindly 提交一个工单并解释问题。在描述问题时请尽可能具体。
如果你只是有一个问题、额外功能的建议,或者只是想给予赞美,你可以在这页留下评论。
备注
- 如果在插件上使用 '/version MyRegister',它将显示 DJ_Jack 为作者;这是我的 Minecraft 用户名。
- 这是我的第二个插件,如果你使用它,我希望它能派上用场。
- 我的母语是荷兰语,所以我的英语可能不够完美;但我尽力使其尽可能清晰。
Alpha Register, simple, yet comprehensive!
Alpha Register is a very simple plugin to let your users register themselves with a password which is then stored into a MySQL database. Which can be used for multiple purposes. (Like a login for a mobile app or web application)
Main Idea
Since there was an android-application being developed for our server, we needed some form of registration from inside Minecraft. I decided to make a plugin myself. Of course you can use this for other applications/solutions as well.
Features
- Simple installation and configuration
- Simple use of the in-game commands, everyone can understand!
- Somewhat extensive configuration-abilities (Everything down to the MySQL-column names are configurable)
- The /register command for players to register themselves.
- The /changepass command for players to change their own password.
Installation
Step 1: Downloading
- Download the plugin and put the AlphaRegister.jar into the 'plugins' folder.
Step 2: Generating default config
- Start your server and wait for it until it finishes loading, you will see errors coming from AlphaRegister about not being able to connect to MySQL. (This is normal and nothing to worry about; this will go away after configuration.)
Step 3: Configuring
Stop your server, and navigate into the 'plugins/AlphaRegister' of your server. Once there open up the 'config.yml' file with a text-editor of your choice.
This is what it will look like:
MySQL:
host: localhost
port: 3306
user: yourUser
password: yourPassword
Database:
dbName: dbToSaveTo
tableName: tableToSaveTo
columnUser: columnNameToSaveUsernamesTo
columnPassword: columnNameToSavePasswordsTo
Debug: false
Explanation:
- MySQL:
- host: Hostname (or ip address) of your MySQL server.
- port: Port where your MySQL server is listening on.
- user: MySQL user to use.
- password: Password to use when logging onto the user specified.
- Database:
- dbName: Name of the database to save all data to. (THE DATABASE WILL BE GENERATED FOR YOU!)
- tableName: Name of the table to save all data to. (JUST LIKE THE DATABASE, THIS WILL BE GENERATED FOR YOU, DOING THIS YOURSELF MAY CAUSE ERRORS)
- columnUser: Name of the column to save usernames to. (WILL BE GENERATED WITH THE TABLE)
- columnPassword: Name of the column to save passwords to. (They will be hashed with MD5)
- Debug: <true/false> - Should there be debug-messages in the console, this should only be used when errors occur or something seems off, defaults to false. (This will spam the console if turned on because there's lots of debug-messages)
Step 4: Permissions
There are just a few permissions:
- AlphaRegister.register - Allows a player to register him-/herself (Allowed to everyone by default)
- AlphaRegister.register - Allows a player to change his/her own password (Only allowed to ops by default)
- AlphaRegister.* - Allows all permissions for AlphaRegister.
Step 5: Check
If you believe you've done everything correctly, you can start your server again. If you actually did do everything right, the errors should be gone and the plugin should be enabled! Have fun!
Upcoming features/More ideas
- Administrative commands like: '/deluser <name>' and '/resetpass <user> <password>'. (Upcoming feature)
- Configurable option to require the providing of e-mail address before you can register. (Idea)
Bugs
If you find a bug or another thing that might not be right, please be so kind to open a ticket and explain the problem. Be as specific as possible when describing the problem.
If you simply have a question, additional features or possibly a compliment, you can leave it in a comment at this page.
Side-notes
- If you use '/version MyRegister' on the plugin, it will show DJ_Jack as the author; this is my Minecraft name.
- This is my second plugin, and if you use it I hope it will be useful.
- My native language is Dutch, so my English might not be perfect; but I tried to make it as clear as possible.
评论 0
登录后参与评分
还没有评论,来抢沙发吧