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
Hey!
How are you? I'll hope fine :)
I have a little suggestion to "/ap info" command. If you could add to some line the last group that user's belongs, it will be nice. Thanks. For example: If user was promoted from "Guess" to "Member", so the plugin should be "Group: Member".
Sorry for my bad english.
Does anyone know of a similar plugin since this won't be updated?
When using this plugin, every time I modify the config, it rewrites the entire thing back to the default.
Running on the latest RB of craftbukkit, and using GroupManager with Vault installed. It constantly spams me that it's demoting me to default, then promoting me to Trial. I don't have a trial group, my config only has 1 setting, which is to promote my members to the group Member after 2 hours.
o wait i see the todo list now u want to make an command for specific time like vip 100 ours but does the list reset too then for 1 specefic player? and not the whole group
i have a question does if i have been 1 sec online i get guest but if i have 2 sec on my name i cant get to guest anymore right ? becuase if thats so i cant make automated stuff so vips buy and they are automaticly time reseted then so i wont have to put in a specific date it will be reseted otherwise my vips will always have vip and thats not what i want.
The folder will not load and it says it is not in my plugins when i type /plugins..... please help!!!!
@Chumpertm With flatfile everything worked perfectly, never had problems.
Only that stopping the server took 30 seconds, and it was stuck in "disabling activitypromotion" or something like that when it's unloading the plugins. And it was getting worse all the time.
@HuntVenom
Take a look at this post and change the config in the last post acording to your needs.
http://dev.bukkit.org/server-mods/activitypromotion/forum/config-creation/36250-play-10-hours-and-promote-to-pro-rank-problem-with/
Hey. Can you make me a config? That promotes "Member" to "Elite" in 50 hours? I don't know how to make one. Thanks.
@weja93
I will give you the possibility to set the save circle in the config but will set it to false by default.
Did you have the same problem when you used the Flatfile?
Yes, he lost his stats just as you said.
And it does not add anymore players to mySQL. The server has been restarted for more than 5 times now, and there are still only 40 players, that were added right after I enabled mySQL. So it seems to be "disabled" somehow.
Sorry to cause this much problems, I appreciate this plugin, it's very awesome.
I just hope you get this mySQL thing working correctly.
And it should add those every 5 minute or something for safety. If the server crashes and it has been on for like 3 days, everything will be lost.. But if it saves it to mySQL every 5 minute, you could lose max 5 minutes.
@weja93
I am on the train right now, but i will take a look as soon as i am home.
Why should the plugin save the actual status every five minutes or so?
That would be unnecessary load for the server. It makes sense to save everything when the
server is shutting down and nobody would mind if it takes a while.
I will try to spot errors in the mysql handling, so can you please describe the error one more time?
A User alreadsy played 2 hours and quit and after he joins 10 hours later all his stats were resetted?
@weja93
Then it is the correct behaviour. The plugin will keep the data inside a list and will only write it to the disk or the database when it will be reloaded or disabled.
So if you try /ap reload and look again, what do you see?
@weja93
Did you shut down the server over night?
@weja93
Hey, thanks for the feedback. It is much appreciated.
Just to clear thinks up:
The promotiontask is executed every five seconds while the task to reset the period runs every 10 seconds.
The plugin just hooks into you permission plugin, so there should not be any bugs regarding the groups. Can you show me your config in the forum?
I love this plugin. However, it gets more and more resource hungry all the time. list.yml (FLATFILE!!) is already 150kb sized, and it's getting bigger all the time.
When I stop server, unloading ActivityPromotion takes 30 seconds. I have 60 plugins, and without ActivityPromotion, stopping takes less than 5 seconds.
I don't think this is usable for me anymore, maybe if mySQL with query.. Totally waiting for it!
It was very nice to have players stay for 10 hours for awesome rank.
And there is "bug" or then it's just damn hard to configure. Every player of the server are now 2 groups.. For me example Owner and Pro(promoted rank) and when I try to take that Pro away from my group, it still persist.
/who lists shows every single player as Pro, it doesn't show that I'm owner or that someone else is Moderator. Everyone is just default(player less that 10 hours) or Pro(promoted for playing).
I also think it lags. Maybe you should make much less checks, instead of every second, how about every 10 second? or 1 MINUTE? Wouldn't be too long time. Having 100 players on... Well... Lags.. For sure..
I like this plugin very much, it makes people want to stay and wait for something on the server. However with current setup I think I cannot keep using it much longer..
THANKS!
Hi please answer my question on forum section, Thanks!
http://dev.bukkit.org/server-mods/activitypromotion/forum/config-creation/36094-cant-get-to-work-help/#p3