当前位置: 首页>>代码示例>>C++>>正文


C++ Logout函数代码示例

本文整理汇总了C++中Logout函数的典型用法代码示例。如果您正苦于以下问题:C++ Logout函数的具体用法?C++ Logout怎么用?C++ Logout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Logout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ValidateServerUrl

    void LoginHandler::ProcessLoginData(const QMap<QString, QString> &data)
    {
        QString type = data["AvatarType"];
        if (type == "OpenSim")
        {
            credentials_.SetType(ProtocolUtilities::AT_OpenSim);
            QString username = data["Username"];
            QStringList firstAndLast = username.split(" ");
            if (firstAndLast.length() == 2)
            {
                credentials_.SetFirstName(firstAndLast.at(0));
                credentials_.SetLastName(firstAndLast.at(1));
                credentials_.SetPassword(data["Password"]);

                QString startLocation = data["StartLocation"];
                if (!startLocation.isEmpty())
                    credentials_.SetStartLocation(startLocation);

                server_entry_point_url_ = ValidateServerUrl(data["WorldAddress"]);
                if (server_entry_point_url_.isValid())
                {
                    Logout();
                    StartWorldSession();
                }
            }
            else
            {
                RexLogicModule::LogError("Username was not in form \"firstname lastname\", could not perform login");
            }
        }
        else if (type == "RealXtend")
        {
            credentials_.SetType(ProtocolUtilities::AT_RealXtend);
            credentials_.SetIdentity(data["Username"]);
            credentials_.SetPassword(data["Password"]);
            credentials_.SetAuthenticationUrl(ValidateServerUrl(data["AuthenticationAddress"]));

            QString startLocation = data["StartLocation"];
            if (!startLocation.isEmpty())
                credentials_.SetStartLocation(startLocation);

            server_entry_point_url_ = ValidateServerUrl(data["WorldAddress"]);
            if (server_entry_point_url_.isValid())
            {
                Logout();
                StartWorldSession();
            }
        }
        else
        {
            RexLogicModule::LogError("Could not find avatar type in login info map. Cannot proceed login.");
        }
    }
开发者ID:Chiru,项目名称:naali,代码行数:53,代码来源:LoginHandler.cpp

示例2: SettingsPage

SpotifySettingsPage::SpotifySettingsPage(SettingsDialog* dialog)
  : SettingsPage(dialog),
    ui_(new Ui_SpotifySettingsPage),
    service_(InternetModel::Service<SpotifyService>()),
    validated_(false)
{
  ui_->setupUi(this);

  setWindowIcon(QIcon(":/icons/48x48/spotify.png"));

  QFont bold_font(font());
  bold_font.setBold(true);
  ui_->blob_status->setFont(bold_font);

  connect(ui_->download_blob, SIGNAL(clicked()), SLOT(DownloadBlob()));
  connect(ui_->login, SIGNAL(clicked()), SLOT(Login()));
  connect(ui_->login_state, SIGNAL(LogoutClicked()), SLOT(Logout()));
  connect(ui_->login_state, SIGNAL(LoginClicked()), SLOT(Login()));

  connect(service_, SIGNAL(LoginFinished(bool)), SLOT(LoginFinished(bool)));
  connect(service_, SIGNAL(BlobStateChanged()), SLOT(BlobStateChanged()));

  ui_->login_state->AddCredentialField(ui_->username);
  ui_->login_state->AddCredentialField(ui_->password);
  ui_->login_state->AddCredentialGroup(ui_->account_group);

  ui_->bitrate->addItem("96 " + tr("kbps"), pb::spotify::Bitrate96k);
  ui_->bitrate->addItem("160 " + tr("kbps"), pb::spotify::Bitrate160k);
  ui_->bitrate->addItem("320 " + tr("kbps"), pb::spotify::Bitrate320k);

  BlobStateChanged();
}
开发者ID:nti1094,项目名称:clementine-subsonic,代码行数:32,代码来源:spotifysettingspage.cpp

示例3: m_pCallback

void CCommunity::DoPulse ( void )
{
    if ( m_ulStartTime )
    {
        eVerificationResult Status;

        // Poll the HTTP client
        CHTTPBuffer buffer;
        if ( m_HTTP.GetData ( buffer ) ) {

            char *szBuffer = buffer.GetData ();
            
            // Get the returned status
            Status = (eVerificationResult)(szBuffer[0] - 48);
            m_bLoggedIn = Status == VERIFY_ERROR_SUCCESS;
            m_ulStartTime = 0;

            // Change GUI
            CLocalGUI::GetSingleton ().GetMainMenu()->ChangeCommunityState ( m_bLoggedIn, m_strUsername );
            CLocalGUI::GetSingleton ().GetMainMenu()->GetSettingsWindow()->OnLoginStateChange ( m_bLoggedIn );

            // Perform callback
            if ( m_pCallback ) {
                m_pCallback ( m_bLoggedIn, szVerificationMessages[Status], m_pVerificationObject );
                m_pCallback = NULL;
                m_pVerificationObject = NULL;
            }
        }
        // Check for timeout
        else if ( ( CClientTime::GetTime () - m_ulStartTime ) > VERIFICATION_DELAY ) {
            g_pCore->ShowMessageBox ( "Error", "Services currently unavaliable", MB_BUTTON_OK | MB_ICON_ERROR );
            Logout ();
        }
    }
}
开发者ID:EagleShen,项目名称:MTA,代码行数:35,代码来源:CCommunity.cpp

示例4: Login

	virtual void Login(IOnlineSubsystem* InOnlineSub, bool bInIsGame, int32 LocalUserID) override
	{
		// Clear existing data
		Logout();
		
		LocalControllerIndex = LocalUserID;
		
		if (InOnlineSub)
		{
			OnlineSub = InOnlineSub;
		}
		else
		{
			OnlineSub = IOnlineSubsystem::Get(TEXT("MCP"));
		}

		if (OnlineSub != nullptr &&
			OnlineSub->GetUserInterface().IsValid() &&
			OnlineSub->GetIdentityInterface().IsValid())
		{
			OnlineIdentity = OnlineSub->GetIdentityInterface();
			OnPresenceUpdatedCompleteDelegate = IOnlinePresence::FOnPresenceTaskCompleteDelegate::CreateSP(this, &FOSSSchedulerImpl::OnPresenceUpdated);
		}

		if (UpdateFriendsTickerDelegate.IsBound() == false)
		{
			UpdateFriendsTickerDelegate = FTickerDelegate::CreateSP(this, &FOSSSchedulerImpl::Tick);
		}

		UpdateFriendsTickerDelegateHandle = FTicker::GetCoreTicker().AddTicker(UpdateFriendsTickerDelegate);
	}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:31,代码来源:OSSScheduler.cpp

示例5: SettingsPage

SpotifySettingsPage::SpotifySettingsPage(SettingsDialog* dialog)
    : SettingsPage(dialog),
      network_(new NetworkAccessManager(this)),
      ui_(new Ui_SpotifySettingsPage),
      service_(InternetModel::Service<SpotifyService>()),
      validated_(false)
{
    ui_->setupUi(this);

    setWindowIcon(QIcon(":/icons/svg/spotify.svg"));

    QFont bold_font(font());
    bold_font.setBold(true);
    ui_->blob_status->setFont(bold_font);

    connect(ui_->download_blob, SIGNAL(clicked()), SLOT(DownloadBlob()));
    connect(ui_->login, SIGNAL(clicked()), SLOT(Login()));
    connect(ui_->login_state, SIGNAL(LogoutClicked()), SLOT(Logout()));
    connect(ui_->login_state, SIGNAL(LoginClicked()), SLOT(Login()));

    connect(service_, SIGNAL(LoginFinished(bool)), SLOT(LoginFinished(bool)));
    connect(service_, SIGNAL(BlobStateChanged()), SLOT(BlobStateChanged()));

    ui_->login_state->AddCredentialField(ui_->username);
    ui_->login_state->AddCredentialField(ui_->password);
    ui_->login_state->AddCredentialGroup(ui_->account_group);

    BlobStateChanged();
}
开发者ID:ximion,项目名称:Clementine-LibDanceTag,代码行数:29,代码来源:spotifysettingspage.cpp

示例6: SAFE_DELETE

 void OpenSimLoginHandler::ProcessOpenSimLogin(QMap<QString,QString> map)
 {
     SAFE_DELETE(credentials_);
     credentials_ = new ProtocolUtilities::OpenSimCredentials();
     ProtocolUtilities::OpenSimCredentials *osCredentials = dynamic_cast<ProtocolUtilities::OpenSimCredentials *>(credentials_);
     if (osCredentials)
     {
         QString username = map["Username"];
         QStringList firstAndLast = username.split(" ");
         if (firstAndLast.length() == 2)
         {
             osCredentials->SetFirstName(firstAndLast.at(0));
             osCredentials->SetLastName(firstAndLast.at(1));
             osCredentials->SetPassword(map["Password"]);
             server_entry_point_url_ = ValidateServerUrl(map["WorldAddress"]);
             if (server_entry_point_url_.isValid())
             {
                 Logout();
                 emit LoginStarted();
                 InstantiateWorldSession();
             }
         }
         else
         {
             rex_logic_module_->LogInfo("Username was not in form firstname lastname, could not perform login");
         }
     }
 }
开发者ID:caocao,项目名称:naali,代码行数:28,代码来源:LoginHandler.cpp

示例7: Logout

NetClientConfig::~NetClientConfig()
{
	Logout();

	instance = 0;
	servers.destroy();
}
开发者ID:The-E,项目名称:Starshatter-Experimental,代码行数:7,代码来源:NetClientConfig.cpp

示例8: printf

void AIMNetManager::MishMashWarningFunction( int type, SNAC_Object& snac )
{
	BMessage* msg;

	// you got booted because someone signed on w/ the same screen name
	if( type == 1 ) {
		printf( "You are being IMPERSONATED!!!! AAAAAAAHHHHHHH!!!!!\n" );
	
		// kill the connection and let 'em know why they got booted
		Logout();
		msg = new BMessage(BEAIM_DISCONNECTED);
		msg->AddBool("quietly", true);
		PostAppMessage( msg );
		windows->ShowMessage( Language.get("ERR_BEING_IMPERSONATED"), B_STOP_ALERT );
	}
	
	// you missed a few messages due to somebody else's rate violation
	else if( type == 2 ) {
		printf( "some messages were missed... the other person sent them too fast.\n" );
		windows->ShowMessage( Language.get("ERR_MISSED_MESSAGES"), B_INFO_ALERT );
	}
	
	// you did a rate violation yourself, you naughty person, you!
	else if( type == 3 ) {
		printf( "Rate violation!\n" );
		windows->ShowMessage( Language.get("ERR_RATE_VIOLATION"), B_STOP_ALERT, Language.get("BEHAVE_LABEL"), WS_WARNED );
	}
}
开发者ID:HaikuArchives,项目名称:BeAIM,代码行数:28,代码来源:AIMInfoFunctions.cpp

示例9: Logout

CWizKMAccountsServer::~CWizKMAccountsServer(void)
{
    if (m_bAutoLogout)
    {
        Logout();
    }
}
开发者ID:Onekr,项目名称:WizQTClient,代码行数:7,代码来源:wizkmxmlrpc.cpp

示例10: Logout

bool CHarmonyHub::SetupCommandSocket()
{
	if(m_commandcsocket)
		Logout();

	m_commandcsocket = new csocket();


	if(ConnectToHarmony(m_harmonyAddress, m_usIPPort,m_commandcsocket) == 1)
	{
		_log.Log(LOG_ERROR,"Harmony Hub: Cannot setup command socket to Harmony Hub");
		return false;
	}

	std::string strUserName = m_szAuthorizationToken;
	//strUserName.append("@connect.logitech.com/gatorade.");
	std::string  strPassword = m_szAuthorizationToken;

	if(StartCommunication(m_commandcsocket, strUserName, strPassword) == 1)
	{
		_log.Log(LOG_ERROR,"Harmony Hub: Start communication failed");
		return false;
	}
	return true;
}
开发者ID:clafa,项目名称:domoticz,代码行数:25,代码来源:HarmonyHub.cpp

示例11: Logout

bool CNest::Login()
{
	if (!m_AccessToken.empty())
	{
		Logout();
	}
	m_AccessToken = "";
	m_UserID = "";

	std::stringstream sstr;
	sstr << "username=" << m_UserName << "&password=" << m_Password;
	std::string szPostdata=sstr.str();
	std::vector<std::string> ExtraHeaders;
	ExtraHeaders.push_back("user-agent:Nest/1.1.0.10 CFNetwork/548.0.4");
	std::string sResult;

	std::string sURL = NEST_LOGIN_PATH;
	if (!HTTPClient::POST(sURL, szPostdata, ExtraHeaders, sResult))
	{
		_log.Log(LOG_ERROR,"Nest: Error login!");
		return false;
	}

	Json::Value root;
	Json::Reader jReader;
	if (!jReader.parse(sResult, root))
	{
		_log.Log(LOG_ERROR, "Nest: Invalid data received, or invalid username/password!");
		return false;
	}

	if (root["urls"].empty())
	{
		_log.Log(LOG_ERROR, "Nest: Invalid data received, or invalid username/password!");
		return false;
	}
	if (root["urls"]["transport_url"].empty())
	{
		_log.Log(LOG_ERROR, "Nest: Invalid data received, or invalid username/password!");
		return false;
	}
	m_TransportURL = root["urls"]["transport_url"].asString();

	if (root["access_token"].empty())
	{
		_log.Log(LOG_ERROR, "Nest: Invalid data received, or invalid username/password!");
		return false;
	}
	m_AccessToken = root["access_token"].asString();
	
	if (root["userid"].empty())
	{
		_log.Log(LOG_ERROR, "Nest: Invalid data received, or invalid username/password!");
		return false;
	}
	m_UserID = root["userid"].asString();

	m_bDoLogin = false;
	return true;
}
开发者ID:AbsolutK,项目名称:domoticz,代码行数:60,代码来源:Nest.cpp

示例12: SettingsPage

LastFMSettingsPage::LastFMSettingsPage(SettingsDialog* dialog)
  : SettingsPage(dialog),
    service_(static_cast<LastFMService*>(InternetModel::ServiceByName("Last.fm"))),
    ui_(new Ui_LastFMSettingsPage),
    waiting_for_auth_(false)
{
  ui_->setupUi(this);

  // Icons
  setWindowIcon(QIcon(":/last.fm/as.png"));

  connect(service_, SIGNAL(AuthenticationComplete(bool,QString)),
          SLOT(AuthenticationComplete(bool,QString)));
  connect(service_, SIGNAL(UpdatedSubscriberStatus(bool)), SLOT(UpdatedSubscriberStatus(bool)));
  connect(ui_->login_state, SIGNAL(LogoutClicked()), SLOT(Logout()));
  connect(ui_->login_state, SIGNAL(LoginClicked()), SLOT(Login()));
  connect(ui_->login, SIGNAL(clicked()), SLOT(Login()));

  ui_->login_state->AddCredentialField(ui_->username);
  ui_->login_state->AddCredentialField(ui_->password);
  ui_->login_state->AddCredentialGroup(ui_->groupBox);

  ui_->username->setMinimumWidth(QFontMetrics(QFont()).width("WWWWWWWWWWWW"));
  resize(sizeHint());
}
开发者ID:BrummbQ,项目名称:Clementine,代码行数:25,代码来源:lastfmsettingspage.cpp

示例13: printf

void AIMNetManager::CancelSignOn() {
	
	// disconnect both of the netlets that could be active at this point
	printf( "canceling sign-on...\n" );
	printf( "auth.nid = %d        main.nid = %d\n", authNetlet.nid, mainNetlet.nid );
	Logout();
}
开发者ID:HaikuArchives,项目名称:BeAIM,代码行数:7,代码来源:AIMNetManager.cpp

示例14: procFunc

int procFunc(int p)
{
    int message;
    if (CheckAuthority(p, inOperation))
    switch(p)
    {
        case 0 : message = SignIn(); break;
        case 1 : message = Login(); break;
        case -2 : message = Finalization(); break;
        case 2 : message = Logout(); break;
        case -3 : message = SearchBookByKeyword();break;
        case 3 : message = BorBook(); break;
        case 4 : message = RetBook(); break;
		case -4 : message = ShowSpecificBook(); break;
        case 5 : message = ChangeNickName(); break;
        case 6 : message = ChangePassword(); break;
        case 7 : message = AddBook(); break;
        case 8 : message = DelBook(); break;
        case 9 : message = EditBook(); break;
        case 10 : message = DelUser(); break;
        case -10 : message = 0; break;
        case 11 : message = ChangeUserAuthority(); break;
        default : break;
    }
    return message;
}
开发者ID:desire2020,项目名称:Lisperarian,代码行数:26,代码来源:interface.cpp

示例15: Logout

bool CPlayer::Logon(const std::string& ip, USHORT port)
{
	if (isLogon())
	{
		Logout();
	}

	m_logonSocket = socket(AF_INET,SOCK_STREAM,0);

	SOCKADDR_IN sock_in;
	sock_in.sin_addr.S_un.S_addr=inet_addr(ip.c_str());
	sock_in.sin_family=AF_INET;
	sock_in.sin_port=htons(port);

	for (int i=0; i<5; ++i)
	{
		if (connect(m_logonSocket,(SOCKADDR*)&sock_in,sizeof(SOCKADDR)))
		{
			// send and recv packets to make a connection with logon server

			::InterlockedExchange(&m_bLogon, 1);
			m_hLogonThread = CreateThread(NULL, 0, LogonThreadProc, reinterpret_cast<LPVOID>(this), 0, NULL);
			return true;
		}

		::Sleep(500);
	}

	return false;
}
开发者ID:caidongyun,项目名称:FZStudio,代码行数:30,代码来源:Player.cpp


注:本文中的Logout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。