[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 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

7
gradlew vendored
View file

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

View file

@ -37,9 +37,9 @@ publishing {
} }
dependencies { dependencies {
compileOnly("org.projectlombok:lombok:1.18.28") compileOnly("org.projectlombok:lombok:1.18.30")
annotationProcessor("org.projectlombok:lombok:1.18.28") annotationProcessor("org.projectlombok:lombok:1.18.30")
compileOnly("org.json:json:20230618") compileOnly("org.json:json:20231013")
compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT") compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
annotationProcessor("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 { dependencies {
library "org.projectlombok:lombok:1.18.28" library "org.projectlombok:lombok:1.18.30"
annotationProcessor "org.projectlombok:lombok:1.18.28" annotationProcessor "org.projectlombok:lombok:1.18.30"
library "org.json:json:20230618" library "org.json:json:20231013"
library "commons-io:commons-io:2.13.0" library "commons-io:commons-io:2.15.0"
library "redis.clients:jedis:5.0.0-beta2" library "redis.clients:jedis:5.0.2"
library "org.mariadb.jdbc:mariadb-java-client:3.1.4" library "org.mariadb.jdbc:mariadb-java-client:3.2.0"
library "com.zaxxer:HikariCP:5.0.1" 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" library "org.jetbrains:annotations:24.0.1"
compileOnly "dev.folia:folia-api:1.20.1-R0.1-SNAPSHOT" compileOnly "dev.folia:folia-api:1.20.1-R0.1-SNAPSHOT"
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") { 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 // 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()) 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-server:11.0.17"), 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-servlet:11.0.17"), 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-proxy:11.0.17"), null));
} }
classpathBuilder.addLibrary(resolver); classpathBuilder.addLibrary(resolver);
} }

View file

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

View file

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

View file

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

View file

@ -283,7 +283,7 @@ public class PlexUtils implements PlexBase
public static void broadcastToAdmins(Component component, String permission) 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); pl.sendMessage(component);
}); });