mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 14:59:21 +00:00
Fix MySQL issues, ver 1.0
This commit is contained in:
@@ -11,7 +11,7 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
group 'me.William278'
|
||||
version '1.0-dev'
|
||||
version '1.0'
|
||||
|
||||
compileJava { options.encoding = 'UTF-8' }
|
||||
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
|
||||
|
||||
@@ -32,6 +32,9 @@ public final class HuskSyncBungeeCord extends Plugin {
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Whether the plugin is ready to accept redis messages
|
||||
public static boolean readyForRedis = false;
|
||||
|
||||
/**
|
||||
Set of all the {@link Server}s that have completed the synchronisation handshake with HuskSync on the proxy
|
||||
*/
|
||||
@@ -107,6 +110,9 @@ public final class HuskSyncBungeeCord extends Plugin {
|
||||
|
||||
// Log to console
|
||||
getLogger().info("Enabled HuskSync (" + getProxy().getName() + ") v" + getDescription().getVersion());
|
||||
|
||||
// Mark as ready for redis message processing
|
||||
readyForRedis = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MySQL extends Database {
|
||||
"`advancements` longtext NOT NULL," +
|
||||
"`location` text NOT NULL," +
|
||||
|
||||
"PRIMARY KEY (`player_id`,`uuid`)," +
|
||||
"PRIMARY KEY (`player_id`,`version_uuid`)," +
|
||||
"FOREIGN KEY (`player_id`) REFERENCES " + PLAYER_TABLE_NAME + " (`id`)" +
|
||||
");"
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@ public class BungeeRedisListener extends RedisListener {
|
||||
if (message.getMessageTarget().targetServerType() != Settings.ServerType.BUNGEECORD) {
|
||||
return;
|
||||
}
|
||||
// Only process redis messages when ready
|
||||
if (!HuskSyncBungeeCord.readyForRedis) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (message.getMessageType()) {
|
||||
case PLAYER_DATA_REQUEST -> {
|
||||
|
||||
@@ -10,4 +10,4 @@ error_cannot_view_ender_chest_online: '[Error:](#ff3300) [You can''t access the
|
||||
error_cannot_view_own_inventory: '[Error:](#ff3300) [You can''t access your own inventory!](#ff7e5e)'
|
||||
error_cannot_view_own_ender_chest: '[Error:](#ff3300) [You can''t access your own ender chest!](#ff7e5e)'
|
||||
error_console_command_only: '[Error:](#ff3300) [That command can only be run through the %1% console](#ff7e5e)'
|
||||
error_no_servers_proxied: '[Error:](#ff3300) [Failed to process operation; no servers are online that have HuskSync installed.\nPlease ensure HuskSync is installed on both the Proxy server and all servers you wish to synchronise data between](#ff7e5e)'
|
||||
error_no_servers_proxied: '[Error:](#ff3300) [Failed to process operation; no servers are online that have HuskSync installed. Please ensure HuskSync is installed on both the Proxy server and all servers you wish to synchronise data between.](#ff7e5e)'
|
||||
Reference in New Issue
Block a user