Archiviert
1
0

Merge remote-tracking branch 'origin/master'

Dieser Commit ist enthalten in:
yoyosource 2022-06-07 22:38:29 +02:00
Commit 27750d4e71
5 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -50,6 +50,7 @@ public class BanListener extends BasicListener {
user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress()); user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress());
event.setCancelled(true); event.setCancelled(true);
ChatSender.of(event).system(user.punishmentMessage(Punishment.PunishmentType.Ban)); ChatSender.of(event).system(user.punishmentMessage(Punishment.PunishmentType.Ban));
event.completeIntent(BungeeCore.get());
return; return;
} }

Datei anzeigen

@ -26,15 +26,13 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.SettingsChangedEvent; import net.md_5.bungee.api.event.SettingsChangedEvent;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
import java.util.Objects;
public class SettingsChangedListener extends BasicListener { public class SettingsChangedListener extends BasicListener {
@EventHandler @EventHandler
public void onSettingsChanged(SettingsChangedEvent event) { public void onSettingsChanged(SettingsChangedEvent event) {
BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> { BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
ProxiedPlayer player = event.getPlayer(); ProxiedPlayer player = event.getPlayer();
SteamwarUser.get(player).setLocale(Objects.requireNonNull(player.getLocale()), false); SteamwarUser.get(player).setLocale(player.getLocale(), false);
}); });
} }
} }

Datei anzeigen

@ -49,12 +49,18 @@ public class SubserverProtocolFixer extends BasicListener {
@EventHandler @EventHandler
public void loginEvent(LoginEvent e) { public void loginEvent(LoginEvent e) {
InitialHandler initialHandler = ((InitialHandler) e.getConnection()); InitialHandler initialHandler = ((InitialHandler) e.getConnection());
LoginResult.Property[] properties = initialHandler.getLoginProfile().getProperties();
try {
String extraData = "\00" + AddressUtil.sanitizeAddress(inetSocketAddress) + "\00" + UUIDUtils.undash(initialHandler.getUniqueId().toString()); String extraData = "\00" + AddressUtil.sanitizeAddress(inetSocketAddress) + "\00" + UUIDUtils.undash(initialHandler.getUniqueId().toString());
LoginResult result = initialHandler.getLoginProfile();
if (result != null) {
LoginResult.Property[] properties = result.getProperties();
if (properties.length > 0) { if (properties.length > 0) {
extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties); extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties);
} }
}
try {
field.set(initialHandler, extraData); field.set(initialHandler, extraData);
} catch (IllegalAccessException ex) { } catch (IllegalAccessException ex) {
BungeeCord.getInstance().getLogger().log(Level.SEVERE, ex.getMessage(), ex); BungeeCord.getInstance().getLogger().log(Level.SEVERE, ex.getMessage(), ex);

Datei anzeigen

@ -115,7 +115,7 @@ public class Statement implements AutoCloseable {
} }
synchronized (connections) { synchronized (connections) {
connections.push(connection); connections.addLast(connection);
} }
return result; return result;

Datei anzeigen

@ -382,7 +382,7 @@ public class SteamwarUser {
} }
public void setLocale(Locale locale, boolean manualLocale) { public void setLocale(Locale locale, boolean manualLocale) {
if (this.manualLocale && !manualLocale) if (locale == null || (this.manualLocale && !manualLocale))
return; return;
this.locale = locale; this.locale = locale;