From d6fe6af5a0d5d21c08867d099c8eaf822a00ff65 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Mon, 6 Mar 2017 11:40:07 +0200 Subject: [PATCH] [2.8.0] Added gm chart back, minor fixes to html --- .../java/com/djrapitops/plan/ui/Html.java | 3 +- .../plan/utilities/PlaceholderUtils.java | 40 +++--- Plan/src/main/resources/analysis.html | 18 +-- Plan/src/main/resources/player.html | 132 +++++++++++------- Plan/src/main/resources/plugin.yml | 2 +- 5 files changed, 114 insertions(+), 81 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/ui/Html.java b/Plan/src/main/java/com/djrapitops/plan/ui/Html.java index 085c68fbe..9886652d2 100644 --- a/Plan/src/main/java/com/djrapitops/plan/ui/Html.java +++ b/Plan/src/main/java/com/djrapitops/plan/ui/Html.java @@ -45,7 +45,8 @@ public enum Html { TOTAL_VOTES("

Players have voted total of " + REPLACE0 + " times.

"), PLOT_OPTIONS("

Plot options: " + REPLACE0 + "

"), FRIENDS("

Friends with " + REPLACE0 + "

"), - BALANCE("

Balance: " + REPLACE0 + "

"), BANNED("| " + SPAN.parse(COLOR_4.parse() + "Banned")), + BALANCE("

Balance: " + REPLACE0 + "

"), + BANNED("| " + SPAN.parse(COLOR_4.parse() + "Banned")), OPERATOR(", Operator (Op)"), ONLINE("| " + SPAN.parse(COLOR_2.parse() + "Online")), OFFLINE("| " + SPAN.parse(COLOR_4.parse() + "Offline")), diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/PlaceholderUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/PlaceholderUtils.java index c43a57003..5497dd610 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/PlaceholderUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/PlaceholderUtils.java @@ -44,7 +44,7 @@ public class PlaceholderUtils { replaceMap.put("%npweek%", data.getNewPlayersWeek() + ""); replaceMap.put("%npmonth%", data.getNewPlayersMonth() + ""); replaceMap.put("%commanduse%", HtmlUtils.removeXSS(data.getCommandUseListHtml())); - replaceMap.put("%totalcommands%", data.getTotalCommands()+""); + replaceMap.put("%totalcommands%", data.getTotalCommands() + ""); replaceMap.put("%avgage%", (data.getAverageAge() != -1) ? "" + data.getAverageAge() : Phrase.DEM_UNKNOWN + ""); replaceMap.put("%avgplaytime%", FormatUtils.formatTimeAmount("" + data.getAveragePlayTime())); replaceMap.put("%totalplaytime%", FormatUtils.formatTimeAmount("" + data.getTotalPlayTime())); @@ -72,21 +72,21 @@ public class PlaceholderUtils { "\"" + Html.GRAPH_ACTIVE.parse() + "\"", "\"" + Html.GRAPH_INACTIVE.parse() + "\"", "\"" + Html.GRAPH_UNKNOWN.parse() + "\"", - "\"" + Html.GRAPH_BANNED.parse() + "\"" + "\"" + Html.GRAPH_BANNED.parse() + "\"" }; replaceMap.put("%labelsactivity%", Arrays.toString(activityLabels)); - String[] activityData = new String[]{data.getActive() + "", data.getInactive() + "", data.getJoinleaver()+ "", data.getBanned() + ""}; + String[] activityData = new String[]{data.getActive() + "", data.getInactive() + "", data.getJoinleaver() + "", data.getBanned() + ""}; replaceMap.put("%activitydata%", Arrays.toString(activityData)); replaceMap.put("%activitycolors%", "\"#" + Settings.HCOLOR_ACTP_ACT + "\",\"#" + Settings.HCOLOR_ACTP_INA + "\",\"#" + Settings.HCOLOR_ACTP_JON + "\",\"#" + Settings.HCOLOR_ACTP_BAN + "\""); - replaceMap.put("%activecol%", Settings.HCOLOR_ACTP_ACT+""); - replaceMap.put("%inactivecol%", Settings.HCOLOR_ACTP_INA+""); - replaceMap.put("%joinleavecol%", Settings.HCOLOR_ACTP_JON+""); - replaceMap.put("%bancol%", Settings.HCOLOR_ACTP_BAN+""); - replaceMap.put("%gm0col%", Settings.HCOLOR_GMP_0+""); - replaceMap.put("%gm1col%", Settings.HCOLOR_GMP_1+""); - replaceMap.put("%gm2col%", Settings.HCOLOR_GMP_2+""); - replaceMap.put("%gm3col%", Settings.HCOLOR_GMP_3+""); + replaceMap.put("%activecol%", Settings.HCOLOR_ACTP_ACT + ""); + replaceMap.put("%inactivecol%", Settings.HCOLOR_ACTP_INA + ""); + replaceMap.put("%joinleavecol%", Settings.HCOLOR_ACTP_JON + ""); + replaceMap.put("%bancol%", Settings.HCOLOR_ACTP_BAN + ""); + replaceMap.put("%gm0col%", Settings.HCOLOR_GMP_0 + ""); + replaceMap.put("%gm1col%", Settings.HCOLOR_GMP_1 + ""); + replaceMap.put("%gm2col%", Settings.HCOLOR_GMP_2 + ""); + replaceMap.put("%gm3col%", Settings.HCOLOR_GMP_3 + ""); String[] gmData = new String[]{ (data.getGm0Perc() * 100) + "", (data.getGm1Perc() * 100) + "", @@ -98,7 +98,7 @@ public class PlaceholderUtils { replaceMap.put("%gmcolors%", "\"#" + Settings.HCOLOR_GMP_0 + "\",\"#" + Settings.HCOLOR_GMP_1 + "\",\"#" + Settings.HCOLOR_GMP_2 + "\",\"#" + Settings.HCOLOR_GMP_3 + "\""); replaceMap.putAll(plugin.getHookHandler().getAdditionalAnalysisReplaceRules()); - replaceMap.put("%sessionaverage%", FormatUtils.formatTimeAmount(data.getSessionAverage()+"")); + replaceMap.put("%sessionaverage%", FormatUtils.formatTimeAmount(data.getSessionAverage() + "")); return replaceMap; } @@ -144,6 +144,10 @@ public class PlaceholderUtils { replaceMap.put("%gm1%", FormatUtils.formatTimeAmount("" + gmData[1])); replaceMap.put("%gm2%", FormatUtils.formatTimeAmount("" + gmData[2])); replaceMap.put("%gm3%", FormatUtils.formatTimeAmount("" + gmData[3])); + replaceMap.put("%gmdata%", Arrays.toString(gmData)); + replaceMap.put("%gmlabels%", "[\"Survival\", \"Creative\", \"Adventure\", \"Spectator\"]"); + replaceMap.put("%gmcolors%", "\"#" + Settings.HCOLOR_GMP_0 + "\",\"#" + Settings.HCOLOR_GMP_1 + + "\",\"#" + Settings.HCOLOR_GMP_2 + "\",\"#" + Settings.HCOLOR_GMP_3 + "\""); replaceMap.put("%gmtotal%", FormatUtils.formatTimeAmount("" + total)); replaceMap.put("%ips%", (showIPandUUID ? data.getIps().toString() : Html.HIDDEN.parse())); replaceMap.put("%nicknames%", HtmlUtils.removeXSS(FormatUtils.swapColorsToSpan(data.getNicknames().toString()))); @@ -159,20 +163,20 @@ public class PlaceholderUtils { replaceMap.put("%playerkills%", data.getPlayerKills().size() + ""); replaceMap.put("%mobkills%", data.getMobKills() + ""); replaceMap.put("%sessionstable%", SortableSessionTableCreator.createSortedSessionDataTable10(data.getSessions())); - replaceMap.put("%sessionaverage%", FormatUtils.formatTimeAmount(AnalysisUtils.average(AnalysisUtils.transformSessionDataToLengths(data.getSessions()))+"")); + replaceMap.put("%sessionaverage%", FormatUtils.formatTimeAmount(AnalysisUtils.average(AnalysisUtils.transformSessionDataToLengths(data.getSessions())) + "")); replaceMap.put("%killstable%", SortableKillsTableCreator.createSortedSessionDataTable10(data.getPlayerKills())); Plan plugin = getPlugin(Plan.class); replaceMap.put("%version%", plugin.getDescription().getVersion()); replaceMap.put("%planlite%", ""); String[] playersDataArray = PlayerActivityGraphCreator.generateDataArray(data.getSessions(), (long) 604800 * 1000); - replaceMap.put("%dataweek%", playersDataArray[0].replace(plugin.getHandler().getMaxPlayers()+"]", "2]")); + replaceMap.put("%dataweek%", playersDataArray[0].replace(plugin.getHandler().getMaxPlayers() + "]", "2]")); replaceMap.put("%labelsweek%", playersDataArray[1]); replaceMap.put("%playersgraphcolor%", Settings.HCOLOR_ACT_ONL + ""); replaceMap.put("%playersgraphfill%", Settings.HCOLOR_ACT_ONL_FILL + ""); - replaceMap.put("%gm0col%", Settings.HCOLOR_GMP_0+""); - replaceMap.put("%gm1col%", Settings.HCOLOR_GMP_1+""); - replaceMap.put("%gm2col%", Settings.HCOLOR_GMP_2+""); - replaceMap.put("%gm3col%", Settings.HCOLOR_GMP_3+""); + replaceMap.put("%gm0col%", Settings.HCOLOR_GMP_0 + ""); + replaceMap.put("%gm1col%", Settings.HCOLOR_GMP_1 + ""); + replaceMap.put("%gm2col%", Settings.HCOLOR_GMP_2 + ""); + replaceMap.put("%gm3col%", Settings.HCOLOR_GMP_3 + ""); replaceMap.put("%inaccuratedatawarning%", (new Date().getTime() - data.getRegistered() < 180000) ? Html.WARN_INACCURATE.parse() : ""); replaceMap.putAll(plugin.getHookHandler().getAdditionalInspectReplaceRules(uuid)); return replaceMap; diff --git a/Plan/src/main/resources/analysis.html b/Plan/src/main/resources/analysis.html index 4af0fe2c9..33a81696e 100644 --- a/Plan/src/main/resources/analysis.html +++ b/Plan/src/main/resources/analysis.html @@ -481,13 +481,13 @@ - - - - - - - + + + + + + + @@ -517,8 +517,8 @@
PlayerActivePlaytimeLogin timesRegisteredLast seenGeolocation Player Active Playtime Login times Registered Last seen Geolocation
- - + + diff --git a/Plan/src/main/resources/player.html b/Plan/src/main/resources/player.html index 79c456c73..77d88c9a8 100644 --- a/Plan/src/main/resources/player.html +++ b/Plan/src/main/resources/player.html @@ -174,7 +174,7 @@
Player Analytics | Inspect %name%

Player Analytics v.%version%

-

Plan | Inspect Player %name%

+

Plan | Inspect Player %name%%op%

Has Connected from ips: %ips%

%inaccuratedatawarning% @@ -204,11 +204,11 @@ %name% -

%active% %isonline% %essentials% %banned%%op%
+

%active% %isonline%%banned% %essentials%
Nicknames: %nicknames%
Playtime: %playtime%
- Login times %logintimes%
- Times kicked %timeskicked%
+ Login times: %logintimes%
+ Times kicked: %timeskicked%
Player kills: %playerkills% | Mob kills: %mobkills% | Deaths: %deaths%

Geolocation: %geoloc%
@@ -233,58 +233,63 @@ -

-
-
- -
-
-
- %gm0% +
+
+
+
+
-
- Survival +
+
+ %gm0% +
+
+ Survival +
+
+
+
+
+ +
+
+
+ %gm1% +
+
+ Creative +
+
+
+
+
+ +
+
+
+ %gm2% +
+
+ Adventure +
+
+
+
+
+ +
+
+
+ %gm3% +
+
+ Spectator +
-
-
- -
-
-
- %gm1% -
-
- Creative -
-
-
-
-
- -
-
-
- %gm2% -
-
- Adventure -
-
-
-
-
- -
-
-
- %gm3% -
-
- Spectator -
-
+
+
@@ -356,6 +361,29 @@
CommandTimes used Command Times used