Merge remote-tracking branch 'origin/master' into future/nms

feat/data-edit-commands
Harvels X 3 years ago
commit 9ff20e6e93
No known key found for this signature in database
GPG Key ID: 9637BCFE856BB8F3

@ -11,7 +11,7 @@ plugins {
allprojects { allprojects {
group 'me.William278' group 'me.William278'
version '1.2' version '1.2.2'
compileJava { options.encoding = 'UTF-8' } compileJava { options.encoding = 'UTF-8' }
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }

@ -3,7 +3,7 @@ dependencies {
compileOnly project(':api') compileOnly project(':api')
implementation project(path: ':common', configuration: 'shadow') implementation project(path: ':common', configuration: 'shadow')
compileOnly 'redis.clients:jedis:3.7.0' compileOnly 'redis.clients:jedis:3.7.1'
implementation 'org.bstats:bstats-bukkit:2.2.1' implementation 'org.bstats:bstats-bukkit:2.2.1'
implementation 'de.themoep:minedown:1.7.1-SNAPSHOT' implementation 'de.themoep:minedown:1.7.1-SNAPSHOT'

@ -2,7 +2,7 @@ dependencies {
compileOnly project(':common') compileOnly project(':common')
implementation project(path: ':common', configuration: 'shadow') implementation project(path: ':common', configuration: 'shadow')
compileOnly 'redis.clients:jedis:3.7.0' compileOnly 'redis.clients:jedis:3.7.1'
implementation 'org.bstats:bstats-bungeecord:2.2.1' implementation 'org.bstats:bstats-bungeecord:2.2.1'
implementation 'de.themoep:minedown:1.7.1-SNAPSHOT' implementation 'de.themoep:minedown:1.7.1-SNAPSHOT'
implementation 'net.byteflux:libby-bungee:1.1.5' implementation 'net.byteflux:libby-bungee:1.1.5'

@ -156,7 +156,7 @@ public final class HuskSyncBungeeCord extends Plugin {
Library mySqlLib = Library.builder() Library mySqlLib = Library.builder()
.groupId("mysql") .groupId("mysql")
.artifactId("mysql-connector-java") .artifactId("mysql-connector-java")
.version("8.0.25") .version("8.0.27")
.build(); .build();
Library sqLiteLib = Library.builder() Library sqLiteLib = Library.builder()

@ -1,5 +1,5 @@
dependencies { dependencies {
implementation 'redis.clients:jedis:3.7.0' implementation 'redis.clients:jedis:3.7.1'
implementation 'com.zaxxer:HikariCP:5.0.0' implementation 'com.zaxxer:HikariCP:5.0.0'
} }

@ -341,8 +341,9 @@ public class DataManager {
// Remove the old data if it exists // Remove the old data if it exists
PlayerData oldData = null; PlayerData oldData = null;
for (PlayerData data : playerData) { for (PlayerData data : playerData) {
if (data.getPlayerUUID() == newData.getPlayerUUID()) { if (data.getPlayerUUID().equals(newData.getPlayerUUID())) {
oldData = data; oldData = data;
break;
} }
} }
if (oldData != null) { if (oldData != null) {
@ -361,7 +362,7 @@ public class DataManager {
*/ */
public PlayerData getPlayer(UUID playerUUID) { public PlayerData getPlayer(UUID playerUUID) {
for (PlayerData data : playerData) { for (PlayerData data : playerData) {
if (data.getPlayerUUID() == playerUUID) { if (data.getPlayerUUID().equals(playerUUID)) {
return data; return data;
} }
} }

@ -77,6 +77,9 @@ public class MySQL extends Database {
dataSource.setUsername(username); dataSource.setUsername(username);
dataSource.setPassword(password); dataSource.setPassword(password);
// Set data source driver path
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
// Set various additional parameters // Set various additional parameters
dataSource.setMaximumPoolSize(hikariMaximumPoolSize); dataSource.setMaximumPoolSize(hikariMaximumPoolSize);
dataSource.setMinimumIdle(hikariMinimumIdle); dataSource.setMinimumIdle(hikariMinimumIdle);

@ -2,6 +2,7 @@ package me.william278.husksync.redis;
import me.william278.husksync.Settings; import me.william278.husksync.Settings;
import redis.clients.jedis.Jedis; import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisClientConfig;
import redis.clients.jedis.JedisPubSub; import redis.clients.jedis.JedisPubSub;
import redis.clients.jedis.exceptions.JedisException; import redis.clients.jedis.exceptions.JedisException;
@ -17,13 +18,15 @@ public abstract class RedisListener {
/** /**
* Handle an incoming {@link RedisMessage} * Handle an incoming {@link RedisMessage}
*
* @param message The {@link RedisMessage} to handle * @param message The {@link RedisMessage} to handle
*/ */
public abstract void handleMessage(RedisMessage message); public abstract void handleMessage(RedisMessage message);
/** /**
* Log to console * Log to console
* @param level The {@link Level} to log *
* @param level The {@link Level} to log
* @param message Message to log * @param message Message to log
*/ */
public abstract void log(Level level, String message); public abstract void log(Level level, String message);
@ -32,15 +35,15 @@ public abstract class RedisListener {
* Start the Redis listener * Start the Redis listener
*/ */
public final void listen() { public final void listen() {
try(Jedis jedis = new Jedis(Settings.redisHost, Settings.redisPort)) { try (Jedis jedis = new Jedis(Settings.redisHost, Settings.redisPort)) {
final String jedisPassword = Settings.redisPassword; final String jedisPassword = Settings.redisPassword;
if (!jedisPassword.equals("")) {
jedis.auth(jedisPassword);
}
jedis.connect(); jedis.connect();
if (jedis.isConnected()) { if (jedis.isConnected()) {
if (!jedisPassword.equals("")) {
jedis.auth(jedisPassword);
}
isActiveAndEnabled = true; isActiveAndEnabled = true;
log(Level.INFO,"Enabled Redis listener successfully!"); log(Level.INFO, "Enabled Redis listener successfully!");
new Thread(() -> jedis.subscribe(new JedisPubSub() { new Thread(() -> jedis.subscribe(new JedisPubSub() {
@Override @Override
public void onMessage(String channel, String message) { public void onMessage(String channel, String message) {

@ -63,10 +63,10 @@ public class RedisMessage {
public void send() throws IOException { public void send() throws IOException {
try (Jedis publisher = new Jedis(Settings.redisHost, Settings.redisPort)) { try (Jedis publisher = new Jedis(Settings.redisHost, Settings.redisPort)) {
final String jedisPassword = Settings.redisPassword; final String jedisPassword = Settings.redisPassword;
publisher.connect();
if (!jedisPassword.equals("")) { if (!jedisPassword.equals("")) {
publisher.auth(jedisPassword); publisher.auth(jedisPassword);
} }
publisher.connect();
publisher.publish(REDIS_CHANNEL, getFullMessage()); publisher.publish(REDIS_CHANNEL, getFullMessage());
} }
} }

@ -2,7 +2,7 @@ dependencies {
compileOnly project(':common') compileOnly project(':common')
implementation project(path: ':common', configuration: 'shadow') implementation project(path: ':common', configuration: 'shadow')
compileOnly 'redis.clients:jedis:3.7.0' compileOnly 'redis.clients:jedis:3.7.1'
implementation 'org.bstats:bstats-velocity:2.2.1' implementation 'org.bstats:bstats-velocity:2.2.1'
implementation 'de.themoep:minedown-adventure:1.7.1-SNAPSHOT' implementation 'de.themoep:minedown-adventure:1.7.1-SNAPSHOT'
implementation 'net.byteflux:libby-velocity:1.1.5' implementation 'net.byteflux:libby-velocity:1.1.5'

@ -43,7 +43,7 @@ import static me.william278.husksync.HuskSyncVelocity.VERSION;
public class HuskSyncVelocity { public class HuskSyncVelocity {
// Plugin version // Plugin version
public static final String VERSION = "1.2"; public static final String VERSION = "1.2.2";
// Velocity bStats ID (different from Bukkit and BungeeCord) // Velocity bStats ID (different from Bukkit and BungeeCord)
private static final int METRICS_ID = 13489; private static final int METRICS_ID = 13489;
@ -208,7 +208,7 @@ public class HuskSyncVelocity {
Library mySqlLib = Library.builder() Library mySqlLib = Library.builder()
.groupId("mysql") .groupId("mysql")
.artifactId("mysql-connector-java") .artifactId("mysql-connector-java")
.version("8.0.25") .version("8.0.27")
.build(); .build();
Library sqLiteLib = Library.builder() Library sqLiteLib = Library.builder()

Loading…
Cancel
Save