Merge pull request #196 from Fuzzlemann/master

PR for 3.6.0 (Fuzzlemann)
This commit is contained in:
Rsl1122 2017-07-27 09:19:51 +03:00 committed by GitHub
commit 9c67c7b69d
185 changed files with 2429 additions and 2680 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name='Checker'>
<!-- asetetaan kieliasetukset englanniksi. -->
@ -8,15 +9,15 @@
<module name='TreeWalker'>
<property name='tabWidth' value='4' />
<property name='tabWidth' value='4'/>
<!-- Block Checks -->
<module name='EmptyBlock' />
<module name='LeftCurly' />
<module name='NeedBraces' />
<module name='RightCurly' />
<module name='AvoidNestedBlocks' />
<module name='EmptyBlock'/>
<module name='LeftCurly'/>
<module name='NeedBraces'/>
<module name='RightCurly'/>
<module name='AvoidNestedBlocks'/>
<module name="NestedIfDepth">
<property name="max" value="2"/>
</module>
@ -26,50 +27,50 @@
<module name="NestedTryDepth"/>
<!-- Miscellaneous -->
<module name='Indentation' />
<module name='Indentation'/>
<module name="OneStatementPerLine"/>
<!--- Naming Conventions -->
<module name='ClassTypeParameterName' />
<module name='ConstantName' />
<module name='LocalFinalVariableName' />
<module name='LocalVariableName' />
<module name='MemberName' />
<module name='MethodName' />
<module name='MethodTypeParameterName' />
<module name='ClassTypeParameterName'/>
<module name='ConstantName'/>
<module name='LocalFinalVariableName'/>
<module name='LocalVariableName'/>
<module name='MemberName'/>
<module name='MethodName'/>
<module name='MethodTypeParameterName'/>
<module name='PackageName'>
<property name='format' value='^[a-z]+(\.[a-z][a-z0-9]*)*$' />
<property name='format' value='^[a-z]+(\.[a-z][a-z0-9]*)*$'/>
</module>
<module name='ParameterName' />
<module name='StaticVariableName' />
<module name='TypeName' />
<module name='ParameterName'/>
<module name='StaticVariableName'/>
<module name='TypeName'/>
<!-- Whitespace -->
<module name='GenericWhitespace' />
<module name='EmptyForInitializerPad' />
<module name='EmptyForIteratorPad' />
<module name='MethodParamPad' />
<module name='GenericWhitespace'/>
<module name='EmptyForInitializerPad'/>
<module name='EmptyForIteratorPad'/>
<module name='MethodParamPad'/>
<module name='NoWhitespaceAfter'>
<property name='tokens' value='BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS' />
<property name='tokens' value='BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS'/>
</module>
<module name='NoWhitespaceBefore'>
<property name='tokens' value='SEMI, DOT, POST_DEC, POST_INC' />
<property name='allowLineBreaks' value='true' />
<property name='tokens' value='SEMI, DOT, POST_DEC, POST_INC'/>
<property name='allowLineBreaks' value='true'/>
</module>
<module name='ParenPad' />
<module name='TypecastParenPad' />
<module name='WhitespaceAfter' />
<module name='ParenPad'/>
<module name='TypecastParenPad'/>
<module name='WhitespaceAfter'/>
<module name='WhitespaceAround'>
<property name='allowEmptyConstructors' value='true' />
<property name='allowEmptyMethods' value='true' />
<property name='allowEmptyConstructors' value='true'/>
<property name='allowEmptyMethods' value='true'/>
</module>
<!-- Javadoc -->
@ -81,7 +82,7 @@
<property name="allowMissingReturnTag" value="false"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="JavadocStyle">
<property name="scope" value="public"/>
<property name="checkEmptyJavadoc" value="true"/>
@ -91,7 +92,7 @@
<!-- File Length -->
<module name='FileLength'>
<property name='max' value='2000' />
<property name='max' value='2000'/>
</module>
</module>

View File

@ -1,182 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>Plan</artifactId>
<version>3.5.4</version>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<defaultGoal>clean package install</defaultGoal>
<resources>
<resource>
<targetPath>.</targetPath>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>*.yml</include>
<include>*.html</include>
</includes>
</resource>
</resources>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<excludes>
<exclude>org.powermock:*</exclude>
<exclude>org.javassist:*</exclude>
<exclude>com.thoughtworks.xstream:*</exclude>
<exclude>xmlpull:*</exclude>
<exclude>xpp3:*</exclude>
<exclude>org.objenesis:*</exclude>
<exclude>cglib:*</exclude>
<exclude>org.*:*</exclude>
<exclude>org.easymock:*</exclude>
<exclude>junit:*</exclude>
</excludes>
</artifactSet>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<excludes>
<exclude>**/test/*</exclude>
<exclude>**/*/test/*</exclude>
<exclude>**/*/test.*</exclude>
<exclude>**/test/**/*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.1.8</version>
<configuration>
<targetClasses>
<param>main.java.com.djrapitops.plan.*</param>
</targetClasses>
<targetTests>
<param>test.java.main.java.com.djrapitops.plan.*</param>
</targetTests>
<timeoutConstant>1000</timeoutConstant>
</configuration>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<excludes>**/test/**/*</excludes>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<excludePackageNames>test.*</excludePackageNames>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock</artifactId>
<version>1.6.6</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-classloading-xstream</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>
<artifactId>Plan</artifactId>
<version>3.5.4</version>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<defaultGoal>clean package install</defaultGoal>
<resources>
<resource>
<targetPath>.</targetPath>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>*.yml</include>
<include>*.html</include>
</includes>
</resource>
</resources>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<excludes>
<exclude>org.powermock:*</exclude>
<exclude>org.javassist:*</exclude>
<exclude>com.thoughtworks.xstream:*</exclude>
<exclude>xmlpull:*</exclude>
<exclude>xpp3:*</exclude>
<exclude>org.objenesis:*</exclude>
<exclude>cglib:*</exclude>
<exclude>org.*:*</exclude>
<exclude>org.easymock:*</exclude>
<exclude>junit:*</exclude>
</excludes>
</artifactSet>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<excludes>
<exclude>**/test/*</exclude>
<exclude>**/*/test/*</exclude>
<exclude>**/*/test.*</exclude>
<exclude>**/test/**/*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.1.8</version>
<configuration>
<targetClasses>
<param>main.java.com.djrapitops.plan.*</param>
</targetClasses>
<targetTests>
<param>test.java.main.java.com.djrapitops.plan.*</param>
</targetTests>
<timeoutConstant>1000</timeoutConstant>
</configuration>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<excludes>**/test/**/*</excludes>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<excludePackageNames>test.*</excludePackageNames>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock</artifactId>
<version>1.6.6</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4-rule</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-classloading-xstream</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>

View File

@ -1,6 +1,6 @@
ENABLED <> Player Analytics Enabled.
DISABLED <> Player Analytics Disabled.
RELOAD_COMPLETE <> §a[Plan] Reload complete.
RELOAD_COMPLETE <> <EFBFBD>a[Plan] Reload complete.
CACHE_SAVE <> Saving cached data..
CACHE_ADD <> Added REPLACE0 to Cache.
CACHE_REMOVE <> Cleared REPLACE0 from Cache.
@ -13,19 +13,19 @@ DB_CONNECTION_FAIL <> REPLACE0-Database Connection failed: REPLACE1
DB_ESTABLISHED <> REPLACE0-database connection established.
DB_TYPE_DOES_NOT_EXIST <> That database type doesn't exist.
DB_FAILURE_DISABLE <> Database initialization has failed, disabling Plan.
NOTIFY_EMPTY_IP <> §e[Plan] IP in server.properties is empty & AlternativeServerIP is not used, incorrect links will be given!
VERSION_NEW_AVAILABLE <> New Version (REPLACE0) is availible at https://www.spigotmc.org/resources/plan-player-analytics.32536/
NOTIFY_EMPTY_IP <> <EFBFBD>e[Plan] IP in server.properties is empty & AlternativeServerIP is not used, incorrect links will be given!
VERSION_NEW_AVAILABLE <> New Version (REPLACE0) is available at https://www.spigotmc.org/resources/plan-player-analytics.32536/
VERSION_LATEST <> You're running the latest version
VERSION_CHECK_ERROR <> Failed to compare versions.
VERSION_FAIL <> Failed to get newest version number.
USERNAME_NOT_VALID <> §c[Plan] This Player doesn't exist.
USERNAME_NOT_SEEN <> §c[Plan] This Player has not played on this server.
USERNAME_NOT_KNOWN <> §c[Plan] Player not found from the database.
GRABBING_DATA_MESSAGE <> Ȥ2 Fetching data to cache..
USERNAME_NOT_VALID <> <EFBFBD>c[Plan] This Player doesn't exist.
USERNAME_NOT_SEEN <> <EFBFBD>c[Plan] This Player has not played on this server.
USERNAME_NOT_KNOWN <> <EFBFBD>c[Plan] Player not found from the database.
GRABBING_DATA_MESSAGE <> <EFBFBD><EFBFBD>2 Fetching data to cache..
DEM_UNKNOWN <> Not Known
NOT_IN_TOWN <> Not in a town
NOT_IN_FAC <> Not in a faction
COMMAND_TIMEOUT <> §c[Plan] REPLACE0 Command timed out! Error most likely on console.
COMMAND_TIMEOUT <> <EFBFBD>c[Plan] REPLACE0 Command timed out! Error most likely on console.
ANALYSIS_START <> Analysis | Beginning analysis of user data..
ANALYSIS_BOOT_NOTIFY <> Analysis | Boot analysis in 30 seconds..
ANALYSIS_BOOT <> Analysis | Starting Boot Analysis..
@ -36,44 +36,44 @@ ANALYSIS_FAIL_NO_DATA <> Analysis | Analysis failed, no data in the database.
ANALYSIS_BEGIN_ANALYSIS <> Analysis | Data Fetched, beginning Analysis of data..
ANALYSIS_COMPLETE <> Analysis | Analysis Complete.
DATA_CORRUPTION_WARN <> Some data might be corrupted: REPLACE0
ERROR_NO_DATA_VIEW <> §eWebserver disabled but Alternative IP/PlanLite not used, no way to view data!
ERROR_WEBSERVER_OFF_ANALYSIS <> §e[Plan] This command can be only used if the webserver is running on this server.
ERROR_WEBSERVER_OFF_INSPECT <> §e[Plan] This command can be only used if webserver/planlite is enabled on this server.
MANAGE_ERROR_INCORRECT_PLUGIN <> §c[Plan] Plugin not supported:
MANAGE_PROCESS_START <> Ȥ7 Processing data..
MANAGE_ERROR_PLUGIN_NOT_ENABLED <> §c[Plan] Plugin is not enabled:
MANAGE_ERROR_INCORRECT_DB <> §c[Plan] Incorrect database! (sqlite/mysql accepted):
MANAGE_ERROR_SAME_DB <> §c[Plan] Can't move to the same database!
MANAGE_DATABASE_FAILURE <> §c[Plan] One of the databases was not initialized properly.
MANAGE_DB_CONFIG_REMINDER <> §e[Plan] Remember to swap to the new database and reload plugin
MANAGE_ERROR_NO_PLAYERS <> §c[Plan] Database has no player data!
MANAGE_ERROR_BACKUP_FILE_NOT_FOUND <> §c[Plan] Backup file doesn't exist!
MANAGE_MOVE_SUCCESS <> §a[Plan] All data moved successfully!
MANAGE_COPY_SUCCESS <> §a[Plan] All data copied successfully!
MANAGE_PROCESS_FAIL <> §c[Plan] Something went wrong while processing the data!
MANAGE_CLEAR_SUCCESS <> §a[Plan] All data cleared successfully!
MANAGE_REMOVE_SUCCESS <> §f» §2Data of §fREPLACE0§2 was removed from Database §fREPLACE1§2.
MANAGE_IMPORTING <> §f» §2 Importing Data..
MANAGE_SUCCESS <> §f» §2 Success!
CMD_ANALYZE_HEADER <> §f»§2 Player Analytics - Analysis results
CMD_INSPECT_HEADER <> §f»§2 Player Analytics - Inspect results:
CMD_INFO_HEADER <> §f»§2 Player Analytics - Info
CMD_INFO_VERSION <> §7 •§2§2 Version: §7REPLACE0
CMD_SEARCH_HEADER <> §f»§2 Player Analytics - Search results for:
CMD_HELP_HEADER <> §f»§2 Player Analytics - Help
CMD_MANAGE_HELP_HEADER <> §f»§2 Player Analytics - Managment Help
CMD_MANAGE_STATUS_HEADER <> §f»§2 Player Analytics - Database status
CMD_MANAGE_STATUS_ACTIVE_DB <> §7 •§2§2 Active Database: §7REPLACE0
ERROR_NO_DATA_VIEW <> <EFBFBD>eWebserver disabled but Alternative IP/PlanLite not used, no way to view data!
ERROR_WEBSERVER_OFF_ANALYSIS <> <EFBFBD>e[Plan] This command can be only used if the webserver is running on this server.
ERROR_WEBSERVER_OFF_INSPECT <> <EFBFBD>e[Plan] This command can be only used if webserver/planlite is enabled on this server.
MANAGE_ERROR_INCORRECT_PLUGIN <> <EFBFBD>c[Plan] Plugin not supported:
MANAGE_PROCESS_START <> <EFBFBD><EFBFBD>7 Processing data..
MANAGE_ERROR_PLUGIN_NOT_ENABLED <> <EFBFBD>c[Plan] Plugin is not enabled:
MANAGE_ERROR_INCORRECT_DB <> <EFBFBD>c[Plan] Incorrect database! (sqlite/mysql accepted):
MANAGE_ERROR_SAME_DB <> <EFBFBD>c[Plan] Can't move to the same database!
MANAGE_DATABASE_FAILURE <> <EFBFBD>c[Plan] One of the databases was not initialized properly.
MANAGE_DB_CONFIG_REMINDER <> <EFBFBD>e[Plan] Remember to swap to the new database and reload plugin
MANAGE_ERROR_NO_PLAYERS <> <EFBFBD>c[Plan] Database has no player data!
MANAGE_ERROR_BACKUP_FILE_NOT_FOUND <> <EFBFBD>c[Plan] Backup file doesn't exist!
MANAGE_MOVE_SUCCESS <> <EFBFBD>a[Plan] All data moved successfully!
MANAGE_COPY_SUCCESS <> <EFBFBD>a[Plan] All data copied successfully!
MANAGE_PROCESS_FAIL <> <EFBFBD>c[Plan] Something went wrong while processing the data!
MANAGE_CLEAR_SUCCESS <> <EFBFBD>a[Plan] All data cleared successfully!
MANAGE_REMOVE_SUCCESS <> <EFBFBD>f<EFBFBD> <20>2Data of <20>fREPLACE0<45>2 was removed from Database <20>fREPLACE1<45>2.
MANAGE_IMPORTING <> <EFBFBD>f<EFBFBD> <20>2 Importing Data..
MANAGE_SUCCESS <> <EFBFBD>f<EFBFBD> <20>2 Success!
CMD_ANALYZE_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Analysis results
CMD_INSPECT_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Inspect results:
CMD_INFO_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Info
CMD_INFO_VERSION <> <EFBFBD>7 <20><>2<EFBFBD>2 Version: <20>7REPLACE0
CMD_SEARCH_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Search results for:
CMD_HELP_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Help
CMD_MANAGE_HELP_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Managment Help
CMD_MANAGE_STATUS_HEADER <> <EFBFBD>f<EFBFBD><EFBFBD>2 Player Analytics - Database status
CMD_MANAGE_STATUS_ACTIVE_DB <> <EFBFBD>7 <20><>2<EFBFBD>2 Active Database: <20>7REPLACE0
CMD_CLICK_ME <> Click Me
CMD_LINK <> §7 •§2 Link: §f
CMD_RESULTS_AVAILABLE <> §7 Results will be available for §fREPLACE0§7 minutes.
CMD_NO_RESULTS <> §7 •§2 No results for §7REPLACE0§2.
CMD_MATCH <> §7 Matching player: §f
CMD_LINK <> <EFBFBD>7 <20><>2 Link: <20>f
CMD_RESULTS_AVAILABLE <> <EFBFBD>7 Results will be available for <20>fREPLACE0<45>7 minutes.
CMD_NO_RESULTS <> <EFBFBD>7 <20><>2 No results for <20>7REPLACE0<45>2.
CMD_MATCH <> <EFBFBD>7 Matching player: <20>f
CMD_USG_ANALYZE <> View the Server Analysis
CMD_USG_HELP <> Show command list.
CMD_USG_INFO <> View Version of Plan
CMD_USG_INSPECT <> Inspect Player's Data
CMD_USG_MANAGE <> Database managment command
CMD_USG_MANAGE <> Database management command
CMD_USG_MANAGE_BACKUP <> Backup a database to .db file
CMD_USG_MANAGE_RESTORE <> Restore a database from a backup file
CMD_USG_MANAGE_MOVE <> Copy data from one database to another & overwrite values
@ -82,7 +82,7 @@ CMD_USG_MANAGE_IMPORT <> Import Data from supported plugins to Active Database.
CMD_USG_MANAGE_CLEAR <> Clear data from one database
CMD_USG_MANAGE_REMOVE <> Remove players's data from the Active Database.
CMD_USG_MANAGE_STATUS <> Check the status of the Active Database.
CMD_USG_MANAGE_HELP <> Show managment help.
CMD_USG_MANAGE_HELP <> Show management help.
CMD_USG_MANAGE_HOTSWAP <> Hotswap to another database & restart the plugin
CMD_USG_RELOAD <> Reload plugin config & save cached data
CMD_USG_SEARCH <> Search for player
@ -101,11 +101,11 @@ WARN_REWRITE <> Data in REPLACE0-database will be rewritten!
WARN_OVERWRITE <> Data in REPLACE0-database will be overwritten!
WARN_OVERWRITE_SOME <> Some data in REPLACE0-database will be overwritten!
WARN_REMOVE <> Data in REPLACE0-database will be removed!
COMMAND_SENDER_NOT_PLAYER <> §c[Plan] This command can be only used as a player.
COMMAND_REQUIRES_ARGUMENTS <> §c[Plan] Command requires arguments. REPLACE0
COMMAND_ADD_CONFIRMATION_ARGUMENT <> §c[Plan] Add -a to confirm execution! REPLACE0
COMMAND_REQUIRES_ARGUMENTS_ONE <> §c[Plan] Command requires one argument.
COMMAND_NO_PERMISSION <> §c[Plan] You do not have the required permmission.
COMMAND_SENDER_NOT_PLAYER <> <EFBFBD>c[Plan] This command can be only used as a player.
COMMAND_REQUIRES_ARGUMENTS <> <EFBFBD>c[Plan] Command requires arguments. REPLACE0
COMMAND_ADD_CONFIRMATION_ARGUMENT <> <EFBFBD>c[Plan] Add -a to confirm execution! REPLACE0
COMMAND_REQUIRES_ARGUMENTS_ONE <> <EFBFBD>c[Plan] Command requires one argument.
COMMAND_NO_PERMISSION <> <EFBFBD>c[Plan] You do not have the required permission.
<<<<<<HTML>>>>>>
WARN_INACCURATE <> <div class="warn">Data might be inaccurate, player has just registered.</div>
BANNED <> | <span class="darkred">Banned</span>

View File

@ -46,7 +46,9 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.djrapitops.nmplayer.NMPlayer</exec.args>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath
com.djrapitops.nmplayer.NMPlayer
</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.djrapitops</groupId>

View File

@ -4,7 +4,7 @@ import java.util.Collection;
/**
* This class manages the messages going to the Console Logger.
*
* <p>
* Methods of Abstract Plugin Framework log utility are used.
*
* @author Rsl1122
@ -52,7 +52,7 @@ public class Log {
* Logs trace of caught Exception to Errors.txt and notifies on console.
*
* @param source Class name the exception was caught in.
* @param e Throwable, eg NullPointerException
* @param e Throwable, eg NullPointerException
*/
public static void toLog(String source, Throwable e) {
Plan.getInstance().getPluginLogger().toLog(source, e);
@ -62,7 +62,7 @@ public class Log {
* Logs multiple caught Errors to Errors.txt.
*
* @param source Class name the exception was caught in.
* @param e Collection of Throwables, eg NullPointerException
* @param e Collection of Throwables, eg NullPointerException
*/
public static void toLog(String source, Collection<Throwable> e) {
Plan.getInstance().getPluginLogger().toLog(source, e);
@ -71,7 +71,7 @@ public class Log {
/**
* Logs a message to the a given file with a timestamp.
*
* @param message Message to log to Errors.txt [timestamp] Message
* @param message Message to log to Errors.txt [timestamp] Message
* @param filename Name of the file to write to.
*/
public static void toLog(String message, String filename) {

View File

@ -44,7 +44,7 @@ public enum Permissions {
/**
* Returns the permission node in plugin.yml.
*
* <p>
* Same as getPermission.
*
* @return permission node eg. plan.inspect

View File

@ -1,12 +1,13 @@
package main.java.com.djrapitops.plan;
import org.bukkit.ChatColor;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import org.bukkit.ChatColor;
/**
* Phrase contains every message that is used in placeholders or commands. The
@ -44,7 +45,7 @@ public enum Phrase {
CACHE_GETTASK_DISABLED("Attempted to schedule data grab after task was shut down."),
CACHE_CLEARTASK_DISABLED("Attempted to schedule data for clear after task was shut down."),
//
VERSION_NEW_AVAILABLE("New Version (" + REPLACE0 + ") is availible at https://www.spigotmc.org/resources/plan-player-analytics.32536/"),
VERSION_NEW_AVAILABLE("New Version (" + REPLACE0 + ") is available at https://www.spigotmc.org/resources/plan-player-analytics.32536/"),
VERSION_LATEST("You're running the latest version"),
VERSION_CHECK_ERROR("Failed to compare versions."),
VERSION_FAIL("Failed to get newest version number."),
@ -82,7 +83,7 @@ public enum Phrase {
ERROR_CONSOLE_PLAYER("This point of code should not be accessable on console. Inform author: " + REPLACE0 + " Console: REPLACE1"),
ERROR_NO_DATA_VIEW(ChatColor.YELLOW + "Webserver disabled but Alternative IP/PlanLite not used, no way to view data!"),
ERROR_WEBSERVER_OFF_ANALYSIS(ChatColor.YELLOW + "" + PREFIX + "This command can be only used if the webserver is running on this server."),
ERROR_WEBSERVER_OFF_INSPECT(ChatColor.YELLOW + "" + PREFIX + "This command can be only used if webserver/planlite is enabled on this server."),
ERROR_WEBSERVER_OFF_INSPECT(ChatColor.YELLOW + "" + PREFIX + "This command can be only used if webserver is enabled on this server."),
ERROR_LOGGED("Caught " + REPLACE0 + ". It has been logged to the Errors.txt"),
ERROR_SESSIONDATA_INITIALIZATION("Player's session was initialized in a wrong way! (" + REPLACE0 + ")"),
ERROR_ANALYSIS_FETCH_FAIL("Failed to fetch data for Analysis, Exception occurred."),
@ -134,7 +135,7 @@ public enum Phrase {
CMD_USG_INFO("View Version of Plan"),
CMD_USG_INSPECT("Inspect Player's Data"),
CMD_USG_QINSPECT("QuickInspect Player's Data"),
CMD_USG_MANAGE("Database managment command"),
CMD_USG_MANAGE("Database management command"),
CMD_USG_MANAGE_BACKUP("Backup a database to .db file"),
CMD_USG_MANAGE_RESTORE("Restore a database from a backup file"),
CMD_USG_MANAGE_MOVE("Copy data from one database to another & overwrite values"),
@ -144,7 +145,7 @@ public enum Phrase {
CMD_USG_MANAGE_CLEAN("Clear incorrect data from the database"),
CMD_USG_MANAGE_REMOVE("Remove players's data from the Active Database."),
CMD_USG_MANAGE_STATUS("Check the status of the Active Database."),
CMD_USG_MANAGE_HELP("Show managment help."),
CMD_USG_MANAGE_HELP("Show management help."),
CMD_USG_MANAGE_HOTSWAP("Hotswap to another database & restart the plugin"),
CMD_USG_RELOAD("Reload plugin config & save cached data"),
CMD_USG_SEARCH("Search for player"),
@ -171,7 +172,7 @@ public enum Phrase {
COMMAND_REQUIRES_ARGUMENTS(ChatColor.RED + "" + PREFIX + "Command requires arguments. REPLACE0"),
COMMAND_ADD_CONFIRMATION_ARGUMENT(ChatColor.RED + "" + PREFIX + "Add -a to confirm execution! REPLACE0"),
COMMAND_REQUIRES_ARGUMENTS_ONE(ChatColor.RED + "" + PREFIX + "Command requires one argument."),
COMMAND_NO_PERMISSION(ChatColor.RED + "" + PREFIX + "You do not have the required permmission."),
COMMAND_NO_PERMISSION(ChatColor.RED + "" + PREFIX + "You do not have the required permission."),
ERROR_TOO_SMALL_QUEUE("Queue size is too small! (REPLACE0), change the setting to a higher number! (Currently REPLACE1)");
private String text;
@ -187,6 +188,32 @@ public enum Phrase {
this.text = "";
}
static void loadLocale(File localeFile) {
try {
Scanner localeScanner = new Scanner(localeFile, "UTF-8");
List<String> localeRows = new ArrayList<>();
while (localeScanner.hasNextLine()) {
String line = localeScanner.nextLine();
if (!line.isEmpty()) {
if ("<<<<<<HTML>>>>>>".equals(line)) {
break;
}
localeRows.add(line);
}
}
for (String localeRow : localeRows) {
try {
String[] split = localeRow.split(" <> ");
Phrase.valueOf(split[0]).setText(split[1]);
} catch (IllegalArgumentException e) {
Log.error("There is a miswritten line in locale on line " + localeRows.indexOf(localeRow));
}
}
} catch (IOException e) {
}
}
@Override
public String toString() {
return text;
@ -241,30 +268,4 @@ public enum Phrase {
public void setColor(char colorCode) {
this.color = ChatColor.getByChar(colorCode);
}
static void loadLocale(File localeFile) {
try {
Scanner localeScanner = new Scanner(localeFile, "UTF-8");
List<String> localeRows = new ArrayList<>();
while (localeScanner.hasNextLine()) {
String line = localeScanner.nextLine();
if (!line.isEmpty()) {
if ("<<<<<<HTML>>>>>>".equals(line)) {
break;
}
localeRows.add(line);
}
}
for (String localeRow : localeRows) {
try {
String[] split = localeRow.split(" <> ");
Phrase.valueOf(split[0]).setText(split[1]);
} catch (IllegalArgumentException e) {
Log.error("There is a miswritten line in locale on line " + localeRows.indexOf(localeRow));
}
}
} catch (IOException e) {
}
}
}

View File

@ -52,7 +52,7 @@ import java.util.concurrent.ScheduledExecutorService;
/**
* Main class for Bukkit that manages the plugin.
*
* <p>
* Everything can be accessed through this class. Use Plan.getInstance() to get
* the initialised instance of Plan.
*
@ -77,8 +77,32 @@ public class Plan extends BukkitPlugin<Plan> {
private int bootAnalysisTaskID = -1;
/**
* OnEnable method.
* Used to get the PlanAPI. @see API
*
* @return API of the current instance of Plan.
* @throws IllegalStateException If onEnable method has not been called on
* Plan and the instance is null.
*/
public static API getPlanAPI() throws IllegalStateException {
Plan instance = getInstance();
if (instance == null) {
throw new IllegalStateException("Plugin not enabled properly, Singleton instance is null.");
}
return instance.api;
}
/**
* Used to get the plugin-instance singleton.
*
* @return this object.
*/
public static Plan getInstance() {
return (Plan) getPluginInstance(Plan.class);
}
/**
* OnEnable method.
* <p>
* - Enables the plugin's subsystems.
*/
@Override
@ -182,7 +206,7 @@ public class Plan extends BukkitPlugin<Plan> {
/**
* Disables the plugin.
*
* <p>
* Stops the webserver, cancels all tasks and saves cache to the database.
*/
@Override
@ -233,7 +257,7 @@ public class Plan extends BukkitPlugin<Plan> {
/**
* Initializes the database according to settings in the config.
*
* <p>
* If database connection can not be established plugin is disabled.
*
* @return true if init was successful, false if not.
@ -414,7 +438,7 @@ public class Plan extends BukkitPlugin<Plan> {
/**
* Used to get all possible database objects.
*
* <p>
* #init() might need to be called in order for the object to function.
*
* @return Set containing the SqLite and MySQL objects.
@ -446,35 +470,11 @@ public class Plan extends BukkitPlugin<Plan> {
/**
* Old method for getting the API.
*
* @deprecated Use Plan.getPlanAPI() (static method) instead.
* @return the Plan API.
* @deprecated Use Plan.getPlanAPI() (static method) instead.
*/
@Deprecated
public API getAPI() {
return api;
}
/**
* Used to get the PlanAPI. @see API
*
* @return API of the current instance of Plan.
* @throws IllegalStateException If onEnable method has not been called on
* Plan and the instance is null.
*/
public static API getPlanAPI() throws IllegalStateException {
Plan instance = getInstance();
if (instance == null) {
throw new IllegalStateException("Plugin not enabled properly, Singleton instance is null.");
}
return instance.api;
}
/**
* Used to get the plugin-instance singleton.
*
* @return this object.
*/
public static Plan getInstance() {
return (Plan) getPluginInstance(Plan.class);
}
}

View File

@ -23,7 +23,9 @@ public class ServerVariableHolder {
public ServerVariableHolder(Server server) {
maxPlayers = server.getMaxPlayers();
ip = server.getIp();
usingPaper = server.getName().equals("Paper");
String serverName = server.getName();
usingPaper = serverName.equals("Paper") || serverName.equals("TacoSpigot");
}
/**

View File

@ -25,20 +25,20 @@ import java.util.stream.Collectors;
/**
* This class contains the API methods.
*
* <p>
* Methods can be called from Asynchronous task and are thread safe unless
* otherwise stated.
*
* <p>
* Use Plan.getPlanAPI() to get the API.
*
* <p>
* More information about API methods can be found on GitHub.
*
* @author Rsl1122
* @since 2.0.0
* @see PluginData
* @see AnalysisType
* @see DBCallableProcessor
* @see HandlingInfo
* @since 2.0.0
*/
public class API {
@ -65,12 +65,12 @@ public class API {
/**
* Add a source of plugin data to the Plugins tab on Analysis and/or Inspect
* page.
*
* <p>
* Refer to documentation on GitHub or Javadoc of PluginData to set-up a
* data source that extends PluginData correctly.
*
* @param dataSource an object that extends PluginData-object, thus allowing
* Analysis and Inspect to manage the data of a plugin correctly.
* Analysis and Inspect to manage the data of a plugin correctly.
* @see PluginData
*/
public void addPluginDataSource(PluginData dataSource) {
@ -81,10 +81,10 @@ public class API {
/**
* Used to get the link to InspectPage of a player.
*
* <p>
* This method is useful if you have a table and want to link to the inspect
* page.
*
* <p>
* Html.LINK.parse("Link", "Playername") can be used to get a link
* {@code <a href="Link">Playername</a>}
*
@ -98,12 +98,12 @@ public class API {
/**
* Schedule a UserData object to be fetched from the database or cache if
* the player is online.
*
* <p>
* The data will not be cached if it is not already cached.
*
* @param uuid UUID of the player.
* @param uuid UUID of the player.
* @param processor Object implementing DBCallableProcessor, which
* process (UserData data) method will be called.
* process (UserData data) method will be called.
*/
public void scheduleForGet(UUID uuid, DBCallableProcessor processor) {
plugin.getHandler().getUserDataForProcessing(processor, uuid, false);
@ -111,7 +111,7 @@ public class API {
/**
* Schedule a HandlingInfo object to be processed.
*
* <p>
* UserData associated with the UUID of the HandlingInfo object will be
* cached.
*
@ -123,11 +123,11 @@ public class API {
/**
* Used to cache a UserData object.
*
* <p>
* If data is already cached it will be overridden.
*
* @param data UserData object. Will be placed to the data.getUuid() key in
* the cache.
* the cache.
*/
public void placeDataToCache(UserData data) {
plugin.getHandler().cache(data);
@ -135,7 +135,7 @@ public class API {
/**
* Used to save the cached data to the database.
*
* <p>
* Should be only called from an Asynchronous thread.
*/
public void saveCachedData() {
@ -154,7 +154,7 @@ public class API {
/**
* Cache the UserData to InspectCache.
*
* <p>
* Uses cache if data is cached or database if not. Call from an Asynchronous
* thread.
*
@ -166,7 +166,7 @@ public class API {
/**
* Used to get the full Html of the Inspect page as a string.
*
* <p>
* Check if the data is cached to InspectCache before calling this.
*
* @param uuid UUID of the player.
@ -193,7 +193,7 @@ public class API {
/**
* Run's the analysis with the current data in the cache and fetches rest
* from the database.
*
* <p>
* Starts a new Asynchronous task to run the analysis.
*/
public void updateAnalysisCache() {
@ -202,7 +202,7 @@ public class API {
/**
* Used to get the full HTML of the Analysis page as a string.
*
* <p>
* Check if the data is cached to AnalysisCache before calling this.
*
* @return analysis.html with all placeholders replaced.
@ -218,7 +218,7 @@ public class API {
/**
* Used to get the AnalysisData object.
*
* <p>
* Check if the data is cached to AnalysisCache before calling this.
*
* @return AnalysisData object.
@ -234,8 +234,8 @@ public class API {
* @param uuid UUID of the player.
* @return Playername, eg "Rsl1122"
* @throws IllegalArgumentException If uuid is null.
* @throws IllegalStateException If the player has not played on the server
* before.
* @throws IllegalStateException If the player has not played on the server
* before.
*/
public String getPlayerName(UUID uuid) throws IllegalStateException, IllegalArgumentException {
Verify.nullCheck(uuid);
@ -259,7 +259,7 @@ public class API {
/**
* Get the saved UUIDs in the database.
*
* <p>
* Should be called from async thread.
*
* @return Collection of UUIDs that can be found in the database.
@ -272,9 +272,9 @@ public class API {
/**
* Get the saved UserData in the database for a collection of UUIDs.
*
* <p>
* Will not contain data for UUIDs not found in the database.
*
* <p>
* Should be called from async thread.
*
* @param uuids Collection of UUIDs that can be found in the database.
@ -288,7 +288,7 @@ public class API {
/**
* Get the cached UserData objects in the InspectCache.
*
* <p>
* This can be used with PluginData objects safely to get the data for all
* users in Plan database, because all data is InspectCached before analysis
* begins.
@ -302,7 +302,7 @@ public class API {
/**
* Get the cached UserData objects in the InspectCache in a Map form.
*
* <p>
* This can be used with PluginData objects safely to get the data for all
* users in Plan database, because all data is InspectCached before analysis
* begins.

View File

@ -9,9 +9,9 @@ import main.java.com.djrapitops.plan.command.commands.*;
/**
* TreeCommand for the /plan command, and all subcommands.
*
* <p>
* Uses the Abstract Plugin Framework for easier command management.
*
*
* @author Rsl1122
* @since 1.0.0
*/
@ -19,7 +19,7 @@ public class PlanCommand extends TreeCommand<Plan> {
/**
* CommandExecutor class Constructor.
*
* <p>
* Initializes Subcommands
*
* @param plugin Current instance of Plan

View File

@ -6,11 +6,7 @@ import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.Settings;
import main.java.com.djrapitops.plan.*;
import main.java.com.djrapitops.plan.command.ConditionUtils;
import main.java.com.djrapitops.plan.data.cache.AnalysisCacheHandler;
import main.java.com.djrapitops.plan.ui.text.TextUI;
@ -110,7 +106,7 @@ public class AnalyzeCommand extends SubCommand {
/**
* Used to send the message after /plan analysis.
*
* <p>
* Final because
*
* @param sender Command sender.
@ -132,7 +128,7 @@ public class AnalyzeCommand extends SubCommand {
sendLink(sender, url);
}
}
sender.sendMessage(Phrase.CMD_FOOTER + "");
sender.sendMessage(Phrase.CMD_FOOTER.toString());
}
@Deprecated // TODO Will be rewritten to the RslPlugin abstractions in the future.
@ -140,6 +136,6 @@ public class AnalyzeCommand extends SubCommand {
plugin.getServer().dispatchCommand(
Bukkit.getConsoleSender(),
"tellraw " + sender.getName() + " [\"\",{\"text\":\"" + Phrase.CMD_CLICK_ME + "\",\"underlined\":true,"
+ "\"clickEvent\":{\"action\":\"open_url\",\"value\":\"" + url + "\"}}]");
+ "\"clickEvent\":{\"action\":\"open_url\",\"value\":\"" + url + "\"}}]");
}
}

View File

@ -34,11 +34,11 @@ public class InfoCommand extends SubCommand {
public boolean onCommand(ISender sender, String commandLabel, String[] args) {
ChatColor tColor = Phrase.COLOR_SEC.color();
String[] messages = {
Phrase.CMD_INFO_HEADER.toString(),
Phrase.CMD_INFO_VERSION.parse(plugin.getDescription().getVersion()),
Phrase.CMD_BALL.toString() + tColor + " " + Version.checkVersion(plugin),
Phrase.CMD_MANAGE_STATUS_ACTIVE_DB.parse(plugin.getDB().getConfigName()),
Phrase.CMD_FOOTER.toString()
Phrase.CMD_INFO_HEADER.toString(),
Phrase.CMD_INFO_VERSION.parse(plugin.getDescription().getVersion()),
Phrase.CMD_BALL.toString() + tColor + " " + Version.checkVersion(plugin),
Phrase.CMD_MANAGE_STATUS_ACTIVE_DB.parse(plugin.getDB().getConfigName()),
Phrase.CMD_FOOTER.toString()
};
sender.sendMessage(messages);
return true;

View File

@ -141,6 +141,6 @@ public class InspectCommand extends SubCommand {
plugin.getServer().dispatchCommand(
Bukkit.getConsoleSender(),
"tellraw " + sender.getName() + " [\"\",{\"text\":\"" + Phrase.CMD_CLICK_ME + "\",\"underlined\":true,"
+ "\"clickEvent\":{\"action\":\"open_url\",\"value\":\"" + url + "\"}}]");
+ "\"clickEvent\":{\"action\":\"open_url\",\"value\":\"" + url + "\"}}]");
}
}

View File

@ -15,9 +15,9 @@ import org.bukkit.command.CommandException;
/**
* Command used to display link to the player list webpage.
*
* <p>
* Subcommand is not registered if Webserver is not enabled.
*
*
* @author Rsl1122
* @since 3.5.2
*/
@ -66,6 +66,6 @@ public class ListCommand extends SubCommand {
plugin.getServer().dispatchCommand(
Bukkit.getConsoleSender(),
"tellraw " + sender.getName() + " [\"\",{\"text\":\"" + Phrase.CMD_CLICK_ME + "\",\"underlined\":true,"
+ "\"clickEvent\":{\"action\":\"open_url\",\"value\":\"" + url + "\"}}]");
+ "\"clickEvent\":{\"action\":\"open_url\",\"value\":\"" + url + "\"}}]");
}
}

View File

@ -9,7 +9,7 @@ import main.java.com.djrapitops.plan.command.commands.manage.*;
/**
* This command is used to manage the database of the plugin.
*
* <p>
* No arguments will run ManageHelpCommand. Contains subcommands.
*
* @author Rsl1122

View File

@ -6,7 +6,6 @@ import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import java.util.UUID;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
@ -18,6 +17,8 @@ import main.java.com.djrapitops.plan.utilities.Check;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import main.java.com.djrapitops.plan.utilities.uuid.UUIDUtility;
import java.util.UUID;
/**
* This command is used to cache UserData to InspectCache and to view some of
* the data in game.

View File

@ -17,11 +17,11 @@ import org.bukkit.ChatColor;
/**
* Command for registering web users.
*
* <p>
* Registers a new webuser to the database.
*
* <p>
* No permission required for self registration. (Constructor string is empty)
*
* <p>
* plan.webmanage required for registering other users.
*
* @author Rsl1122

View File

@ -5,7 +5,7 @@ import java.util.logging.LogRecord;
/**
* Filters out WebUser registration command logs.
*
*
* @author Rsl1122
* @since 3.5.2
*/
@ -14,10 +14,10 @@ public class RegisterCommandFilter implements Filter {
@Override
public boolean isLoggable(LogRecord record) {
String message = record.getMessage();
boolean block = message.contains("command: /plan register")
|| message.contains("command: /plan web register")
|| message.contains("command: /plan webuser register");
boolean block = message.contains("command: /plan register")
|| message.contains("command: /plan web register")
|| message.contains("command: /plan webuser register");
return !block;
}
}

View File

@ -23,7 +23,7 @@ public class ReloadCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public ReloadCommand(Plan plugin) {
super("reload", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_RELOAD + "");
super("reload", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_RELOAD.toString());
this.plugin = plugin;
}
@ -33,7 +33,7 @@ public class ReloadCommand extends SubCommand {
plugin.onDisable();
plugin.reloadConfig();
plugin.onEnable();
sender.sendMessage(Phrase.RELOAD_COMPLETE + "");
sender.sendMessage(Phrase.RELOAD_COMPLETE.toString());
return true;
}

View File

@ -5,14 +5,15 @@ import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.FormattingUtils;
import java.util.Arrays;
import java.util.List;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.utilities.Check;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import java.util.Arrays;
import java.util.List;
/**
* This subcommand is used to search for a user, and to view all matches' data.
*
@ -57,7 +58,7 @@ public class SearchCommand extends SubCommand {
} else {
sender.sendMessage(Phrase.CMD_MATCH + "" + FormattingUtils.collectionToStringNoBrackets(names));
}
sender.sendMessage(Phrase.CMD_FOOTER + "");
sender.sendMessage(Phrase.CMD_FOOTER.toString());
} finally {
this.cancel();
}

View File

@ -21,7 +21,7 @@ import java.util.stream.Collectors;
/**
* This manage subcommand is used to import data from 3rd party plugins.
*
* <p>
* Supported plugins (v3.0.0) : OnTime
*
* @author Rsl1122

View File

@ -18,7 +18,7 @@ import java.util.UUID;
/**
* This manage subcommand is used to move all data from one database to another.
*
* <p>
* Destination database will be cleared.
*
* @author Rsl1122

View File

@ -30,13 +30,13 @@ public class ManageStatusCommand extends SubCommand {
@Override
public boolean onCommand(ISender sender, String commandLabel, String[] args) {
String[] messages = new String[]{
Phrase.CMD_MANAGE_STATUS_HEADER.toString(),
Phrase.CMD_MANAGE_STATUS_ACTIVE_DB.parse(plugin.getDB().getConfigName()),
Phrase.CMD_MANAGE_STATUS_QUEUE_PROCESS.parse("" + plugin.getHandler().getProcessTask().size()),
Phrase.CMD_MANAGE_STATUS_QUEUE_SAVE.parse("" + plugin.getHandler().getSaveTask().size()),
Phrase.CMD_MANAGE_STATUS_QUEUE_GET.parse("" + plugin.getHandler().getGetTask().size()),
Phrase.CMD_MANAGE_STATUS_QUEUE_CLEAR.parse("" + plugin.getHandler().getClearTask().size()),
Phrase.CMD_FOOTER.toString()
Phrase.CMD_MANAGE_STATUS_HEADER.toString(),
Phrase.CMD_MANAGE_STATUS_ACTIVE_DB.parse(plugin.getDB().getConfigName()),
Phrase.CMD_MANAGE_STATUS_QUEUE_PROCESS.parse("" + plugin.getHandler().getProcessTask().size()),
Phrase.CMD_MANAGE_STATUS_QUEUE_SAVE.parse("" + plugin.getHandler().getSaveTask().size()),
Phrase.CMD_MANAGE_STATUS_QUEUE_GET.parse("" + plugin.getHandler().getGetTask().size()),
Phrase.CMD_MANAGE_STATUS_QUEUE_CLEAR.parse("" + plugin.getHandler().getClearTask().size()),
Phrase.CMD_FOOTER.toString()
};
sender.sendMessage(messages);

View File

@ -29,12 +29,12 @@ public class WebLevelCommand extends SubCommand {
String sCol = cs.getSecondaryColor();
String cmdBall = Phrase.CMD_BALL.parse();
String[] messages = new String[]{
Phrase.CMD_FOOTER.parse(),
cmdBall + sCol + "0: Access all pages",
cmdBall + sCol + "1: Access '/players' and all inspect pages",
cmdBall + sCol + "2: Access inspect page with the same username as the webuser",
cmdBall + sCol + "3+: No permissions",
Phrase.CMD_FOOTER.parse()
Phrase.CMD_FOOTER.parse(),
cmdBall + sCol + "0: Access all pages",
cmdBall + sCol + "1: Access '/players' and all inspect pages",
cmdBall + sCol + "2: Access inspect page with the same username as the webuser",
cmdBall + sCol + "3+: No permissions",
Phrase.CMD_FOOTER.parse()
};
sender.sendMessage(messages);
return true;

View File

@ -13,12 +13,12 @@ import java.util.Map;
/**
* Big container object for Data.
*
* <p>
* Contains parts that can be analysed. Each part has their own purpose.
*
* <p>
* Parts contain variables that can be added to. These variables are then
* analysed using the analysis method.
*
* <p>
* After being analysed the ReplaceMap can be retrieved for replacing
* placeholders on the analysis.html file.
*
@ -27,14 +27,6 @@ import java.util.Map;
*/
public class AnalysisData extends RawData<AnalysisData> {
private long refreshDate;
private String planVersion;
private String pluginsTabLayout;
private Map<String, String> additionalDataReplaceMap;
private String playersTable;
private final ActivityPart activityPart;
private final CommandUsagePart commandUsagePart;
private final GamemodePart gamemodePart;
@ -44,6 +36,11 @@ public class AnalysisData extends RawData<AnalysisData> {
private final PlayerCountPart playerCountPart;
private final PlaytimePart playtimePart;
private final TPSPart tpsPart;
private long refreshDate;
private String planVersion;
private String pluginsTabLayout;
private Map<String, String> additionalDataReplaceMap;
private String playersTable;
public AnalysisData(Map<String, Integer> commandUsage, List<TPS> tpsData) {
commandUsagePart = new CommandUsagePart(commandUsage);
@ -95,9 +92,9 @@ public class AnalysisData extends RawData<AnalysisData> {
public List<RawData> getAllParts() {
return Arrays.asList(new RawData[]{
activityPart, commandUsagePart, gamemodePart,
geolocationPart, joinInfoPart, killPart,
playerCountPart, playtimePart, tpsPart
activityPart, commandUsagePart, gamemodePart,
geolocationPart, joinInfoPart, killPart,
playerCountPart, playtimePart, tpsPart
});
}
@ -125,10 +122,6 @@ public class AnalysisData extends RawData<AnalysisData> {
this.additionalDataReplaceMap = additionalDataReplaceMap;
}
public void setRefreshDate(long refreshDate) {
this.refreshDate = refreshDate;
}
public void setPlayersTable(String playersTable) {
this.playersTable = playersTable;
}
@ -166,4 +159,8 @@ public class AnalysisData extends RawData<AnalysisData> {
public long getRefreshDate() {
return refreshDate;
}
public void setRefreshDate(long refreshDate) {
this.refreshDate = refreshDate;
}
}

View File

@ -19,10 +19,10 @@ public class KillData {
/**
* Creates a KillData object with given parameters.
*
* @param victim UUID of the victim.
* @param victim UUID of the victim.
* @param victimID ID of the victim, get from the database.
* @param weapon Weapon used.
* @param date Epoch millisecond at which the kill occurred.
* @param weapon Weapon used.
* @param date Epoch millisecond at which the kill occurred.
*/
public KillData(UUID victim, int victimID, String weapon, long date) {
this.victim = victim;

View File

@ -25,7 +25,7 @@ public class SessionData {
* Creates a new session with given start and end.
*
* @param sessionStart Epoch millisecond the session was started.
* @param sessionEnd Epoch millisecond the session ended.
* @param sessionEnd Epoch millisecond the session ended.
*/
public SessionData(long sessionStart, long sessionEnd) {
this.sessionStart = sessionStart;
@ -44,7 +44,7 @@ public class SessionData {
/**
* Ends the session with given end point.
*
* <p>
* (Changes the end to the parameter.).
*
* @param endOfSession Epoch millisecond the session ended.

View File

@ -6,7 +6,7 @@
package main.java.com.djrapitops.plan.data;
/**
* Class containing single datapoint of TPS/players online.
* Class containing single datapoint of TPS / Players online / CPU Usage / Used Memory / Entity Count / Chunks loaded.
*
* @author Rsl1122
* @since 3.5.0
@ -17,20 +17,29 @@ public class TPS {
private final double tps;
private final int players;
private final double cpuUsage;
private final long usedMemory;
private final int entityCount;
private final int chunksLoaded;
/**
* Constructor.
*
* @param date time of the average calculation.
* @param tps average tps for the last minute.
* @param players average players for the last minute.
* @param cpuUsage average CPU usage for the last minute.
* @param date time of the TPS calculation.
* @param tps average tps for the last minute.
* @param players players for the minute.
* @param cpuUsage CPU usage for the minute
* @param usedMemory used memory at the time of fetching
* @param entityCount amount of entities at the time of fetching
* @param chunksLoaded amount of chunks loaded at the time of fetching
*/
public TPS(long date, double tps, int players, double cpuUsage) {
public TPS(long date, double tps, int players, double cpuUsage, long usedMemory, int entityCount, int chunksLoaded) {
this.date = date;
this.tps = tps;
this.players = players;
this.cpuUsage = cpuUsage;
this.usedMemory = usedMemory;
this.entityCount = entityCount;
this.chunksLoaded = chunksLoaded;
}
/**
@ -52,7 +61,7 @@ public class TPS {
}
/**
* Get the average players for the minute.
* Get the player for the time, when the data was fetched.
*
* @return Players online.
*/
@ -61,14 +70,41 @@ public class TPS {
}
/**
* Get the average CPU Usage for the minute.
* Get the average CPU Usage for the minute
*
* @return 0-20 double
* @return 0-100 double
*/
public double getCPUUsage() {
return cpuUsage;
}
/**
* Get the used memory for the time, when the data was fetched.
*
* @return Used Memory in Megabyte
*/
public long getUsedMemory() {
return usedMemory;
}
/**
* Get the amount of entities for the time, when the data was fetched
*
* @return Amount of entities
*/
public int getEntityCount() {
return entityCount;
}
/**
* Get the amount of chunks loaded for the time, when the data was fetched
*
* @return Amount of chunks loaded
*/
public int getChunksLoaded() {
return chunksLoaded;
}
@Override
public int hashCode() {
int hash = 3;

View File

@ -16,9 +16,9 @@ import java.util.stream.Collectors;
*/
public class UserData {
private final List<SessionData> sessions;
private int accessing;
private boolean clearAfterSave;
private UUID uuid;
private Set<InetAddress> ips;
private Set<String> nicknames;
@ -34,37 +34,33 @@ public class UserData {
private boolean isOp;
private boolean isBanned;
private String geolocation;
private int mobKills;
private List<KillData> playerKills;
private int deaths;
private String name;
private boolean isOnline;
private SessionData currentSession;
private final List<SessionData> sessions;
/**
* Creates a new UserData object with given values and default values.
*
* <p>
* Some variables are left uninitialized: isBanned, lastPlayed, playTime,
* loginTimes, timesKicked, lastGmSwapTime, mobKills, deaths and
* currentSession.
*
* <p>
* These variables need to be set with setters.
*
* <p>
* All Collections are left empty: locations, nicknames, ips, sessions,
* playerKills. Because nicknames is empty, lastNick is an empty string.
*
* <p>
* gmTimes HashMap will contain 4 '0L' values: SURVIVAL, CREATIVE,
* ADVENTURE, SPECTATOR
*
* @param uuid UUID of the player
* @param reg Epoch millisecond the player registered.
* @param op Is the player op? (true/false)
* @param uuid UUID of the player
* @param reg Epoch millisecond the player registered.
* @param op Is the player op? (true/false)
* @param lastGM last GameMode the player was seen in.
* @param name Name of the player.
* @param name Name of the player.
* @param online Is the player online?
*/
public UserData(UUID uuid, long reg, boolean op, String lastGM, String name, boolean online) {
@ -90,15 +86,15 @@ public class UserData {
/**
* Creates a new UserData object with the variables inside a Player object.
*
* <p>
* Some variables are left uninitialized: lastPlayed, playTime, loginTimes,
* timesKicked, lastGmSwapTime, mobKills, deaths and currentSession.
*
* <p>
* These variables need to be set with setters.
*
* <p>
* All Collections are left empty: locations, nicknames, ips, sessions,
* playerKills. Because nicknames is empty, lastNick is an empty string.
*
* <p>
* gmTimes HashMap will contain 4 '0L' values: SURVIVAL, CREATIVE,
* ADVENTURE, SPECTATOR
*
@ -118,19 +114,19 @@ public class UserData {
/**
* Creates a new UserData object with the variables inside a OfflinePlayer
* object.
*
* <p>
* Some variables are left uninitialized: location, lastPlayed, playTime,
* loginTimes, timesKicked, lastGmSwapTime, mobKills, deaths and
* currentSession.
*
* <p>
* These variables need to be set with setters.
*
* <p>
* All Collections are left empty: locations, nicknames, ips, sessions,
* playerKills. Because nicknames is empty, lastNick is an empty string.
*
* <p>
* gmTimes HashMap will contain 4 '0L' values: SURVIVAL, CREATIVE,
* ADVENTURE, SPECTATOR
*
* <p>
* lastGM will be set as SURVIVAL
*
* @param player IOfflinePlayer object.
@ -215,9 +211,9 @@ public class UserData {
/**
* Adds a nickname to the nicknames Set.
*
* <p>
* null or empty values filtered.
*
* <p>
* lastNick will be set as the given parameter, if accepted.
*
* @param nick Displayname of the player.
@ -237,7 +233,7 @@ public class UserData {
/**
* Adds nicknames to the nicknames Set.
*
* <p>
* null or empty values filtered.
*
* @param addNicks Collection of nicknames.
@ -249,7 +245,7 @@ public class UserData {
/**
* Set a specific GameMode's millisecond value.
*
* @param gm Name of Gamemode.
* @param gm Name of Gamemode.
* @param time Milliseconds spent in the gamemode.
*/
public void setGMTime(String gm, long time) {
@ -264,8 +260,8 @@ public class UserData {
/**
* Set every GameMode's millisecond value.
*
* @param survivalTime ms spent in SURVIVAL
* @param creativeTime ms spent in CREATIVE
* @param survivalTime ms spent in SURVIVAL
* @param creativeTime ms spent in CREATIVE
* @param adventureTime ms spent in ADVENTURE
* @param spectatorTime ms spent in SPECTATOR
*/
@ -279,7 +275,7 @@ public class UserData {
/**
* Adds a new SessionData to the sessions list.
*
* <p>
* null and invalid sessions filtered.
*
* @param session SessionData object
@ -292,7 +288,7 @@ public class UserData {
/**
* Adds SessionData objects to the sessions list.
*
* <p>
* null and invalid sessions filtered.
*
* @param sessions Collection of SessionData objects.
@ -305,20 +301,9 @@ public class UserData {
this.sessions.addAll(filteredSessions);
}
/**
* Sets the current session.
*
* Currently unused.
*
* @param session SessionData object, no restrictions.
*/
public void setCurrentSession(SessionData session) {
currentSession = session;
}
/**
* Gets the current session.
*
* <p>
* Currently unused.
*
* @return SessionData object with a recent start.
@ -327,6 +312,17 @@ public class UserData {
return currentSession;
}
/**
* Sets the current session.
* <p>
* Currently unused.
*
* @param session SessionData object, no restrictions.
*/
public void setCurrentSession(SessionData session) {
currentSession = session;
}
/**
* Changes the value of isBanned.
*
@ -369,6 +365,15 @@ public class UserData {
return uuid;
}
/**
* Set the UUID.
*
* @param uuid UUID
*/
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
/**
* Get the InetAddress Set.
*
@ -378,6 +383,17 @@ public class UserData {
return ips;
}
/**
* Set the ips set.
*
* @param ips ips of the user.
*/
public void setIps(Set<InetAddress> ips) {
if (Verify.notNull(ips)) {
this.ips = ips;
}
}
/**
* Get the nickname String Set.
*
@ -387,6 +403,17 @@ public class UserData {
return nicknames;
}
/**
* Set the nicknames set.
*
* @param nicknames nicknames of the user.
*/
public void setNicknames(Set<String> nicknames) {
if (Verify.notNull(nicknames)) {
this.nicknames = nicknames;
}
}
/**
* Get the Epoch millisecond the player registered.
*
@ -397,8 +424,17 @@ public class UserData {
}
/**
* Get the Epoch millisecond the player was last seen.
* Set the time the user was registered.
*
* @param registered Epoch millisecond of register time.
*/
public void setRegistered(long registered) {
this.registered = registered;
}
/**
* Get the Epoch millisecond the player was last seen.
* <p>
* NOT INITIALIZED BY CONSTRUCTORS. Value is updated periodically by cache
* if the player is online.
*
@ -409,8 +445,20 @@ public class UserData {
}
/**
* Get the playtime in milliseconds.
* Set the time the user was last seen.
* <p>
* Affects playtime calculation, playtime should be updated before updating
* this value.
*
* @param lastPlayed Epoch millisecond of last seen moment.
*/
public void setLastPlayed(long lastPlayed) {
this.lastPlayed = lastPlayed;
}
/**
* Get the playtime in milliseconds.
* <p>
* NOT INITIALIZED BY CONSTRUCTORS. Value is updated periodically by cache
* if the player is online.
*
@ -421,8 +469,17 @@ public class UserData {
}
/**
* Get how many times the player has logged in.
* Set the time the user has been playing.
*
* @param playTime Time in ms.
*/
public void setPlayTime(long playTime) {
this.playTime = playTime;
}
/**
* Get how many times the player has logged in.
* <p>
* NOT INITIALIZED BY CONSTRUCTORS.
*
* @return 0 to Integer.MAX
@ -432,8 +489,19 @@ public class UserData {
}
/**
* Get how many times the player has been kicked.
* Set how many times the user has logged in.
* <p>
* No check for input.
*
* @param loginTimes 0 to Int.MAX
*/
public void setLoginTimes(int loginTimes) {
this.loginTimes = loginTimes;
}
/**
* Get how many times the player has been kicked.
* <p>
* NOT INITIALIZED BY CONSTRUCTORS.
*
* @return 0 to Integer.MAX
@ -442,6 +510,17 @@ public class UserData {
return timesKicked;
}
/**
* Set how many times the user has been kicked.
* <p>
* No check for input.
*
* @param timesKicked 0 to Int.MAX
*/
public void setTimesKicked(int timesKicked) {
this.timesKicked = timesKicked;
}
/**
* Get the GMTimes Map.
*
@ -455,6 +534,18 @@ public class UserData {
return gmTimes;
}
/**
* Set the GM Times map containing playtime in each gamemode.
*
* @param gmTimes Map containing SURVIVAL, CREATIVE, ADVENTURE and SPECTATOR
* (After 1.8) keys.
*/
public void setGmTimes(Map<String, Long> gmTimes) {
if (Verify.notNull(gmTimes)) {
this.gmTimes = gmTimes;
}
}
/**
* Get the last time a Gamemode time was updated.
*
@ -465,8 +556,17 @@ public class UserData {
}
/**
* Get the last Gamemode that the user was seen in.
* Set the last time a Gamemode time was updated.
*
* @param lastGmSwapTime Epoch millisecond a gm time was updated.
*/
public void setLastGmSwapTime(long lastGmSwapTime) {
this.lastGmSwapTime = lastGmSwapTime;
}
/**
* Get the last Gamemode that the user was seen in.
* <p>
* When player changes to SURVIVAL this is set to SURVIVAL.
*
* @return Gamemode.
@ -475,6 +575,15 @@ public class UserData {
return lastGamemode;
}
/**
* Set the last gamemode the user was seen in.
*
* @param lastGamemode gamemode.
*/
public void setLastGamemode(String lastGamemode) {
this.lastGamemode = lastGamemode;
}
/**
* Is the user Operator?
*
@ -493,6 +602,15 @@ public class UserData {
return isBanned;
}
/**
* Set the banned value.
*
* @param isBanned true/false
*/
public void setBanned(boolean isBanned) {
this.isBanned = isBanned;
}
/**
* Get the username of the player.
*
@ -502,132 +620,6 @@ public class UserData {
return name;
}
/**
* Set the UUID.
*
* @param uuid UUID
*/
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
/**
* Set the ips set.
*
* @param ips ips of the user.
*/
public void setIps(Set<InetAddress> ips) {
if (Verify.notNull(ips)) {
this.ips = ips;
}
}
/**
* Set the nicknames set.
*
* @param nicknames nicknames of the user.
*/
public void setNicknames(Set<String> nicknames) {
if (Verify.notNull(nicknames)) {
this.nicknames = nicknames;
}
}
/**
* Set the time the user was registered.
*
* @param registered Epoch millisecond of register time.
*/
public void setRegistered(long registered) {
this.registered = registered;
}
/**
* Set the time the user was last seen.
*
* Affects playtime calculation, playtime should be updated before updating
* this value.
*
* @param lastPlayed Epoch millisecond of last seen moment.
*/
public void setLastPlayed(long lastPlayed) {
this.lastPlayed = lastPlayed;
}
/**
* Set the time the user has been playing.
*
* @param playTime Time in ms.
*/
public void setPlayTime(long playTime) {
this.playTime = playTime;
}
/**
* Set how many times the user has logged in.
*
* No check for input.
*
* @param loginTimes 0 to Int.MAX
*/
public void setLoginTimes(int loginTimes) {
this.loginTimes = loginTimes;
}
/**
* Set how many times the user has been kicked.
*
* No check for input.
*
* @param timesKicked 0 to Int.MAX
*/
public void setTimesKicked(int timesKicked) {
this.timesKicked = timesKicked;
}
/**
* Set the GM Times map containing playtime in each gamemode.
*
* @param gmTimes Map containing SURVIVAL, CREATIVE, ADVENTURE and SPECTATOR
* (After 1.8) keys.
*/
public void setGmTimes(Map<String, Long> gmTimes) {
if (Verify.notNull(gmTimes)) {
this.gmTimes = gmTimes;
}
}
/**
* Set the last time a Gamemode time was updated.
*
* @param lastGmSwapTime Epoch millisecond a gm time was updated.
*/
public void setLastGmSwapTime(long lastGmSwapTime) {
this.lastGmSwapTime = lastGmSwapTime;
}
/**
* Set the last gamemode the user was seen in.
*
* @param lastGamemode gamemode.
*/
public void setLastGamemode(String lastGamemode) {
this.lastGamemode = lastGamemode;
}
/**
* Set whether or not player is op.
*
* @param isOp operator?
*/
public void setIsOp(boolean isOp) {
this.isOp = isOp;
}
public void setGeolocation(String geolocation) {
this.geolocation = geolocation;
}
/**
* Set the username of the user.
*
@ -637,6 +629,15 @@ public class UserData {
this.name = name;
}
/**
* Set whether or not player is op.
*
* @param isOp operator?
*/
public void setIsOp(boolean isOp) {
this.isOp = isOp;
}
/**
* Is the player online?
*
@ -646,6 +647,15 @@ public class UserData {
return isOnline;
}
/**
* Set the online value.
*
* @param isOnline true/false
*/
public void setOnline(boolean isOnline) {
this.isOnline = isOnline;
}
/**
* Get how many mob kills the player has.
*
@ -722,7 +732,7 @@ public class UserData {
/**
* Get the last nickname the user has set.
*
* <p>
* Set when using addNickname(String)
*
* @return last nickname used.
@ -733,7 +743,7 @@ public class UserData {
/**
* Set the last nickname the user has set.
*
* <p>
* Also set when using addNickname(String)
*
* @param lastNick last nickname used.
@ -797,25 +807,11 @@ public class UserData {
this.clearAfterSave = clearAfterSave;
}
/**
* Set the banned value.
*
* @param isBanned true/false
*/
public void setBanned(boolean isBanned) {
this.isBanned = isBanned;
}
/**
* Set the online value.
*
* @param isOnline true/false
*/
public void setOnline(boolean isOnline) {
this.isOnline = isOnline;
}
public String getGeolocation() {
return geolocation;
}
public void setGeolocation(String geolocation) {
this.geolocation = geolocation;
}
}

View File

@ -3,10 +3,10 @@ package main.java.com.djrapitops.plan.data.additional;
/**
* This class contains Enum values for different types of Analysis that can be
* performed on values of PluginData.
*
* <p>
* The enum determines what should be done to the return value of
* PluginData.getValue() method when the analysis is run.
*
* <p>
* Refer to the documentation on GitHub for additional information.
*
* @author Rsl1122
@ -17,56 +17,56 @@ public enum AnalysisType {
/**
* Used when the getValue() method returns an integer and average should be
* calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
INT_AVG("avgInt_", "Average "),
/**
* Used when the getValue() method returns a long and average should be
* calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
LONG_AVG("avgLong_", "Average "),
/**
* Used when the getValue() method returns double and average should be
* calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
DOUBLE_AVG("avgDouble_", "Average "),
/**
* Used when the getValue() method returns an integer and total should be
* calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
INT_TOTAL("totalInt_", "Total "),
/**
* Used when the getValue() method returns a long and total should be
* calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
LONG_TOTAL("totalLong_", "Total "),
/**
* Used when the getValue() method returns a double and total should be
* calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
DOUBLE_TOTAL("totalDouble_", "Total "),
/**
* Used when the getValue() method returns an amount of milliseconds as long
* and average should be calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
LONG_TIME_MS_AVG("avgTimeMs_", "Average "),
/**
* Used when the getValue() method returns an amount of milliseconds as long
* and total should be calculated.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
LONG_TIME_MS_TOTAL("totalTimeMs_"),
@ -74,11 +74,11 @@ public enum AnalysisType {
* Used when the getValue() method returns an Epoch Millisecond as long and
* average of differences between the millisecond and current millisecond
* should be calculated.
*
* <p>
* For example if a player has dropped a Foo on epoch ms 1494486504000 and
* that was 5s (5000ms) ago. Now you want to calculate the average
* time-since for all players. Then you use this one.
*
* <p>
* -1 values will be disregarded from the calculation (size will not grow).
*/
LONG_EPOCH_MS_MINUS_NOW_AVG("avgEpochMsMinusNow_", "Average "),
@ -89,13 +89,13 @@ public enum AnalysisType {
/**
* Used to calculate number of true values for the returned boolean values
* of getValue().
*
* <p>
* Will be presented as "n / total".
*/
BOOLEAN_TOTAL("totalBool_"),
/**
* Used to add html tags to the plugins tab.
*
* <p>
* Can be used to add Tables, Images (for example maps) and other html
* elements.
*/
@ -121,7 +121,7 @@ public enum AnalysisType {
/**
* Used to get the modifier for the Prefix of the value.
*
* <p>
* For example: "Average Votes" when INT_AVG is used and Prefix is set as
* "Votes".
*

View File

@ -38,10 +38,10 @@ public class HookHandler {
/**
* Adds a new PluginData source to the list.
*
* <p>
* The plugin data will appear on Analysis and/or Inspect pages depending on
* how the extending object is set up.
*
* <p>
* Refer to documentation on GitHub for more information.
*
* @param dataSource an object extending the PluginData class.

View File

@ -8,7 +8,7 @@ import java.util.*;
/**
* This is an abstract class that can be used to add data from a plugin to the
* "Plugins"-tab of Analysis and Inspect pages.
*
* <p>
* API-section of documentation has examples on the usage of this class and how
* to register objects extending this class.
*
@ -17,71 +17,65 @@ import java.util.*;
*/
public abstract class PluginData {
/**
* A list containing the AnalysisType enums that determine what should be
* done with the data on the analysis page.
*/
protected final List<AnalysisType> analysisTypes;
/**
* Placeholder string, for example "stepsTaken". This will be used when
* building the structure of the Plugins tab.
*
* <p>
* The complete placeholder also includes the plugin name and if analysis is
* run, a modifier.
*
* <p>
* Second parameter of any super constructor.
*/
protected String placeholder;
/**
* Name of the plugin the data is coming from.
*
* <p>
* All sources of data with the same sourcePlugin will be placed in the same
* "box" in the "Plugins" tab.
*
* <p>
* A box has a max height of 600px, and higher than that will add a
* scrollbar.
*
* <p>
* First parameter of any super constructor.
*/
protected String sourcePlugin;
/**
* Determines if the datapoint should only be used for the analysis page.
*
* <p>
* If set to false, the datapoint will be added to the inspect page as well.
*/
protected boolean analysisOnly;
/**
* Font Awesome icon name.
*
* <p>
* http://fontawesome.io/icons/
*/
protected String icon;
/**
* Prefix shown before the data, for example "Steps taken: ".
*/
protected String prefix;
/**
* Suffix shown after the data, for example " steps".
*/
protected String suffix;
/**
* A list containing the AnalysisType enums that determine what should be
* done with the data on the analysis page.
*/
protected final List<AnalysisType> analysisTypes;
/**
* Main constructor.
*
* <p>
* Defaults analysisOnly to true.
*
* <p>
* Defaults icon, prefix and suffix to "".
*
* @param sourcePlugin Name of the plugin the data is coming from
* @param placeholder Placeholder string, for example "stepsTaken"
* @param sourcePlugin Name of the plugin the data is coming from
* @param placeholder Placeholder string, for example "stepsTaken"
* @param analysisTypes A list containing the AnalysisType enums that
* determine what should be done with the data on the analysis page
* determine what should be done with the data on the analysis page
*/
public PluginData(String sourcePlugin, String placeholder, List<AnalysisType> analysisTypes) {
this.placeholder = placeholder;
@ -96,10 +90,10 @@ public abstract class PluginData {
/**
* Constructor for accepting single, multiple and arrays of AnalysisType.
*
* @param sourcePlugin Name of the plugin the data is coming from
* @param placeholder Placeholder string, for example "stepsTaken"
* @param sourcePlugin Name of the plugin the data is coming from
* @param placeholder Placeholder string, for example "stepsTaken"
* @param analysisTypes AnalysisType enums that determine what should be
* done with the data on the analysis page
* done with the data on the analysis page
*/
public PluginData(String sourcePlugin, String placeholder, AnalysisType... analysisTypes) {
this(sourcePlugin, placeholder, Arrays.asList(analysisTypes));
@ -107,11 +101,11 @@ public abstract class PluginData {
/**
* Constructor for Inspect-page only data point.
*
* <p>
* analysisOnly will be set to false.
*
* @param sourcePlugin Name of the plugin the data is coming from
* @param placeholder Placeholder string, for example "stepsTaken"
* @param placeholder Placeholder string, for example "stepsTaken"
*/
public PluginData(String sourcePlugin, String placeholder) {
this(sourcePlugin, placeholder, new ArrayList<>());
@ -120,7 +114,7 @@ public abstract class PluginData {
/**
* Returns the list of AnalysisTypes.
*
* <p>
* Used by Analysis
*
* @return a list.
@ -132,15 +126,15 @@ public abstract class PluginData {
/**
* This method should be used with the return values of
* getHtmlReplaceValue(String, UUID).
*
* <p>
* It will add the div, icon, modifier, prefix and suffix to the value.
* Modifier is for example, if calculating AnalysisType.INT_AVG "Average ",
* it is a text that helps user understand that a calculation has been made.
*
* @param modifier For example "Average " - Determined by value of
* AnalysisType's modifier-variable.
* AnalysisType's modifier-variable.
* @param contents The data, number/string/html that should be placed on the
* page.
* page.
* @return a proper format for the html.
* @see AnalysisType
*/
@ -150,12 +144,12 @@ public abstract class PluginData {
/**
* Used to get the full placeholder.
*
* <p>
* Used to avoid conflicts with existing placeholders and placeholders of
* other plugins.
*
* @param modifier Modifier determined by AnalysisType's
* placeholderModifier-variable.
* placeholderModifier-variable.
* @return for example "%StepCounter_stepsTaken_total%"
* @see AnalysisType
*/
@ -174,20 +168,20 @@ public abstract class PluginData {
/**
* Used to get the string for the html page.
*
* <p>
* parseContainer(modifierPrefix, value); should be used for all return
* values so that div, icon, prefix and suffix are added.
*
* <p>
* This method is used when AnalysisType.HTML is set, or while getting the
* value for the inspect page.
*
* <p>
* When using AnalysisType.HTML a random UUID is given, so it should be
* disregarded. modifierPrefix is empty in that case.
*
* @param modifierPrefix Modifier determined by AnalysisType's
* modifier-variable.
* @param uuid UUID of the player or random UUID if AnalysisType.HTML is
* used.
* modifier-variable.
* @param uuid UUID of the player or random UUID if AnalysisType.HTML is
* used.
* @return html for the page.
*/
public abstract String getHtmlReplaceValue(String modifierPrefix, UUID uuid);
@ -196,10 +190,10 @@ public abstract class PluginData {
* Used to get the value for analysis. The return value is determined by
* AnalysisType you have specified. If the AnalysisType's name has a BOOLEAN
* in it, Analysis will expect boolean values etc.
*
* <p>
* If the Type and return value mismatch, exception is thrown and the result
* on the analysis page will say that error occurred as the value.
*
* <p>
* If a player has no value a -1 should be returned in the case of a Number.
* -1 is excluded from the Average calculation's size and total.
*
@ -209,24 +203,6 @@ public abstract class PluginData {
*/
public abstract Serializable getValue(UUID uuid);
/**
* Used to set the prefix.
*
* @param prefix for example "Steps Taken: " or a Html start tag.
*/
public final void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
* Used to set the suffix.
*
* @param suffix for example " steps" or a html end tag.
*/
public final void setSuffix(String suffix) {
this.suffix = suffix;
}
/**
* Used to set the Font Awesome icon.
*
@ -238,7 +214,7 @@ public abstract class PluginData {
/**
* Used to set the analysisOnly parameter.
*
* <p>
* true: only used for Analysis page false: used for both if AnalysisTypes
* specified, if no AnalysisTypes are specified only used for Inspect page.
*
@ -266,6 +242,15 @@ public abstract class PluginData {
return prefix;
}
/**
* Used to set the prefix.
*
* @param prefix for example "Steps Taken: " or a Html start tag.
*/
public final void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
* Used to get the suffix.
*
@ -275,6 +260,15 @@ public abstract class PluginData {
return suffix;
}
/**
* Used to set the suffix.
*
* @param suffix for example " steps" or a html end tag.
*/
public final void setSuffix(String suffix) {
this.suffix = suffix;
}
/**
* If a PluginData object has same placeholder, sourcePlugin and
* analysisTypes, it is considered equal.

View File

@ -2,13 +2,6 @@ package main.java.com.djrapitops.plan.data.analysis;
import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.utilities.Verify;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import main.java.com.djrapitops.plan.Settings;
import main.java.com.djrapitops.plan.data.SessionData;
import main.java.com.djrapitops.plan.data.TPS;
@ -22,14 +15,17 @@ import main.java.com.djrapitops.plan.utilities.HtmlUtils;
import main.java.com.djrapitops.plan.utilities.analysis.AnalysisUtils;
import main.java.com.djrapitops.plan.utilities.analysis.MathUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* Part responsible for all Player Activity related analysis.
*
* <p>
* Online Graphs, Player-base pie-chart, Recent Players and Session
* visualisation.
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: recentlogins, sessionaverage,
* datapunchcard, datasessiondistribution, labelssessiondistribution,
* datascatterday, datascatterweek, datascattermonth, playersonlinecolor,
@ -44,14 +40,12 @@ public class ActivityPart extends RawData<ActivityPart> {
private final JoinInfoPart joins;
private final TPSPart tpsPart;
private List<String> recentPlayers;
private List<UUID> recentPlayersUUIDs;
private final Set<UUID> bans;
private final Set<UUID> active;
private final Set<UUID> inactive;
private final Set<UUID> joinedOnce;
private List<String> recentPlayers;
private List<UUID> recentPlayersUUIDs;
public ActivityPart(JoinInfoPart joins, TPSPart tps) {
this.joins = joins;
@ -149,14 +143,6 @@ public class ActivityPart extends RawData<ActivityPart> {
joinedOnce.add(uuid);
}
public void setRecentPlayers(List<String> recentPlayers) {
this.recentPlayers = recentPlayers;
}
public void setRecentPlayersUUIDs(List<UUID> recentPlayersUUIDs) {
this.recentPlayersUUIDs = recentPlayersUUIDs;
}
public Map<Long, Integer> getPlayersOnline() {
return tpsPart.getTpsData().stream().collect(Collectors.toMap(TPS::getDate, TPS::getPlayers));
}
@ -165,10 +151,18 @@ public class ActivityPart extends RawData<ActivityPart> {
return recentPlayers;
}
public void setRecentPlayers(List<String> recentPlayers) {
this.recentPlayers = recentPlayers;
}
public List<UUID> getRecentPlayersUUIDs() {
return recentPlayersUUIDs;
}
public void setRecentPlayersUUIDs(List<UUID> recentPlayersUUIDs) {
this.recentPlayersUUIDs = recentPlayersUUIDs;
}
public Set<UUID> getBans() {
return bans;
}

View File

@ -5,17 +5,18 @@
*/
package main.java.com.djrapitops.plan.data.analysis;
import java.util.Map;
import main.java.com.djrapitops.plan.ui.html.tables.CommandUseTableCreator;
import main.java.com.djrapitops.plan.utilities.HtmlUtils;
import java.util.Map;
/**
* Part responsible for all CommandUsage related analysis.
*
* <p>
* Command Usage Table.
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: uniquecommands, totalcommands, commanduse
*
* @author Rsl1122

View File

@ -9,11 +9,11 @@ import java.util.Arrays;
/**
* Part responsible for all Gamemode usage related analysis.
*
* <p>
* Gamemode Piechart, Percentages and Totals.
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: gmtotal, gm0col-gm3col, gmcolors, gmlabels,
* gm0-gm3, gmdata, gm0total-gm3total
*
@ -45,13 +45,13 @@ public class GamemodePart extends RawData<GamemodePart> {
addValue("gmtotal", FormatUtils.formatTimeAmount(totalTime));
double[] percentages = new double[]{
(survivalTime * 100.0) / totalTime,
(creativeTime * 100.0) / totalTime,
(adventureTime * 100.0) / totalTime,
(spectatorTime * 100.0) / totalTime
(survivalTime * 100.0) / totalTime,
(creativeTime * 100.0) / totalTime,
(adventureTime * 100.0) / totalTime,
(spectatorTime * 100.0) / totalTime
};
long[] times = new long[]{
survivalTime, creativeTime, adventureTime, spectatorTime
survivalTime, creativeTime, adventureTime, spectatorTime
};
String col0 = Settings.HCOLOR_GMP_0 + "";
String col1 = Settings.HCOLOR_GMP_1 + "";

View File

@ -5,11 +5,11 @@ import java.util.Map;
/**
* Part responsible for all Geolocation related analysis.
*
* Player location World Chloropleth map.
*
* <p>
* Player location World Choropleth map.
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: geomapz, geomapcountries, geomapcodes
*
* @author Rsl1122
@ -17,46 +17,44 @@ import java.util.Map;
*/
public class GeolocationPart extends RawData<GeolocationPart> {
private final Map<String, Integer> geolocations;
private final Map<String, Integer> geoLocations;
private final Map<String, String> geoCodes;
public GeolocationPart() {
geolocations = new HashMap<>();
geoLocations = new HashMap<>();
geoCodes = new HashMap<>();
String[] countries = new String[]{"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas, The", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cabo Verde", "Cambodia", "Cameroon", "Canada", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic of the", "Congo, Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Curacao", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Islas Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "French Polynesia", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guam", "Guatemala", "Guernsey", "Guinea-Bissau", "Guinea", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kosovo", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia, Federated States of", "Moldova", "Monaco", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Namibia", "Nepal", "Netherlands", "New Caledonia", "New Zealand", "Nicaragua", "Nigeria", "Niger", "Niue", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Puerto Rico", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Martin", "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Sint Maarten", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Timor-Leste", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands", "West Bank", "Yemen", "Zambia", "Zimbabwe"};
String[] codes = new String[]{"AFG", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHM", "BHR", "BGD", "BRB", "BLR", "BEL", "BLZ", "BEN", "BMU", "BTN", "BOL", "BIH", "BWA", "BRA", "VGB", "BRN", "BGR", "BFA", "MMR", "BDI", "CPV", "KHM", "CMR", "CAN", "CYM", "CAF", "TCD", "CHL", "CHN", "COL", "COM", "COD", "COG", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "PYF", "GAB", "GMB", "GEO", "DEU", "GHA", "GIB", "GRC", "GRL", "GRD", "GUM", "GTM", "GGY", "GNB", "GIN", "GUY", "HTI", "HND", "HKG", "HUN", "ISL", "IND", "IDN", "IRN", "IRQ", "IRL", "IMN", "ISR", "ITA", "JAM", "JPN", "JEY", "JOR", "KAZ", "KEN", "KIR", "KOR", "PRK", "KSV", "KWT", "KGZ", "LAO", "LVA", "LBN", "LSO", "LBR", "LBY", "LIE", "LTU", "LUX", "MAC", "MKD", "MDG", "MWI", "MYS", "MDV", "MLI", "MLT", "MHL", "MRT", "MUS", "MEX", "FSM", "MDA", "MCO", "MNG", "MNE", "MAR", "MOZ", "NAM", "NPL", "NLD", "NCL", "NZL", "NIC", "NGA", "NER", "NIU", "MNP", "NOR", "OMN", "PAK", "PLW", "PAN", "PNG", "PRY", "PER", "PHL", "POL", "PRT", "PRI", "QAT", "ROU", "RUS", "RWA", "KNA", "LCA", "MAF", "SPM", "VCT", "WSM", "SMR", "STP", "SAU", "SEN", "SRB", "SYC", "SLE", "SGP", "SXM", "SVK", "SVN", "SLB", "SOM", "ZAF", "SSD", "ESP", "LKA", "SDN", "SUR", "SWZ", "SWE", "CHE", "SYR", "TWN", "TJK", "TZA", "THA", "TLS", "TGO", "TON", "TTO", "TUN", "TUR", "TKM", "TUV", "UGA", "UKR", "ARE", "GBR", "USA", "URY", "UZB", "VUT", "VEN", "VNM", "VGB", "WBG", "YEM", "ZMB", "ZWE"};
for (int i = 0; i < countries.length; i++) {
String country = countries[i];
geolocations.put(country, 0);
geoCodes.put(country, codes[i]);
String countryCode = codes[i];
geoLocations.put(country, 0);
geoCodes.put(country, countryCode);
}
}
@Override
public void analyse() {
cloroplethMapValues();
choroplethMapValues();
}
private void cloroplethMapValues() {
StringBuilder locations = new StringBuilder();
StringBuilder z = new StringBuilder();
StringBuilder text = new StringBuilder();
locations.append("[");
z.append("[");
text.append("[");
private void choroplethMapValues() {
StringBuilder locations = new StringBuilder("[");
StringBuilder z = new StringBuilder("[");
StringBuilder text = new StringBuilder("[");
int i = 0;
int size = geolocations.size();
for (String c : geolocations.keySet()) {
locations.append("\"").append(c).append("\"");
z.append("\"").append(geolocations.get(c)).append("\"");
text.append("\"");
String code = geoCodes.get(c);
if (code != null) {
text.append(code);
} else {
text.append("UNK");
}
text.append("\"");
int size = geoLocations.size();
for (Map.Entry<String, Integer> entrySet : geoLocations.entrySet()) {
String country = entrySet.getKey();
String code = geoCodes.getOrDefault(country, "UNK");
int amount = entrySet.getValue();
z.append("\"").append(amount).append("\"");
locations.append("\"").append(country).append("\"");
text.append("\"").append(code).append("\"");
if (i < size - 1) {
locations.append(",");
@ -64,16 +62,18 @@ public class GeolocationPart extends RawData<GeolocationPart> {
text.append(",");
}
}
locations.append("]");
z.append("]");
text.append("]");
addValue("geomapz", z.toString());
addValue("geomapcountries", locations.toString());
addValue("geomapcodes", text.toString());
}
public void addGeoloc(String country) {
geolocations.computeIfPresent(country, (computedCountry, amount) -> amount + 1);
geoLocations.computeIfPresent(country, (computedCountry, amount) -> amount + 1);
}
}

View File

@ -11,11 +11,11 @@ import java.util.stream.Collectors;
/**
* Part responsible for all Player login related analysis.
*
* <p>
* Unique per Day, Unique, New Players, Logins
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: totallogins, uniquejoinsday,
* uniquejoinsweek, uniquejoinsmonth, avguniquejoins, avguniquejoinsday,
* avguniquejoinsweek, avguniquejoinsmonth, npday, npweek, npmonth

View File

@ -11,11 +11,11 @@ import java.util.UUID;
/**
* Part responsible for all Death related analysis.
*
* <p>
* Totals
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: deaths, mobkills, playerkilss
*
* @author Rsl1122

View File

@ -1,6 +1,7 @@
package main.java.com.djrapitops.plan.data.analysis;
import com.djrapitops.plugin.utilities.Verify;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@ -8,11 +9,11 @@ import java.util.UUID;
/**
* Part responsible for counting players.
*
* <p>
* Total player count, op count
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: activitytotal, ops
*
* @author Rsl1122

View File

@ -5,9 +5,9 @@ import main.java.com.djrapitops.plan.utilities.analysis.MathUtils;
/**
* Part responsible for all Playtime related analysis.
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* <p>
* Contains following place-holders: totalplaytime, avgplaytime
*
* @author Rsl1122
@ -15,8 +15,8 @@ import main.java.com.djrapitops.plan.utilities.analysis.MathUtils;
*/
public class PlaytimePart extends RawData<PlaytimePart> {
private long totalPlaytime;
private final PlayerCountPart playerCount;
private long totalPlaytime;
public PlaytimePart(PlayerCountPart part) {
playerCount = part;

View File

@ -1,6 +1,7 @@
package main.java.com.djrapitops.plan.data.analysis;
import com.djrapitops.plugin.utilities.Verify;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
@ -8,8 +9,8 @@ import java.util.Map;
/**
* Extending objects should represent, add together and analyse data.
*
* @author Rsl1122
* @param <T> The extending class, return value for get method.
* @author Rsl1122
* @since 3.5.2
*/
public abstract class RawData<T extends RawData> {
@ -40,7 +41,7 @@ public abstract class RawData<T extends RawData> {
/**
* Analyses the data added together.
*
* <p>
* Places place-holders to the replace map.
*/
public void analyseData() {
@ -50,7 +51,7 @@ public abstract class RawData<T extends RawData> {
/**
* Subclasses should analyse the data added together.
*
* <p>
* Place-holders should be added to the replace map.
*/
protected abstract void analyse();
@ -69,7 +70,7 @@ public abstract class RawData<T extends RawData> {
* Adds a placeholder to the replaceMap.
*
* @param placeholder placeholder, with or without % signs.
* @param value Any value the placeholder should be replaced with.
* @param value Any value the placeholder should be replaced with.
*/
public void addValue(String placeholder, Serializable value) {
placeholder = addPlaceholderSigns(placeholder);

View File

@ -12,13 +12,14 @@ import java.util.List;
/**
* Part responsible for all TPS related analysis.
*
* <p>
* Ticks Per Second Graphs
*
* <p>
* Placeholder values can be retrieved using the get method.
*
* Contains following place-holders: tpsscatterday, tpsscatterweek, cpuscatterday, cpuscatterweek, averagetps,
* averagetpsday
* <p>
* Contains following place-holders: tpsscatterday, tpsscatterweek, cpuscatterday, cpuscatterweek, averagetps(-week),
* averagetpsday, averagecpuday, averagecpuweek, averagememoryday, averagememoryweek, averageentitiesday, averageentitiesweek,
* averagechunksday, averagechunkweek
*
* @author Rsl1122
* @since 3.5.2
@ -48,11 +49,36 @@ public class TPSPart extends RawData<TPSPart> {
addValue("cpuscatterday", cpuScatterDay);
addValue("cpuscatterweek", cpuScatterWeek);
double averageTPSweek = MathUtils.averageDouble(week.stream().map(TPS::getTps));
double averageTPSday = MathUtils.averageDouble(day.stream().map(TPS::getTps));
double averageTPSWeek = MathUtils.averageDouble(week.stream().map(TPS::getTps));
double averageTPSDay = MathUtils.averageDouble(day.stream().map(TPS::getTps));
addValue("averagetps", FormatUtils.cutDecimals(averageTPSweek));
addValue("averagetpsday", FormatUtils.cutDecimals(averageTPSday));
double averageCPUWeek = MathUtils.averageDouble(week.stream().map(TPS::getCPUUsage));
double averageCPUDay = MathUtils.averageDouble(day.stream().map(TPS::getCPUUsage));
long averageUsedMemoryWeek = MathUtils.averageLong(week.stream().map(TPS::getUsedMemory));
long averageUsedMemoryDay = MathUtils.averageLong(day.stream().map(TPS::getUsedMemory));
double averageEntityCountWeek = MathUtils.averageInt(week.stream().map(TPS::getEntityCount));
double averageEntityCountDay = MathUtils.averageInt(day.stream().map(TPS::getEntityCount));
double averageChunksLoadedWeek = MathUtils.averageInt(week.stream().map(TPS::getChunksLoaded));
double averageChunksLoadedDay = MathUtils.averageInt(day.stream().map(TPS::getChunksLoaded));
addValue("averagetps", FormatUtils.cutDecimals(averageTPSWeek)); //Staying for backwards compatibility
addValue("averagetpsweek", FormatUtils.cutDecimals(averageTPSWeek));
addValue("averagetpsday", FormatUtils.cutDecimals(averageTPSDay));
addValue("averagecpuweek", FormatUtils.cutDecimals(averageCPUWeek));
addValue("averagecpuday", FormatUtils.cutDecimals(averageCPUDay));
addValue("averagememoryweek", FormatUtils.cutDecimals(averageUsedMemoryWeek));
addValue("averagememoryday", FormatUtils.cutDecimals(averageUsedMemoryDay));
addValue("averageentitiesweek", FormatUtils.cutDecimals(averageEntityCountWeek));
addValue("averageentitiesday", FormatUtils.cutDecimals(averageEntityCountDay));
addValue("averagechunksweek", FormatUtils.cutDecimals(averageChunksLoadedWeek));
addValue("averagechunksday", FormatUtils.cutDecimals(averageChunksLoadedDay));
}
public List<TPS> getTpsData() {

View File

@ -13,13 +13,13 @@ import main.java.com.djrapitops.plan.utilities.analysis.Analysis;
*/
public class AnalysisCacheHandler {
private AnalysisData cache;
private final Analysis analysis;
private AnalysisData cache;
private boolean analysisEnabled;
/**
* Class Constructor.
*
* <p>
* Initializes Analysis
*
* @param plugin Current instance of Plan
@ -64,7 +64,6 @@ public class AnalysisCacheHandler {
}
/**
*
* @return
*/
public boolean isAnalysisBeingRun() {

View File

@ -5,7 +5,7 @@ import main.java.com.djrapitops.plan.data.UserData;
/**
* This abstract class can be extended with anything as the process method and
* given to the Database.
*
* <p>
* The process method will be called with the UserData object fetched from the
* database.
*
@ -19,7 +19,7 @@ public abstract class DBCallableProcessor {
* changing properties etc.
*
* @param data UserData object given to the DBCallableProcessor by the
* method it was given as parameter to.
* method it was given as parameter to.
*/
public abstract void process(UserData data);
}

View File

@ -27,13 +27,13 @@ import java.util.*;
/**
* This Class contains the Cache.
*
* <p>
* This class is the main processing class that initialises Save, Clear, Process
* and Get queue and Starts the asynchronous save task.
*
* <p>
* It is used to store command use, locations, active sessions and UserData
* objects in memory.
*
* <p>
* Its methods can be used to access all the data it stores and to clear them.
*
* @author Rsl1122
@ -43,13 +43,15 @@ public class DataCacheHandler extends SessionCache {
// Cache
private final HashMap<UUID, UserData> dataCache;
private Map<String, Integer> commandUse;
private List<List<TPS>> unsavedTPSHistory;
// Plan
private final Plan plugin;
private final Database db;
//Cache
private Map<String, Integer> commandUse;
private List<List<TPS>> unsavedTPSHistory;
// Queues
private DataCacheSaveQueue saveTask;
private DataCacheClearQueue clearTask;
@ -61,7 +63,7 @@ public class DataCacheHandler extends SessionCache {
/**
* Class Constructor.
*
* <p>
* Gets the Database from the plugin. Starts the queues. Registers
* Asynchronous Periodic Save Task
*
@ -115,8 +117,8 @@ public class DataCacheHandler extends SessionCache {
* Used to start the Asynchronous Save Task.
*
* @throws IllegalArgumentException BukkitRunnable was given wrong
* parameters.
* @throws IllegalStateException BukkitScheduler is in a wrong state.
* parameters.
* @throws IllegalStateException BukkitScheduler is in a wrong state.
*/
public void startAsyncPeriodicSaveTask() throws IllegalArgumentException, IllegalStateException {
int minutes = Settings.SAVE_CACHE_MIN.getNumber();
@ -160,14 +162,14 @@ public class DataCacheHandler extends SessionCache {
/**
* Uses Database or Cache to retrieve the UserData of a matching player.
*
* <p>
* Caches the data to the Cache if cache-parameter is true.
*
* @param processor DBCallableProcessor Object used to process the data
* after it was retrieved
* @param uuid Player's UUID
* @param cache Whether or not the UserData will be Cached in this instance
* of DataCacheHandler after it has been fetched (if not already fetched)
* after it was retrieved
* @param uuid Player's UUID
* @param cache Whether or not the UserData will be Cached in this instance
* of DataCacheHandler after it has been fetched (if not already fetched)
*/
public void getUserDataForProcessing(DBCallableProcessor processor, UUID uuid, boolean cache) {
Log.debug(uuid + ": HANDLER getForProcess," + " Cache:" + cache);
@ -191,7 +193,7 @@ public class DataCacheHandler extends SessionCache {
/**
* Used to Cache a UserData object to the Cache.
*
* <p>
* If a object already exists it will be replaced.
*
* @param data UserData object with the UUID inside used as key.
@ -204,12 +206,12 @@ public class DataCacheHandler extends SessionCache {
/**
* Uses Database or Cache to retrieve the UserData of a matching player.
*
* <p>
* Always Caches the data after retrieval (unless already cached)
*
* @param processor DBCallableProcessor Object used to process the data
* after it was retrieved
* @param uuid Player's UUID
* after it was retrieved
* @param uuid Player's UUID
*/
public void getUserDataForProcessing(DBCallableProcessor processor, UUID uuid) {
getUserDataForProcessing(processor, uuid, true);
@ -217,9 +219,9 @@ public class DataCacheHandler extends SessionCache {
/**
* Saves all UserData in the cache to Database.
*
* <p>
* ATTENTION: TODO - Doesn't save the Locations in the locationCache.
*
* <p>
* Should only be called from Async thread
*/
public void saveCachedUserData() {
@ -234,7 +236,7 @@ public class DataCacheHandler extends SessionCache {
/**
* Used to add event HandlingInfo to the processTask's pool.
*
* <p>
* Given HandlingInfo object's process method will be called.
*
* @param i Object that extends HandlingInfo.
@ -249,9 +251,9 @@ public class DataCacheHandler extends SessionCache {
/**
* Saves all data in the cache to Database and closes the database down.
*
* <p>
* Stops all tasks.
*
* <p>
* If processTask has unprocessed information, it will be processed.
*/
public void saveCacheOnDisable() {
@ -334,7 +336,7 @@ public class DataCacheHandler extends SessionCache {
/**
* Saves the cached CommandUse.
*
* <p>
* Should be only called from an Asynchronous Thread.
*/
public void saveCommandUse() {
@ -369,8 +371,11 @@ public class DataCacheHandler extends SessionCache {
final double averageTPS = MathUtils.averageDouble(history.stream().map(TPS::getTps));
final int averagePlayersOnline = (int) MathUtils.averageInt(history.stream().map(TPS::getPlayers));
final double averageCPUUsage = MathUtils.averageDouble(history.stream().map(TPS::getCPUUsage));
final long averageUsedMemory = MathUtils.averageLong(history.stream().map(TPS::getUsedMemory));
final int averageEntityCount = (int) MathUtils.averageInt(history.stream().map(TPS::getEntityCount));
final int averageChunksLoaded = (int) MathUtils.averageInt(history.stream().map(TPS::getChunksLoaded));
averages.add(new TPS(lastDate, averageTPS, averagePlayersOnline, averageCPUUsage));
averages.add(new TPS(lastDate, averageTPS, averagePlayersOnline, averageCPUUsage, averageUsedMemory, averageEntityCount, averageChunksLoaded));
}
unsavedTPSHistory.removeAll(copy);
return averages;
@ -491,7 +496,7 @@ public class DataCacheHandler extends SessionCache {
/**
* If /reload is run this treats every online player as a new login.
*
* <p>
* Calls all the methods that are ran when PlayerJoinEvent is fired
*/
public void handleReload() {
@ -525,7 +530,6 @@ public class DataCacheHandler extends SessionCache {
}
/**
*
* @return
*/
public DataCacheSaveQueue getSaveTask() {
@ -533,7 +537,6 @@ public class DataCacheHandler extends SessionCache {
}
/**
*
* @return
*/
public DataCacheClearQueue getClearTask() {
@ -541,7 +544,6 @@ public class DataCacheHandler extends SessionCache {
}
/**
*
* @return
*/
public DataCacheProcessQueue getProcessTask() {
@ -549,7 +551,6 @@ public class DataCacheHandler extends SessionCache {
}
/**
*
* @return
*/
public DataCacheGetQueue getGetTask() {

View File

@ -36,7 +36,7 @@ public class InspectCacheHandler {
/**
* Caches the UserData object to InspectCache.
*
* <p>
* If the Userdata is cached in DataCache it will be used. Otherwise the Get
* Queue will handle the DBCallableProcessor.
*

View File

@ -1,13 +1,14 @@
package main.java.com.djrapitops.plan.data.cache;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.data.SessionData;
import main.java.com.djrapitops.plan.data.UserData;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* This class is used to store active sessions of players in memory.
*
@ -54,7 +55,7 @@ public class SessionCache {
/**
* Used to get the SessionData of the player in the sessionCache.
*
* @param uuid UUId of the player.
* @param uuid UUID of the player.
* @return SessionData or null if not cached.
*/
public SessionData getSession(UUID uuid) {
@ -78,7 +79,7 @@ public class SessionCache {
/**
* Used to get the Map of active sessions.
*
* <p>
* Used for testing.
*
* @return key:value UUID:SessionData

View File

@ -1,24 +1,25 @@
package main.java.com.djrapitops.plan.data.cache.queue;
import com.djrapitops.plugin.task.AbsRunnable;
import java.util.concurrent.BlockingQueue;
/**
* Abstract class representing a queue consumer.
*
* @author Rsl1122
* @param <T>
* @author Rsl1122
*/
public abstract class Consumer<T> extends AbsRunnable {
boolean run;
final BlockingQueue<T> queue;
boolean run;
/**
* Constructor, defines queue.
*
* @param queue Queue to consume from.
* @param name Name of the queue.
* @param name Name of the queue.
*/
public Consumer(BlockingQueue<T> queue, String name) {
super(name);

View File

@ -34,9 +34,9 @@ public class DataCacheGetQueue extends Queue<Map<UUID, List<DBCallableProcessor>
/**
* Schedules UserData objects to be get for the given processors.
*
* @param uuid UUID of the player whose UserData object is fetched.
* @param uuid UUID of the player whose UserData object is fetched.
* @param processors Processors which process-method will be called after
* fetch is complete, with the UserData object.
* fetch is complete, with the UserData object.
*/
public void scheduleForGet(UUID uuid, DBCallableProcessor... processors) {
Log.debug(uuid + ": Scheduling for get");
@ -68,6 +68,7 @@ class GetConsumer extends Consumer<Map<UUID, List<DBCallableProcessor>>> {
if (db == null) {
return;
}
try {
for (UUID uuid : processors.keySet()) {
if (uuid == null) {

View File

@ -27,7 +27,7 @@ public class DataCacheSaveQueue extends Queue<UserData> {
/**
* Class constructor, starts the new Thread for saving.
*
* @param plugin current instance of Plan
* @param plugin current instance of Plan
* @param handler DataCacheHandler
*/
public DataCacheSaveQueue(Plan plugin, DataCacheHandler handler) {

View File

@ -7,8 +7,8 @@ import java.util.concurrent.BlockingQueue;
/**
* Abstract implementation of a Queue.
*
* @author Rsl1122
* @param <T> Object this queue consumes
* @author Rsl1122
*/
public abstract class Queue<T> {

View File

@ -5,8 +5,8 @@ import main.java.com.djrapitops.plan.Plan;
/**
* Abstract representation of a queue setup.
*
* @author Rsl1122
* @param <T> Object this queue consumes.
* @author Rsl1122
*/
public abstract class Setup<T> {

View File

@ -15,9 +15,9 @@ public class ChatHandling {
* Processes the information of the Event and changes UserData object
* accordingly.
*
* @param data UserData of the player.
* @param data UserData of the player.
* @param nickname Nickname of the player during the event.
* @param msg Message sent by the player.
* @param msg Message sent by the player.
*/
public static void processChatInfo(UserData data, String nickname, String msg) {
data.addNickname(nickname);

View File

@ -18,8 +18,8 @@ public class GamemodeHandling {
* Processes the information of the Event and changes UserData object
* accordingly.
*
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param newGM The Gamemode the player changed to.
*/
public static void processGamemodeInfo(UserData data, long time, Gamemode newGM) {

View File

@ -1,7 +1,5 @@
package main.java.com.djrapitops.plan.data.handling;
import java.sql.SQLException;
import java.util.UUID;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.KillData;
@ -9,6 +7,9 @@ import main.java.com.djrapitops.plan.data.UserData;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import java.sql.SQLException;
import java.util.UUID;
/**
* Class containing static methods for processing information contained in a
* DeathEvent when the killer is a player.
@ -22,9 +23,9 @@ public class KillHandling {
* Processes the information of the Event and changes UserData object
* accordingly.
*
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param dead Mob or a Player the player killed.
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param dead Mob or a Player the player killed.
* @param weaponName The name of the Weapon used.
*/
public static void processKillInfo(UserData data, long time, LivingEntity dead, String weaponName) {

View File

@ -18,11 +18,11 @@ public class LoginHandling {
* Processes the information of the Event and changes UserData object
* accordingly.
*
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param ip IP of the player
* @param banned Is the player banned
* @param nickname Nickname of the player
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param ip IP of the player
* @param banned Is the player banned
* @param nickname Nickname of the player
* @param loginTimes amount the loginTimes should be incremented with.
*/
public static void processLoginInfo(UserData data, long time, InetAddress ip, boolean banned, String nickname, int loginTimes) {
@ -36,10 +36,10 @@ public class LoginHandling {
/**
* Updates the geolocation of the player.
*
* <p>
* Uses free service of freegeoip.net. 15000 requests can be sent per hour.
*
* @param ip InetAddress used for location.
* @param ip InetAddress used for location.
* @param data UserData of the player.
* @see GeolocationCacheHandler
*/

View File

@ -15,8 +15,8 @@ public class LogoutHandling {
* Processes the information of the Event and changes UserData object
* accordingly.
*
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param data UserData of the player.
* @param time Epoch ms the event occurred.
* @param banned Is the player banned?
*/
public static void processLogoutInfo(UserData data, long time, boolean banned) {

View File

@ -1,9 +1,11 @@
package main.java.com.djrapitops.plan.data.handling.importing;
import com.djrapitops.pluginbridge.plan.importing.OnTimeImporter;
import main.java.com.djrapitops.plan.Log;
import java.util.HashMap;
import java.util.Map;
import main.java.com.djrapitops.plan.Log;
import static org.bukkit.Bukkit.getPluginManager;
/**

View File

@ -2,15 +2,6 @@ package main.java.com.djrapitops.plan.data.handling.importing;
import com.djrapitops.plugin.utilities.player.Fetch;
import com.djrapitops.plugin.utilities.player.IOfflinePlayer;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Collectors;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.UserData;
@ -21,6 +12,11 @@ import main.java.com.djrapitops.plan.database.Database;
import main.java.com.djrapitops.plan.utilities.Benchmark;
import main.java.com.djrapitops.plan.utilities.NewPlayerCreator;
import java.sql.SQLException;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Abstract class used for importing data from other plugins.
*
@ -52,11 +48,11 @@ public abstract class Importer {
/**
* Method used for the import.
*
* <p>
* Creates UserData for players that have not been saved to the database.
*
* @param uuids UUIDs to be imported
* @param args arguments for the import
* @param args arguments for the import
* @return success
*/
public boolean importData(Collection<UUID> uuids, String... args) {

View File

@ -1,8 +1,9 @@
package main.java.com.djrapitops.plan.data.handling.importing;
import java.util.UUID;
import main.java.com.djrapitops.plan.data.handling.info.HandlingInfo;
import java.util.UUID;
/**
* Imports all players who have not joined since Plan was installed.
*

View File

@ -19,9 +19,9 @@ public class ChatInfo extends HandlingInfo {
/**
* Constructor.
*
* @param uuid UUID of the player.
* @param uuid UUID of the player.
* @param nickname Nickname of the player.
* @param message Message the player sent.
* @param message Message the player sent.
*/
public ChatInfo(UUID uuid, String nickname, String message) {
super(uuid, InfoType.CHAT, 0L);

View File

@ -1,8 +1,9 @@
package main.java.com.djrapitops.plan.data.handling.info;
import java.util.UUID;
import main.java.com.djrapitops.plan.data.UserData;
import java.util.UUID;
/**
* HandlingInfo Class for DeathEvent information.
*

View File

@ -1,10 +1,11 @@
package main.java.com.djrapitops.plan.data.handling.info;
import com.djrapitops.plugin.utilities.player.Gamemode;
import java.util.UUID;
import main.java.com.djrapitops.plan.data.UserData;
import main.java.com.djrapitops.plan.data.handling.GamemodeHandling;
import java.util.UUID;
/**
* HandlingInfo Class for GamemodeChangeEvent information.
*
@ -20,7 +21,7 @@ public class GamemodeInfo extends HandlingInfo {
*
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param gm Gamemode the player changed to.
* @param gm Gamemode the player changed to.
*/
public GamemodeInfo(UUID uuid, long time, Gamemode gm) {
super(uuid, InfoType.GM, time);

View File

@ -22,7 +22,7 @@ public abstract class HandlingInfo {
*
* @param uuid UUID of the player
* @param type InfoType enum of the event. Only used for debugging different
* types.
* types.
* @param time Epoch ms of the event.
*/
public HandlingInfo(UUID uuid, InfoType type, long time) {
@ -60,7 +60,7 @@ public abstract class HandlingInfo {
/**
* Process the info and modify the UserData object accordingly.
*
* <p>
* If the UUIDs don't match no change should occur.
*
* @param uData UserData object to modify.

View File

@ -2,9 +2,9 @@ package main.java.com.djrapitops.plan.data.handling.info;
/**
* Enum class for the types of HandlingInfo to be processed.
*
* <p>
* Type is only used for debugging.
*
* <p>
* OTHER should be used when
*
* @author Rsl1122

View File

@ -1,8 +1,9 @@
package main.java.com.djrapitops.plan.data.handling.info;
import java.util.UUID;
import main.java.com.djrapitops.plan.data.UserData;
import java.util.UUID;
/**
* HandlingInfo Class for KickEvent information.
*

View File

@ -21,9 +21,9 @@ public class KillInfo extends HandlingInfo {
/**
* Constructor.
*
* @param uuid UUID of the killer.
* @param time Epoch ms the event occurred.
* @param dead Dead entity (Mob or Player)
* @param uuid UUID of the killer.
* @param time Epoch ms the event occurred.
* @param dead Dead entity (Mob or Player)
* @param weaponName Weapon used.
*/
public KillInfo(UUID uuid, long time, LivingEntity dead, String weaponName) {

View File

@ -24,12 +24,12 @@ public class LoginInfo extends HandlingInfo {
/**
* Constructor.
*
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param ip IP of the player
* @param banned Is the player banned?
* @param nickname Nickname of the player
* @param gm current gamemode of the player
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param ip IP of the player
* @param banned Is the player banned?
* @param nickname Nickname of the player
* @param gm current gamemode of the player
* @param loginTimes number the loginTimes should be incremented with.
*/
public LoginInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, Gamemode gm, int loginTimes) {
@ -44,12 +44,12 @@ public class LoginInfo extends HandlingInfo {
/**
* Constructor for not incrementing the loginTimes.
*
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param ip IP of the player
* @param banned Is the player banned?
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param ip IP of the player
* @param banned Is the player banned?
* @param nickname Nickname of the player
* @param gm current gamemode of the player
* @param gm current gamemode of the player
*/
public LoginInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, Gamemode gm) {
this(uuid, time, ip, banned, nickname, gm, 0);

View File

@ -22,12 +22,12 @@ public class LogoutInfo extends HandlingInfo {
/**
* Constructor.
*
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param banned Is the player banned
* @param gm current gamemode of the player
* @param sData session that has been ended at the moment of the logout
* event.
* @param gm current gamemode of the player
* @param sData session that has been ended at the moment of the logout
* event.
*/
public LogoutInfo(UUID uuid, long time, boolean banned, Gamemode gm, SessionData sData) {
super(uuid, InfoType.LOGOUT, time);

View File

@ -23,12 +23,12 @@ public class ReloadInfo extends HandlingInfo {
/**
* Constructor.
*
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param ip IP of the player
* @param banned Is the player banned?
* @param uuid UUID of the player.
* @param time Epoch ms of the event.
* @param ip IP of the player
* @param banned Is the player banned?
* @param nickname Nickname of the player
* @param gm current gamemode of the player
* @param gm current gamemode of the player
*/
public ReloadInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, Gamemode gm) {
super(uuid, InfoType.RELOAD, time);

View File

@ -49,14 +49,14 @@ public class PlanCommandPreprocessListener implements Listener {
boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue();
if (doNotLogUnknownCommands || combineCommandAliasesToMainCommand) {
Command command = plugin.getServer().getPluginCommand(commandName);
Command command = plugin.getServer().getPluginCommand(commandName.substring(1, commandName.length()));
if (command == null) {
if (doNotLogUnknownCommands) {
Log.debug("Ignored command, command is unknown");
return;
}
} else if (combineCommandAliasesToMainCommand) {
commandName = command.getName();
commandName = "/" + command.getName();
}
}
@ -66,6 +66,7 @@ public class PlanCommandPreprocessListener implements Listener {
Log.debug("Ignored command, player had ignore permission.");
return;
}
handler.handleCommand(commandName);
}
}

View File

@ -34,7 +34,7 @@ public class PlanPlayerListener implements Listener {
/**
* Class Constructor.
*
* <p>
* Copies the references to multiple handlers from Current instance of
* handler.
*
@ -47,7 +47,7 @@ public class PlanPlayerListener implements Listener {
/**
* PlayerJoinEvent Listener.
*
* <p>
* If player is a new player, creates a new data in the database for the
* player. Retrieves the UserData, updates and then saves it to the Cache.
*
@ -80,7 +80,7 @@ public class PlanPlayerListener implements Listener {
/**
* PlayerQuitEvent Listener.
*
* <p>
* Retrieves the current UserData for the Player, updates it, saves the data
* to Database and clears it from cache.
*
@ -99,7 +99,7 @@ public class PlanPlayerListener implements Listener {
/**
* PlayerKickEvent Listener.
*
* <p>
* Updates current playerdata and saves it to the Database.
*
* @param event Fired event

View File

@ -8,6 +8,7 @@ import main.java.com.djrapitops.plan.data.TPS;
import main.java.com.djrapitops.plan.data.cache.DataCacheHandler;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import main.java.com.djrapitops.plan.utilities.analysis.MathUtils;
import org.bukkit.World;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
@ -21,10 +22,10 @@ import java.util.List;
*/
public class TPSCountTimer extends AbsRunnable {
private long lastCheckNano;
private final Plan plugin;
private final DataCacheHandler handler;
private final List<TPS> history;
private long lastCheckNano;
public TPSCountTimer(Plan plugin) {
super("TPSCountTimer");
@ -60,36 +61,73 @@ public class TPSCountTimer extends AbsRunnable {
* Calculates the TPS
*
* @param diff The time difference between the last run and the new run
* @param now The time right now
* @param now The time right now
* @return the TPS
*/
private TPS calculateTPS(long diff, long now) {
OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
int availableProcessors = operatingSystemMXBean.getAvailableProcessors();
double averageCPUUsage = MathUtils.round(operatingSystemMXBean.getSystemLoadAverage() / availableProcessors * 100.0);
if (averageCPUUsage < 0) { // If Unavailable, getSystemLoadAverage() returns -1
if (averageCPUUsage < 0) { // If unavailable, getSystemLoadAverage() returns -1
averageCPUUsage = -1;
}
Runtime runtime = Runtime.getRuntime();
long totalMemory = runtime.totalMemory() / 1024L;
long usedMemory = totalMemory - runtime.freeMemory() / 1024L;
int playersOnline = plugin.getServer().getOnlinePlayers().size();
int loadedChunks = getLoadedChunks();
int entityCount;
if (plugin.getVariable().isUsingPaper()) {
return getTPSPaper(now, averageCPUUsage, playersOnline);
entityCount = getEntityCountPaper();
return getTPSPaper(now, averageCPUUsage, usedMemory, entityCount, loadedChunks, playersOnline);
} else {
entityCount = getEntityCount();
diff -= TimeAmount.MILLISECOND.ns() * 40L; // 40ms removed because the run appears to take 40-50ms, screwing the tps.
return getTPS(diff, now, averageCPUUsage, playersOnline);
return getTPS(diff, now, averageCPUUsage, usedMemory, entityCount, loadedChunks, playersOnline);
}
}
/**
* Gets the TPS for Spigot / Bukkit
*
* @param diff The difference between the last run and this run
* @param now The time right now
* @param cpuUsage The usage of the CPU
* @param playersOnline The amount of players that are online
* @return the TPS
*/
private TPS getTPS(long diff, long now, double cpuUsage, long usedMemory, int entityCount, int chunksLoaded, int playersOnline) {
if (diff < TimeAmount.SECOND.ns()) { // No tick count above 20
diff = TimeAmount.SECOND.ns();
}
long twentySeconds = 20L * TimeAmount.SECOND.ns();
while (diff > twentySeconds) {
history.add(new TPS(now, 0, playersOnline, cpuUsage, usedMemory, entityCount, chunksLoaded));
diff -= twentySeconds;
}
double tpsN = twentySeconds / diff;
return new TPS(now, tpsN, playersOnline, cpuUsage, usedMemory, entityCount, chunksLoaded);
}
/**
* Gets the TPS for Paper
*
* @param now The time right now
* @param cpuUsage The usage of the CPU
* @param now The time right now
* @param cpuUsage The usage of the CPU
* @param playersOnline The amount of players that are online
* @return the TPS
*/
private TPS getTPSPaper(long now, double cpuUsage, int playersOnline) {
private TPS getTPSPaper(long now, double cpuUsage, long usedMemory, int entityCount, int chunksLoaded, int playersOnline) {
double tps = plugin.getServer().getTPS()[0];
if (tps > 20) {
@ -98,31 +136,33 @@ public class TPSCountTimer extends AbsRunnable {
tps = MathUtils.round(tps);
return new TPS(now, tps, playersOnline, cpuUsage);
return new TPS(now, tps, playersOnline, cpuUsage, usedMemory, entityCount, chunksLoaded);
}
/**
* Gets the TPS for a Spigot / Bukkit
* Gets the amount of loaded chunks
*
* @param diff The difference between the last run and this run
* @param now The time right now
* @param cpuUsage The usage of the CPU
* @param playersOnline The amount of players that are online
* @return the TPS
* @return amount of loaded chunks
*/
private TPS getTPS(long diff, long now, double cpuUsage, int playersOnline) {
if (diff < TimeAmount.SECOND.ns()) { // No tick count above 20
diff = TimeAmount.SECOND.ns();
}
private int getLoadedChunks() {
return plugin.getServer().getWorlds().stream().mapToInt(world -> world.getLoadedChunks().length).sum();
}
long twentySeconds = 20L * TimeAmount.SECOND.ns();
while (diff > twentySeconds) {
history.add(new TPS(now, 0, playersOnline, cpuUsage));
diff -= twentySeconds;
}
/**
* Gets the amount of entities on the server for Bukkit / Spigot
*
* @return amount of entities
*/
private int getEntityCount() {
return plugin.getServer().getWorlds().stream().mapToInt(world -> world.getEntities().size()).sum();
}
double tpsN = twentySeconds / diff;
return new TPS(now, tpsN, playersOnline, cpuUsage);
/**
* Gets the amount of entities on the server for Paper
*
* @return amount of entities
*/
private int getEntityCountPaper() {
return plugin.getServer().getWorlds().stream().mapToInt(World::getEntityCount).sum();
}
}

View File

@ -3,9 +3,9 @@ package main.java.com.djrapitops.plan.database;
/**
* Class to contain objects in the batches.
*
* @param <T> Object stored.
* @author Rsl1122
* @since 3.4.3
* @param <T> Object stored.
*/
public class Container<T> {
@ -16,7 +16,7 @@ public class Container<T> {
* Constructor for the object.
*
* @param object Object to place inside the container.
* @param id UserID related to the object.
* @param id UserID related to the object.
*/
public Container(T object, int id) {
this.object = object;

View File

@ -25,9 +25,9 @@ public class DBUtils {
* Splits a collection of objects into lists with the size defined by
* BATCH_SIZE.
*
* @param <T> Object type
* @param <T> Object type
* @param objects Collection of the objects. // * @return Lists with max
* size of BATCH_SIZE.
* size of BATCH_SIZE.
* @return
*/
public static <T> List<List<T>> splitIntoBatches(Collection<T> objects) {
@ -50,7 +50,6 @@ public class DBUtils {
}
/**
*
* @param <T>
* @param objects
* @return

View File

@ -10,7 +10,7 @@ import java.util.*;
/**
* Abstract class representing a Database.
*
* <p>
* All methods should be only called from an asynchronous thread, unless stated
* otherwise.
*
@ -91,7 +91,7 @@ public abstract class Database {
/**
* Initiates the database.
*
* <p>
* Default method returns false.
*
* @return Was the initiation successful?
@ -103,12 +103,12 @@ public abstract class Database {
/**
* Used to give Database processors to call with UserData after they have
* been fetched from the database.
*
* <p>
* This method is a shortcut method for multiple parameters.
*
* @param uuid UUID of the player.
* @param uuid UUID of the player.
* @param processors Processors to call with the UserData after the fetch is
* complete.
* complete.
* @throws SQLException If a database error occurs.
*/
public void giveUserDataToProcessors(UUID uuid, DBCallableProcessor... processors) throws SQLException {
@ -119,16 +119,16 @@ public abstract class Database {
* Used to give Database processors to call with UserData after they have
* been fetched from the database.
*
* @param uuid UUID of the player.
* @param uuid UUID of the player.
* @param processors Processors to call with the UserData after the fetch is
* complete.
* complete.
* @throws SQLException If a database error occurs.
*/
public abstract void giveUserDataToProcessors(UUID uuid, Collection<DBCallableProcessor> processors) throws SQLException;
/**
* Used to get all UserData for multiple UUIDs.
*
* <p>
* Should only be called from async thread.
*
* @param uuids UUIDs to fetch data for.
@ -168,7 +168,7 @@ public abstract class Database {
/**
* Used to get the name of the database type.
*
* <p>
* Thread safe.
*
* @return SQLite/MySQL
@ -177,7 +177,7 @@ public abstract class Database {
/**
* Used to get the config name of the database type.
*
* <p>
* Thread safe.
*
* @return sqlite/mysql
@ -199,7 +199,7 @@ public abstract class Database {
* Used to set the database schema version.
*
* @param version Integer starting from 0, incremented by one when schema is
* updated.
* updated.
* @throws SQLException If a database error occurs.
*/
public abstract void setVersion(int version) throws SQLException;
@ -222,7 +222,7 @@ public abstract class Database {
/**
* Used to clear all data from the database.
*
* <p>
* Uses DELETE * FROM table.
*
* @return Success of removal.
@ -233,7 +233,7 @@ public abstract class Database {
* Used to save CommandUse map.
*
* @param data String command (key), Integer times used
* @throws SQLException If a database error occurs.
* @throws SQLException If a database error occurs.
* @throws NullPointerException If the database has not initialized tables.
*/
public void saveCommandUse(Map<String, Integer> data) throws SQLException, NullPointerException {

View File

@ -1,15 +1,15 @@
package main.java.com.djrapitops.plan.database.databases;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
import org.bukkit.configuration.file.FileConfiguration;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
*
* @author Rsl1122
*/
public class MySQLDB extends SQLDB {
@ -45,7 +45,6 @@ public class MySQLDB extends SQLDB {
}
/**
*
* @return
*/
@Override

View File

@ -20,7 +20,6 @@ import java.util.function.Function;
import java.util.stream.Collectors;
/**
*
* @author Rsl1122
*/
public abstract class SQLDB extends Database {
@ -30,7 +29,6 @@ public abstract class SQLDB extends Database {
private Connection connection;
/**
*
* @param plugin
* @param supportsModification
*/
@ -75,7 +73,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
@Override
@ -99,7 +96,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return @throws SQLException
*/
public boolean checkConnection() throws SQLException {
@ -178,7 +174,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
public Table[] getAllTables() {
@ -186,7 +181,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
public Table[] getAllTablesInRemoveOrder() {
@ -194,13 +188,11 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
public abstract Connection getNewConnection();
/**
*
* @throws SQLException
*/
@Override
@ -212,7 +204,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return @throws SQLException
*/
@Override
@ -221,7 +212,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @param version
* @throws SQLException
*/
@ -231,7 +221,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @param uuid
* @return
*/
@ -252,7 +241,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @param uuid
* @return
* @throws SQLException
@ -281,7 +269,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @param uuid
* @param processors
* @throws SQLException
@ -319,13 +306,12 @@ public abstract class SQLDB extends Database {
List<SessionData> sessions = sessionsTable.getSessionData(userId);
data.addSessions(sessions);
data.setPlayerKills(killsTable.getPlayerKills(userId));
processors.forEach((processor) -> processor.process(data));
processors.forEach(processor -> processor.process(data));
Benchmark.stop("Database: Give userdata to processors");
setAvailable();
}
/**
*
* @param uuidsCol
* @return
* @throws SQLException
@ -339,7 +325,7 @@ public abstract class SQLDB extends Database {
Benchmark.start("Database: Get UserData for " + uuidsCol.size());
Map<UUID, Integer> userIds = usersTable.getAllUserIds();
Set<UUID> remove = uuidsCol.stream()
.filter((uuid) -> (!userIds.containsKey(uuid)))
.filter(uuid -> !userIds.containsKey(uuid))
.collect(Collectors.toSet());
List<UUID> uuids = new ArrayList<>(uuidsCol);
Log.debug("Data not found for: " + remove.size());
@ -359,6 +345,7 @@ public abstract class SQLDB extends Database {
Map<Integer, List<SessionData>> sessionData = sessionsTable.getSessionData(ids);
Map<Integer, Map<String, Long>> gmTimes = gmTimesTable.getGMTimes(ids);
Log.debug("Sizes: UUID:" + uuids.size() + " DATA:" + data.size() + " ID:" + userIds.size() + " N:" + nicknames.size() + " I:" + ipList.size() + " K:" + playerKills.size() + " S:" + sessionData.size());
for (UserData uData : data) {
UUID uuid = uData.getUuid();
Integer id = userIds.get(uuid);
@ -368,13 +355,13 @@ public abstract class SQLDB extends Database {
uData.setPlayerKills(playerKills.get(id));
uData.setGmTimes(gmTimes.get(id));
}
Benchmark.stop("Database: Get UserData for " + uuidsCol.size());
setAvailable();
return data;
}
/**
*
* @param data
* @throws SQLException
*/
@ -430,7 +417,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @param data
* @throws SQLException
*/
@ -476,7 +462,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
@Override
@ -492,7 +477,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
public boolean supportsModification() {
@ -500,7 +484,6 @@ public abstract class SQLDB extends Database {
}
/**
*
* @return
*/
public Connection getConnection() {

View File

@ -1,13 +1,13 @@
package main.java.com.djrapitops.plan.database.databases;
import main.java.com.djrapitops.plan.Plan;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import main.java.com.djrapitops.plan.Plan;
/**
*
* @author Rsl1122
*/
public class SQLiteDB extends SQLDB {
@ -24,7 +24,6 @@ public class SQLiteDB extends SQLDB {
}
/**
*
* @param plugin
* @param dbName
*/
@ -44,7 +43,6 @@ public class SQLiteDB extends SQLDB {
}
/**
*
* @param dbName
* @return
*/
@ -59,7 +57,6 @@ public class SQLiteDB extends SQLDB {
}
/**
*
* @return
*/
@Override

View File

@ -1,16 +1,16 @@
package main.java.com.djrapitops.plan.database.tables;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.utilities.Benchmark;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.utilities.Benchmark;
/**
*
* @author Rsl1122
*/
public class CommandUseTable extends Table {
@ -19,7 +19,6 @@ public class CommandUseTable extends Table {
private final String columnTimesUsed;
/**
*
* @param db
* @param usingMySQL
*/
@ -30,7 +29,6 @@ public class CommandUseTable extends Table {
}
/**
*
* @return
*/
@Override
@ -49,7 +47,6 @@ public class CommandUseTable extends Table {
}
/**
*
* @return @throws SQLException
*/
public Map<String, Integer> getCommandUse() throws SQLException {
@ -78,7 +75,6 @@ public class CommandUseTable extends Table {
}
/**
*
* @param data
* @throws SQLException
* @throws NullPointerException

View File

@ -10,7 +10,6 @@ import java.sql.SQLException;
import java.util.*;
/**
*
* @author Rsl1122
*/
public class GMTimesTable extends Table {
@ -22,7 +21,6 @@ public class GMTimesTable extends Table {
private final String columnSpectatorTime;
/**
*
* @param db
* @param usingMySQL
*/
@ -40,7 +38,6 @@ public class GMTimesTable extends Table {
}
/**
*
* @return
*/
@Override
@ -64,7 +61,6 @@ public class GMTimesTable extends Table {
}
/**
*
* @param userId
* @return
*/
@ -84,7 +80,6 @@ public class GMTimesTable extends Table {
}
/**
*
* @param userId
* @return
* @throws SQLException
@ -137,7 +132,6 @@ public class GMTimesTable extends Table {
}
/**
*
* @param userId
* @param gamemodeTimes
* @throws SQLException
@ -152,11 +146,11 @@ public class GMTimesTable extends Table {
try {
statement = prepareStatement(
"UPDATE " + tableName + " SET "
+ columnSurvivalTime + "=?, "
+ columnCreativeTime + "=?, "
+ columnAdventureTime + "=?, "
+ columnSpectatorTime + "=? "
+ " WHERE (" + columnUserID + "=?)");
+ columnSurvivalTime + "=?, "
+ columnCreativeTime + "=?, "
+ columnAdventureTime + "=?, "
+ columnSpectatorTime + "=? "
+ " WHERE (" + columnUserID + "=?)");
statement.setInt(5, userId);
for (int i = 0; i < gms.length; i++) {
try {
@ -208,11 +202,11 @@ public class GMTimesTable extends Table {
try {
statement = prepareStatement(
"UPDATE " + tableName + " SET "
+ columnSurvivalTime + "=?, "
+ columnCreativeTime + "=?, "
+ columnAdventureTime + "=?, "
+ columnSpectatorTime + "=? "
+ " WHERE (" + columnUserID + "=?)");
+ columnSurvivalTime + "=?, "
+ columnCreativeTime + "=?, "
+ columnAdventureTime + "=?, "
+ columnSpectatorTime + "=? "
+ " WHERE (" + columnUserID + "=?)");
boolean commitRequired = false;
for (Integer id : gamemodeTimes.keySet()) {
if (!savedIDs.contains(id)) {
@ -256,12 +250,12 @@ public class GMTimesTable extends Table {
try {
statement = prepareStatement(
"INSERT INTO " + tableName + " ("
+ columnUserID + ", "
+ columnSurvivalTime + ", "
+ columnCreativeTime + ", "
+ columnAdventureTime + ", "
+ columnSpectatorTime
+ ") VALUES (?, ?, ?, ?, ?)");
+ columnUserID + ", "
+ columnSurvivalTime + ", "
+ columnCreativeTime + ", "
+ columnAdventureTime + ", "
+ columnSpectatorTime
+ ") VALUES (?, ?, ?, ?, ?)");
boolean commitRequired = false;
for (Integer id : gamemodeTimes.keySet()) {
statement.setInt(1, id);

View File

@ -1,23 +1,17 @@
package main.java.com.djrapitops.plan.database.tables;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.utilities.Benchmark;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.utilities.Benchmark;
import java.util.*;
/**
*
* @author Rsl1122
*/
public class IPsTable extends Table {
@ -26,7 +20,6 @@ public class IPsTable extends Table {
private final String columnIP;
/**
*
* @param db
* @param usingMySQL
*/
@ -37,7 +30,6 @@ public class IPsTable extends Table {
}
/**
*
* @return
*/
@Override
@ -58,7 +50,6 @@ public class IPsTable extends Table {
}
/**
*
* @param userId
* @return
*/
@ -78,7 +69,6 @@ public class IPsTable extends Table {
}
/**
*
* @param userId
* @return
* @throws SQLException
@ -107,7 +97,6 @@ public class IPsTable extends Table {
}
/**
*
* @param userId
* @param ips
* @throws SQLException
@ -147,7 +136,6 @@ public class IPsTable extends Table {
}
/**
*
* @param ids
* @return
* @throws SQLException
@ -185,7 +173,6 @@ public class IPsTable extends Table {
}
/**
*
* @param ips
* @throws SQLException
*/

View File

@ -1,22 +1,17 @@
package main.java.com.djrapitops.plan.database.tables;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.data.KillData;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.utilities.Benchmark;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.stream.Collectors;
/**
*
* @author Rsl1122
*/
public class KillsTable extends Table {
@ -27,7 +22,6 @@ public class KillsTable extends Table {
private final String columnDate;
/**
*
* @param db
* @param usingMySQL
*/
@ -40,7 +34,6 @@ public class KillsTable extends Table {
}
/**
*
* @return
*/
@Override
@ -64,7 +57,6 @@ public class KillsTable extends Table {
}
/**
*
* @param userId
* @return
*/
@ -85,7 +77,6 @@ public class KillsTable extends Table {
}
/**
*
* @param userId
* @return
* @throws SQLException
@ -114,7 +105,6 @@ public class KillsTable extends Table {
}
/**
*
* @param userId
* @param kills
* @throws SQLException
@ -165,7 +155,6 @@ public class KillsTable extends Table {
}
/**
*
* @param ids
* @param uuids
* @return
@ -203,7 +192,6 @@ public class KillsTable extends Table {
}
/**
*
* @param kills
* @param uuids
* @throws SQLException

View File

@ -1,12 +1,12 @@
package main.java.com.djrapitops.plan.database.tables;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
*
* @author Rsl1122
*/
@Deprecated
@ -18,18 +18,7 @@ public class LocationsTable extends Table {
private final String columnCoordinatesZ;
private final String columnWorld;
@Override
@Deprecated
public boolean removeAllData() {
try {
execute("DELETE FROM " + tableName);
} catch (Exception e) {
}
return true;
}
/**
*
* @param db
* @param usingMySQL
*/
@ -43,8 +32,17 @@ public class LocationsTable extends Table {
columnWorld = "world_name";
}
@Override
@Deprecated
public boolean removeAllData() {
try {
execute("DELETE FROM " + tableName);
} catch (Exception e) {
}
return true;
}
/**
*
* @return
*/
@Override
@ -70,7 +68,6 @@ public class LocationsTable extends Table {
}
/**
*
* @param userId
* @return
*/

View File

@ -1,20 +1,15 @@
package main.java.com.djrapitops.plan.database.tables;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import main.java.com.djrapitops.plan.utilities.Benchmark;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
/**
*
* @author Rsl1122
*/
public class NicknamesTable extends Table {
@ -24,7 +19,6 @@ public class NicknamesTable extends Table {
private final String columnCurrent;
/**
*
* @param db
* @param usingMySQL
*/
@ -36,7 +30,6 @@ public class NicknamesTable extends Table {
}
/**
*
* @return
*/
@Override
@ -75,7 +68,6 @@ public class NicknamesTable extends Table {
}
/**
*
* @param userId
* @return
*/
@ -95,7 +87,6 @@ public class NicknamesTable extends Table {
}
/**
*
* @param userId
* @return
* @throws SQLException
@ -133,7 +124,6 @@ public class NicknamesTable extends Table {
}
/**
*
* @param userId
* @param names
* @param lastNick
@ -177,7 +167,6 @@ public class NicknamesTable extends Table {
}
/**
*
* @param ids
* @return
* @throws SQLException
@ -228,7 +217,6 @@ public class NicknamesTable extends Table {
}
/**
*
* @param nicknames
* @param lastNicks
* @throws SQLException

View File

@ -16,7 +16,6 @@ import java.util.ArrayList;
import java.util.List;
/**
*
* @author Rsl1122
*/
public class SecurityTable extends Table {

View File

@ -14,7 +14,6 @@ import java.sql.SQLException;
import java.util.*;
/**
*
* @author Rsl1122
*/
public class SessionsTable extends Table {
@ -24,7 +23,6 @@ public class SessionsTable extends Table {
private final String columnSessionEnd;
/**
*
* @param db
* @param usingMySQL
*/
@ -36,7 +34,6 @@ public class SessionsTable extends Table {
}
/**
*
* @return
*/
@Override
@ -58,7 +55,6 @@ public class SessionsTable extends Table {
}
/**
*
* @param userId
* @return
* @throws SQLException
@ -86,7 +82,6 @@ public class SessionsTable extends Table {
}
/**
*
* @param userId
* @return
*/
@ -106,7 +101,6 @@ public class SessionsTable extends Table {
}
/**
*
* @param userId
* @param sessions
* @throws SQLException
@ -152,7 +146,6 @@ public class SessionsTable extends Table {
}
/**
*
* @param ids
* @return
* @throws SQLException
@ -190,7 +183,6 @@ public class SessionsTable extends Table {
}
/**
*
* @param sessions
* @throws SQLException
*/
@ -255,7 +247,6 @@ public class SessionsTable extends Table {
}
/**
*
* @throws SQLException
*/
public void clean() throws SQLException {

View File

@ -37,6 +37,7 @@ public class TPSTable extends Table {
columnTPS = "tps";
columnPlayers = "players_online";
columnCPUUsage = "cpu_usage";
//TODO add new columns
}
@Override
@ -48,6 +49,7 @@ public class TPSTable extends Table {
+ columnPlayers + " integer NOT NULL, "
+ columnCPUUsage + " double NOT NULL"
+ ")"
//TODO add new columns
);
int version = getVersion();
if (version < 6) {
@ -72,6 +74,8 @@ public class TPSTable extends Table {
}
}
//TODO alterTablesV7
/**
* @return @throws SQLException
*/
@ -88,7 +92,8 @@ public class TPSTable extends Table {
double tps = set.getDouble(columnTPS);
int players = set.getInt(columnPlayers);
double cpuUsage = set.getDouble(columnCPUUsage);
data.add(new TPS(date, tps, players, cpuUsage));
//TODO add new data
data.add(new TPS(date, tps, players, cpuUsage, 0, 0, 0));
}
return data;
} finally {

View File

@ -13,7 +13,6 @@ import java.util.List;
import java.util.Map;
/**
*
* @author Rsl1122
*/
public abstract class Table {
@ -34,7 +33,6 @@ public abstract class Table {
protected final boolean usingMySQL;
/**
*
* @param name
* @param db
* @param usingMySQL
@ -46,13 +44,11 @@ public abstract class Table {
}
/**
*
* @return
*/
public abstract boolean createTable();
/**
*
* @return @throws SQLException
*/
protected Connection getConnection() throws SQLException {
@ -64,7 +60,6 @@ public abstract class Table {
}
/**
*
* @return @throws SQLException
*/
public int getVersion() throws SQLException {
@ -72,7 +67,6 @@ public abstract class Table {
}
/**
*
* @param sql
* @return
* @throws SQLException
@ -83,7 +77,6 @@ public abstract class Table {
}
/**
*
* @param sql
* @return
* @throws SQLException
@ -93,7 +86,6 @@ public abstract class Table {
}
/**
*
* @param toClose
*/
protected void close(AutoCloseable... toClose) {
@ -101,7 +93,6 @@ public abstract class Table {
}
/**
*
* @return
*/
public String getTableName() {
@ -109,7 +100,6 @@ public abstract class Table {
}
/**
*
* @return
*/
public boolean removeAllData() {
@ -123,7 +113,6 @@ public abstract class Table {
}
/**
*
* @param <T>
* @param objects
* @return

View File

@ -17,7 +17,6 @@ import java.util.function.Function;
import java.util.stream.Collectors;
/**
*
* @author Rsl1122
*/
public class UsersTable extends Table {
@ -44,7 +43,6 @@ public class UsersTable extends Table {
private final String columnContainsBukkitData;
/**
*
* @param db
* @param usingMySQL
*/
@ -72,7 +70,6 @@ public class UsersTable extends Table {
}
/**
*
* @return
*/
@Override
@ -129,19 +126,19 @@ public class UsersTable extends Table {
String[] queries;
if (usingMySQL) {
queries = new String[]{
"ALTER TABLE " + tableName + " ADD " + columnContainsBukkitData + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnOP + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnBanned + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnName + " varchar(16) NOT NULL DEFAULT \'Unknown\'",
"ALTER TABLE " + tableName + " ADD " + columnRegistered + " bigint NOT NULL DEFAULT 0"
"ALTER TABLE " + tableName + " ADD " + columnContainsBukkitData + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnOP + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnBanned + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnName + " varchar(16) NOT NULL DEFAULT \'Unknown\'",
"ALTER TABLE " + tableName + " ADD " + columnRegistered + " bigint NOT NULL DEFAULT 0"
};
} else {
queries = new String[]{
"ALTER TABLE " + tableName + " ADD COLUMN " + columnContainsBukkitData + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnOP + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnBanned + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnName + " varchar(16) NOT NULL DEFAULT \'Unknown\'",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnRegistered + " bigint NOT NULL DEFAULT 0"
"ALTER TABLE " + tableName + " ADD COLUMN " + columnContainsBukkitData + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnOP + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnBanned + " boolean NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnName + " varchar(16) NOT NULL DEFAULT \'Unknown\'",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnRegistered + " bigint NOT NULL DEFAULT 0"
};
}
for (String query : queries) {
@ -156,14 +153,14 @@ public class UsersTable extends Table {
String[] queries;
if (usingMySQL) {
queries = new String[]{
"ALTER TABLE " + tableName + " ADD " + columnDeaths + " integer NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnMobKills + " integer NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " DROP INDEX " + columnPlayerKills
"ALTER TABLE " + tableName + " ADD " + columnDeaths + " integer NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD " + columnMobKills + " integer NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " DROP INDEX " + columnPlayerKills
};
} else {
queries = new String[]{
"ALTER TABLE " + tableName + " ADD COLUMN " + columnDeaths + " integer NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnMobKills + " integer NOT NULL DEFAULT 0"
"ALTER TABLE " + tableName + " ADD COLUMN " + columnDeaths + " integer NOT NULL DEFAULT 0",
"ALTER TABLE " + tableName + " ADD COLUMN " + columnMobKills + " integer NOT NULL DEFAULT 0"
};
}
for (String query : queries) {
@ -175,7 +172,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuid
* @return
* @throws SQLException
@ -185,7 +181,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuid
* @return
* @throws SQLException
@ -209,7 +204,6 @@ public class UsersTable extends Table {
}
/**
*
* @param userID
* @return
* @throws SQLException
@ -233,7 +227,6 @@ public class UsersTable extends Table {
}
/**
*
* @return @throws SQLException
*/
public Set<UUID> getSavedUUIDs() throws SQLException {
@ -257,7 +250,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuid
* @return
*/
@ -266,7 +258,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuid
* @return
*/
@ -285,7 +276,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuid
* @return
* @throws SQLException
@ -324,7 +314,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuids
* @return
* @throws SQLException
@ -353,7 +342,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuids
* @return
* @throws SQLException
@ -457,7 +445,6 @@ public class UsersTable extends Table {
}
/**
*
* @param data
* @throws SQLException
*/
@ -487,7 +474,6 @@ public class UsersTable extends Table {
}
/**
*
* @param data
* @throws SQLException
*/
@ -523,7 +509,6 @@ public class UsersTable extends Table {
}
/**
*
* @param data
* @throws SQLException
*/
@ -656,7 +641,6 @@ public class UsersTable extends Table {
}
/**
*
* @param data
* @throws SQLException
*/
@ -782,7 +766,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuids
* @return
* @throws SQLException
@ -812,7 +795,6 @@ public class UsersTable extends Table {
}
/**
*
* @return @throws SQLException
*/
public Map<UUID, Integer> getAllUserIds() throws SQLException {
@ -837,7 +819,6 @@ public class UsersTable extends Table {
}
/**
*
* @return @throws SQLException
*/
public Map<Integer, Integer> getLoginTimes() throws SQLException {
@ -861,7 +842,6 @@ public class UsersTable extends Table {
}
/**
*
* @return
*/
public String getColumnID() {
@ -869,7 +849,6 @@ public class UsersTable extends Table {
}
/**
*
* @param playername
* @return
* @throws SQLException
@ -893,7 +872,6 @@ public class UsersTable extends Table {
}
/**
*
* @param uuids
* @return
*/

View File

@ -1,19 +1,18 @@
package main.java.com.djrapitops.plan.database.tables;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.database.databases.SQLDB;
/**
*
* @author Rsl1122
*/
public class VersionTable extends Table {
/**
*
* @param db
* @param usingMySQL
*/
@ -22,7 +21,6 @@ public class VersionTable extends Table {
}
/**
*
* @return
*/
@Override
@ -40,7 +38,6 @@ public class VersionTable extends Table {
}
/**
*
* @return @throws SQLException
*/
@Override
@ -62,7 +59,6 @@ public class VersionTable extends Table {
}
/**
*
* @param version
* @throws SQLException
*/

View File

@ -11,7 +11,6 @@ import java.io.FileNotFoundException;
import java.util.UUID;
/**
*
* @author Rsl1122
*/
public class DataRequestHandler {
@ -43,7 +42,7 @@ public class DataRequestHandler {
* Returns the player.html as string with replaced placeholders.
*
* @param uuid UUID of player, whose UserData is used to replace
* placeholders with
* placeholders with
* @return The html
*/
public String getInspectHtml(UUID uuid) {

View File

@ -1,15 +1,15 @@
package main.java.com.djrapitops.plan.ui.html;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import main.java.com.djrapitops.plan.Log;
/**
*
* @author Rsl1122
*/
public enum Html {
@ -112,37 +112,6 @@ public enum Html {
}
/**
*
* @return
*/
public String parse() {
return html;
}
/**
*
* @param p
* @return
*/
public String parse(String... p) {
Verify.nullCheck(p);
String returnValue = this.html;
for (int i = 0; i < p.length; i++) {
returnValue = returnValue.replace("REPLACE" + i, p[i]);
}
return returnValue;
}
/**
*
* @param html
*/
public void setHtml(String html) {
this.html = html;
}
/**
*
* @param localeFile
*/
public static void loadLocale(File localeFile) {
@ -173,4 +142,31 @@ public enum Html {
}
}
/**
* @return
*/
public String parse() {
return html;
}
/**
* @param p
* @return
*/
public String parse(String... p) {
Verify.nullCheck(p);
String returnValue = this.html;
for (int i = 0; i < p.length; i++) {
returnValue = returnValue.replace("REPLACE" + i, p[i]);
}
return returnValue;
}
/**
* @param html
*/
public void setHtml(String html) {
this.html = html;
}
}

View File

@ -5,7 +5,6 @@ import main.java.com.djrapitops.plan.utilities.HtmlUtils;
import java.util.List;
/**
*
* @author Rsl1122
*/
public class RecentPlayersButtonsCreator {

View File

@ -1,7 +1,6 @@
package main.java.com.djrapitops.plan.ui.html.graphs;
import main.java.com.djrapitops.plan.data.TPS;
import main.java.com.djrapitops.plan.utilities.FormatUtils;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import main.java.com.djrapitops.plan.utilities.analysis.Point;
@ -13,7 +12,7 @@ public class CPUGraphCreator {
long now = MiscUtils.getTime();
List<Point> points = tpsData.stream()
.filter(tps -> tps.getDate() >= now - scale)
.map(tps -> new Point(tps.getDate(), Double.parseDouble(FormatUtils.cutDecimals(tps.getCPUUsage()).replace(",", "."))))
.map(tps -> new Point(tps.getDate(), tps.getCPUUsage()))
.collect(Collectors.toList());
return ScatterGraphCreator.scatterGraph(points, true);
}

View File

@ -17,13 +17,11 @@ import java.util.Objects;
import java.util.stream.Collectors;
/**
*
* @author Rsl1122
*/
public class PunchCardGraphCreator {
/**
*
* @param data
* @return
*/

View File

@ -5,25 +5,20 @@
*/
package main.java.com.djrapitops.plan.ui.html.graphs;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import main.java.com.djrapitops.plan.data.SessionData;
import main.java.com.djrapitops.plan.utilities.analysis.AnalysisUtils;
import main.java.com.djrapitops.plan.utilities.analysis.MathUtils;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
/**
*
* @author Rsl1122
*/
public class SessionLengthDistributionGraphCreator {
/**
*
* @param data
* @return
*/
@ -33,7 +28,6 @@ public class SessionLengthDistributionGraphCreator {
}
/**
*
* @param lengths
* @return
*/

Some files were not shown because too many files have changed in this diff Show More