Merge pull request #164 from LeisureTimeDock/1.20.1
[Backport 1.20.1]Fix #151 #160
This commit is contained in:
commit
5764e85647
|
|
@ -34,7 +34,7 @@ mod_name=PlayerSync
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=GPL-3.0 license
|
mod_license=GPL-3.0 license
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=2.1.4
|
mod_version=2.1.5
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ public class JdbcConfig {
|
||||||
public static final ForgeConfigSpec.BooleanValue IS_CHAT_SERVER;
|
public static final ForgeConfigSpec.BooleanValue IS_CHAT_SERVER;
|
||||||
public static final ForgeConfigSpec.ConfigValue<String> ITEM_PLACEHOLDER_TITLE_OVERRIDE;
|
public static final ForgeConfigSpec.ConfigValue<String> ITEM_PLACEHOLDER_TITLE_OVERRIDE;
|
||||||
public static final ForgeConfigSpec.ConfigValue<String> ITEM_PLACEHOLDER_DESCRIPTION_OVERRIDE;
|
public static final ForgeConfigSpec.ConfigValue<String> ITEM_PLACEHOLDER_DESCRIPTION_OVERRIDE;
|
||||||
|
public static final ForgeConfigSpec.BooleanValue KICK_WHEN_ALREADY_ONLINE;
|
||||||
public static final ForgeConfigSpec.ConfigValue<String> CHAT_SERVER_IP;
|
public static final ForgeConfigSpec.ConfigValue<String> CHAT_SERVER_IP;
|
||||||
public static final ForgeConfigSpec.IntValue CHAT_SERVER_PORT;
|
public static final ForgeConfigSpec.IntValue CHAT_SERVER_PORT;
|
||||||
public static final ForgeConfigSpec.BooleanValue USE_LEGACY_SERIALIZATION;
|
public static final ForgeConfigSpec.BooleanValue USE_LEGACY_SERIALIZATION;
|
||||||
|
|
@ -44,6 +45,8 @@ public class JdbcConfig {
|
||||||
.define("sync_advancements", true);
|
.define("sync_advancements", true);
|
||||||
SYNC_CHAT = COMMON_BUILDER.comment("Whether synchronize chat").define("sync_chat", false);
|
SYNC_CHAT = COMMON_BUILDER.comment("Whether synchronize chat").define("sync_chat", false);
|
||||||
IS_CHAT_SERVER = COMMON_BUILDER.comment("Whether recieve messages from other servers as host").define("IsChatServer",false);
|
IS_CHAT_SERVER = COMMON_BUILDER.comment("Whether recieve messages from other servers as host").define("IsChatServer",false);
|
||||||
|
KICK_WHEN_ALREADY_ONLINE = COMMON_BUILDER.comment("Whether to kick player when already online on another server")
|
||||||
|
.define("kick_when_already_online", true);
|
||||||
CHAT_SERVER_IP = COMMON_BUILDER.define("ChatServerIP","127.0.0.1");
|
CHAT_SERVER_IP = COMMON_BUILDER.define("ChatServerIP","127.0.0.1");
|
||||||
CHAT_SERVER_PORT = COMMON_BUILDER.defineInRange("ChatServerPort",7900,0,65535);
|
CHAT_SERVER_PORT = COMMON_BUILDER.defineInRange("ChatServerPort",7900,0,65535);
|
||||||
USE_LEGACY_SERIALIZATION = COMMON_BUILDER.comment(
|
USE_LEGACY_SERIALIZATION = COMMON_BUILDER.comment(
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ public class VanillaSync {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second query: Check if player is already online on another server
|
// Second query: Check if player is already online on another server
|
||||||
if (online && lastServer != JdbcConfig.SERVER_ID.get()) {
|
if (JdbcConfig.KICK_WHEN_ALREADY_ONLINE.get() && online && lastServer != JdbcConfig.SERVER_ID.get()) {
|
||||||
JDBCsetUp.QueryResult qr2 = JDBCsetUp.executeQuery("SELECT last_update,enable FROM server_info WHERE id='" + lastServer + "'");
|
JDBCsetUp.QueryResult qr2 = JDBCsetUp.executeQuery("SELECT last_update,enable FROM server_info WHERE id='" + lastServer + "'");
|
||||||
try (ResultSet rs2 = qr2.resultSet()) {
|
try (ResultSet rs2 = qr2.resultSet()) {
|
||||||
if (rs2.next()) {
|
if (rs2.next()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user