Add sincronizacion de jugadores en partida
This commit is contained in:
@@ -80,7 +80,7 @@ switch ($orden) {
|
||||
!isset($_POST['tiempoRespuesta'])
|
||||
) {
|
||||
echo json_encode([
|
||||
'error' => 'Faltan datos para registrar la respuesta.'
|
||||
'error' => 'Faltan datos para registrar la respuestfdfa.'
|
||||
]);
|
||||
|
||||
break;
|
||||
|
||||
@@ -164,7 +164,7 @@ switch ($_POST['orden']) {
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* ==========================================
|
||||
* 3. INSERTAMOS LOS EQUIPOS CON SU PARTIDA EN EQUIPOXPARTIDA
|
||||
* ==========================================
|
||||
@@ -220,9 +220,9 @@ switch ($_POST['orden']) {
|
||||
* 5. ASIGNAMOS 10 PREGUNTAS ALEATORIAS A LA PARTIDA
|
||||
* ==========================================
|
||||
*/
|
||||
|
||||
|
||||
// Obtenemos todos los IDs de las preguntas
|
||||
|
||||
|
||||
$listaPreguntas = Pregunta::getTodosIds();
|
||||
|
||||
$totalPreguntas = count($listaPreguntas);
|
||||
@@ -246,7 +246,7 @@ switch ($_POST['orden']) {
|
||||
// Asignamos el ID real de la pregunta a la partida
|
||||
$partida->asignarPregunta($idPreguntaAleatoria);
|
||||
}
|
||||
}//fin shile
|
||||
} //fin shile
|
||||
|
||||
|
||||
/*
|
||||
@@ -795,13 +795,47 @@ switch ($_POST['orden']) {
|
||||
|
||||
*/
|
||||
|
||||
$resultado = $partida->iniciar();
|
||||
$resultado = $partida->iniciarPartida();
|
||||
|
||||
|
||||
echo json_encode($resultado);
|
||||
|
||||
break;
|
||||
|
||||
case 'comprobarInicio':
|
||||
|
||||
if (!isset($_POST['idPartida'])) {
|
||||
|
||||
echo json_encode([
|
||||
'error' => 'No se ha indicado la partida.'
|
||||
]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$partida = new Partida();
|
||||
|
||||
$partida->idPartida =
|
||||
intval($_POST['idPartida']);
|
||||
|
||||
$datosPartida = $partida->buscar();
|
||||
|
||||
if (!$datosPartida || isset($datosPartida['error'])) {
|
||||
|
||||
echo json_encode([
|
||||
'error' => 'La partida no existe.'
|
||||
]);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'iniciada' => $datosPartida['fechaInicio'] !== null
|
||||
]);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
// OBTENER LA PREGUNTA ACTUAL
|
||||
@@ -933,7 +967,7 @@ switch ($_POST['orden']) {
|
||||
) {
|
||||
|
||||
echo json_encode([
|
||||
'error' => 'Faltan datos para registrar la respuesta.'
|
||||
'error' => 'Faltan datos para registrar la respuestadd.'
|
||||
]);
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user