Dieser Commit ist enthalten in:
Ursprung
298aa9d3de
Commit
7b3162ece3
@ -332,11 +332,7 @@ public class SQLProvider implements Provider {
|
||||
|
||||
private SteamwarUser newSteamwarUser(ResultSet rs) throws SQLException {
|
||||
String dbLocale = rs.getString("Locale");
|
||||
Locale locale = null;
|
||||
if (dbLocale != null) {
|
||||
locale = Locale.forLanguageTag(dbLocale);
|
||||
}
|
||||
return new SteamwarUser(rs.getInt("id"), UUID.fromString(rs.getString("UUID")), rs.getString("UserName"), UserGroup.getUsergroup(rs.getString("UserGroup")), rs.getInt("Team"), rs.getBoolean("Bedrock"), locale);
|
||||
return new SteamwarUser(rs.getInt("id"), UUID.fromString(rs.getString("UUID")), rs.getString("UserName"), UserGroup.getUsergroup(rs.getString("UserGroup")), rs.getInt("Team"), rs.getBoolean("Bedrock"), dbLocale != null ? Locale.forLanguageTag(dbLocale) : null);
|
||||
}
|
||||
|
||||
private static final Statement insert = new Statement("INSERT INTO Exception (server, message, stacktrace) VALUES (?, ?, ?)");
|
||||
|
@ -55,7 +55,7 @@ public class SteamwarUser {
|
||||
private final UserGroup userGroup;
|
||||
private final int team;
|
||||
private final boolean bedrock;
|
||||
private final Locale locale;
|
||||
private Locale locale;
|
||||
|
||||
public SteamwarUser(int id, UUID uuid, String userName, UserGroup userGroup, int team, boolean bedrock, Locale locale) {
|
||||
this.id = id;
|
||||
@ -96,9 +96,9 @@ public class SteamwarUser {
|
||||
}
|
||||
|
||||
public Locale getLocale() {
|
||||
Locale locale = this.locale;
|
||||
if (locale == null)
|
||||
locale = WorldOfColorWrapper.impl.getLocale(Bukkit.getPlayer(uuid));
|
||||
if(locale != null)
|
||||
return locale;
|
||||
locale = WorldOfColorWrapper.impl.getLocale(Bukkit.getPlayer(uuid));
|
||||
if (locale != null)
|
||||
return locale;
|
||||
return Locale.getDefault();
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren