Reset yaml locations on any error, closes #1007

This commit is contained in:
md_5 2014-06-23 17:13:41 +10:00
parent 4d1f0cbb26
commit fbc69543fd

View File

@ -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 )