Always use root locale for case conversions

This commit is contained in:
md_5
2018-10-28 12:09:37 +11:00
parent 27f926cfc7
commit ed6b03d24a
9 changed files with 25 additions and 17 deletions

View File

@@ -724,7 +724,7 @@ public class BungeeCord extends ProxyServer
@Override
public boolean apply(ProxiedPlayer input)
{
return ( input == null ) ? false : input.getName().toLowerCase().startsWith( partialName.toLowerCase() );
return ( input == null ) ? false : input.getName().toLowerCase( Locale.ROOT ).startsWith( partialName.toLowerCase( Locale.ROOT ) );
}
} ) );
}

View File

@@ -3,6 +3,7 @@ package net.md_5.bungee;
import com.google.common.base.Preconditions;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import java.util.Locale;
import java.util.Queue;
import java.util.Set;
import java.util.UUID;
@@ -296,7 +297,7 @@ public class ServerConnector extends PacketHandler
{
ServerInfo def = user.updateAndGetNextServer( target );
ServerKickEvent event = new ServerKickEvent( user, target, ComponentSerializer.parse( kick.getMessage() ), def, ServerKickEvent.State.CONNECTING );
if ( event.getKickReason().toLowerCase().contains( "outdated" ) && def != null )
if ( event.getKickReason().toLowerCase( Locale.ROOT ).contains( "outdated" ) && def != null )
{
// Pre cancel the event if we are going to try another server
event.setCancelled( true );

View File

@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import lombok.RequiredArgsConstructor;
@@ -243,7 +244,7 @@ public class YamlConfig implements ConfigurationAdapter
InetSocketAddress address = Util.getAddr( host );
Map<String, String> forced = new CaseInsensitiveMap<>( get( "forced_hosts", forcedDef, val ) );
String tabListName = get( "tab_list", "GLOBAL_PING", val );
DefaultTabList value = DefaultTabList.valueOf( tabListName.toUpperCase() );
DefaultTabList value = DefaultTabList.valueOf( tabListName.toUpperCase( Locale.ROOT ) );
if ( value == null )
{
value = DefaultTabList.GLOBAL_PING;