AutoGroup
Source
https://github.com/md-5/AutoGroup
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: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNSetup
- 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="http://yoursite.com/donate.php" else follow the instructions.
- If you wish to test using PayPal's sandbox API, use donate.php and follow the instructions here https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/ipn-test-outside
- 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:
https://github.com/md-5/AutoGroup/blob/master/src/main/resources/config.yml
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
hmm no ticket filing here? okay 1) I found that installed on a server without bothering to setup the donations tracking part, etc (such as my sandbox pc server) it works fine, but if anyone typed /donate in, it would throw an internal error and crash the server, sorry i dont have a server log file goign back to that time, and i also saw this on my public hosted server. The server log would throw out message about the mysql being locked out or something. Even if I negative-permissioned the donate node nonop testers could call the command and grind it to a halt with the same error, as if the plugin was doing work and THEN seeing if the user was permitted to do use that command... Since at the time, the /donate and /playtime commands were the first two entries in the /help page, they were perpetually tried by my sandbox testers while killing time waiting for me to give additional instructions "oh what does this do, if i use it it will tell me there is an error or it needs something"
The workaround for me was to remove the /donate command from your plugins.yml file in the jar and resave it - and even if one knows there is a /donate command in the plugin, nicely, it won't try running and reports no such command exists. No more internal-error inducing griefing :)
MD5 - glad to hear you plan to continue this one, it has meant the world to me to have it running on my server all this time, even if i am always so wanting to crack open the file and change the time formatting output :)
I will file some tickets for you now on some server-crippling (and workaround-able) bugs I encountered with it and some encouraging suggested changes/options to consider please.
I'd love an update :)
This looks awesome I'll wait for the update to use it, although you said it was compatible but I have other things to do first anyway. Can't wait though awesome job, also saw that you were working on Guardian that plugin looks amazing really looking forward to the release.
@WingedSpear
Yes, just edit the command in the config to match gm's
Update soon, I promise
@md_5
Working with Group Manager?
@yaitsbilly
Soo much to do..... I'll try. it is compatible with all CraftBukkit builds though
Update please?
Love it, if I have time I'll make a little tutorial. Thanks! :)
This looks great! I am setting up a server and I think it might be nice to be able to use something like this but I am a little concerned. Your MySQL queries in the PHP files are possibly insecure. People will probably try to use these rather than using them as examples. I think they are allowing for a MySQL injection attack because you don't filter the POST variables before using them in a query. You should use mysql_real_escape_string and/or regex's to secure your strings. I'm not too sure about the Java, maybe it filters it at the driver level and would be ok but I don't see filters there either although I am not too experienced with Java. Anyway, cool stuff! Thanks =)
Hi
can you make it like this: loyaltyGroup_ disabled: true/false
So i can turn it off.
And another thing make it read more ranks then just 3 of them, maybe like this:
or just do it like you did but can add more groups like 4, 5, 6...
etc.
And make the /playtime show X days, X hours, X minutes, X seconds.
Then this plugin would be epic! ;D
Please Note
If you are using a permissions plugin that does not have a command that you can use in game (or via the console) to change the group of players while the server is running, you cannot use this plugin effectively.
For your cause
I will pretend two of your groups are called: "Default" and "Noob".
LoyaltyGroup is meant to define the highest rank you can get by playing a certain amount of time. This is why when you type in /playtime, it will show you how long until you achieve the LoyaltyGroup. If you wish to disable it, simply set the LoyaltyTime to 0.
Hope this helps!
Umm i have NO clue how this thing works. I look at the rank up in the configuration folder and i just dont understand what it all means. Im not doing donations but i do what to have it so after like an hour people rank and after 500 hours they rank again. I just have no clue what each line on the config means. If you could just define them for me that would help alot. Or a nice tutorial too.
@md_5
This does not work either, it simply over-writes a player's status in the .db file after logging in again.
Would It be hard to add a node that exempts players/groups from being auto ranked, but still have their playtime checked?
That's currently the only solution to this problem..
Another note: http://localhostr.com/file/PgJJdR9/2011-11-16_15.34.51.png
This is when you've achieved the LoyaltyGroup and have passed the maximum AddictRank.
@deleted_7720465
Sorry my bad. In users.db edit time to a big number and then edit status to 'Owner' that will solve it.
@md_5 The same problem still occurs. This is my config file:
debug: false mysqlURL: 127.0.0.1 dbName: AutoGroup username: AutoGroup password: AutoGroup table: donators table2: players command: pex user %1$s group set %2$s interval: 300 loyaltyGroup: Veteran loyaltyTime: 2419200 don1Group: Donator1 don2Group: Donator2 don3Group: Donator3 don1Amount: 5 don2Amount: 15 don3Amount: 25 addict1Group: Builder addict2Group: Crafter addict1Amount: 1800 addict2Amount: 1209600
I previously had every other group's playtime set to 0, but still had the same effect as this.
So all in all, it takes 30 minutes to become a Builder, 2 weeks to become a Crafter and 1 Month to become a Veteran.
I, am in the group "Owner".
Starting with a fresh users.db file, I log in... and it creates my player's name in the db file and logs my time. My rank at this point, is still Owner.
For testing purposes, I set the interval at which it updates information to 10 seconds, and changed the times at which you auto rank to:
addict1Group: Builder addict2Group: Crafter addict1Amount: 20 addict2Amount: 40 loyaltyGroup: Veteran loyaltyTime: 60
Now, because i'm technically starting at zero seconds of gameplay, it will start the timer. Once it reaches 20 seconds, my group changes from Owner to Builder. 40 seconds, Builder to Crafter. 60 seconds, Crafter to Veteran. I expect this to happen, though.
After reaching the top rank possible via AutoRank, which in my case is Veteran, I then /pex user ReVurb group set Owner (adds me to the Owner group again).
10 seconds after, when it performs it's check, it then sets me back to the Veteran group. Clearly because it does a check to see if I'm in the Veteran group, and if I'm not, then it checks to see how long i've played, and if i've played longer than the required time to be a Veteran then it will put me in that group.
I apologize for the massive amounts of posts, but I'm not sure if you understand what my problem is completely, - specifically because your stated methods of solving this problem have not worked.
@deleted_7720465
You don't need to put all groups, so define the groups you want and the ones you don't need put the playtime as 0. This will automatically disable it.
@md_5
Thank you md_5, I will definitely be making a video on how to use this, it's really helpful :)
Another request in addition to my other post:
I can already see this plugin being used by many people, and because you don't have paypal... THANK YOU.
Gah. Another edit. This is the problem I have.
I would like to be in the group 'Owner', which has a time set as 0, however it is the top rank on my server. If my playtime is above the highest time in seconds, it will revert me back to that group on the next interval.
Example.
loyaltyGroup: Veteran loyaltyTime: 2419200
That is the highest rank in my server, without applying for Moderator or Admin positions. I am in the group Owner, and I set my player's playtime above 2419200.
On the interval at which it checks to see if your playtime is greater than the specified amount in the config file for a corresponding group, it will set me back to Veteran, because that's the highest rank in the config.
I can't really think of any workarounds, besides: Setting the time required to get into the group 'Owner' to multiple years... thus preventing players from getting into that group... or with my Permissions plugin, use the built in group latter system and making your plugin run that command depending on your playtime.
Not sure what to do, I really need to use your plugin :S
@deleted_7720465
To stop using groups set the time to 0, you don't need to have all of them. users.db or whatever I called it is Sqlite so you can edit that in a program that can handle it. There is a firefox addon or a standalone one. Yeah parsing would be nice, I should do that. I really gotta get working on Guardian as well. If your server is worth your two cents it should be running Logblock Hawkeye or BigBrother, Guardian is a collab between all those and I'm in!
I've been searching for a plugin like this for the longest time, so glad you made it! I was going to have to resort to making it myself :3
To get to the point, however,
I would quite like to suggest adding some preset times (defining minutes, hours, days, weeks).
I currently have a rank that takes two weeks to get, and had to input 1209600 seconds; and would have been accomplished easier with an abbreviated '2w'
Another suggestion: Allow a section to exempt players from auto ranking. (or manually set a default playtime for specific users) I have many moderators and admins, which after playing for an amount of time will essentially "de-rank" because of their play time starting at 0.
Some trouble I'm currently having though, (I'm not sure if you mean for it to be this way), but on the server I run, there are many groups. To cut things short, I wish to prevent players from ranking to specific groups, and I have no clue how to go about doing so. A workaround to setting the rank-up time for the group 'owner' to 9999999999 and setting my playtime over that number.
Once again, great plugin! I hope you continue to work on it :)