mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-02 14:37:45 +01:00
[Merge] Version 4.6.2 (#909)
This commit is contained in:
commit
9b08037d68
@ -26,10 +26,13 @@ jobs:
|
||||
- stage: "System Tests"
|
||||
name: "Test environment setup"
|
||||
script: bash scripts/prepareServerJars.sh
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||
cache:
|
||||
directories:
|
||||
- '$HOME/.m2/repository'
|
||||
- '$HOME/.sonar/cache'
|
||||
- '$HOME/.gradle'
|
||||
- '.gradle'
|
||||
- '$HOME/.gradle/caches/'
|
||||
- '$HOME/.gradle/wrapper/'
|
||||
- '$HOME/servers/'
|
||||
|
@ -12,7 +12,7 @@ allprojects {
|
||||
wrapper.gradleVersion = "5.0"
|
||||
|
||||
group "com.djrapitops"
|
||||
version "4.6.1-SNAPSHOT"
|
||||
version "4.6.2-SNAPSHOT"
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
@ -46,7 +46,7 @@ subprojects {
|
||||
ext.daggerCompilerVersion = "2.21"
|
||||
|
||||
ext.abstractPluginFrameworkVersion = "3.4.1"
|
||||
ext.planPluginBridgeVersion = "4.6.1"
|
||||
ext.planPluginBridgeVersion = "4.6.2"
|
||||
|
||||
ext.bukkitVersion = "1.12.2-R0.1-SNAPSHOT"
|
||||
ext.spigotVersion = "1.12.2-R0.1-SNAPSHOT"
|
||||
@ -56,7 +56,7 @@ subprojects {
|
||||
ext.velocityVersion = "1.0-SNAPSHOT"
|
||||
ext.redisBungeeVersion = "0.3.8-SNAPSHOT"
|
||||
|
||||
ext.httpClientVersion = "4.5.6"
|
||||
ext.httpClientVersion = "4.5.7"
|
||||
ext.commonsTextVersion = "1.6"
|
||||
ext.htmlCompressorVersion = "1.5.2"
|
||||
ext.caffeineVersion = "2.6.2"
|
||||
@ -107,14 +107,14 @@ subprojects {
|
||||
testCompile "org.junit.vintage:junit-vintage-engine:5.3.2" // JUnit 4 compatibility for JUnit 5
|
||||
testCompile "org.junit.jupiter:junit-jupiter-params:5.3.2" // JUnit 5, parameterized tests
|
||||
testCompile "org.junit-pioneer:junit-pioneer:0.3.0" // TempDirectory TODO REMOVE W/ JUNIT 5.4
|
||||
testCompile "org.mockito:mockito-core:2.23.4" // Mockito Core
|
||||
testCompile "org.mockito:mockito-junit-jupiter:2.23.4" // Mockito JUnit 5 Extension
|
||||
testCompile "org.mockito:mockito-core:2.24.0" // Mockito Core
|
||||
testCompile "org.mockito:mockito-junit-jupiter:2.24.0" // Mockito JUnit 5 Extension
|
||||
testCompile "org.seleniumhq.selenium:selenium-java:3.141.59" // Selenium (Browser tests)
|
||||
testCompile "com.jayway.awaitility:awaitility:1.7.0" // Awaitility (Concurrent wait conditions)
|
||||
|
||||
// Testing dependencies required by Plan
|
||||
testCompile "org.xerial:sqlite-jdbc:3.25.2" // SQLite
|
||||
testCompile "mysql:mysql-connector-java:8.0.13" // MySQL
|
||||
testCompile "mysql:mysql-connector-java:8.0.15" // MySQL
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,7 +126,7 @@ public class NetworkContainer extends DataContainer {
|
||||
"<h2><i class=\"col-light-green fa fa-servers\"></i> No Servers</h2>" +
|
||||
"</div><div class=\"body\">" +
|
||||
"<p>No Bukkit/Sponge servers connected to Plan.</p>" +
|
||||
"</div></div></div></div>");
|
||||
"</div></div></div></div></div></div>");
|
||||
}
|
||||
return serverBoxes.toString();
|
||||
});
|
||||
|
@ -39,7 +39,7 @@ public class KillsServerIDPatch extends Patch {
|
||||
|
||||
// KillsOptimizationPatch makes this patch incompatible with newer patch versions.
|
||||
return hasColumn(tableName, KillsTable.Col.SERVER_UUID.get())
|
||||
|| hasColumn(tableName, columnName) && allValuesHaveServerID(tableName, columnName);
|
||||
|| (hasColumn(tableName, columnName) && allValuesHaveServerID(tableName, columnName));
|
||||
}
|
||||
|
||||
private Boolean allValuesHaveServerID(String tableName, String columnName) {
|
||||
@ -59,6 +59,10 @@ public class KillsServerIDPatch extends Patch {
|
||||
|
||||
@Override
|
||||
protected void applyPatch() {
|
||||
if (hasColumn(KillsTable.TABLE_NAME, KillsTable.Col.SERVER_UUID.get())) {
|
||||
return;
|
||||
}
|
||||
|
||||
addColumn(KillsTable.TABLE_NAME, "server_id integer NOT NULL DEFAULT 0");
|
||||
|
||||
Map<Integer, Integer> sessionIDServerIDRelation = db.getSessionsTable().getIDServerIDRelation();
|
||||
|
@ -178,7 +178,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
|
||||
public WorldTimes getWorldTimesOfServer(UUID serverUUID) {
|
||||
String worldIDColumn = worldTable + "." + WorldTable.Col.ID;
|
||||
String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world_name";
|
||||
String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world";
|
||||
String sql = "SELECT " +
|
||||
"SUM(" + Col.SURVIVAL + ") as survival, " +
|
||||
"SUM(" + Col.CREATIVE + ") as creative, " +
|
||||
@ -188,7 +188,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
" FROM " + tableName +
|
||||
" INNER JOIN " + worldTable + " on " + worldIDColumn + "=" + Col.WORLD_ID +
|
||||
" WHERE " + tableName + "." + Col.SERVER_UUID + "=?" +
|
||||
" GROUP BY " + Col.WORLD_ID;
|
||||
" GROUP BY world";
|
||||
|
||||
return query(new QueryStatement<WorldTimes>(sql, 1000) {
|
||||
@Override
|
||||
@ -202,7 +202,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
|
||||
WorldTimes worldTimes = new WorldTimes(new HashMap<>());
|
||||
while (set.next()) {
|
||||
String worldName = set.getString("world_name");
|
||||
String worldName = set.getString("world");
|
||||
|
||||
Map<String, Long> gmMap = new HashMap<>();
|
||||
gmMap.put(gms[0], set.getLong("survival"));
|
||||
@ -220,7 +220,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
|
||||
public WorldTimes getWorldTimesOfUser(UUID uuid) {
|
||||
String worldIDColumn = worldTable + "." + WorldTable.Col.ID;
|
||||
String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world_name";
|
||||
String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world";
|
||||
String sql = "SELECT " +
|
||||
"SUM(" + Col.SURVIVAL + ") as survival, " +
|
||||
"SUM(" + Col.CREATIVE + ") as creative, " +
|
||||
@ -230,7 +230,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
" FROM " + tableName +
|
||||
" INNER JOIN " + worldTable + " on " + worldIDColumn + "=" + Col.WORLD_ID +
|
||||
" WHERE " + Col.UUID + "=?" +
|
||||
" GROUP BY " + Col.WORLD_ID;
|
||||
" GROUP BY world";
|
||||
|
||||
return query(new QueryStatement<WorldTimes>(sql) {
|
||||
@Override
|
||||
@ -244,7 +244,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
|
||||
WorldTimes worldTimes = new WorldTimes(new HashMap<>());
|
||||
while (set.next()) {
|
||||
String worldName = set.getString("world_name");
|
||||
String worldName = set.getString("world");
|
||||
|
||||
Map<String, Long> gmMap = new HashMap<>();
|
||||
gmMap.put(gms[0], set.getLong("survival"));
|
||||
@ -262,7 +262,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
|
||||
public Map<Integer, WorldTimes> getAllWorldTimesBySessionID() {
|
||||
String worldIDColumn = worldTable + "." + WorldTable.Col.ID;
|
||||
String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world_name";
|
||||
String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world";
|
||||
String sql = "SELECT " +
|
||||
Col.SESSION_ID + ", " +
|
||||
Col.SURVIVAL + ", " +
|
||||
@ -282,7 +282,7 @@ public class WorldTimesTable extends UserUUIDTable {
|
||||
while (set.next()) {
|
||||
int sessionID = set.getInt(Col.SESSION_ID.get());
|
||||
|
||||
String worldName = set.getString("world_name");
|
||||
String worldName = set.getString("world");
|
||||
|
||||
Map<String, Long> gmMap = new HashMap<>();
|
||||
gmMap.put(gms[0], set.getLong(Col.SURVIVAL.get()));
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: Plan
|
||||
author: Rsl1122
|
||||
main: com.djrapitops.plan.PlanBungee
|
||||
version: 4.6.1
|
||||
version: 4.6.2
|
||||
softdepend:
|
||||
- AdvancedBan
|
||||
- LiteBans
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: Plan
|
||||
author: Rsl1122
|
||||
main: com.djrapitops.plan.Plan
|
||||
version: 4.6.1
|
||||
version: 4.6.2
|
||||
softdepend:
|
||||
- EssentialsX
|
||||
- Towny
|
||||
|
@ -637,6 +637,7 @@
|
||||
if (slideIndex < 0) {
|
||||
slideIndex = max
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
window.sessionStorage.setItem("NetworkSlideIndex", slideIndex);
|
||||
var value = slideIndex * percent;
|
||||
x.style.transition = "0.5s";
|
||||
|
@ -910,6 +910,7 @@
|
||||
if (slideIndex < 0) {
|
||||
slideIndex = max
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
window.sessionStorage.setItem("InspectSlideIndex", slideIndex);
|
||||
var value = slideIndex * percent;
|
||||
x.style.transition = "0.5s";
|
||||
|
@ -331,6 +331,7 @@
|
||||
if (slideIndex < 0) {
|
||||
slideIndex = max
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
window.sessionStorage.setItem("AnalysisSlideIndex", slideIndex);
|
||||
var value = slideIndex * percent;
|
||||
x.style.transition = "0.5s";
|
||||
|
@ -1542,6 +1542,7 @@
|
||||
if (slideIndex < 0) {
|
||||
slideIndex = max
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
window.sessionStorage.setItem("AnalysisSlideIndex", slideIndex);
|
||||
var value = slideIndex * percent;
|
||||
x.style.transition = "0.5s";
|
||||
|
@ -42,7 +42,7 @@ import java.io.InputStream;
|
||||
@Plugin(
|
||||
id = "plan",
|
||||
name = "Plan",
|
||||
version = "4.6.1",
|
||||
version = "4.6.2",
|
||||
description = "Player Analytics Plugin by Rsl1122",
|
||||
authors = {"Rsl1122"},
|
||||
dependencies = {
|
||||
|
@ -46,7 +46,7 @@ import java.nio.file.Path;
|
||||
@Plugin(
|
||||
id = "plan",
|
||||
name = "Plan",
|
||||
version = "4.6.1",
|
||||
version = "4.6.2",
|
||||
description = "Player Analytics Plugin by Rsl1122",
|
||||
authors = {"Rsl1122"}
|
||||
)
|
||||
|
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.djrapitops</groupId>
|
||||
<artifactId>PlanPluginBridge</artifactId>
|
||||
<version>4.6.1</version>
|
||||
<version>4.6.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.groupId}:${project.artifactId}</name>
|
||||
@ -95,7 +95,7 @@
|
||||
<dependency>
|
||||
<groupId>com.djrapitops</groupId>
|
||||
<artifactId>Plan-plugin</artifactId>
|
||||
<version>4.5.0-SNAPSHOT</version>
|
||||
<version>4.6.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -132,6 +132,13 @@
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.dagger</groupId>
|
||||
<artifactId>dagger</artifactId>
|
||||
<version>2.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Plugins from repositories -->
|
||||
|
||||
<dependency>
|
||||
@ -315,7 +322,7 @@
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.2</version>
|
||||
<version>0.8.3</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
@ -25,8 +25,6 @@ import litebans.api.Database;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static github.scarsz.discordsrv.util.PluginUtil.getPlugin;
|
||||
|
||||
/**
|
||||
* A Class responsible for hooking to LiteBans and registering data
|
||||
* sources.
|
||||
@ -54,8 +52,7 @@ public class LiteBansBukkitHook extends Hook {
|
||||
|
||||
public void hook(HookHandler handler) throws NoClassDefFoundError {
|
||||
if (enabled) {
|
||||
String tablePrefix = getPlugin("LiteBans").getConfig().getString("sql.table_prefix");
|
||||
LiteBansDatabaseQueries db = new LiteBansDatabaseQueries(tablePrefix);
|
||||
LiteBansDatabaseQueries db = new LiteBansDatabaseQueries();
|
||||
handler.addPluginDataSource(new LiteBansData(db, timestampFormatter));
|
||||
}
|
||||
}
|
||||
|
@ -21,17 +21,9 @@ import com.djrapitops.plan.utilities.formatting.Formatter;
|
||||
import com.djrapitops.plan.utilities.formatting.Formatters;
|
||||
import com.djrapitops.pluginbridge.plan.Hook;
|
||||
import litebans.api.Database;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
import net.md_5.bungee.config.YamlConfiguration;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A Class responsible for hooking to LiteBans and registering data
|
||||
@ -60,22 +52,8 @@ public class LiteBansBungeeHook extends Hook {
|
||||
|
||||
public void hook(HookHandler handler) throws NoClassDefFoundError {
|
||||
if (enabled) {
|
||||
LiteBansDatabaseQueries db = new LiteBansDatabaseQueries(getTablePrefix());
|
||||
LiteBansDatabaseQueries db = new LiteBansDatabaseQueries();
|
||||
handler.addPluginDataSource(new LiteBansData(db, timestampFormatter));
|
||||
}
|
||||
}
|
||||
|
||||
private String getTablePrefix() {
|
||||
String tablePrefix = "libeans_";
|
||||
try {
|
||||
File litebansDataFolder = ProxyServer.getInstance().getPluginManager().getPlugin("LiteBans").getDataFolder();
|
||||
File configFile = new File(litebansDataFolder, "config.yml");
|
||||
|
||||
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
|
||||
tablePrefix = configuration.getString("sql.table_prefix");
|
||||
} catch (NullPointerException | IOException e) {
|
||||
Logger.getLogger("Plan").log(Level.WARNING, "Could not get Litebans table prefix, using default (litebans_). " + e.toString());
|
||||
}
|
||||
return tablePrefix;
|
||||
}
|
||||
}
|
||||
|
@ -45,13 +45,13 @@ public class LiteBansDatabaseQueries extends Table {
|
||||
|
||||
private final String selectSQL;
|
||||
|
||||
public LiteBansDatabaseQueries(String tablePrefix) {
|
||||
public LiteBansDatabaseQueries() {
|
||||
super("litebans", null);
|
||||
database = Database.get();
|
||||
banTable = tablePrefix + "bans";
|
||||
mutesTable = tablePrefix + "mutes";
|
||||
warningsTable = tablePrefix + "warnings";
|
||||
kicksTable = tablePrefix + "kicks";
|
||||
banTable = "{bans}";
|
||||
mutesTable = "{mutes}";
|
||||
warningsTable = "{warnings}";
|
||||
kicksTable = "{kicks}";
|
||||
selectSQL = "SELECT uuid, reason, banned_by_name, until, active, time FROM ";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user