Пример #1
0
    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.");
        }
    }
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();
}
Пример #3
0
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 ();
        }
    }
}
Пример #4
0
	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);
	}
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();
}
Пример #6
0
 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");
         }
     }
 }
NetClientConfig::~NetClientConfig()
{
	Logout();

	instance = 0;
	servers.destroy();
}
Пример #8
0
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 );
	}
}
Пример #9
0
CWizKMAccountsServer::~CWizKMAccountsServer(void)
{
    if (m_bAutoLogout)
    {
        Logout();
    }
}
Пример #10
0
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;
}
Пример #11
0
bool CNest::Login()
{
	if (!m_AccessToken.empty())
	{
		Logout();
	}
	m_AccessToken = "";
	m_UserID = "";

	std::stringstream sstr;
	sstr << "username="******"&password="******"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;
}
Пример #12
0
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());
}
Пример #13
0
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();
}
Пример #14
0
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;
}
Пример #15
0
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;
}
Пример #16
0
bool 
UserManager::Dispatch( ValueSet *pRequestSet, U32 requestCode, SsapiResponder *pResponder ){

	bool			rc = false;
	User			*pUser;

	if( ObjectManager::Dispatch( pRequestSet, requestCode, pResponder ) )
		return true;

	switch(requestCode){
		case SSAPI_USER_MANAGER_LOGIN:
			pUser = new User( GetListenManager() );
			*pUser = *((ValueSet *)pRequestSet->GetValue( SSAPI_USER_MANAGER_LOGIN_OBJECT ));
			rc = Login( pUser, pResponder );
			delete pUser;
			break;
		
		case SSAPI_USER_MANAGER_LOGOUT:
			pUser = new User( GetListenManager() );
			*pUser = *((ValueSet *)pRequestSet->GetValue( SSAPI_USER_MANAGER_LOGOUT_OBJECT ));
			rc = Logout( pUser, pResponder );
			delete pUser;
			break;

		case SSAPI_USER_MANAGER_CHANGE_PASSWORD:
			rc = ChangePassword( *pRequestSet, pResponder );
			break;

		default:
			ASSERT(0);
			break;
	}

	return false;
}
Пример #17
0
bool cCardClientGbox::Init(const char *config) 
{ 
  cMutexLock lock(this); 
  Logout();
  int num=0;
  if(!ParseStdConfig(config,&num)) return false;
  return true;
} 
Пример #18
0
void CXSdk::Deinit()
{
    for(int i=1; i<=JO_MAX_USER; i++)
    {
        Logout(i);
    }
    m_usrMap.clear();
}
Пример #19
0
CAironixAdapter::~CAironixAdapter()
{
	if (Logout() == J_OK)
		m_status = jo_dev_broken;

    NET_SDK_Cleanup();

	J_OS::LOGINFO("CAironixAdapter::~CAironixAdapter()");
}
Пример #20
0
CPktQue::~CPktQue() {
	try {
		SAFE_DEL_ARRAY(pBuf);
		cs.Del();
	}
	catch(...) {
		Logout(_T("#ERR Occur an exception while running CPktQue::~CPktQue()"));
	}
}
Пример #21
0
bool cCardClient::SendMsg(const unsigned char *data, int len)
{
  if(!so.Connected() && !Login()) return false;
  if(so.Write(data,len)<0) {
    PRINTF(L_CC_CORE,"send error. reconnecting...");
    Logout();
    return false;
    }
  return true;
}
Пример #22
0
int cCardClient::RecvMsg(unsigned char *data, int len, int to)
{
  if(!so.Connected() && !Login()) return -1;
  int n=so.Read(data,len,to);
  if(n<0) {
    if(errno==ETIMEDOUT && (len<0 || to==0)) return 0;
    PRINTF(L_CC_CORE,"recv error. reconnecting...");;
    Logout();
    }
  return n;
}
Пример #23
0
bool CThermosmart::StopHardware()
{
	if (m_thread!=NULL)
	{
		assert(m_thread);
		m_stoprequested = true;
		m_thread->join();
	}
    m_bIsStarted=false;
	if (!m_bDoLogin)
		Logout();
    return true;
}
Пример #24
0
int FH2LocalClient::Main(void)
{
    const Settings & conf = Settings::Get();
    std::string err;

    if(ConnectionChat())
    {
	if(conf.GameType(Game::TYPE_STANDARD))
	{
	    if(ScenarioInfoDialog())
	    {
		Cursor & cursor = Cursor::Get();
		Display & display = Display::Get();

		cursor.Hide();
    		display.Fill(0, 0, 0);
        	TextBox(_("Please wait..."), Font::BIG, Rect(0, display.h()/2, display.w(), display.h()/2));
        	display.Flip();

/*
		if(Game::IO::LoadBIN(packet))
		{
			conf.SetMyColor(Color::Get(player_color));
			cursor.Hide();
			return true;
		}
*/

//    		StartGame();
		err = "under construction";
	    }
	    else
		err = "close scenario dialog";
	}
	else
	if(conf.GameType(Game::TYPE_BATTLEONLY))
	{
	    if(Prepare4BattleOnly())
	    {
		GetLoadMaps(false, false);
		Game::StartBattleOnly();
	    }
	}
	else
	    err = "unknown game type";
    }

    Logout(err);

    return 1;
}
Пример #25
0
bool cCardClientRadegast::Login(void)
{
  Logout();
  if(!so.Connect(hostname,port)) return false;
  PRINTF(L_CC_LOGIN,"%s: connected to %s:%d",name,hostname,port);

  InitVars();
  unsigned char buff[512];
  char hello[32];
  snprintf(hello,sizeof(hello),"rdgd/vdr-sc-%s",ScVersion);
  StartMsg(buff,0x90);			// RDGD_MSG_CLIENT_HELLO
  AddNano(buff,1,strlen(hello),(unsigned char *)hello);	// RDGD_NANO_DESCR
  if(!Send(buff) || Recv(buff,sizeof(buff))<0) return false;
  if(buff[0]==0x91) {
    PRINTF(L_CC_RDGD,"got server hello, assuming V4 mode");
    StartMsg(buff,0x94);		// RDGD_MSG_CLIENT_CAP_REQ;
    int n;
    if(!Send(buff) || (n=Recv(buff,sizeof(buff)))<0) return false;
    if(buff[0]==0x95) {
      LBSTARTF(L_CC_LOGIN);
      LBPUT("radegast: got caps");
      int caid;
      for(int l=GetNanoStart(buff); l<n; l+=buff[l+1]+2) {
        switch(buff[l]) {
          case 0xE2:
            LBPUT(" VERS %s",(char *)&buff[l+2]);
            break;
          case 0xE4: // CAP_NANO_CAID
            if(numCaids>=MAXCAIDS) { l=n; break; } //stop processing
            caid=(buff[l+2]<<8)+buff[l+3];
            LBPUT(" CAID %04X",caid);
            caids[numCaids++]=caid;
            // XXX we should have EMM processing setup here, but as we don't
            // XXX get any ua/sa we cannot filter EMM anyways
            break;
          case 0xE5: // CAP_NANO_PROVID
            for(int i=0; i<buff[l+1]; i+=3)
              LBPUT("/%02X%02X%02X",buff[l+2+i],buff[l+2+i+1],buff[l+2+i+2]);
            break;
          }
        }
      LBEND();
      }
    }
  else PRINTF(L_CC_RDGD,"no server hello, assuming old mode");
  if(emmProcessing && !emmAllowed) 
    PRINTF(L_CC_EMM,"%s: EMM disabled from config",name);
  CaidsChanged();
  return true;
}
Пример #26
0
bool CHarmonyHub::StopHardware()
{
	if (m_thread!=NULL)
	{
		assert(m_thread);
		m_stoprequested = true;
		m_thread->join();
	}
	m_bIsStarted=false;
	if (!m_bDoLogin)
		Logout();
	m_bIsChangingActivity=false;
	return true;
}
Пример #27
0
MythPianoService::~MythPianoService()
{
    // This really should have already been deleted by StopPlayback()
    assert(!m_AudioOutput);

    if (class LCD *lcd = LCD::Get())
    {
        lcd->switchToTime();
        lcd->setFunctionLEDs(FUNC_MUSIC, false);
    }

    if (m_Piano)
      Logout();
}
Пример #28
0
	virtual void Login() override
	{
		Logout();
		OnPresenceReceivedCompleteDelegate = FOnPresenceReceivedDelegate::CreateSP(this, &FGameAndPartyServiceImpl::OnPresenceReceived);
		OnQueryUserInfoCompleteDelegate = FOnQueryUserInfoCompleteDelegate::CreateSP(this, &FGameAndPartyServiceImpl::OnQueryUserInfoComplete);
		OnGameInviteReceivedDelegate = FOnSessionInviteReceivedDelegate::CreateSP(this, &FGameAndPartyServiceImpl::OnGameInviteReceived);
		OnPartyInviteReceivedDelegate = FOnPartyInviteReceivedDelegate::CreateSP(this, &FGameAndPartyServiceImpl::OnPartyInviteReceived);
		OnGameInviteResponseDelegate = IChatNotificationService::FOnNotificationResponseDelegate::CreateSP(this, &FGameAndPartyServiceImpl::OnHandleGameInviteResponse);
		OnPresenceReceivedCompleteDelegateHandle = OSSScheduler->GetPresenceInterface()->AddOnPresenceReceivedDelegate_Handle(OnPresenceReceivedCompleteDelegate);
		OnQueryUserInfoCompleteDelegateHandle = OSSScheduler->GetUserInterface()->AddOnQueryUserInfoCompleteDelegate_Handle(LocalControllerIndex, OnQueryUserInfoCompleteDelegate);
		OnGameInviteReceivedDelegateHandle = OSSScheduler->GetSessionInterface()->AddOnSessionInviteReceivedDelegate_Handle(OnGameInviteReceivedDelegate);
		OnPartyInviteReceivedDelegateHandle = OSSScheduler->GetPartyInterface()->AddOnPartyInviteReceivedDelegate_Handle(OnPartyInviteReceivedDelegate);

		OnRequestOSSAcceptedDelegate = FOSSScheduler::FOnRequestOSSAccepted::CreateSP(this, &FGameAndPartyServiceImpl::OnRequestOSSAccepted);
	}
Пример #29
0
bool LoginSession::Recieve(XMLPacket *Packet)
{
    if (!Packet) {
        return false;
    }

    if (strncmp(Packet->m_Path, g_STS_Ping, sizeof(Packet->m_Path)) == 0) {
        printf("%s -> Ping!\n", m_Client->m_ClientIP);
    }

    else if (strncmp(Packet->m_Path, g_STS_Connect, sizeof(Packet->m_Path)) == 0) {
        Init(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_StartTLS, sizeof(Packet->m_Path)) == 0) {
        StartTLS(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_GetHost, sizeof(Packet->m_Path)) == 0) {
        GetHostname(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_StartSsoLogin, sizeof(Packet->m_Path)) == 0) {
        StartSsoLogin(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_ListGameAcc, sizeof(Packet->m_Path)) == 0) {
        ListGameAccounts(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_Resume, sizeof(Packet->m_Path)) == 0) {
        ResumeAuthentication(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_RequestGameToken, sizeof(Packet->m_Path)) == 0) {
        RequestGameToken(Packet);
    }

    else if (strncmp(Packet->m_Path, g_AUTH_Logout, sizeof(Packet->m_Path)) == 0) {
        Logout(Packet);
    }

    else {
        printf("Unknown command: %s\n", Packet->m_Path);
    }

    return true;
}
Пример #30
0
LoginStateWidget::LoginStateWidget(QWidget* parent)
    : QWidget(parent), ui_(new Ui_LoginStateWidget), state_(LoggedOut) {
  ui_->setupUi(this);
  ui_->signed_in->hide();
  ui_->expires->hide();
  ui_->account_type->hide();
  ui_->busy->hide();

  ui_->sign_out->setIcon(IconLoader::Load("list-remove", IconLoader::Base));

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

  connect(ui_->sign_out, SIGNAL(clicked()), SLOT(Logout()));
}