描述
Minecraft……一款多么令人惊叹的游戏……除非服务器宕机,你无法再玩的时候……好吧,这个插件或许能解决这个问题!
每当玩家加入你的服务器时,如果他未登录(使用 /login 命令),将不允许进行任何操作。
它使用 MySQL 数据库和自定义加密流程。
这样,你可以创建一个网站,用户可以在上面注册账号,并使用相同的密码登录到你的 Minecraft 服务器。
你还可以使用该插件,仅允许拥有你服务器账号的玩家进行游戏。这样一来,你可以更有效地筛选玩家。
数据库结构
- 一列 <ColUsername>
- 一列 <ColPassword>
- 任何你希望的其他列,只要你将其包含在加密公式中即可。
其中 ColUsername 包含用户名,ColPassword 包含加密后的密码。
公式部分
由于每个人都可能希望使用不同类型的加密流程,我的想法是让你自由选择。
其工作原理如下:
目前你只有以下几个可用函数:
- MD5, MD2 => 需要 1 个参数
- SHA1, SHA256, SHA384, SHA512 => 需要 1 个参数
- CONCAT => 需要 2 个或多个参数
- DB => 需要 1 个参数
- PASS => 不需要任何参数
每个函数都会返回一个字符串,因此你可以将它们组合使用。以下是一些示例:
- MD5(PASS()) => 将返回玩家提供的密码的 MD5 哈希值。
- MD5(CONCAT("salt",PASS())) => 将给定的密码与字符串 "salt" 连接,并对结果创建 MD5 哈希值
- SHA1(CONCAT(PASS(),MD5(DB("username")))) => 将对数据库中 "username" 列的值创建 MD5 哈希值,将其与给定的密码连接,并对结果创建 SHA1 哈希值
- 以此类推……
该公式的计算结果将与数据库中的 <ColPassword> 内容进行比对。如果两者相同的字符串,则允许玩家进行游戏。
警告:务必小心,不要在公式中插入任何空格,字符串除外。
待办事项
- 添加 SQLite 数据库支持;
- 在存档外部创建一个默认配置文件。
- 为哈希公式添加更多功能;
- 在每个事件(登录失败、登录成功等)上关联一个操作,以便数据库可以记录这些操作。
- 为不想在线的用户添加 /register 命令(管理员应能够启用/禁用该命令);
- 为管理员添加 /valid-request 命令,用于验证账户请求;
- 添加 /forgot-account 命令;
- 添加 /login-enable 和 /login-disable 命令;
- 添加 /let-play 命令,允许某位玩家在指定时间内进行游戏(需要 OP 权限);
- ...(有任何建议吗?)
命令
- /login <password> - 尝试使用该玩家的名称和提供的密码登录。
权限
安装方法
- 下载 “LoginPlugin.jar” 文件
- 编辑你下载的 LoginPlugin.jar 文件中的 “config.yml”
- 将压缩包复制到你的 “plugins/” 文件夹中
- 重启服务器
版本记录
- v0.1 - 首次发布。
- v0.2 - 添加算法、加密流程。重构代码。
更新日志
在十一月底之前,我将无法继续为此项目投入精力。
我会公开源代码,供任何希望复用此项目的开发者使用。
很抱歉,但请放心,我不会让大家失望的。 祝好!
如果您有任何问题,请随时问我!
如果你有任何推测,请告诉我!
DESCRIPTION
Minecraft... What an amazing game... Except when the server is down, and when you can't play anymore... Well, this plugin might be a solution!
Whenever a player join your server, he won't be allowed to do anything if he didn't log in (using /login command).
It is using a MySQL database, and a personalised encryption process.
This way, you can create a website on which people will sign in, and use the very same password to log into your Minecraft server.
You can also use this plugin to let people play only if they have an account on your server. That way, you can filter players more efficiently.
DATABASE STRUCTURE
- A Column <ColUsername>
- A Column <ColPassword>
- Any other column you want, as soon as you describe it in the encryption formula.
Where ColUsername contains a username, and ColPassword contains an encrypted password.
THE FORMULA THING
As everybody might want to use a different kind of encryption process, my idea was to let you the choice.
Here is how it works :
You only have few functions available right now :
- MD5, MD2 => require 1 parameter
- SHA1, SHA256, SHA384, SHA512 => require 1 parameter
- CONCAT => require 2 or more parameters
- DB => require 1 parameter
- PASS => don't require any parameter
Each function will return a String, so you can combine them together. Here are few examples :
- MD5(PASS()) => will return a MD5 hash of the password given by the player.
- MD5(CONCAT("salt",PASS())) => will concatenate the given password with the String "salt", and create a MD5 hash of the result
- SHA1(CONCAT(PASS(),MD5(DB("username")))) => will create a MD5 hash of the "username" column from the database, concatenate it with the given password, and create a SHA1 hash of the result
- And so on...
The result of this formula will be compared with the content of the <ColPassword> in the database. If it's the same String, then the player is allowed to play.
WARNING : You must be careful and you shouldn't put any space in the formula, except in the String.
TODO
- Add SQLite database support;
- Create a default configuration file outside of the archive.
- Add more functions for the hash formula;
- Associate an action on each event (login fail, login success, ...) so that the database can keep a record of it.
- Add a /register for people who don't want to go online (op should be able to activate/deactivate it);
- Add a /valid-request for op, to validate request for an account;
- Add a /forgot-account command;
- Add a /login-enable and a /login-disable command;
- Add a /let-play command to let a player play for a certain amount of time (requires op permissions);
- ... (any suggestions?)
COMMAND
- /login <password> - Will try to log the player in with his pseudo and the given password.
PERMISSIONS
INSTALLATION
- Download "LoginPlugin.jar" file
- Edit "config.yml" in the LoginPlugin.jar file you've downloaded
- Copy the archive in your "plugins/" folder
- Restart your server
VERSIONS
- v0.1 - first release.
- v0.2 - Add algorithm, encryption process. Reorganize code.
NEWS
I wont be able to keep on working on this project before the end of November.
I will release the source code for anyone who would like to re-use it.
I'm sorry about that, but be sure I will not let it down.
Cheers!
If you have any questions, please ask me!
If you have any suppositions, please tell me!
评论 0
登录后参与评分
还没有评论,来抢沙发吧