ActivityPromotion
ActivityPromotion - Promote players based on their activitytime.
IMPORTANT: As I am not playing minecraft anymore, i stopped developing this plugin.
This will now be unactive. If you want to continue or start over fell free to take a look at the Code.
Version: v0.5.5
Notes on the last changes
v0.5.4 - v0.5.5
I fixed the spelling mistake, please change it in the config: "necessaryGroup" instead of "neccesaryGroup".
I implemented two new variables in the config: "promotionCheck" and "resetCheck".
They are used to determine in which periods the tasks should run. 10 means every 10 seconds.
Change that according to your needs.
I also implemented MYSQL, but i haven't fully tested it yet. Please report any bugs in the forum.
Attention
This plugin needs Vault as permission and economic interface!
You have to download Vault er ein order to get this plugin to work.
http://dev.bukkit.org/server-mods/vault/
I am the owner of a german minecraftserver and on our server is a need for automatic promotion.
There is nothing out there, that provides the same functionality, so i created this plugin.
This plugins allows you to put player in multiple groups, based on the time they have spend playing on the Server.
This is my first plugin for bukkit, so please be patient with updates and bad code ;)
Features:
- Multiworld support
- Supports Flatfile and MYSQL
- Vault integrated: supports Permissions 3, bPermissions, PEX, GroupManager, PermissionsBukkit, zPermission
- limit the promotion to groups
- add Users that should be ignored
- define your own period of time the user should be promoted
- multiple timeperiods possible
- add Permissions to the user
- define own ActivityPeriods like 7 days, 1 month, whatever
- See also the last logout, the total playing time and inactive players
Description:
The plugin will count the onlinetime of each player.
when a player reaches a specific timelevel, he will be promoted to the group.
After a resetdate the player will keep the groups for one more timeperiode
if he is inactive in this period, he will be degraded in the next period.
The date will be stored in the list.yml
That is all.
See the video for more details.
Commands:
- /ap
- shows all commands
- /ap reload
- reload the plugin and save actual status
- /ap info <player>
- shows information about the player
- ap info
- shows information about yourself
Permissionnodes:
- activitypromotion.reload
- able to reload ActivityPromotion
- activitypromotion.info
- Allows you to see Information about yourself.
- activitypromotion.info.other
- Allows you to see Informations about other players.
- activitypromotion.loginmessage:
- With this node you will see inactive Player when you log in
All nodes can be used by OP by default.
config.yml:
db: port: 3306 enable: false adress: 'localhost' user: root database: minecraft pass: '' promotionCheck: 10 resetCheck: 10 periods: oneMonth: resetActivity: true periodTime: 1 nextReset: '2011-10-25 00:00:00' activeGroups: - Trial - Member lifeTime: resetActivity: false periodTime: 1 activeGroups: - VIP nextReset: '2012-03-22 10:36:00' groups: Trial: startTime: 1 endTime: 40 setForFirstUse: false permissions: - example.permission necessaryGroup: promotionGroup: - Trial ignoreUser: - Notch world: - world Member: startTime: 30 endTime: false setForFirstUse: false necessaryGroup: - Trial permissions: - another.example.permission promotionGroup: - Member ignoreUser: - Notch world: - world VIP: startTime: 100 endTime: false setForFirstUse: false necessaryGroup: - Member - ^Trial permissions: - vip.permission promotionGroup: - VIP ignoreUser: - Notch world: - world
Explanation for the periods
Except for periodTime (which values are in minutes) all values have to be in seconds!
- oneMonth:
- the name for the group doesn't really matter, put in what you like
- resetActivity
- true
- If you want to reset the timecount every now and then, set this to true.
- If you set this to false it wil count as a lifetime period.
- periodTime
- 1
- Put here the time in MINUTES after a period should be resetted.
- activeGroups:
- - Trial
- - Member
- Define the active groups here. They have to be listed in the groups section.
- nextReset
- '2012-03-22 20:16:00'
- You have to put a date in the past here for the first time you use the plugin.
- After that the plugin will update this entry on its own.
Explanation for the groups
- startTime
- 100
- The time in seconds after a player will be promoted
- endTime
- false
- The time in seconds after a player will get this group removed, if set to false it means this group has no endtime
- setForFirstUse
- false
- If you want to give this group every player on the server on the first start, set this to true. it will reset after one period is over.
- neccesaryGroup:
- The groups the player has to be in to get promoted. Please be aware that he has to be in ALL Groups to get promoted.
- '^' Means, that he must not be in this group to get promoted.
- permissions:
- If you want to grant permission nodes instead of groups put your nodes here.
- promotionGroup:
- This are the groups the player will be promoted to
- ignoreUser:
- Add Users that shoud be ignored
- world:
- Put the worlds here. Please be aware, that the nessecaryGroup will apply on all worlds.
- So the player has to be in Member and not in Trial in ALL worlds to get promoted.
Attention:
The "^" command will only work for nessecaryGroup.
list.yml
players: Chumper_tm: lastLogout: 1332443720 totalTime: 130 passivePeriod: oneMonth: 6 lifeTime: 0 timePlayed: oneMonth: 4 lifeTime: 62
SQL
Since version 0.5.5 AP supports MYSQL again.
Please note that this plugin will NOT create the table, instead you have to create it.
The code looks like this:
CREATE TABLE `ap_player` ( `period` VARCHAR(255) NOT NULL , `name` VARCHAR(255) NOT NULL , `lastLogout` INT NULL , `totalTime` INT NULL , `passivePeriod` INT NULL , `timePlayed` INT NULL , PRIMARY KEY (`name`, `period`) ) ENGINE = InnoDB;
Known Bugs
Lag?
Download & Source
All Files on GitHub
Source on GitHub
Changelog:
- v0.5.5
- implemented MYSQL
- fixed spelling mistake
- v0.5.4
- implemented Vault to support more permissionplugins and to easier integrate economics in further steps
- fixed exception when a player was not found after asking information about it
- v0.5.3
- fixed handling with console
- v0.5.2
- Compiled against CB1.2.4-R1.0
- v0.5.1
- Added GroupManager support
- Added Ingame commands
- v0.5DEV
- Complete rewrite, thanks to the new code base provided by bukkit.
- v0.4.1
- updated version number
- fixed a small bug
- implemented some more features that doesn't work actually
- v0.4
- Compiled against CB 1317
- Includes newest version of bPermission and PermissionsEx
- v0.3.3
- fixed an error that created nullpointerexceptions when using the flatfile
- v0.3.2
- removed Permission reload after each promotion and put it in the /ap reload command
- added secure close for mysql
- v0.3.1
- removed debug output when a player joins
- v0.3
- Added MySQL support
- improved performance
- playerupdate now every two (2) seconds instead of every tick
- v0.2
- More Permissions to support
- Added ignoreUser, endTime, default and permissions
- Bugfixing
- v0.1
- First release
Warning
Even so i tested out this plugin there sure will be Bugs and Errors.
Please post them here so i can improve the Plugin and add more Features.
If you want to help me, improve the plugin or request features please do that also here.
Todo
- timed Groups, e.g VIPs after you typed in "/ap promote <player> <group> <time>
- MYSQL support
- Regulary updates ;)
Roadmap:
- written periods like "1 month" or "6 weeks"
- timed/VIP groups
- IConomy support
- Add MySQL support
@Squirzy
Yes, you should!
The plugins relies on the point that all nodes are available. If they are not then xou will get errors.
Please fill out all of these nodes:
So players are automatically P when they join my server. After 3 hours I want them to become M. This will work?
db: port: 3306 adress: localhost enable: false user: root database: minecraft pass: '' saveLastLogout: true saveTotalTime: true idleTime: 15 periods: lifeTime: resetActivity: false periodTime: 1 activeGroups: - M nextReset: '2012-03-22 10:36:00' groups: Member: startTime: 10800 endTime: false setForFirstUse: false neccesaryGroup: - P promotionGroup: - M
Also I get this in console: [SEVERE] java.lang.NullPointerException [SEVERE] at de.Chumper.ActivityPromotion.Tasks.PromotionTask.run(PromotionTask.java:64) [SEVERE] at com.bergerkiller.bukkit.nolagg.examine.TimedWrapper.run(TimedWrapper.java:20) [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34) [SEVERE] at java.lang.Thread.run(Unknown Source)
Do I need to be worried?
Hello I posted a help thread on the forum please respond, it is something wrong with config.
Thanks :D
@Poopfish
I will give you an example:
Lets say the periodtime is set to 2 minutes and the Group Member will start at 30 seconds ant end at 60.
After 60 seconds the player will be promoted to VeryActive and the endTime will be false on this group.
So
Member:
startTime:30
endTime: 60
VeryActive:
startTime:60
endTime: false
When a player first joins the server he won't get promoted to any group until he played 30 seconds.
He then will be promoted to Member and will keep this group until he played 60 seconds, then he will be demoted from Members and promoted to veryActive.
He will keep this group until the period is over and will be reseted.
Now there are two options:
Number One: He is playing as he played in the old period. In this case nothing hapens, he will keep veryActive and wont get promoted to Member, because the plugins saves the played time from the last period.
Number two: He stops playing in this period, that means he still ahve the veryActive group, but is not doing anything is this period or is not playing enough to get 60 seconds.
When the next period starts and he is still under 60 seconds he will get demoted from the group. But if he played more than 30 seconds he will get promoted to Members.
If he didn't do anything in this period he will loose all groups.
Now to answer your questions:
"So if I set a 30 second starttime and a 31 second endtime, does that mean they will leave that group 1 second after they join it? "
Yes
"I was thinking the config would be more "start time" and "keep time" meaning they start being that group when they hit the start time and the keep time would be how long they needed to play in order to not be demoted."
startTime and keepTime are the same in this case.
You have to see it this way:
Every time a new period starts the players have to level up again.
But the plugin will keep the played time from the last period in mind and calculate the promotion and demotion based on this value.
I'm a little confused, about the "end time".. The plugin description says "After a resetdate the player will keep the groups for one more timeperiode if he is inactive in this period, he will be degraded in the next period." The config doesn't seem to follow the same logic? There is a start time and an end time, the start time is when a user starts being in that group, but the end time is when they leave the group. So if I set a 30 second starttime and a 31 second endtime, does that mean they will leave that group 1 second after they join it? My thinking was that in a period that would have to play a certain amount of time, if they didn't they were demoted 1 rank. repeated periods of inactivity means demoting all the way back to the base rank. I was thinking the config would be more "start time" and "keep time" meaning they start being that group when they hit the start time and the keep time would be how long they needed to play in order to not be demoted. Does your plugin work like this and I am just missing something?
@ADNARAM
I replied to your question in the forum: http://dev.bukkit.org/server-mods/activitypromotion/forum/config-creation/35604-visiteur-and-joueur/
Hi, sorry for my english. I use Pex and Vault. I want my player to be in a group call "Visiteur" when they loggin for the first time in the server. After 6 hours of playing, I want them be in the group "Joueur" for everytime (for life). How should be the config file to do that? Thanks.
@JohOply
I will reply to your question in the forum: http://dev.bukkit.org/server-mods/activitypromotion/forum/config-creation/35592-vagabond-paysan-citoyen/
Ok, so I want when a player plays x hours, 15 hours for instance, his default group "Vagabond" change in "Paysan". More later, after 80 hours, the player's group change "Paysan" to "Citoyen" (for life)
Sorry for my bad english :x And thank you for your help :)
@JohOply
Hey, first there is one thing you should be aware of:
The groups in this config are not the same groups you use in your permissionplugin.
So: to get promoted to the permission group "Paysan" the user has to be in the permissions group "Citoyen". Is that the case?
Another problem is that you din't define Paysan as an active group in the period section.
Please describe what you want to achive and we can figure out a config for you in the forum.
I like this plugin but i have a problem.... The time is register, but ranks are not change
This is my config :
Help me please :)
@weja93
May you can take a look at this: http://dev.bukkit.org/server-mods/afkmanager/
@weja93
That is not possible, the only thing i could do is to rely on the move event of the player, but that is also not cheat safe.
I love this plugin, it works smoothly and doesn't cause any lag.
There is still one problem. When people go afk, they just put something to hold their mouse to be clicking, and they can afk while time is counting. This is cheating.
Any way to inspect whether the player is AFK or actually playing?
It's a bit frustrating that people get promoted to first donor rank by just standing in corner and hitting the wall.
Thanks though, I love this plugin and will be using it whether you fix this issue or not.
@Chumpertm
that would be nice
@weja93
Hey, the plugin will update the time for one player when he moves. That should not produce any lag.
It is also checking every 5 seconds if a player has to be promoted or demoted.
This task is seperated in his own thread, so there shouldn't be any noticeable lag on the server. The task is also running in low priority mode.
I would suggest to try it out, but i don't see any problems.
@ Tealk123:
I am not planning this feature at the moment, but i can add an option that users will only be promoted if they have specific items in their inventory.
I want to add this to my server, so that players at first join cannot do all stuff, but nearly everything. They can skip "waiting" part and donate very small amount of money, or then play the time it requires to get promoted, and have 100% access to commands and features.
I am still afraid that this will lag if I have 100 players online, and the plugin is checking all the time the players and their current time.
Could this be a problem, or is it even possible to cause lag with this?
Thanks!
@Chumpertm
Ok thanks for your Answer, because i would like use this for my server as a rank system,
the player must have a fix time to promote and he must pay items for it
so a admin check the items and promote the player, or is this possible to edit
that the plugin check the time and if the player have the items in the inventory he use a command and he get promote?
@Tealk123
No, that is not possible, but a solution would be to promote the users to the group "toBePromoted" and then manually check who is in the group and promote them.
I can also put in a command, that will show you who is in a specific group if you need that.
is it possible to manage it that a admin become a message if a player have reach the time, and then the admin promote the player with a command?