diff --git a/Plan/dependency-reduced-pom.xml b/Plan/dependency-reduced-pom.xml index b7abea364..aa0691c29 100644 --- a/Plan/dependency-reduced-pom.xml +++ b/Plan/dependency-reduced-pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.djrapitops Plan - 3.6.3 + 4.0.0 ${basedir}/src ${basedir}/test diff --git a/Plan/pom.xml b/Plan/pom.xml index e474d25c4..a99e4b618 100644 --- a/Plan/pom.xml +++ b/Plan/pom.xml @@ -107,10 +107,28 @@ ${basedir}/src/main/resources *.keystore - *.js + *.css *.yml + + + licence.yml + + + + . + ${basedir}/src/main/resources/html + *.html - *.txt + + + *Example* + + + + . + ${basedir}/src/main/resources/js + + *.js diff --git a/Plan/src/main/java/com/djrapitops/plan/Plan.java b/Plan/src/main/java/com/djrapitops/plan/Plan.java index d7886eeb1..670cbcae1 100644 --- a/Plan/src/main/java/com/djrapitops/plan/Plan.java +++ b/Plan/src/main/java/com/djrapitops/plan/Plan.java @@ -44,7 +44,6 @@ import main.java.com.djrapitops.plan.ui.webserver.api.bukkit.*; import main.java.com.djrapitops.plan.utilities.Benchmark; import main.java.com.djrapitops.plan.utilities.Check; import main.java.com.djrapitops.plan.utilities.MiscUtils; -import main.java.com.djrapitops.plan.utilities.metrics.BStats; import main.java.com.djrapitops.plan.utilities.webserver.api.WebAPIManager; import org.apache.logging.log4j.LogManager; import org.bukkit.ChatColor; @@ -277,25 +276,11 @@ public class Plan extends BukkitPlugin { private void registerListeners() { Benchmark.start("Register Listeners"); registerListener(new PlanPlayerListener(this)); - boolean chatListenerIsEnabled = Check.isTrue(Settings.GATHERCHAT.isTrue(), Locale.get(Msg.ENABLE_NOTIFY_DISABLED_CHATLISTENER).toString()); - boolean commandListenerIsEnabled = Check.isTrue(Settings.GATHERCOMMANDS.isTrue(), Locale.get(Msg.ENABLE_NOTIFY_DISABLED_COMMANDLISTENER).toString()); - boolean deathListenerIsEnabled = Check.isTrue(Settings.GATHERKILLS.isTrue(), Locale.get(Msg.ENABLE_NOTIFY_DISABLED_DEATHLISTENER).toString()); - - if (chatListenerIsEnabled) { - registerListener(new PlanChatListener(this)); - } - + registerListener(new PlanChatListener(this)); registerListener(new PlanGamemodeChangeListener(this)); registerListener(new PlanWorldChangeListener(this)); - - if (commandListenerIsEnabled) { - registerListener(new PlanCommandPreprocessListener(this)); - } - - if (deathListenerIsEnabled) { - registerListener(new PlanDeathEventListener(this)); - } - + registerListener(new PlanCommandPreprocessListener(this)); + registerListener(new PlanDeathEventListener(this)); Benchmark.stop("Enable", "Register Listeners"); } diff --git a/Plan/src/main/java/com/djrapitops/plan/Settings.java b/Plan/src/main/java/com/djrapitops/plan/Settings.java index 642b29943..dce6a2fdb 100644 --- a/Plan/src/main/java/com/djrapitops/plan/Settings.java +++ b/Plan/src/main/java/com/djrapitops/plan/Settings.java @@ -10,86 +10,108 @@ import java.util.List; * @since 2.3.2 */ public enum Settings { - // Boolean - WEBSERVER_ENABLED("Settings.WebServer.Enabled"), - ANALYSIS_REFRESH_ON_ENABLE("Settings.Cache.AnalysisCache.RefreshAnalysisCacheOnEnable"), - ANALYSIS_LOG_TO_CONSOLE("Settings.Analysis.LogProgressOnConsole"), - ANALYSIS_LOG_FINISHED("Settings.Analysis.NotifyWhenFinished"), - ANALYSIS_EXPORT("Settings.Analysis.Export.Enabled"), - SHOW_ALTERNATIVE_IP("Settings.WebServer.ShowAlternativeServerIP"), - USE_ALTERNATIVE_UI("Settings.UseTextUI"), - GATHERCHAT("Settings.Data.ChatListener"), - GATHERKILLS("Settings.Data.GatherKillData"), - GATHERCOMMANDS("Settings.Data.GatherCommandUsage"), - DO_NOT_LOG_UNKNOWN_COMMANDS("Customization.Data.DoNotLogUnknownCommands"), - COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND("Customization.Data.CombineCommandAliasesToMainCommand"), - SECURITY_IP_UUID("Settings.WebServer.Security.DisplayIPsAndUUIDs"), - PLAYERLIST_SHOW_IMAGES("Customization.SmallHeadImagesOnAnalysisPlayerlist"), - WRITE_NEW_LOCALE("Settings.WriteNewLocaleFileOnStart"), + // Boolean + BUNGEE_COPY_CONFIG("Bungee-Override.CopyBungeeConfig"), + BUNGEE_OVERRIDE_STANDALONE_MODE("Bungee-Override.StandaloneMode"), + @Deprecated WEBSERVER_ENABLED("Settings.WebServer.Enabled"), + @Deprecated ANALYSIS_REFRESH_ON_ENABLE("Settings.Cache.AnalysisCache.RefreshAnalysisCacheOnEnable"), + @Deprecated ANALYSIS_LOG_TO_CONSOLE("Settings.Analysis.LogProgressOnConsole"), + @Deprecated ANALYSIS_LOG_FINISHED("Settings.Analysis.NotifyWhenFinished"), + ANALYSIS_EXPORT("Analysis.Export.Enabled"), + SHOW_ALTERNATIVE_IP("Commands.AlternativeIP.Enabled"), + @Deprecated USE_ALTERNATIVE_UI("Settings.UseTextUI"), + LOG_UNKNOWN_COMMANDS("DAta.Commands.LogUnknownCommands"), + COMBINE_COMMAND_ALIASES("Data.Commands.CombineCommandAliases"), + @Deprecated SECURITY_IP_UUID("Settings.WebServer.Security.DisplayIPsAndUUIDs"), + @Deprecated PLAYERLIST_SHOW_IMAGES("Customization.SmallHeadImagesOnAnalysisPlayerlist"), + WRITE_NEW_LOCALE("Plugin.WriteNewLocaleFileOnStart"), + // Integer - ANALYSIS_MINUTES_FOR_ACTIVE("Settings.Analysis.MinutesPlayedUntilConsidiredActive"), - SAVE_CACHE_MIN("Settings.Cache.DataCache.SaveEveryXMinutes"), - CLEAR_INSPECT_CACHE("Settings.Cache.InspectCache.ClearFromInspectCacheAfterXMinutes"), - CLEAR_CACHE_X_SAVES("Settings.Cache.DataCache.ClearCacheEveryXSaves"), - WEBSERVER_PORT("Settings.WebServer.Port"), - ANALYSIS_AUTO_REFRESH("Settings.Cache.AnalysisCache.RefreshEveryXMinutes"), - PROCESS_GET_LIMIT("Settings.Cache.Processing.GetLimit"), - PROCESS_SAVE_LIMIT("Settings.Cache.Processing.SaveLimit"), - PROCESS_CLEAR_LIMIT("Settings.Cache.Processing.ClearLimit"), - TPS_GRAPH_HIGH("Customization.Colors.HTML.TPSGraph.TPSHigh"), - TPS_GRAPH_MED("Customization.Colors.HTML.TPSGraph.TPSMedium"), + @Deprecated ANALYSIS_MINUTES_FOR_ACTIVE("Settings.Analysis.MinutesPlayedUntilConsidiredActive"), + @Deprecated SAVE_CACHE_MIN("Settings.Cache.DataCache.SaveEveryXMinutes"), + @Deprecated CLEAR_INSPECT_CACHE("Settings.Cache.InspectCache.ClearFromInspectCacheAfterXMinutes"), + @Deprecated CLEAR_CACHE_X_SAVES("Settings.Cache.DataCache.ClearCacheEveryXSaves"), + WEBSERVER_PORT("WebServer.Port"), + ANALYSIS_AUTO_REFRESH("Analysis.AutoRefreshPeriod"), + @Deprecated PROCESS_GET_LIMIT("Settings.Cache.Processing.GetLimit"), + @Deprecated PROCESS_SAVE_LIMIT("Settings.Cache.Processing.SaveLimit"), + @Deprecated PROCESS_CLEAR_LIMIT("Settings.Cache.Processing.ClearLimit"), + @Deprecated TPS_GRAPH_HIGH("Customization.Colors.HTML.TPSGraph.TPSHigh"), + @Deprecated TPS_GRAPH_MED("Customization.Colors.HTML.TPSGraph.TPSMedium"), // String - DEBUG("Settings.Debug"), - ALTERNATIVE_IP("Settings.WebServer.AlternativeIP"), - DB_TYPE("database.type"), - DEM_TRIGGERS("Customization.DemographicsTriggers.Trigger"), - DEM_FEMALE("Customization.DemographicsTriggers.Female"), - DEM_MALE("Customization.DemographicsTriggers.Male"), - DEM_IGNORE("Customization.DemographicsTriggers.IgnoreWhen"), - LOCALE("Settings.Locale"), - WEBSERVER_IP("Settings.WebServer.InternalIP"), - ANALYSIS_EXPORT_PATH("Settings.Analysis.Export.DestinationFolder"), - WEBSERVER_CERTIFICATE_PATH("Settings.WebServer.Security.Certificate.KeyStorePath"), - WEBSERVER_CERTIFICATE_KEYPASS("Settings.WebServer.Security.Certificate.KeyPass"), - WEBSERVER_CERTIFICATE_STOREPASS("Settings.WebServer.Security.Certificate.StorePass"), - WEBSERVER_CERTIFICATE_ALIAS("Settings.WebServer.Security.Certificate.Alias"), - LINK_PROTOCOL("Settings.WebServer.ExternalWebServerLinkProtocol"), + DEBUG("Plugin.Debug"), + ALTERNATIVE_IP("Commands.AlternativeIP.Link"), + DB_TYPE("Database.Type"), + LOCALE("Plugin.Locale"), + WEBSERVER_IP("WebServer.InternalIP"), + ANALYSIS_EXPORT_PATH("Analysis.Export.DestinationFolder"), + WEBSERVER_CERTIFICATE_PATH("WebServer.Security.Certificate.KeyStorePath"), + WEBSERVER_CERTIFICATE_KEYPASS("WebServer.Security.Certificate.KeyPass"), + WEBSERVER_CERTIFICATE_STOREPASS("WebServer.Security.Certificate.StorePass"), + WEBSERVER_CERTIFICATE_ALIAS("WebServer.Security.Certificate.Alias"), + ETERNAL_WEBSERVER_LINK_PROTOCOL("Analysis.Export.ExternalWebServerLinkProtocol"), // - SERVER_NAME("Customization.ServerName"), + SERVER_NAME("Server.ServerName"), // - FORMAT_YEAR("Customization.Formats.TimeAmount.Year"), - FORMAT_YEARS("Customization.Formats.TimeAmount.Years"), - FORMAT_DAY("Customization.Formats.TimeAmount.Day"), - FORMAT_DAYS("Customization.Formats.TimeAmount.Days"), - FORMAT_HOURS("Customization.Formats.TimeAmount.Hours"), - FORMAT_MINUTES("Customization.Formats.TimeAmount.Minutes"), - FORMAT_SECONDS("Customization.Formats.TimeAmount.Seconds"), - FORMAT_DECIMALS("Customization.Formats.DecimalPoints"), + FORMAT_YEAR("Customization.Formatting.TimeAmount.Year"), + FORMAT_YEARS("Customization.Formatting.TimeAmount.Years"), + FORMAT_MONTH("Customization.Formatting.TimeAmount.Month"), + FORMAT_MONTHS("Customization.Formatting.TimeAmount.Months"), + FORMAT_DAY("Customization.Formatting.TimeAmount.Day"), + FORMAT_DAYS("Customization.Formatting.TimeAmount.Days"), + FORMAT_HOURS("Customization.Formatting.TimeAmount.Hours"), + FORMAT_MINUTES("Customization.Formatting.TimeAmount.Minutes"), + FORMAT_SECONDS("Customization.Formatting.TimeAmount.Seconds"), + FORMAT_DECIMALS("Customization.Formatting.DecimalPoints"), // - COLOR_MAIN("Customization.Colors.Commands.Main"), - COLOR_SEC("Customization.Colors.Commands.Secondary"), - COLOR_TER("Customization.Colors.Commands.Highlight"), + COLOR_MAIN("Commands.Colors.Main"), + COLOR_SEC("Commands.Colors.Secondary"), + COLOR_TER("Commands.Colors.Highlight"), // - HCOLOR_MAIN("Customization.Colors.HTML.UI.Main"), - HCOLOR_MAIN_DARK("Customization.Colors.HTML.UI.MainDark"), - HCOLOR_SEC("Customization.Colors.HTML.UI.Secondary"), - HCOLOR_TER("Customization.Colors.HTML.UI.Tertiary"), - HCOLOR_TER_DARK("Customization.Colors.HTML.UI.TertiaryDark"), - HCOLOR_TPS_HIGH("Customization.Colors.HTML.TPSGraph.TPSHighCol"), - HCOLOR_TPS_MED("Customization.Colors.HTML.TPSGraph.TPSMediumCol"), - HCOLOR_TPS_LOW("Customization.Colors.HTML.TPSGraph.TPSLowCol"), - HCOLOR_ACT_ONL("Customization.Colors.HTML.ActivityGraph.OnlinePlayers"), - HCOLOR_ACTP_ACT("Customization.Colors.HTML.ActivityPie.Active"), - HCOLOR_ACTP_BAN("Customization.Colors.HTML.ActivityPie.Banned"), - HCOLOR_ACTP_INA("Customization.Colors.HTML.ActivityPie.Inactive"), - HCOLOR_ACTP_JON("Customization.Colors.HTML.ActivityPie.JoinedOnce"), - HCOLOR_GMP_0("Customization.Colors.HTML.GamemodePie.Survival"), - HCOLOR_GMP_1("Customization.Colors.HTML.GamemodePie.Creative"), - HCOLOR_GMP_2("Customization.Colors.HTML.GamemodePie.Adventure"), - HCOLOR_GMP_3("Customization.Colors.HTML.GamemodePie.Spectator"), + THEME_BASE("Theme.Base"), + THEME_FONT_STYLESHEET("Theme.Font.FontStyleSheet"), + THEME_FONT_FAMILY("Theme.Font.FontFamily"), + THEME_FONT_COLOR_DARK("Theme.Font.Dark"), + THEME_FONT_COLOR_LIGHT("Theme.Font.Light"), + THEME_COLOR_MAIN("Theme.Colors.Main"), + THEME_COLOR_SECONDARY("Theme.Colors.Secondary"), + THEME_COLOR_SECONDARY_DARK("Theme.Colors.Secondary-Dark"), + THEME_COLOR_TERTIARY("Theme.Colors.Tertiary"), + THEME_COLOR_BACKGROUND("Theme.Colors.Background"), + THEME_COLOR_TABLE_DARK("Theme.Colors.Table-Dark"), + THEME_COLOR_TABLE_LIGHT("Theme.Colors.Table-Light"), + THEME_GRAPH_PUNCHCARD("Theme.Graphs.PunchCard"), + THEME_GRAPH_PLAYERS_ONLINE("Theme.Graphs.PlayersOnline"), + THEME_GRAPH_TPS_THRESHOLD_HIGH("Theme.Graphs.TPS.High-Threshold"), + THEME_GRAPH_TPS_THRESHOLD_MED("Theme.Graphs.TPS.Medium-Threshold"), + THEME_GRAPH_TPS_HIGH("Theme.Graphs.TPS.High"), + THEME_GRAPH_TPS_MED("Theme.Graphs.TPS.Medium"), + THEME_GRAPH_TPS_LOW("Theme.Graphs.TPS.Low"), + THEME_GRAPH_CPU("Theme.Graphs.CPU"), + THEME_GRAPH_RAM("Theme.Graphs.RAM"), + THEME_GRAPH_CHUNKS("Theme.Graphs.Chunks"), + THEME_GRAPH_ENTITIES("Theme.Graphs.Entities"), + // + @Deprecated HCOLOR_MAIN("Customization.Colors.HTML.UI.Main"), + @Deprecated HCOLOR_MAIN_DARK("Customization.Colors.HTML.UI.MainDark"), + @Deprecated HCOLOR_SEC("Customization.Colors.HTML.UI.Secondary"), + @Deprecated HCOLOR_TER("Customization.Colors.HTML.UI.Tertiary"), + @Deprecated HCOLOR_TER_DARK("Customization.Colors.HTML.UI.TertiaryDark"), + @Deprecated HCOLOR_TPS_HIGH("Customization.Colors.HTML.TPSGraph.TPSHighCol"), + @Deprecated HCOLOR_TPS_MED("Customization.Colors.HTML.TPSGraph.TPSMediumCol"), + @Deprecated HCOLOR_TPS_LOW("Customization.Colors.HTML.TPSGraph.TPSLowCol"), + @Deprecated HCOLOR_ACT_ONL("Customization.Colors.HTML.ActivityGraph.OnlinePlayers"), + @Deprecated HCOLOR_ACTP_ACT("Customization.Colors.HTML.ActivityPie.Active"), + @Deprecated HCOLOR_ACTP_BAN("Customization.Colors.HTML.ActivityPie.Banned"), + @Deprecated HCOLOR_ACTP_INA("Customization.Colors.HTML.ActivityPie.Inactive"), + @Deprecated HCOLOR_ACTP_JON("Customization.Colors.HTML.ActivityPie.JoinedOnce"), + @Deprecated HCOLOR_GMP_0("Customization.Colors.HTML.GamemodePie.Survival"), + @Deprecated HCOLOR_GMP_1("Customization.Colors.HTML.GamemodePie.Creative"), + @Deprecated HCOLOR_GMP_2("Customization.Colors.HTML.GamemodePie.Adventure"), + @Deprecated HCOLOR_GMP_3("Customization.Colors.HTML.GamemodePie.Spectator"), // StringList - HIDE_FACTIONS("Customization.Plugins.Factions.HideFactions"), - HIDE_TOWNS("Customization.Plugins.Towny.HideTowns"); + HIDE_FACTIONS("Plugins.Factions.HideFactions"), + HIDE_TOWNS("Plugins.Towny.HideTowns"); private final String configPath; private Boolean value; diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java index 4da0d3016..7d0049afd 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheClearQueue.java @@ -28,7 +28,7 @@ public class DataCacheClearQueue extends Queue { * @param handler current instance of DataCacheHandler. */ public DataCacheClearQueue(DataCacheHandler handler) { - super(new ArrayBlockingQueue<>(Settings.PROCESS_CLEAR_LIMIT.getNumber())); + super(new ArrayBlockingQueue<>(20000)); setup = new ClearSetup(queue, handler); setup.go(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java index 944db41bc..ce4c5ca03 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheGetQueue.java @@ -27,7 +27,7 @@ public class DataCacheGetQueue extends Queue * @param plugin current instance of Plan */ public DataCacheGetQueue(Plan plugin) { - super(new ArrayBlockingQueue<>(Settings.PROCESS_GET_LIMIT.getNumber())); + super(new ArrayBlockingQueue<>(20000)); setup = new GetSetup(queue, plugin.getDB()); setup.go(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java index 01f9da755..028b2f073 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/cache/queue/DataCacheSaveQueue.java @@ -30,7 +30,7 @@ public class DataCacheSaveQueue extends Queue { * @param handler DataCacheHandler */ public DataCacheSaveQueue(Plan plugin, DataCacheHandler handler) { - super(new ArrayBlockingQueue<>(Settings.PROCESS_SAVE_LIMIT.getNumber())); + super(new ArrayBlockingQueue<>(20000)); setup = new SaveSetup(queue, handler, plugin.getDB()); setup.go(); } diff --git a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanCommandPreprocessListener.java b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanCommandPreprocessListener.java index 5f83ed729..b453f4e88 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanCommandPreprocessListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanCommandPreprocessListener.java @@ -45,8 +45,8 @@ public class PlanCommandPreprocessListener implements Listener { String commandName = event.getMessage().substring(1).split(" ")[0].toLowerCase(); - boolean doNotLogUnknownCommands = Settings.DO_NOT_LOG_UNKNOWN_COMMANDS.isTrue(); - boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue(); + boolean doNotLogUnknownCommands = Settings.LOG_UNKNOWN_COMMANDS.isTrue(); + boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES.isTrue(); if (doNotLogUnknownCommands || combineCommandAliasesToMainCommand) { Command command = plugin.getServer().getPluginCommand(commandName); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java index 10bf9a1f0..ef9537c15 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/HtmlUtils.java @@ -79,7 +79,7 @@ public class HtmlUtils { private static String getProtocol() { WebServer uiServer = Plan.getInstance().getUiServer(); - return uiServer.isEnabled() ? uiServer.getProtocol() : Settings.LINK_PROTOCOL.toString(); + return uiServer.isEnabled() ? uiServer.getProtocol() : Settings.ETERNAL_WEBSERVER_LINK_PROTOCOL.toString(); } /** diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/file/dump/DumpUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/file/dump/DumpUtils.java index 1f43bd583..98afe7790 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/file/dump/DumpUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/file/dump/DumpUtils.java @@ -204,12 +204,8 @@ public class DumpUtils { boolean analysisExport = Settings.ANALYSIS_EXPORT.isTrue(); boolean usingAlternativeServerIP = Settings.USE_ALTERNATIVE_UI.isTrue(); - boolean chatGathering = Settings.GATHERCHAT.isTrue(); - boolean killGathering = Settings.GATHERKILLS.isTrue(); - boolean commandGathering = Settings.GATHERCOMMANDS.isTrue(); - - boolean combineAliases = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue(); - boolean unknownCommandLogging = Settings.DO_NOT_LOG_UNKNOWN_COMMANDS.isTrue(); + boolean combineAliases = Settings.COMBINE_COMMAND_ALIASES.isTrue(); + boolean unknownCommandLogging = Settings.LOG_UNKNOWN_COMMANDS.isTrue(); String locale = Settings.LOCALE.toString(); String dbType = Settings.DB_TYPE.toString(); @@ -222,10 +218,6 @@ public class DumpUtils { log.add("Analysis Export", analysisExport); log.add("Alternative Server IP", usingAlternativeServerIP); - log.add("Chat Gathering", chatGathering); - log.add("Kill Gathering", killGathering); - log.add("Command Gathering", commandGathering); - log.add("Combine Aliases", combineAliases); log.add("Unknown Command Logging", unknownCommandLogging); log.add("Locale", locale); diff --git a/Plan/src/main/resources/Placeholders.txt b/Plan/src/main/resources/Placeholders.txt new file mode 100644 index 000000000..4bef19385 --- /dev/null +++ b/Plan/src/main/resources/Placeholders.txt @@ -0,0 +1,169 @@ +Placeholders: + +${} + +player.html: +${playerName} +${serverName} +${version} + +${playerClassification} (Active • Offline etc) +${nicknames} • name
+${geolocations} • country
+ +${registered} time format full +${lastSeen} time format full +${sessionCount} num +${playtimeTotal} timeamount +${sessionLengthMedian} timeamount +${sessionLengthLongest} timeamount + +${kickCount} num +${playerKillCount} num +${mobKillCount} num +${deathCount} num + +${sessionCountDay} num +${sessionCountWeek} num +${playtimeDay} timeamount +${playtimeWeek} timeamount +${sessionLengthLongestDay} timeamount +${sessionLengthLongestWeek} timeamount + +${contentSessions} See example page +${contentServerOverview} See example page + +${tabContentPlugins} See example page + +${tableBodyActions} (3) (100) + +punchcard +serverPie +worldPie + +network.html: +${networkName} +${playersOnlineSeries} +${version} + +${playersOnline} num +${playersMax} num +${playersTotal} num +${playersActive} num + +${playersNewDay} num +${playersNewWeek} num + +${contentServers} row[column[box-header, box, box-footer[p,button right, refresh button right]], column...], row... + +server.html: +${serverName} String +${timeZone} num + +${playersOnline} num +${playersMax} num +${playersTotal} num +${playersActive} num + +${playersAverage} num +${playersNewAverage} num + +${playersDay} num +${playersWeek} num +${playersMonth} num +${playersAverageDay} num +${playersAverageWeek} num +${playersAverageMonth} num +${playersNewDay} num +${playersNewWeek} num +${playersNewMonth} num +${playersNewAverageDay} num +${playersNewAverageWeek} num +${playersNewAverageMonth} num + +${lastPeakTime} time format hh:mm +${playersLastPeak} num +${bestPeakTime} time format full +${playersBestPeak} num + +${sessionAverage} timeamount + +${playtimeTotal} timeamount +${sessionCount} num +${killCount} num +${mobKillCount} num +${deathCount} num + +${tpsAverageDay} num +${tpsAverageWeek} num +${cpuAverageDay} num% +${cpuAverageWeek} num% +${ramAverageDay} num MB +${ramAverageWeek} num MB +${entityAverageDay} num +${entityAverageWeek} num +${chunkAverageDay} num +${chunkAverageWeek} num + +${tableBodyRecentLogins} tr th html (2) (15-20) +${tableBodySessions} tr th html (4) (50) +${tableBodyPlayerList} tr th html (7) (250) +${tableBodyCommands} tr th html (2) (100) + +${playersOnlineSeries} +${tpsSeries} +${cpuSeries} +${ramSeries} +${entitySeries} +${chunkSeries} +${worldSeries} +${geoMapSeries} +${sessionLengthSeries} +${punchCardSeries} + +${playersGraphColor} + +${gmData} +${gmTotal} timeamount +${gmColors} + +${active} +${inactive} +${joinLeaver} +${banned} +${activityColors} + +${worldTotal} timeamount +${worldColors} NOT IMPLEMENTED //TODO + +${tpsMedium} +${tpsHigh} +${tpsLowColor} +${tpsMediumColor} +${tpsHighColor} + +${tabContentPlugins} row[column[box-header[h2[i, text]],box plugin], column...], row... + style="width: 200%;"

That's all..

Do you have more plugins? ._.

+ +STYLE: + +#267f00 - Theme +#222 - Punchcard +#89c471 - Theme (+sessionLength) +#b58310 - Chunks +#ac69ef - Entities +#7dcc24 - RAM +#e0d264 - CPU + +https://fonts.googleapis.com/css?family=Quicksand:300,400 (Font Link) + +main.css: +#fff (white) +#000 (black) + +#e2e2e2 (Table, even) +#eee (Table, odd) + +#348e0f Theme (Header, on hover) Darker +#5da341 Theme (Main color) + +'Quicksand', sans-serif (Font Family) \ No newline at end of file diff --git a/Plan/src/main/resources/analysis.html b/Plan/src/main/resources/analysis.html deleted file mode 100644 index 7237bc077..000000000 --- a/Plan/src/main/resources/analysis.html +++ /dev/null @@ -1,1361 +0,0 @@ - - - - Plan | Server Analysis - - - - - - - - -
-
- Player Analytics | Analysis -

Player Analytics v.%version%

-

%servername% | Server Analysis

-
-
-
- - -
-
-
-
-
-
-
-
Player Activity
-
-
-
- -
-
-
- %npday% -
-
- New Players / 24h -
-
-
-
-
-

Unique Players: %uniquejoinsday% | Unique/Day: %avguniquejoinsday%

-
-
-

Recent Logins

-
- %recentlogins% -
-
-
-
-
-
-
-
Information
-
-
-
- -
-
-
- %activitytotal% -
-
- Total Players -
-
-
-
-

Total Playtime: %totalplaytime% | Player Average: %avgplaytime%
- Average Session Length: - %sessionaverage%
- Total Login times: - %totallogins%
- Average Unique Players/Day: - %avguniquejoins% | Average New/Day: - %newperday%
- Player kills: %playerkills% | Mob kills: %mobkills% | Deaths: %deaths%

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Player Activity
-
-
-
- -
-
-
- %newperdaymonth% -
-
- New Players / Day -
-
-
-
-
-
-
-

Month:
- Unique Players: %uniquejoinsmonth%
- Unique/Day: %avguniquejoinsmonth% -
- New Players: %npmonth%
- New Players / Day: %newperdaymonth%

-

Week:
- Unique Players: %uniquejoinsweek%
- Unique/Day: %avguniquejoinsweek%
- New Players: %npweek%
- New Players / Day: %newperdayweek%

-

Day:
- Unique Players: %uniquejoinsday%
- Unique/Day: %avguniquejoinsday%
- New Players: %npday%
- New Players / Day: %newperdayday%

-
-
-
-
-
-
-
Playerbase
-
-
-
- -
-
-
- %activitytotal% -
-
- Total Players -
-
-
-
-
-
-
-

Recent Logins

-
- %recentlogins% -
-
-
-
-
-
-
-
-
-
PunchCard - Last 30d
-
-
-
- -
-
-
- %totallogins% -
-
- Login Times -
-
-
-
-
-
-
-
-
-
-
-
Length Distribution
-
-
-
- -
-
-
- %sessionaverage% -
-
- Average Length -
-
-
-
-
-
-
-
-
-
-
-
-
-
Performance
-
-
-

Week:
- Average TPS: %averagetpsweek%
- Average CPU: %averagecpuweek%
- Average RAM: %averagememoryweek%Mb
- Avg. Entities: %averageentitiesweek%
- Average Chunks: %averagechunksweek% -

-

Day:
- Average TPS: %averagetpsday%
- Average CPU: %averagecpuday%
- Average RAM: %averagememoryday%Mb
- Avg. Entities: %averageentitiesday%
- Average Chunks: %averagechunksday%

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Playerlist
-
-
-
- -
-
-
- %activitytotal% -
-
- Total Players -
-
-
-
-
- - - - - - - - - - - - - - %sortabletable% - -
Player Active Playtime Login times Registered Last seen Geolocation
-
-
-
-
-
-
-
-
-
-
Command usage
-
-
-
- -
-
-
- %uniquecommands% -
-
- Unique -
-
-
-
-
- - - - - - - - - %commanduse% - -
Command Times used
-
-
-
-
-
-
-
-
-
-
Geolocations
-
-
-
- -
-
-
- %activitytotal% -
-
- Total Players -
-
-
-
-
-
-
-
-
-
-
- %plugins% -
-
-
- - - - - - - - - - - - - - - - -
- - \ No newline at end of file diff --git a/Plan/src/main/resources/config.yml b/Plan/src/main/resources/config.yml index 365bc58ed..78fb1901b 100644 --- a/Plan/src/main/resources/config.yml +++ b/Plan/src/main/resources/config.yml @@ -1,108 +1,102 @@ -Settings: +Server: + ServerName: 'Plan' + +Plugin: Debug: false Locale: default - WriteNewLocaleFileOnStart: false - UseTextUI: false - Data: - ChatListener: true - GatherKillData: true - GatherCommandUsage: true - Analysis: - LogProgressOnConsole: false - NotifyWhenFinished: true - MinutesPlayedUntilConsidiredActive: 10 - Export: - Enabled: false - DestinationFolder: 'Analysis Results' - Cache: - Processing: - GetLimit: 5000 - SaveLimit: 2500 - ClearLimit: 2500 - AnalysisCache: - RefreshAnalysisCacheOnEnable: true - RefreshEveryXMinutes: -1 - InspectCache: - ClearFromInspectCacheAfterXMinutes: 5 - DataCache: - SaveEveryXMinutes: 2 - ClearCacheEveryXSaves: 5 - WebServer: - Enabled: true - Port: 8804 - InternalIP: 0.0.0.0 - ShowAlternativeServerIP: false - AlternativeIP: your.ip.here:%port% + WriteNewLocaleFileOnEnable: false + Bungee-Override: + StandaloneMode: false + CopyBungeeConfig: true + +WebServer: + Port: 8804 + InternalIP: 0.0.0.0 + Security: + SSL-Certificate: + KeyStorePath: 'SSLCertificate.keystore' + KeyPass: 'default' + StorePass: 'default' + Alias: 'alias' + +Database: + Type: SQLite + MySQL: + Host: localhost + Port: 3306 + User: root + Password: minecraft + Database: Plan + +Commands: + AlternativeIP: + Enabled: false + Link: your.domain.here:%port% + Colors: + Main: '&2' + Secondary: '&7' + Highlight: '&f' + +Analysis: + AutoRefreshPeriod: 60 + Export: + Enabled: false ExternalWebServerLinkProtocol: http - Security: - DisplayIPsAndUUIDs: true - Certificate: - KeyStorePath: 'SSLCertificate.keystore' - KeyPass: 'default' - StorePass: 'default' - Alias: 'alias' + DestinationFolder: 'Analysis Results' + +Data: + Commands: + LogUnknownCommands: false + CombineCommandAliases: true Customization: - ServerName: 'Plan' - SmallHeadImagesOnAnalysisPlayerlist: true - Data: - DoNotLogUnknownCommands: false - CombineCommandAliasesToMainCommand: false - Formats: + Formatting: + DecimalPoints: '#.##' TimeAmount: Year: '1 year, ' Years: '%years% years, ' + Month: '1 month, ' + Months: '%months% months, ' Day: '1d ' Days: '%days%d ' Hours: '%hours%h ' Minutes: '%minutes%m ' Seconds: '%seconds%s' - DecimalPoints: '#.##' - Colors: - Commands: - Main: '&2' - Secondary: '&7' - Highlight: '&f' - HTML: - UI: - Main: 348e0f - MainDark: 267F00 - Secondary: 5cb239 - Tertiary: 89c471 - TertiaryDark: 5da341 - TPSGraph: - TPSHigh: 18 - TPSMedium: 10 - TPSHighCol: 267F00 - TPSMediumCol: e5cc12 - TPSLowCol: b74343 - ActivityGraph: - OnlinePlayers: '1E90FF' - NewPlayers: '228B22' - GamemodePie: - Survival: '438c99' - Creative: '639A67' - Adventure: 'D8EBB5' - Spectator: 'D9BF77' - ActivityPie: - Active: '228B22' - Banned: '951800' - Inactive: 'A9A9A9' - JoinedOnce: '808080' - Plugins: - Factions: - HideFactions: - - ExampleFaction - Towny: - HideTowns: - - ExampleTown -database: - type: sqlite - -mysql: - host: localhost - port: 3306 - user: root - password: minecraft - database: Plan +Theme: + Base: Default + Font: + FontStyleSheet: https://fonts.googleapis.com/css?family=Quicksand:300,400 + FontFamily: "'Quicksand', sans-serif" + Color: + Dark: Base + Light: Base + Colors: + Main: Base + Secondary: Base + Secondary-Dark: Base + Tertiary: Base + Background: Base + Table-Light: Base + Table-Dark: Base + Graphs: + PunchCard: Base + PlayersOnline: Base + TPS: + High-Threshold: 18 + Medium-Threshold: 10 + High: Base + Medium: Base + Low: Base + CPU: Base + RAM: Base + Chunks: Base + Entities: Base + +Plugins: + Factions: + HideFactions: + - ExampleFaction + Towny: + HideTowns: + - ExampleTown diff --git a/Plan/src/main/resources/html/network – Example.html b/Plan/src/main/resources/html/network – Example.html new file mode 100644 index 000000000..faaa354aa --- /dev/null +++ b/Plan/src/main/resources/html/network – Example.html @@ -0,0 +1,130 @@ + + + + Plan | Network + + + + + + + + + +
+
+ Player Analytics | Analysis +

Player Analytics v.4.0.0

+

Plan | Network

+
+
+
+
+
+
+

Players Online

+
+ +
+
+
+

Information

+
+
+

53/175 Players Online

+

497 Active Players
1246 Total Players

+

43 New Players Today
124 New Players This Week

+
+
+
+
+
+
+

Server 1

+
+
+

30/50 Players Online

+

100 Active Players

+
+ +
+
+
+

Server 2

+
+
+

0/25 Players Online

+

3 Active Players

+
+ +
+
+
+

Server 3

+
+
+

23/100 Players Online

+

432 Active Players

+
+ +
+
+
+
+
+

Server 4

+
+
+

Offline

+

 

+
+ +
+
+
+

Hub

+
+
+

0/175 Players Online

+

 

+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/Plan/src/main/resources/html/network.html b/Plan/src/main/resources/html/network.html new file mode 100644 index 000000000..b00173a0d --- /dev/null +++ b/Plan/src/main/resources/html/network.html @@ -0,0 +1,59 @@ + + + + Plan | Network + + + + + + + + + +
+
+ Player Analytics | Analysis +

Player Analytics v.${version}

+

${networkName} | Network

+
+
+
+
+
+
+

Players Online

+
+ +
+
+
+

Information

+
+
+

${playersOnline}/${playersMax} Players Online

+

${playersActive} Active Players
${playersTotal} Total Players

+

${playersNewDay} New Players Today
${playersNewWeek} New Players This Week

+
+
+
+ ${contentServers} +
+ + + + \ No newline at end of file diff --git a/Plan/src/main/resources/html/player - Example.html b/Plan/src/main/resources/html/player - Example.html new file mode 100644 index 000000000..d0c704f15 --- /dev/null +++ b/Plan/src/main/resources/html/player - Example.html @@ -0,0 +1,446 @@ + + + + Plan | Rsl1122 + + + + + + + + + + +
+
+ Player Analytics | Analysis +

Player Analytics v.4.0.0

+

Plan | Rsl1122

+
+
+
+ +
+
+
+
+
+
+

Information

+
+
+
+
+

Active • Offline • Operator
+
+ Also Known As:
+ • Rsl
+ • Rsl1122
+
+ Has Logged in From:
+ • Finland

+
+
+

Registered: May 01 2016, 13:39
+ Last Seen: Aug 18 2017, 20:00
+
+ Sessions: 76
+ Total Playtime: 4d 4h 40m
+ Session Median: 7m
+
+ Longest Session: 2h 37m +

+
+
+
+ +
+

Rsl1122

+
+ +
+
+
+

Join PunchCard

+
+ +
+

Server Preference

+
+ +
+
+
+
+
+
+
+

50 Most Recent Sessions

+
+
+
+

Aug 14 2017, 12:12 • 1h

+

Click to Expand

+
+
+
+
+
+

Aug 13 2017, 13:23 +

+
+
+

Session Length: 3h 5m
+ Session Ended: Aug 14 2017, 13:12
+ Server: Server 2
+
+ Mob Kills: 0
+ Deaths: 1

+ + + + + + + + + + + + + + + + + + + + +
KilledWith
12:42ZubatLightning
12:53ZezimaIron Sword
+
+
+
+ +
+
+
+
+
+
+

Aug 13 2017, 15:23 • 3h 5m

+

Click to Expand

+
+
+
+
+
+

Aug 13 2017, 13:23 +

+
+
+

Session Length: 3h 5m
+ Session Ended: Aug 13 2017, 16:28
+ Server: Server 1
+
+ Mob Kills: 45
+ Deaths: 6

+ + + + + + + + + + + + + + + +
KilledWith
13:42ZubatLightning
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+

World Playtime

+
+ +
+
+
+
+

Last 24 Hours

+
+
+

Sessions: 4
+ Playtime: 4h 20m
+
+ Longest Session: 1h 43m +

+
+
+
+
+

Last 7 Days

+
+
+

Sessions: 63
+ Playtime: 1d 3h 32m
+
+ Longest Session: 1h 43m +

+
+
+
+ +
+
+
+
+

Server 1

+
+
+

Sessions: 24
+ Playtime: 3d 2h 2m
+
+ Longest Session: 2h 43m +

+
+
+

Server 2

+
+
+

Sessions: 52
+ Playtime: 6d 10h 2m
+
+ Longest Session: 3h 7m +

+
+
+
+
+
+ +
+
+
+
+
+
+

Server 2

+

Click to Expand

+
+
+
+
+
+
+
+
+

Plugin 1

+
+
+

Test: 5 / 25
+ Test: 20%

+

More data: Yes
+ Data: 4

+
+
+
+
+

Plugin 2

+
+
+

Yes
+ Yes
+ Yes
Yes
Yes
Yes
Yes
+ Yes
Yes
Yes
Yes
Yes
+ Yes
Yes
Yes
Yes
Yes
+

+
+
+
+
+

Plugin 3

+
+
+ +
+
+
+
+
+
+

Plugin 4

+
+
+ + + + + + + + + + + + + +
TestTest2
DataData
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/Plan/src/main/resources/html/player.html b/Plan/src/main/resources/html/player.html new file mode 100644 index 000000000..ba0a6743c --- /dev/null +++ b/Plan/src/main/resources/html/player.html @@ -0,0 +1,227 @@ + + + + Plan | ${playerName} + + + + + + + + + + +
+
+ Player Analytics | Analysis +

Player Analytics v.${version}

+

${serverName} | ${playerName}

+
+
+
+ +
+
+
+
+
+
+

Information

+
+
+
+
+

${playerClassification}
+
+ Also Known As:
+ ${nicknames} +
+ Has Logged in From:
+ ${geolocations}

+
+
+

Registered: ${registered}
+ Last Seen: ${lastSeen}
+
+ Sessions: ${sessionCount}
+ Total Playtime: ${playtimeTotal}
+ Session Median: ${sessionLengthMedian}
+
+ Longest Session: ${sessionLengthLongest} +

+
+
+
+ +
+

${playerName}

+
+ +
+
+
+

Join PunchCard

+
+ +
+

Server Preference

+
+ +
+
+
+
+
+
+
+

50 Most Recent Sessions

+
+ ${contentSessions} +
+
+
+
+
+
+
+
+

World Playtime

+
+ +
+
+
+
+

Last 24 Hours

+
+
+

Sessions: ${sessionCountDay}
+ Playtime: ${playtimeDay}
+
+ Longest Session: ${sessionLengthLongestDay} +

+
+
+
+
+

Last 7 Days

+
+
+

Sessions: ${sessionCountWeek}
+ Playtime: ${playtimeWeek}
+
+ Longest Session: ${sessionLengthLongestWeek} +

+
+
+
+ +
+
+ ${contentServerOverview} +
+
+
+ +
+ ${tabContentPlugins} +
+
+
+ + + + + + + + + + +
+ + \ No newline at end of file diff --git a/Plan/src/main/resources/html/server - Example.html b/Plan/src/main/resources/html/server - Example.html new file mode 100644 index 000000000..b6a2a17d5 --- /dev/null +++ b/Plan/src/main/resources/html/server - Example.html @@ -0,0 +1,639 @@ + + + + Plan | Server + + + + + + + + + +
+
+ Player Analytics | Analysis +

Player Analytics v.4.0.0

+

Plan | Server Analysis

+
+
+
+ +
+
+
+
+
+
+

Players Online

+
+ +
+
+
+

Information

+
+
+
+
+

30/50 Players Online
43 New Players Today
+
+ 100 Active Players
+ 1246 Total Players
+
+ Peak Time: 18:23 Pm
+ Last Peak: 53 Players
+
+ All Time Peak:
+ Aug 13 2017, 18:46: 75 Players +

+
+
+

Averages:

+
  • Session Length: 28m 42s
  • +
  • Players / Day: 196
  • +
  • New Players / Day: 24
  • +

    Total:

    +
  • Playtime: 3 months 5d 53h
  • +
  • Sessions: 6480
  • +
  • Kills: 3403
  • +
  • Mob Kills: 503402
  • +
  • Deaths: 5704
  • +
    +
    +
    +
    +

    Recent Logins

    +
    + +
    +
    +
    +
    +
    +
    +
    +

    Players Online

    +
    + +
    +
    +
    +

    Player Join PunchCard

    +
    + +
    +
    +
    +
    +
    +

    Last 24 Hours

    +
    +
    +

    Unique Players: 217
    + Unique / Day: 217

    +

    New Players: 38
    + New / Day: 38

    +
    +
    +
    +
    +

    Last 7 Days

    +
    +
    +

    Unique Players: 670
    + Unique / Day: 204

    +

    New Players: 247
    + New / Day: 35

    +
    +
    +
    +
    +

    Last 30 Days

    +
    +
    +

    Unique Players: 812
    + Unique / Day: 196

    +

    New Players: 463
    + New / Day: 15

    +
    +
    +
    +
    +
    +
    +
    +
    +

    50 Most Recent Sessions

    +
    + +
    +
    +
    +
    +
    +

    World Playtime

    +
    + +
    +

    Playerbase

    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +

    Ticks Per Second

    +
    + +
    +
    +
    +

    Resource Usage

    +
    + +
    +
    +
    +
    +
    +

    World Load

    +
    + +
    +
    +
    +
    +

    Last 24 Hours

    +
    +
    +

    Averages:

    +
      +
    • TPS: 19.83
    • +
    • CPU: 25.51%
    • +
    • RAM: 5282 Mb
    • +
    • Entities: 3649
    • +
    • Chunks: 1789
    • +
    +
    +
    +
    +
    +

    Last 7 Days

    +
    +
    +

    Averages:

    +
      +
    • TPS: 19.83
    • +
    • CPU: 25.51%
    • +
    • RAM: 5282 Mb
    • +
    • Entities: 3649
    • +
    • Chunks: 1789
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Playerlist

    +
    + +
    +
    +
    +
    +
    +

    Playerlist

    +
    + +
    +
    +
    +
    +
    +

    Geolocations

    +
    + +
    +
    +
    +
    +
    +
    +

    Plugin 1

    +
    +
    +

    Test: 5 / 25
    + Test: 20%

    +

    More data: Yes
    + Data: 4

    +
    +
    +
    +
    +

    Plugin 2

    +
    +
    +

    Yes
    + Yes
    + Yes
    Yes
    Yes
    Yes
    Yes
    + Yes
    Yes
    Yes
    Yes
    Yes
    + Yes
    Yes
    Yes
    Yes
    Yes
    +

    +
    +
    +
    +
    +

    Plugin 3

    +
    +
    + +
    +
    +
    +
    +
    +
    +

    Plugin 4

    +
    +
    + + + + + + + + + + + + + +
    TestTest2
    DataData
    +
    +
    +
    +
    +

    That's all..

    +
    +
    +

    Do you have more plugins? ._.

    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + +
    + + \ No newline at end of file diff --git a/Plan/src/main/resources/html/server.html b/Plan/src/main/resources/html/server.html new file mode 100644 index 000000000..ee14fc76f --- /dev/null +++ b/Plan/src/main/resources/html/server.html @@ -0,0 +1,536 @@ + + + + Plan | Server + + + + + + + + + +
    +
    + Player Analytics | Analysis +

    Player Analytics v.${version}

    +

    ${serverName} | Server Analysis

    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

    Players Online

    +
    + +
    +
    +
    +

    Information

    +
    +
    +
    +
    +

    ${playersOnline}/${playersMax} Players Online
    43 New Players Today
    +
    + ${playersActive} Active Players
    + ${playersTotal} Total Players
    +
    + Peak Time: ${lastPeakTime}
    + Last Peak: ${playersLastPeak} Players
    +
    + All Time Peak:
    + ${bestPeakTime}: ${playersBestPeak} Players +

    +
    +
    +

    Averages:

    +
  • Session Length: ${sessionAverage}
  • +
  • Players / Day: ${playersAverage}
  • +
  • New Players / Day: ${playersNewAverage}
  • +

    Total:

    +
  • Playtime: ${playtimeTotal}
  • +
  • Sessions: ${sessionCount}
  • +
  • Kills: ${killCount}
  • +
  • Mob Kills: ${mobKillCount}
  • +
  • Deaths: ${deathCount}
  • +
    +
    +
    +
    +

    Recent Logins

    +
    + +
    +
    +
    +
    +
    +
    +
    +

    Players Online

    +
    + +
    +
    +
    +

    Player Join PunchCard

    +
    + +
    +
    +
    +
    +
    +

    Last 24 Hours

    +
    +
    +

    Unique Players: ${playersDay}
    + Unique / Day: ${playersAverageDay}

    +

    New Players: ${playersNewDay}
    + New / Day: ${playersNewAverageDay}

    +
    +
    +
    +
    +

    Last 7 Days

    +
    +
    +

    Unique Players: ${playersWeek}
    + Unique / Day: ${playersAverageWeek}

    +

    New Players: ${playersNewWeek}
    + New / Day: ${playersNewAverageWeek}

    +
    +
    +
    +
    +

    Last 30 Days

    +
    +
    +

    Unique Players: ${playersMonth}
    + Unique / Day: ${playersAverageMonth}

    +

    New Players: ${playersNewMonth}
    + New / Day: ${playersNewAverageMonth}

    +
    +
    +
    +
    +
    +
    +
    +
    +

    50 Most Recent Sessions

    +
    + +
    +
    +
    +
    +
    +

    World Playtime

    +
    + +
    +

    Playerbase

    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +

    Ticks Per Second

    +
    + +
    +
    +
    +

    Resource Usage

    +
    + +
    +
    +
    +
    +
    +

    World Load

    +
    + +
    +
    +
    +
    +

    Last 24 Hours

    +
    +
    +

    Averages:

    +
      +
    • TPS: ${tpsAverageDay}
    • +
    • CPU: ${cpuAverageDay}
    • +
    • RAM: ${ramAverageDay}
    • +
    • Entities: ${entityAverageDay}
    • +
    • Chunks: ${chunkAverageDay}
    • +
    +
    +
    +
    +
    +

    Last 7 Days

    +
    +
    +

    Averages:

    +
      +
    • TPS: ${tpsAverageWeek}
    • +
    • CPU: ${cpuAverageWeek}
    • +
    • RAM: ${ramAverageWeek}
    • +
    • Entities: ${entityAverageWeek}
    • +
    • Chunks: ${chunkAverageWeek}
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Playerlist

    +
    + +
    +
    +
    +
    +
    +

    Playerlist

    +
    + +
    +
    +
    +
    +
    +

    Geolocations

    +
    + +
    +
    +
    + ${tabContentPlugins} +
    +
    +
    + + + + + + + + + + + + + + + + +
    + + \ No newline at end of file diff --git a/Plan/src/main/resources/js/activityPie.js b/Plan/src/main/resources/js/activityPie.js new file mode 100644 index 000000000..58da2997c --- /dev/null +++ b/Plan/src/main/resources/js/activityPie.js @@ -0,0 +1,26 @@ +function activityPie(id, activitySeries, activityTotal, activityColors) { + var myChart = Highcharts.chart(id, { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + subtitle: {text: 'Total Players:' + activityTotal}, + tooltip: { + pointFormat: '{series.name}: {point.y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: false + }, + colors: activityColors, + showInLegend: true + } + }, + series: [activitySeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/gmPie.js b/Plan/src/main/resources/js/gmPie.js new file mode 100644 index 000000000..e0e3c14e8 --- /dev/null +++ b/Plan/src/main/resources/js/gmPie.js @@ -0,0 +1,24 @@ +function gmPie(id, gmSeries, gmtotal, gmColors) { + Highcharts.chart(id, { + chart: { + plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, + type: 'pie' + }, + subtitle: {text: gmtotal}, + tooltip: { + pointFormat: '{series.name}: {point.percentage:.2f}%' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: false + }, + colors: gmColors, + showInLegend: true + } + }, + series: [gmSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/playerGraph.js b/Plan/src/main/resources/js/playerGraph.js new file mode 100644 index 000000000..3d06e7bd6 --- /dev/null +++ b/Plan/src/main/resources/js/playerGraph.js @@ -0,0 +1,33 @@ +function playersChart(id, playersOnlineSeries, sel) { + Highcharts.stockChart(id, { + rangeSelector: { + selected: sel, + buttons: [{ + type: 'hour', + count: 12, + text: '12h' + },{ + type: 'hour', + count: 24, + text: '24h' + },{ + type: 'day', + count: 7, + text: '7d' + },{ + type: 'month', + count: 1, + text: '30d' + },{ + type: 'all', + text: 'All' + }] + }, + plotOptions: { + areaspline: { + fillOpacity: 0.4 + } + }, + series: [playersOnlineSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/pluginsTabExpand.js b/Plan/src/main/resources/js/pluginsTabExpand.js new file mode 100644 index 000000000..3f03bce39 --- /dev/null +++ b/Plan/src/main/resources/js/pluginsTabExpand.js @@ -0,0 +1,8 @@ +$(".plugins-header").click(function () { + $header = $(this); + $content = $header.next(); + $(this).parent().siblings().children().next().slideUp(500); + $content.slideToggle(500, function () { + //execute this after slideToggle is done + }); +}); \ No newline at end of file diff --git a/Plan/src/main/resources/js/punchCard.js b/Plan/src/main/resources/js/punchCard.js new file mode 100644 index 000000000..02375155c --- /dev/null +++ b/Plan/src/main/resources/js/punchCard.js @@ -0,0 +1,21 @@ +function punchCard(id, punchcardSeries) { + Highcharts.chart(id, { + chart: { + defaultSeriesType: 'scatter' + }, + xAxis: { + type: 'datetime', + dateTimeLabelFormats: { + hour: '%I %P' + }, + tickInterval: 3600000 + }, + yAxis: { + categories: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'], + }, + tooltip: { + pointFormat: 'Activity: {point.z}' + }, + series: [punchcardSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/resourceGraph.js b/Plan/src/main/resources/js/resourceGraph.js new file mode 100644 index 000000000..b2ad72988 --- /dev/null +++ b/Plan/src/main/resources/js/resourceGraph.js @@ -0,0 +1,59 @@ +function resourceChart(id, cpuSeries, ramSeries) { + var myChart = Highcharts.stockChart(id, { + rangeSelector: { + selected: 1, + buttons: [{ + type: 'hour', + count: 12, + text: '12h' + },{ + type: 'hour', + count: 24, + text: '24h' + },{ + type: 'day', + count: 7, + text: '7d' + },{ + type: 'month', + count: 1, + text: '30d' + },{ + type: 'all', + text: 'All' + }] + }, + yAxis: [{ + labels: { + align: 'right', + x: -3 + }, + title: { + text: 'CPU / %' + }, + height: '55%', + lineWidth: 2 + }, { + labels: { + align: 'right', + x: -3 + }, + title: { + text: 'RAM / MB' + }, + top: '55%', + height: '40%', + offset: 0, + lineWidth: 2 + }], + tooltip: { + split: true + }, + plotOptions: { + areaspline: { + fillOpacity: 0.4 + } + }, + series: [cpuSeries, ramSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/sessionDistributionChart.js b/Plan/src/main/resources/js/sessionDistributionChart.js new file mode 100644 index 000000000..123943962 --- /dev/null +++ b/Plan/src/main/resources/js/sessionDistributionChart.js @@ -0,0 +1,29 @@ +function sessionDistributionChart(id, sessionLengthSeries) { + Highcharts.chart(id, { + chart: { + type: 'column' + }, + xAxis: { + type: 'category', + labels: { + rotation: -45 + } + }, + yAxis: { + min: 0, + title: { + text: 'Sessions' + } + }, + legend: { + enabled: false + }, + plotOptions: { + series: { + groupPadding: 0 + }, + pointPadding: 0 + }, + series: [sessionLengthSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/sessionTabExpand.js b/Plan/src/main/resources/js/sessionTabExpand.js new file mode 100644 index 000000000..680d0816a --- /dev/null +++ b/Plan/src/main/resources/js/sessionTabExpand.js @@ -0,0 +1,8 @@ +$(".session-header").click(function () { + $header = $(this); + $content = $header.next(); + $(this).parent().siblings().children().next().slideUp(500); + $content.slideToggle(500, function () { + //execute this after slideToggle is done + }); +}); \ No newline at end of file diff --git a/Plan/src/main/resources/js/tpsGraph.js b/Plan/src/main/resources/js/tpsGraph.js new file mode 100644 index 000000000..8c3fcee7a --- /dev/null +++ b/Plan/src/main/resources/js/tpsGraph.js @@ -0,0 +1,59 @@ +function tpsChart(id, tpsSeries, playersOnlineSeries) { + var myChart = Highcharts.stockChart(id, { + rangeSelector: { + selected: 1, + buttons: [{ + type: 'hour', + count: 12, + text: '12h' + },{ + type: 'hour', + count: 24, + text: '24h' + },{ + type: 'day', + count: 7, + text: '7d' + },{ + type: 'month', + count: 1, + text: '30d' + },{ + type: 'all', + text: 'All' + }] + }, + yAxis: [{ + labels: { + align: 'right', + x: -3 + }, + title: { + text: 'Players' + }, + height: '30%', + }, { + lineWidth: 2, + labels: { + align: 'right', + x: -3 + }, + title: { + text: 'TPS' + }, + height: '70%', + top: '30%', + offset: 0, + lineWidth: 2 + }], + tooltip: { + split: true + }, + plotOptions: { + areaspline: { + fillOpacity: 0.4 + } + }, + series: [tpsSeries, playersOnlineSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/worldGraph.js b/Plan/src/main/resources/js/worldGraph.js new file mode 100644 index 000000000..d40f01900 --- /dev/null +++ b/Plan/src/main/resources/js/worldGraph.js @@ -0,0 +1,59 @@ +function worldChart(id, entitySeries, chunkSeries) { + var myChart = Highcharts.stockChart(id, { + rangeSelector: { + selected: 1, + buttons: [{ + type: 'hour', + count: 12, + text: '12h' + },{ + type: 'hour', + count: 24, + text: '24h' + },{ + type: 'day', + count: 7, + text: '7d' + },{ + type: 'month', + count: 1, + text: '30d' + },{ + type: 'all', + text: 'All' + }] + }, + yAxis: [{ + labels: { + align: 'right', + x: -3 + }, + title: { + text: 'Chunks' + }, + height: '50%', + lineWidth: 2 + }, { + labels: { + align: 'right', + x: -3 + }, + title: { + text: 'Entities' + }, + top: '50%', + height: '40%', + offset: 0, + lineWidth: 2 + }], + tooltip: { + split: true + }, + plotOptions: { + areaspline: { + fillOpacity: 0.4 + } + }, + series: [entitySeries, chunkSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/worldMap.js b/Plan/src/main/resources/js/worldMap.js new file mode 100644 index 000000000..a7565185b --- /dev/null +++ b/Plan/src/main/resources/js/worldMap.js @@ -0,0 +1,14 @@ +function worldMap(id, colorMin, colorMax, mapSeries) { + var myChart = Highcharts.mapChart(id, { + chart: { + animation: true + }, + colorAxis: { + min: 1, + type: 'logarithmic', + minColor: colorMin, + maxColor: colorMax + }, + series: [mapSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/js/worldPie.js b/Plan/src/main/resources/js/worldPie.js new file mode 100644 index 000000000..69ad3b7f7 --- /dev/null +++ b/Plan/src/main/resources/js/worldPie.js @@ -0,0 +1,25 @@ +function worldPie(id, worldSeries, worldTotal) { + var myChart = Highcharts.chart(id, { + chart: { + plotBackgroundColor: null, + plotBorderWidth: null, + plotShadow: false, + type: 'pie' + }, + subtitle: {text: worldTotal}, + tooltip: { + pointFormat: '{series.name}: {point.percentage:.2f}%' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: false + }, + showInLegend: true + } + }, + series: [worldSeries] + }); +} \ No newline at end of file diff --git a/Plan/src/main/resources/locale_DE.txt b/Plan/src/main/resources/locale/locale_DE.txt similarity index 100% rename from Plan/src/main/resources/locale_DE.txt rename to Plan/src/main/resources/locale/locale_DE.txt diff --git a/Plan/src/main/resources/locale_FI.txt b/Plan/src/main/resources/locale/locale_FI.txt similarity index 100% rename from Plan/src/main/resources/locale_FI.txt rename to Plan/src/main/resources/locale/locale_FI.txt diff --git a/Plan/src/main/resources/main.css b/Plan/src/main/resources/main.css new file mode 100644 index 000000000..60d35aede --- /dev/null +++ b/Plan/src/main/resources/main.css @@ -0,0 +1,327 @@ +.black { + color: #000000; +} +.darkblue { + color: #0000AA; +} +.darkgreen { + color: #00AA00; +} +.darkaqua { + color: #00AAAA; +} +.darkred { + color: #AA0000; +} +.darkpurple { + color: #AA00AA; +} +.gold { + color: #FFAA00; +} +.gray { + color: #AAAAAA; +} +.darkgray { + color: #555555; +} +.blue { + color: #5555FF; +} +.green { + color: #55FF55; +} +.aqua { + color: #55FFFF; +} +.red { + color: #FF5555; +} +.pink { + color: #FF55FF; +} +.yellow { + color: #FFFF55; + text-shadow: 0px 0px 6px #000; +} +.white { + color: #FFFFFF; + text-shadow: 0px 0px 8px #000; +} + +body { + font-family: 'Quicksand', sans-serif; + background-color: #ddd; + color: #fff; + font-weight: 400; +} +header { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 80px; + padding: 0; + background-color: #348e0f; + z-index: 1; +} +header h1 { + font-weight: 500; + font-size: 55px; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 10px; +} +header p { + font-weight: 400; +} +header div { + padding: 5pxpx 20px; +} + +.right { + float: right; +} +.left { + float: left; +} +.button { + background-color: #5da341; + text-decoration: none!important; + color: #fff; + padding: 10px 20px; + text-align: center; +} +.button:hover { + background-color: #348e0f; +} +.link { + color: #5da341; + text-decoration: none!important; +} +.button:hover { + background-color: #348e0f; +} +.disabled { + background-color: #89c471; +} +.disabled:hover { + background-color: #89c471; +} + +.content { + margin-top: 100px; + margin-left: 15%; + margin-right: 15%; + width: 70%; +} +.content-server { + margin-top: 100px; + margin-left: 10%; + margin-right: 10%; + width: 80%; +} +.box-header { + color: #fff; + background-color: #5da341; + padding: 5px 20px; + text-align: left; + margin: 5px 5px 0px 5px; +} +.box { + background-color: #fff; + padding: 5px 20px; + color: #000; + text-align: left; + margin: 0px 5px; +} +.box-footer { + vertical-align: middle; + display: inline-block; + background-color: #fff; + padding: 5px 10px 5px 20px; + color: #000; + text-align: left; + margin: 2px 5px 5px 5px; +} +.box-footer p { + display: inline-block; +} +.box-footer a { + margin-top: 5px; + display: inline-block; +} +.plugin { + max-height: 300px; + overflow-y: auto; + height: 100%; +} +.row { + width: 100%; + display: flex; + flex-direction: row; +} +.column { + width: 100%; + + display: flex; + flex-direction: column; +} + +.nav-bar { + +} +.nav-button { + font-size: 20px; + font-weight: 400; + padding: 5px 10px; + margin: 5px; + text-decoration: none!important; + color: #fff; + background-color: #5da341; +} +.nav-button:hover { + background-color: #348e0f; +} +.active { + background-color: #348e0f; +} + +table { + width: 100%; +} + +thead th { + color: #fff; + background-color: #5da341; + font-weight: 600; +} +th { + padding: 5px; + font-weight: 400; +} +th.text { + font-size: 120%; +} +tr:nth-child(even) {background: #e2e2e2} +tr:nth-child(odd) {background: #eee} + + +.main-limiter { + width: 100%; + height: 100%; + overflow: hidden; +} + +.main-wrapper { + transform: translate3d(0, 0, 0); + opacity: 0; + transition: 1.5s; + width: 100%; + display: flex; + flex-direction: row; +} +.tab { + width: 20%; + height: 100%; + display: flex; + align-content: flex-start; +} + +.scrollbar { + max-height: 650px; + overflow-y: auto; +} + +.session-header h3 { + margin: 0px; +} +.session-header p { + margin: 0px; +} +.session { + +} + +.session-header { + background: #ddd; + color: #000; + margin: 1px 3px; + display: flex; + flex-direction: row; + padding: 0px; +} + +.session-col { + width: 100%; + background: #fff; + color: #000; + margin: 0px 2px; + display: flex; + flex-direction: column; + padding: 10px 20px; +} + +.session-content { + display: none; + margin: 2px 10px; + flex-direction: row; +} + +.plugins-content { + display: none; +} +.plugins-header h2 { + margin: 0px; +} +.plugins-header p { + margin: 0px; +} + +@media only screen and (max-width: 1680px) { + .nav-button { + font-size: 19px; + } +} +@media only screen and (max-width: 1150px) { + header h1 { + font-weight: 400; + font-size: 40px; + } + .content { + margin-top: 100px; + margin-left: 0%; + margin-right: 0%; + width: 100%; + } + .content-server { + margin-top: 100px; + margin-left: 0%; + margin-right: 0%; + width: 100%; + } + .nav-bar { + flex-wrap:wrap; + } +} +@media only screen and (max-width: 850px) { + header h1 { + font-weight: 400; + font-size: 30px; + } +} +@media only screen and (max-width: 780px) { + .scrollbar { + overflow-x: auto; + width: 100%; + } + .nav-bar { + flex-direction: row; + } + .row { + flex-direction: column; + } + header p { + display: none; + } +} \ No newline at end of file diff --git a/Plan/src/main/resources/player.html b/Plan/src/main/resources/player.html deleted file mode 100644 index 8c84c7d05..000000000 --- a/Plan/src/main/resources/player.html +++ /dev/null @@ -1,779 +0,0 @@ - - - - Plan | Inspect %name% - - - - - - - -
    -
    - Player Analytics | Analysis -

    Player Analytics v.%version%

    -

    %servername% | Inspect Player %name%%op%

    -
    -
    -
    -
    -

    Last Refresh:
    %refresh% ago

    - - Information - - - Sessions - - - Plugins - -
    -
    -
    -
    -
    -
    -
    -
    -
    Information
    -
    -
    -
    - -
    -
    -
    - %registered% -
    -
    - Registered -
    -
    -
    -
    - %name% -

    %active% %isonline%%banned%
    - Nicknames: %nicknames%
    - Playtime: %playtime%
    - Login times: %logintimes%
    - Times kicked: %timeskicked%
    - Player kills: %playerkills% | Mob kills: %mobkills% | Deaths: %deaths%
    -
    - Geolocation: %geoloc%
    - UUID: %uuid%
    - Has Connected from ips: %ips%

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    Player Activity: 7d
    -
    -
    -
    - -
    -
    -
    - %lastseen% -
    -
    - Last seen -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    Last 25 Kills
    -
    -
    -
    - -
    -
    -
    - %playerkills% -
    -
    - Player Kills -
    -
    -
    -
    - %killstable% -
    -
    -
    -
    -
    -
    -
    -
    -
    PunchCard
    -
    -
    -
    - -
    -
    -
    - %logintimes% -
    -
    - Login Times -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    Length Distribution
    -
    -
    -
    - -
    -
    -
    - %sessionaverage% -
    -
    - Average Length -
    -
    -
    -
    -
    -
    -
    -
    -
    - %plugins% -
    -
    -
    - - - - - - - - - -
    - - \ No newline at end of file diff --git a/Plan/test/test/java/main/java/com/djrapitops/plan/SettingsTest.java b/Plan/test/test/java/main/java/com/djrapitops/plan/SettingsTest.java index 139ea0deb..84a504708 100644 --- a/Plan/test/test/java/main/java/com/djrapitops/plan/SettingsTest.java +++ b/Plan/test/test/java/main/java/com/djrapitops/plan/SettingsTest.java @@ -17,9 +17,7 @@ import test.java.utils.TestInit; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; /** * @author Rsl1122 @@ -38,12 +36,12 @@ public class SettingsTest { @Test public void testIsTrue() { - assertTrue("Webserver supposed to be enabled by default", Settings.WEBSERVER_ENABLED.isTrue()); + assertTrue("COMBINE_COMMAND_ALIASES supposed to be true by default", Settings.COMBINE_COMMAND_ALIASES.isTrue()); } @Test public void testIsTrue2() { - Settings gatherCommands = Settings.GATHERCOMMANDS; + Settings gatherCommands = Settings.LOG_UNKNOWN_COMMANDS; gatherCommands.setValue(false); assertFalse(gatherCommands.isTrue()); @@ -54,7 +52,7 @@ public class SettingsTest { @Test public void testToString() { - assertEquals("sqlite", Settings.DB_TYPE.toString()); + assertEquals("SQLite", Settings.DB_TYPE.toString()); } @Test @@ -72,6 +70,6 @@ public class SettingsTest { @Test public void testGetPath() { - assertEquals("Settings.WebServer.Enabled", Settings.WEBSERVER_ENABLED.getPath()); + assertEquals("WebServer.Port", Settings.WEBSERVER_PORT.getPath()); } } diff --git a/Plan/test/test/java/utils/TestInit.java b/Plan/test/test/java/utils/TestInit.java index fe6af2826..6b555a71c 100644 --- a/Plan/test/test/java/utils/TestInit.java +++ b/Plan/test/test/java/utils/TestInit.java @@ -88,7 +88,7 @@ public class TestInit { when(planMock.getDataFolder()).thenReturn(testFolder); // Html Files - File analysis = new File(getClass().getResource("/analysis.html").getPath()); + File analysis = new File(getClass().getResource("/server.html").getPath()); when(planMock.getResource("analysis.html")).thenReturn(new FileInputStream(analysis)); File player = new File(getClass().getResource("/player.html").getPath()); when(planMock.getResource("player.html")).thenReturn(new FileInputStream(player));