void LLLoginInstance::handleLoginFailure(const LLSD& event)
{
	// Login has failed. 
	// Figure out why and respond...
	LLSD response = event["data"];
	std::string reason_response = response["reason"].asString();
	std::string message_response = response["message"].asString();
	// For the cases of critical message or TOS agreement,
	// start the TOS dialog. The dialog response will be handled
	// by the LLLoginInstance::handleTOSResponse() callback.
	// The callback intiates the login attempt next step, either 
	// to reconnect or to end the attempt in failure.
	if(reason_response == "tos")
	{
		LLSD data(LLSD::emptyMap());
		data["message"] = message_response;
		data["reply_pump"] = TOS_REPLY_PUMP;
		gViewerWindow->setShowProgress(FALSE,FALSE);
		LLFloaterReg::showInstance("message_tos", data);
		LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
			.listen(TOS_LISTENER_NAME,
					boost::bind(&LLLoginInstance::handleTOSResponse, 
								this, _1, "agree_to_tos"));
	}
	else if(reason_response == "critical")
	{
		LLSD data(LLSD::emptyMap());
		data["message"] = message_response;
		data["reply_pump"] = TOS_REPLY_PUMP;
		if(response.has("error_code"))
		{
			data["error_code"] = response["error_code"];
		}
		if(response.has("certificate"))
		{
			data["certificate"] = response["certificate"];
		}
		
		gViewerWindow->setShowProgress(FALSE,FALSE);
		LLFloaterReg::showInstance("message_critical", data);
		LLEventPumps::instance().obtain(TOS_REPLY_PUMP)
			.listen(TOS_LISTENER_NAME,
					boost::bind(&LLLoginInstance::handleTOSResponse, 
								this, _1, "read_critical"));
	}
	else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
	{
		gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
		updateApp(true, message_response);
	}
	else if(reason_response == "optional")
	{
		updateApp(false, message_response);
	}
	else
	{	
		attemptComplete();
	}	
}
예제 #2
0
/**
 * @brief Call and shows the settings window.
 * Calls the SettingsWindow class and waits until it closes to handle the results
 */
void MainWindow::showSettingsWindow()
{
    SettingsWindow *l_settingsWindow = new SettingsWindow;
    l_settingsWindow->setModal(true);
    l_settingsWindow->show();
    QObject::connect(l_settingsWindow,SIGNAL(closed()), this, SLOT(updateApp()));
}
void LLLoginInstance::handleLoginSuccess(const LLSD& event)
{
	if(gSavedSettings.getBOOL("ForceMandatoryUpdate"))
	{
		LLSD response = event["data"];
		std::string message_response = response["message"].asString();

		// Testing update...
		gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);

		// Don't confuse startup by leaving login "online".
		mLoginModule->disconnect(); 
		updateApp(true, message_response);
	}
	else
	{
		attemptComplete();
	}
}
예제 #4
0
파일: game.c 프로젝트: HanYu1983/HanWork
void onUpdate(float t){
	updateApp(&_app, t);
}