Reintentos de ejecución de partidas online!

This commit is contained in:
2026-05-05 20:38:13 +02:00
parent 2dbe505d77
commit 5c9e8b2b9c
3 changed files with 24 additions and 91 deletions

View File

@@ -210,6 +210,15 @@ class ServicioNearby extends ChangeNotifier {
String? miNick,
String? miAvatar,
}) async {
if (_conectado ||
_anunciando ||
_buscando ||
_estadoSala != null ||
_jugadores.isNotEmpty) {
await desconectar();
await Future<void>.delayed(const Duration(milliseconds: 250));
}
_nombreSala = nombreSala;
_miNombre = miNombre;
_roomId = DateTime.now().microsecondsSinceEpoch.toString();
@@ -253,9 +262,11 @@ class ServicioNearby extends ChangeNotifier {
notifyListeners();
return true;
}
await desconectar();
return false;
} catch (e) {
debugPrint('Error iniciando host: $e');
await desconectar();
return false;
}
}