|
|
|
@ -61,16 +61,16 @@ class CreateLobbyActivity : AppCompatActivity() {
|
|
|
|
|
|
|
|
|
|
// Vérifier si la création du lobby a réussi
|
|
|
|
|
if (idLobbyCreatedSuccessfully != -1) {
|
|
|
|
|
val intent = Intent(this, ServerDetailsActivity::class.java)
|
|
|
|
|
intent.putExtra("serverName", lobbyName)
|
|
|
|
|
intent.putExtra("lobbyId", idLobbyCreatedSuccessfully.toString())
|
|
|
|
|
|
|
|
|
|
val formDataBuilder = MultipartBody.Builder().setType(MultipartBody.FORM)
|
|
|
|
|
formDataBuilder.addFormDataPart("idplayer", MainActivity.idPlayerConnected.toString())
|
|
|
|
|
formDataBuilder.addFormDataPart("idlobby", idLobbyCreatedSuccessfully.toString())
|
|
|
|
|
formDataBuilder.addFormDataPart("playertime", "0")
|
|
|
|
|
|
|
|
|
|
ControllerUtiliser.createUtiliserByIdLobby(formDataBuilder)
|
|
|
|
|
|
|
|
|
|
val intent = Intent(this, ServerDetailsActivity::class.java)
|
|
|
|
|
intent.putExtra("serverName", lobbyName)
|
|
|
|
|
intent.putExtra("lobbyId", idLobbyCreatedSuccessfully)
|
|
|
|
|
startActivity(intent)
|
|
|
|
|
} else {
|
|
|
|
|
Toast.makeText(this, "Échec de la création du lobby. Veuillez réessayer.", Toast.LENGTH_SHORT).show()
|
|
|
|
|