mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
#3093: Support names with '.', block names with ' '
This commit is contained in:
parent
ab9153ddc3
commit
39a80e414e
@ -299,7 +299,10 @@ public class YamlConfig implements ConfigurationAdapter
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Collection<String> getGroups(String player)
|
public Collection<String> getGroups(String player)
|
||||||
{
|
{
|
||||||
Collection<String> groups = get( "groups." + player, null );
|
// #1270: Do this to support player names with .
|
||||||
|
Map<String, Collection<String>> raw = get( "groups", Collections.emptyMap() );
|
||||||
|
Collection<String> groups = raw.get( player );
|
||||||
|
|
||||||
Collection<String> ret = ( groups == null ) ? new HashSet<String>() : new HashSet<>( groups );
|
Collection<String> ret = ( groups == null ) ? new HashSet<String>() : new HashSet<>( groups );
|
||||||
ret.add( "default" );
|
ret.add( "default" );
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -354,7 +354,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" );
|
Preconditions.checkState( thisState == State.USERNAME, "Not expecting USERNAME" );
|
||||||
this.loginRequest = loginRequest;
|
this.loginRequest = loginRequest;
|
||||||
|
|
||||||
if ( getName().contains( "." ) )
|
if ( getName().contains( " " ) )
|
||||||
{
|
{
|
||||||
disconnect( bungee.getTranslation( "name_invalid" ) );
|
disconnect( bungee.getTranslation( "name_invalid" ) );
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user