源码
前言
AutoGroup 是我很久以前开始开发的一个插件,初衷是为了满足我所在服务器的需求以及广大玩家提出的要求。它曾长期被我搁置在待办事项列表的底部,我将大部分时间都投入到了定制插件的开发中。无论如何,现在是我向大家展示它的时候了。
简介
AutoGroup 是一款独特的插件,旨在让服务器管理员更轻松地管理用户组和晋升权限。它使用 SQLite 数据库记录玩家的在线时长、加入日期和最后登录时间。基于这些数据,当玩家达到设定的游戏时长目标时,管理员可以对其进行晋升。目前支持设置一个“忠诚度”等级(例如:在服务器上停留一个月)和三个“成瘾度”等级(例如:累计游戏时长达到 100 小时)。
AutoGroup 的另一项核心功能是完全由你掌控的 PayPal 捐赠管理系统!所有信息都不会离开你的网站。虽然配置过程可能有些复杂,但我保证回报是丰厚的。该系统利用 PayPal 即时支付通知 (IPN) API 提供近乎实时的付款确认,随后将数据插入 MySQL 数据库,等待用户领取。安全、可靠且快速的半自动捐赠流程。
安装 - 捐赠功能
- 运行一次以生成默认配置文件。
- 使用 phpMyAdmin 或类似工具创建一个数据库(如果使用捐赠功能),确保该数据库同时可从你的 Web 服务器和 Minecraft 服务器访问。你可能需要确保 MySQL 绑定到正确的 IP 地址以允许外部访问。然后将 donate.php 放置在 Web 服务器的某个目录中,并按如下说明编辑变量:
$host = "localhost";
$username = "AutoGroup";
$password = "AutoGroup";
$database = "AutoGroup";
$myemail = "YOUR EMAIL HERE";
- 阅读以下内容:
- 由于我没有 PayPal 账户,无法提供具体的步骤指导,但请阅读相关说明,你应该能明白如何操作。URL 处请填写 donate.php 的地址。简而言之,如果你使用 PayPal 按钮,可以添加 notify_url="",否则请遵循上述说明。
- 如果你想使用 PayPal 的沙盒 API 进行测试,请使用 donate.php 并在此处遵循说明:
- 在 AutoGroup/config.yml 中输入你的数据库详细信息。
- 大功告成!
安装 - 时长功能
配置文件一目了然,但此处提供参考:
编辑:代码标签已损坏,故改为:
所有时间均以秒为单位测量。若要禁用某项时长功能,请将对应时间设置为 0。“成瘾度”等级基于累计游戏时长发放,而“忠诚度”等级则基于玩家加入服务器以来的时长计算。MySQL 信息仅用于捐赠功能,其余部分均不言自明。默认命令适用于 PermissionsBukkit 用户。
命令
/donate [Transaction ID]
通过 PayPal 进行捐赠的命令,只需在其后跟随交易 ID 即可。
/playtime <Player name>
显示你的游戏时长统计信息(以秒为单位),如果你有相应权限且指定了其他参数,则显示该玩家的信息。
权限:
autogroup.donate:
description: 允许使用捐赠命令
default: true
autogroup.playtime:
description: 允许使用 playtime 命令
default: true
autogroup.playtime.others:
description: 允许对其他玩家使用 playtime 命令
default: op
autogroup.norank:
description: 防止玩家获得等级
default: op
表达感谢
正如我之前所述,我没有 PayPal 账户,因此不接受捐赠,但你们的感谢对我来说意义重大。
如果你是经验丰富的服务器管理员,制作一个教程视频将会非常棒,请直接私信我!
更新日志
- 版本 1.1.1 - 修复状态错误
- 版本 1.1 - 修复配置问题并添加 norank
- 版本 1.0 - 初始发布
Source
Preface
AutoGroup was a mod I started a long time ago in response to the needs of a server I play on and of those requested by the general public. It has long spent it's time at the bottom of my todo list, instead my time devoted largely to custom plugin requests. Anyway, it is time for me to reveal it to everyone.
Information
AutoGroup is a unique plugin that aims to make the management of groups and promotions much easier for server owners. It keeps track of the time the player has spent online, date they joined and last join time in a sqlite database. This database is then used to give admins the ability to promote users once certain playtime goals are set. There is currently the ability for one longevity rank, ie. Spend one month on the server and three 'addiction ranks', eg accumulate a total of 100 hours playtime.
The other core feature of AutoGroup is it's PayPal donation management system, completely controlled by you! No information ever leaves your website at all. It's setup can be complicated, but I assure the rewards are great. This system makes use of PayPal's Instant Payment Notification API to give near instant confirmation of the payment, which is then inserted into a MySQL database ready for the user to claim. Safe, secure and fast semi-automatic donations.
Installation - Donations
- Run once to generate default config.
- Using phpMyAdmin or a similar tool create a database, if using the donation feature, that is accessible from both your web server and Minecraft server. You may need to make sure MySQL binds to the correct ip to allow outside access. Then place donate.php in a directory on your web server and edit the variables as outlined below:
$host = "localhost";
$username = "AutoGroup";
$password = "AutoGroup";
$database = "AutoGroup";
$myemail = "YOUR EMAIL HERE";
- Read this:
- As I cannot have a PayPal account I can't tell you the correct steps, but read the instructions and you will figure it out. The URL is where you put donate.php In short if using a PayPal button you can add notify_url="" else follow the instructions.
- If you wish to test using PayPal's sandbox API, use donate.php and follow the instructions here
- Put your database details in AutoGroup/config.yml
- Thats it!
Installation - Time features
The config is self explanatory, but here it is for reference:
EDIT: CODE TAGS DONE BROKE SO:
All times are measured in seconds. To disable a time feature set the time to 0. Addict ranks are given based on cumulative playtime and the loyalty rank is based on how long since they joined the server. The MySQL information is for donations only, and the rest is self explanatory. The default command will work for PermissionsBukkit users.
Commands
/donate [Transaction ID]
Command to donate via PayPal, simply follow it with the transaction id.
/playtime <Player name>
Show statistics about your playtime in seconds, and if you have the permission and another argument is specified, that players information.
Permissions:
autogroup.donate:
description: Allows use of the donate command
default: true
autogroup.playtime:
description: Allows use of the playtime command
default: true
autogroup.playtime.others:
description: Allows use of the playtime command on others
default: op
autogroup.norank:
description: Prevents player from being ranked
default: op
Show your thanks
Well as I may have outlined before, no PayPal account for myself, therefore no donations, however your thanks means a lot to me.
If you are an experienced server owner a tutorial video would be tremendous, just pm me!
Changelog
- Version 1.1.1 - Fix status bug
- Version 1.1 - Fix config and add norank
- Version 1.0 - Initial release
评论 0
登录后参与评分
还没有评论,来抢沙发吧