mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-23 18:55:22 +01:00
Reset yaml locations on any error, closes #1007
This commit is contained in:
parent
4d1f0cbb26
commit
fbc69543fd
@ -16,7 +16,6 @@ import net.md_5.bungee.api.config.ServerInfo;
|
|||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.util.CaseInsensitiveMap;
|
import net.md_5.bungee.util.CaseInsensitiveMap;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.error.YAMLException;
|
|
||||||
|
|
||||||
public class YamlReconnectHandler extends AbstractReconnectHandler
|
public class YamlReconnectHandler extends AbstractReconnectHandler
|
||||||
{
|
{
|
||||||
@ -41,13 +40,10 @@ public class YamlReconnectHandler extends AbstractReconnectHandler
|
|||||||
data = new CaseInsensitiveMap<>( map );
|
data = new CaseInsensitiveMap<>( map );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch ( YAMLException ex )
|
} catch ( Exception ex )
|
||||||
{
|
{
|
||||||
file.renameTo( new File( "locations.yml.old" ) );
|
file.renameTo( new File( "locations.yml.old" ) );
|
||||||
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not load reconnect locations, resetting them" );
|
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not load reconnect locations, resetting them" );
|
||||||
} catch ( IOException ex )
|
|
||||||
{
|
|
||||||
ProxyServer.getInstance().getLogger().log( Level.WARNING, "Could not load reconnect locations", ex );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( data == null )
|
if ( data == null )
|
||||||
|
Loading…
Reference in New Issue
Block a user