CacheCleaner7 for Unofficial MapTool-1.3.b89 Plugin Mod

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
User avatar
Lord.Ashes
Dragon
Posts: 350
Joined: Wed Jul 03, 2013 5:58 am

CacheCleaner7 for Unofficial MapTool-1.3.b89 Plugin Mod

Post by Lord.Ashes »

This is a CacheCleaner7 Plugin for the Unofficial MapTool-1.3.b89.Plugin_Support.R3 Mod of MapTool.

The post for the Unofficial MapTool-1.3.b89.Plugin_Support.R3 Mod can be found here...http://forums.rptools.net/viewtopic.php?f=8&t=24539

The Sound Plugin can be downloaded from here...https://www.mediafire.com/folder/71y10x ... heCleaner7

Disclaimer: This is a CacheCleaner7 Plugin for an unofficial release of MapTools. Please do not post question about this Plugin or MapTool Mod to the Core MapTool team. Post your questions in this thread instead.

As per the Unofficial MapTool-1.3.b89.Plugin_Support.R3 thread, these plugins are intended to add optional functionality which does not impact the use of a Campaign file regardless if the plugin is or is not installed. This means that if a Campaign files is used to provide CacheCleaning requests, the exact same Campaign file will also work with clients that do not have the CacheCleaner plugin installed (as long as they are also using the Unofficial MapTool-1.3.b89.Plugin_Support.R3 version of MapTool).


//
// -------------------------------------------------------------------
// CacheCleaner7 Plugin for MapTool-1.3.b89.Plugin_Support.R3
// -------------------------------------------------------------------
//
// Version: 1.0 (the 7 in the plugin name refers to Java7 not the plugin version)
//
// Programmed By: Lord Ashes
//
// Source Code Files: CacheCleaner7.Java
// Compiled Files: CacheCleaner7.Class, CacheCleaner7$1.Class, CacheCleaner$Cleaner.Class
// Minimum Java Version: 7 (Java 6 compatible CacheCleaner coming soon)
//
// Comments:
//
// This plugin provides a number of functions for monitoring and cleaning the
// MapTool assetcache. Normally most MapTool assets are small and thus not
// cleaning the assetcache directory is not a problem because the overall size
// will remain small. However, with plugins like the Sound Plugin which stores
// potentially larger files in the asssetcache directory, maintenance of the
// assetcache directory may be necessary. Instead of doing this manually this
// CacheCleaner Plugin can be used. Included MapTool macro functions are provided
// for obtaining the size of the assetcache directory, performing automatic smart
// cleaning when the directory exceeds a specified size or forcing a cleaning.
// Cleaning is done based on last access time where files that have not been
// used lately are deleted before files that have been used lately. This makes
// the cleaning more smarter than just using Last Access time.
//

Plugin Installation:

Expand the ZIP file into the "plugins" sub-directory (in you MapTool directory). If a "plugins" sub-directory does not exist, create one.
The Source Code sub-folder created from the ZIP file is not necessary (only the CLASS files are required). The Source Code folder is provided
so that the code can be verified before use and/or to allow custom modification.

Macro Functions:

All macro functions are executed using the pluginExecute(), pluginExecuteWithWarning(), pluginThread() or pluginThreadWithWarning() macro functions which are
added in unofficial MapTool-1.3.b89.Plugin_Support.R3

Typically either pluginExecute() or pluginExecuteWithWarning() can be used to start CacheCleaning macros because the plugin handles threading on it own and thus
the plugin is non-blocking in either case.

The syntax, using clean() as an example, for all CacheCleaner plugin functions is:

pluginExecute("CacheCleaner7","function","parameters")

Where "function" is one of the below functions and "parameters" is a comma separated list of parameters (where applicable).
The below function list uses an abbreviated notation. For example:

check(TripClean,CleanDownTo)

Actually means:

pluginExecute("CacheCleaner7","clean","TripClean,CleanDownTo")

The CacheCleaner Plugin supports the following functions:

check(TripClean,CleanDownToMB) = Checks to see if the assetcache directory exceeds TripClean MB. If so forces a cleaning until the directory size drop to or below CleanDownToMB MB.
clean(CleanDownToMB) = Forces a cleaning (regardless of the size of the assetcache directory) until the directory size drops to (or below) the given value (in MB).
size() = Returns the size of the assetcache directory.

Troubleshooting:

CacheCleaner may fail to clean down to the given amount if files in the assetcache directory are either locked or write/delete protected. Normally this is not the case but if CacheCleaner
does not seem to be cleaning down to the given value check to see that your files, in the assetcache directory, are not write protected. This can happen especially if you copy files
into this directory (for example sound files for the Sound Plugin) from a CD.

Disclaimer:

This plugin only deletes files from the assetcache directory. When MapTool triggers the plugin, it passes the MapTool directory to the plugin and the plugin appends the assetcache
sub-folder to get the final location of the assetcache directory. Only files in this directory are deleted. However if you have concerns about this, you can verify the source code
and recompile the source code to make sure that the plugin is legitimate. Also, although I have not seen such a case, if you are using non-standard folders for MapTools or have
modified your MapTool then please ensure that the assetcache directory is still in the expected place before using this plugin. However unlikely, the programmer will not be held responsible for any damage the plugin may do such as, but not limited to, the deletion of any unintended files.
"We often compare ourselves to the U.S. and often they come out the best,
but they only have the right to bare arms, while we have the right to bare breasts"
The Right To Bare Breasts by Bowser & Blue

Post Reply

Return to “User Creations”