Reintentos de ejecución de partidas online!
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user