[Breaking] Remove rank stuff from database

This commit is contained in:
Telesphoreo 2023-10-29 23:00:12 -05:00
parent 3e9be76aa2
commit 3608e8e825
10 changed files with 28 additions and 43 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

7
gradlew vendored
View File

@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in

View File

@ -37,9 +37,9 @@ publishing {
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.28")
annotationProcessor("org.projectlombok:lombok:1.18.28")
compileOnly("org.json:json:20230618")
compileOnly("org.projectlombok:lombok:1.18.30")
annotationProcessor("org.projectlombok:lombok:1.18.30")
compileOnly("org.json:json:20231013")
compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
annotationProcessor("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
}

View File

@ -3,14 +3,14 @@ plugins {
}
dependencies {
library "org.projectlombok:lombok:1.18.28"
annotationProcessor "org.projectlombok:lombok:1.18.28"
library "org.json:json:20230618"
library "commons-io:commons-io:2.13.0"
library "redis.clients:jedis:5.0.0-beta2"
library "org.mariadb.jdbc:mariadb-java-client:3.1.4"
library "org.projectlombok:lombok:1.18.30"
annotationProcessor "org.projectlombok:lombok:1.18.30"
library "org.json:json:20231013"
library "commons-io:commons-io:2.15.0"
library "redis.clients:jedis:5.0.2"
library "org.mariadb.jdbc:mariadb-java-client:3.2.0"
library "com.zaxxer:HikariCP:5.0.1"
library "org.apache.maven.resolver:maven-resolver-transport-http:1.9.15"
library "org.apache.maven.resolver:maven-resolver-transport-http:1.9.16"
library "org.jetbrains:annotations:24.0.1"
compileOnly "dev.folia:folia-api:1.20.1-R0.1-SNAPSHOT"
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") {

View File

@ -30,9 +30,9 @@ public class PlexLibraryManager implements PluginLoader
// The plugin is null, a hacky way to check whether to load Jetty or not
if (new File("plugins/Plex/modules/Plex-HTTPD.jar").isFile())
{
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-server:11.0.15"), null));
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-servlet:11.0.15"), null));
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-proxy:11.0.15"), null));
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-server:11.0.17"), null));
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-servlet:11.0.17"), null));
resolver.addDependency(new Dependency(new DefaultArtifact("org.eclipse.jetty:jetty-proxy:11.0.17"), null));
}
classpathBuilder.addLibrary(resolver);
}

View File

@ -49,8 +49,6 @@ public class PlexPlayer
private transient boolean muted;
private transient boolean lockedUp;
private boolean adminActive;
private long coins;
private List<String> ips = Lists.newArrayList();

View File

@ -57,7 +57,6 @@ public class TimingService extends AbstractService
}
punishment.setEndDate(TimeUtils.createDate("5m"));
punishment.setCustomTime(false);
punishment.setActive(!plexPlayer.isAdminActive());
plugin.getPunishmentManager().punish(plexPlayer, punishment);
}

View File

@ -86,7 +86,6 @@ public class SQLPlayerData
String name = set.getString("name");
String loginMSG = set.getString("login_msg");
String prefix = set.getString("prefix");
boolean adminActive = set.getBoolean("adminActive");
long coins = set.getLong("coins");
boolean vanished = set.getBoolean("vanished");
boolean commandspy = set.getBoolean("commandspy");
@ -96,7 +95,6 @@ public class SQLPlayerData
plexPlayer.setName(name);
plexPlayer.setLoginMessage(loginMSG);
plexPlayer.setPrefix(prefix);
plexPlayer.setAdminActive(adminActive);
plexPlayer.setIps(ips);
plexPlayer.setCoins(coins);
plexPlayer.setVanished(vanished);
@ -175,7 +173,6 @@ public class SQLPlayerData
plexPlayer.setName(username);
plexPlayer.setLoginMessage(loginMSG);
plexPlayer.setPrefix(prefix);
plexPlayer.setAdminActive(adminActive);
plexPlayer.setIps(ips);
plexPlayer.setCoins(coins);
plexPlayer.setVanished(vanished);
@ -227,8 +224,6 @@ public class SQLPlayerData
String name = set.getString("name");
String loginMSG = set.getString("login_msg");
String prefix = set.getString("prefix");
String rankName = set.getString("rank").toUpperCase();
boolean adminActive = set.getBoolean("adminActive");
long coins = set.getLong("coins");
boolean vanished = set.getBoolean("vanished");
boolean commandspy = set.getBoolean("commandspy");
@ -239,7 +234,6 @@ public class SQLPlayerData
plexPlayer.setName(name);
plexPlayer.setLoginMessage(loginMSG);
plexPlayer.setPrefix(prefix);
plexPlayer.setAdminActive(adminActive);
plexPlayer.setIps(ips);
plexPlayer.setCoins(coins);
plexPlayer.setVanished(vanished);
@ -274,8 +268,6 @@ public class SQLPlayerData
String name = set.getString("name");
String loginMSG = set.getString("login_msg");
String prefix = set.getString("prefix");
String rankName = set.getString("rank").toUpperCase();
boolean adminActive = set.getBoolean("adminActive");
long coins = set.getLong("coins");
boolean vanished = set.getBoolean("vanished");
boolean commandspy = set.getBoolean("commandspy");
@ -284,7 +276,6 @@ public class SQLPlayerData
plexPlayer.setName(name);
plexPlayer.setLoginMessage(loginMSG);
plexPlayer.setPrefix(prefix);
plexPlayer.setAdminActive(adminActive);
plexPlayer.setIps(ips);
plexPlayer.setCoins(coins);
plexPlayer.setVanished(vanished);
@ -314,13 +305,11 @@ public class SQLPlayerData
statement.setString(1, player.getName());
statement.setString(2, player.getLoginMessage());
statement.setString(3, player.getPrefix());
statement.setString(4, null); // rank
statement.setBoolean(5, player.isAdminActive());
statement.setString(6, new Gson().toJson(player.getIps()));
statement.setLong(7, player.getCoins());
statement.setBoolean(8, player.isVanished());
statement.setBoolean(9, player.isCommandSpy());
statement.setString(10, player.getUuid().toString());
statement.setString(4, new Gson().toJson(player.getIps()));
statement.setLong(5, player.getCoins());
statement.setBoolean(6, player.isVanished());
statement.setBoolean(7, player.isCommandSpy());
statement.setString(8, player.getUuid().toString());
statement.executeUpdate();
}
catch (SQLException throwables)
@ -344,12 +333,10 @@ public class SQLPlayerData
statement.setString(2, player.getName());
statement.setString(3, player.getLoginMessage());
statement.setString(4, player.getPrefix());
statement.setString(5, null); //rank
statement.setBoolean(6, player.isAdminActive());
statement.setString(7, new Gson().toJson(player.getIps()));
statement.setLong(8, player.getCoins());
statement.setBoolean(9, player.isVanished());
statement.setBoolean(10, player.isCommandSpy());
statement.setString(5, new Gson().toJson(player.getIps()));
statement.setLong(6, player.getCoins());
statement.setBoolean(7, player.isVanished());
statement.setBoolean(8, player.isCommandSpy());
statement.execute();
}
catch (SQLException throwables)

View File

@ -283,7 +283,7 @@ public class PlexUtils implements PlexBase
public static void broadcastToAdmins(Component component, String permission)
{
Bukkit.getOnlinePlayers().stream().filter(pl -> plugin.getPlayerCache().getPlexPlayer(pl.getUniqueId()).isAdminActive() || pl.hasPermission(permission)).forEach(pl ->
Bukkit.getOnlinePlayers().stream().filter(pl -> pl.hasPermission(permission)).forEach(pl ->
{
pl.sendMessage(component);
});