コード例 #1
0
ファイル: CRemoteCalls.cpp プロジェクト: EagleShen/MTA
void CRemoteCall::MakeCall()
{
    CNetHTTPDownloadManagerInterface * downloadManager = g_pNetServer->GetHTTPDownloadManager();
    downloadManager->QueueFile ( m_strURL, NULL, 0, m_strData.c_str (), this, ProgressCallback );
    if ( !downloadManager->IsDownloading() )
        downloadManager->StartDownloadingQueuedFiles();
}
コード例 #2
0
ファイル: CSerialManager.cpp プロジェクト: 50p/multitheftauto
CSerialVerification::CSerialVerification ( CPlayer* pPlayer, SERIALVERIFICATIONCALLBACK pCallBack )
{
    char buf[32] = {0};
    CLogger::LogPrintf ( "VERIFY: Querying %s\n", SERIAL_VERIFICATION_SERVER );

	m_pCallBack = pCallBack;
	m_pPlayer = pPlayer;
	m_ulStartTime = GetTickCount();
	m_bFinished = false;

	if ( pPlayer->GetSerialUser().length() > 0 && pPlayer->GetSerial().length() > 0 )
	{
        // Create the POST URL
        std::string strPostData = "[\"" + pPlayer->GetSerialUser () +
                                  "\",\"" + pPlayer->GetSerial () +
                                  "\"," + itoa ( g_pGame->GetConfig ()->GetServerPort (), buf, 10 ) + "]";

        // Use CURL to perform the POST
        CNetHTTPDownloadManagerInterface * pHTTP = g_pNetServer->GetHTTPDownloadManager ();
		pHTTP->QueueFile ( SERIAL_VERIFICATION_URL, NULL, 0, strPostData.c_str (), this, ProgressCallback );
		if ( !pHTTP->IsDownloading () )
			pHTTP->StartDownloadingQueuedFiles ();
	}
	else
	{
		m_pCallBack ( m_pPlayer, false, szSerialErrorMessages[SERIAL_ERROR_INVALID_ACCOUNT] );
		m_bFinished = true;
	}
}