geforkt von SteamWar/BungeeCore
Merge remote-tracking branch 'origin/master'
Dieser Commit ist enthalten in:
Commit
27750d4e71
@ -50,6 +50,7 @@ public class BanListener extends BasicListener {
|
||||
user.updateBanIP(event.getConnection().getAddress().getAddress().getHostAddress());
|
||||
event.setCancelled(true);
|
||||
ChatSender.of(event).system(user.punishmentMessage(Punishment.PunishmentType.Ban));
|
||||
event.completeIntent(BungeeCore.get());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -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.event.EventHandler;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class SettingsChangedListener extends BasicListener {
|
||||
|
||||
@EventHandler
|
||||
public void onSettingsChanged(SettingsChangedEvent event) {
|
||||
BungeeCord.getInstance().getScheduler().runAsync(BungeeCore.get(), () -> {
|
||||
ProxiedPlayer player = event.getPlayer();
|
||||
SteamwarUser.get(player).setLocale(Objects.requireNonNull(player.getLocale()), false);
|
||||
SteamwarUser.get(player).setLocale(player.getLocale(), false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -49,12 +49,18 @@ public class SubserverProtocolFixer extends BasicListener {
|
||||
@EventHandler
|
||||
public void loginEvent(LoginEvent e) {
|
||||
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) {
|
||||
extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
field.set(initialHandler, extraData);
|
||||
} catch (IllegalAccessException ex) {
|
||||
BungeeCord.getInstance().getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
|
@ -115,7 +115,7 @@ public class Statement implements AutoCloseable {
|
||||
}
|
||||
|
||||
synchronized (connections) {
|
||||
connections.push(connection);
|
||||
connections.addLast(connection);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -382,7 +382,7 @@ public class SteamwarUser {
|
||||
}
|
||||
|
||||
public void setLocale(Locale locale, boolean manualLocale) {
|
||||
if (this.manualLocale && !manualLocale)
|
||||
if (locale == null || (this.manualLocale && !manualLocale))
|
||||
return;
|
||||
|
||||
this.locale = locale;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren