ActiveTime - The simple playtime logger

This is a discussion topic for the Ore project, ActiveTime. View the full project on Ore for downloads and more information.


Description

ActiveTime is a simple playtime logger that keeps track of a players activity while on your server. ActiveTime can:

  • Log players activetime based on permission, gamemode, and world
  • Keep an overall log and daily logs for the true statisticians
  • Reward milestones for activity (supports multiple commands and repetition)
  • Generate reports of server/user activity over a give date range
  • Limit a player’s allowed time on the server
  • Run nearly all operations async, saving precious server resources

If Nucleus is installed (and the AFK module is enabled), ActiveTime will also:

  • Filter out a players activetime from afktime
  • Stores both activetime and afktime statistics
  • Enables Nucleus Tokens {{activetime}} and {{afktime}}

Once you install ActiveTime to your server, all players with the permission activetime.log.base will begin having their activity tracked. For additional permissions and information about commands, see the documentation section below.

Note: ActiveTime is built on Sponge API 7.1 (snapshot), but is should be functional on API’s 5.2 and 6.1. If you experience an issue running ActiveTime on previous API versions, please let me know so I can put out a patch build!

Documentation

The documentation for ActiveTime can be found in the pages to the right. If you need additional help, you can post a message in the #activetime channel of my Support Discord. It’s also a great place to keep updated with new developments for ActiveTime or any one of my plugins, so feel free to come join in the development fun!

Support Me

There’s a lot of time and effort that goes into making plugins like ActiveTime, so if you’ve benefited from one of my plugins and appreciate the work I do please take some time and add a donation through PayPal. Thanks for your support!

2 Likes

Hello everyone, happy Thursday! Today’s release contains a couple simple (but nonetheless important) fixes to some nasty bugs :bug:. I strongly recommend updating to this release, especially if you’re working with milestones (and if you’re not, you should! \o/).

In addition to the fixes made with checking milestones, I’ve also done some work to minimize the performance impact of saving to the config and have added individual permissions to milestones (activetime.milestones.<name>.base).

Beyond that, there’s a couple other things I’d like to do with milestones and a few formatting things to look into, such as this issue, and a few touch ups to things like reports. If you have any suggestions, feel free to hop in my Support Discord and let me know!


Changelog

  • Added permission check for individual milestones
  • Fixed issue with normal milestones becoming completable
  • Improved performance of saving operations

Ore Release: ActiveTime 1.4.1


Quick mention to @Pixelmon_PRO and @KyleCG for reporting these issues and helping to track them down to get this fixed. Thanks you two!

1 Like
Summary

[12:49:07] [pool-3-thread-10/ERROR] [activetime]: Unable to save config file! Error:
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: java.nio.file.AccessDeniedException: C:\Users\User\Desktop\plugins sponge\testy + dodanie modów\server 1.12.2.\config\activetime\storage\13146843368964players.stor.tmp -> C:\Users\User\Desktop\plugins sponge\testy + dodanie modów\server 1.12.2.\config\activetime\storage\players.stor
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at sun.nio.fs.WindowsFileCopy.move(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.nio.file.Files.move(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at ninja.leaping.configurate.loader.AtomicFiles$AtomicFileWriter.close(AtomicFiles.java:71)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.io.BufferedWriter.close(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at ninja.leaping.configurate.loader.AbstractConfigurationLoader.save(AbstractConfigurationLoader.java:196)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at com.mcsimonflash.sponge.activetime.objects.ConfigHolder.save(ConfigHolder.java:39)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at com.mcsimonflash.sponge.activetime.managers.Storage.save(Storage.java:69)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at com.mcsimonflash.sponge.activetime.managers.Util.lambda$null$17(Util.java:191)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:186)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.util.concurrent.FutureTask.run(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[12:49:07] [pool-3-thread-10/INFO] [STDERR]: [com.mcsimonflash.sponge.activetime.objects.ConfigHolder:save:43]: at java.lang.Thread.run(Unknown Source)

plugin version:ActiveTime 1.4.1
sorry

After reaching out to some other developers, it appears that this is primarily an issue with the timing of how Windows writes to files (see this comment). There’s not much I can do to fix this, but I may be able to minimize its effects by condensing the save logic into a more singular point.

In the future, please do not post raw stacktraces on the forums. You should use something like https://gist.github.com as it’s easier to read and doesn’t clutter the thread. If you need assistance with one of my plugins, it’s best to get ahold of me through my support discord.

1 Like

Morning all! ActiveTime v1.4.2 has been released that contains a number of minor fixes and improvements. In particular, I’ve made some changes to the save system that forcing files to be saved synchronously; this should reduce (if not eliminate) the problem above and potentially some other data saving issues. Included are some improvements to commands, such as Check displaying a player’s activity for the current day, and specific permissions have been added into the Report command as well. Enjoy!

ActiveTime v1.4.2 Ore Release


Changelog:

  • Ensure saving and file update operations are done synchronously
  • Added specific permission checks to the Report command
  • Enable the milestone task by default, disabling if milestones are empty
  • Fix an issue with the dates being incorrectly displayed in user reports
  • Various cleanup changes, particularly with commands

Special thanks to @AnDwHaT5, @NickImpact, @TacticalTickler, @OneAndOnlyWolffy, and a handful of others for providing entertainment during the development process. This has been a night I will never forget.

1 Like

ActiveTime v1.4.3 is now available! The most notable addition in this version is the custom time format from issue #12, which means you can now display active in just about any form you’d like! I’ve also make some minor fixes and have changed the check command to get around a Sponge issue in certain versions for offline players. You can download v1.4.3 from Ore:

Ore Release: ActiveTime v1.4.3


Changelog

  • Added custom time format (resolves #12)
  • Changed to manual parsing of UserOrSource for offline user support
  • Updated config code and removed legacy conversation for multiple commands
  • General cleanup, performance improvements, yada yada

If I want to use this to automatically rank people up, is it possible to check if they are already in a group before doing so? Some players already have non default ranks and I dont want them to be promoted

It’s definitely possible. Each milestone has it’s own permission, so you can give the milestones that control group rankups to the specific permission groups that require them. This shouldn’t be too bad to set up, but if you need clarification feel free to join my support discord and send a message in the activetime channel. Good luck!

1 Like

I will give that a try and if I have any issues ill hit up the support discord, thanks for your help

So when I set a players playtime to a specified time limit, am I able to reset that timer daily?

So when I set a players playtime to a specified time limit, am I able to reset that timer daily?

I am looking to set a player’s play time to a specified time limit per day. Can anyone assist me?