tuixte ha scritto:
Probabilmente all'interno di quel if c'è qualcosa che blocca momentaneamente il flusso di esecuzione, forse in attesa di qualcosa, quindi il ciclo non riparte e gli eventi non vengono gestiti. Puoi postare cosa c'è nell'if?
Si, dentro l'if ci sono varie richieste di variabili.
Esempio:
if (SFU == false)
{
if (responseConnections.isOk())
{
cout <<"Connected."<< endl;
}
else
{
cout <<"Not connected, error..."<< endl;
cout << "Response status: " << responseConnections.getStatus() << endl;
system ("PAUSE");
return 0;
}
ifstream StaffAccount("Saves/StaffAccount.txt");
if (!StaffAccount)
{
cout <<"Insert the username for the login."<< endl;
cin >>username;
cout <<"Insert the password for the login."<< endl;
cin >>password;
cout <<"Do you want to save the username and pass?"<< endl;
cin >>res1;
while (res1 != "No" && res1 != "no" && res1 != "NO" && res1 != "Yes" && res1 != "yes" && res1 != "YES")
{
cout <<"Say Yes or No."<< endl;
cin >>res1;
}
Oppure
else
{
cout <<"There's an account saved. Do you want to load it?"<< endl;
cin >>res1;
while (res1 != "No" && res1 != "no" && res1 != "NO" && res1 != "Yes" && res1 != "yes" && res1 != "YES")
{
cout <<"Say Yes or No."<< endl;
cin >>res1;
}
if (res1 == "Yes"||res1 == "yes"||res1 == "YES")
{
ifstream StaffAccount("Saves/StaffAccount.txt");
StaffAccount >> username >> password;
}
else
{
cout <<"Insert the username for the login."<< endl;
cin >>username;
cout <<"Insert the password for the login."<< endl;
cin >>password;
cout <<"Do you want to save the username and pass?"<< endl;
cin >>res1;
while (res1 != "No" && res1 != "no" && res1 != "NO" && res1 != "Yes" && res1 != "yes" && res1 != "YES")
{
cout <<"Say Yes or No."<< endl;
cin >>res1;
}
if (res1 == "Yes"||res1 == "yes"||res1 == "YES")
{
CreateDirectory("Saves", NULL);
ofstream StaffAccount ("Saves/StaffAccount");
StaffAccount <<username + " " + password;
}
else
{
cout <<"Ok."<< endl;
}