geforkt von SteamWar/BungeeCore
Fix error messages
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
e6ae4603de
Commit
66d832d058
@ -3,6 +3,7 @@ package de.steamwar.bungeecore;
|
|||||||
import de.steamwar.bungeecore.sql.SWException;
|
import de.steamwar.bungeecore.sql.SWException;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.LogRecord;
|
import java.util.logging.LogRecord;
|
||||||
@ -35,7 +36,7 @@ public class ErrorLogger extends Handler {
|
|||||||
thrown = thrown.getCause();
|
thrown = thrown.getCause();
|
||||||
}
|
}
|
||||||
|
|
||||||
SWException.log("Bungee", record.getMessage(), stacktrace.toString());
|
SWException.log("Bungee", MessageFormat.format(record.getMessage(), record.getParameters()), stacktrace.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,7 +47,14 @@ public class SteamwarUser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SteamwarUser getOrCreate(PendingConnection connection){
|
public static SteamwarUser getOrCreate(PendingConnection connection){
|
||||||
SteamwarUser user = SteamwarUser.get(connection.getUniqueId());
|
SteamwarUser user;
|
||||||
|
try{
|
||||||
|
user = SteamwarUser.get(connection.getUniqueId());
|
||||||
|
}catch(SecurityException e){
|
||||||
|
//Exception only thrown for first time users
|
||||||
|
//Reason: java.sql.SQLException: Invalid utf8mb4 character string: 'ACED00'
|
||||||
|
user = null;
|
||||||
|
}
|
||||||
|
|
||||||
if(user != null){
|
if(user != null){
|
||||||
String userName = connection.getName();
|
String userName = connection.getName();
|
||||||
@ -75,7 +82,7 @@ public class SteamwarUser {
|
|||||||
public static SteamwarUser get(UUID uuid){
|
public static SteamwarUser get(UUID uuid){
|
||||||
if(usersByUUID.containsKey(uuid))
|
if(usersByUUID.containsKey(uuid))
|
||||||
return usersByUUID.get(uuid);
|
return usersByUUID.get(uuid);
|
||||||
return dbInit(SQL.select("SELECT * FROM UserData WHERE UUID = '" + uuid.toString() + "'")); //Fix getOrCreate exceptions for first time users
|
return dbInit(SQL.select("SELECT * FROM UserData WHERE UUID = ?", uuid.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SteamwarUser get(ProxiedPlayer player){
|
public static SteamwarUser get(ProxiedPlayer player){
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren