Capture the flag help.

Results 1 to 5 of 5
  1. #1
    Account Upgraded | Title Enabled! flyffhelper is offline
    MemberRank
    Dec 2010 Join Date
    419Posts

    Capture the flag help.

    removed thanks for help.
    Last edited by flyffhelper; 10-01-16 at 06:50 PM.


  2. #2
    Alpha Member Chrisss is offline
    MemberRank
    Feb 2012 Join Date
    Ask the Fox!Location
    1,660Posts

    Re: Capture the flag help.

    and whats the error on the Task list tab?>

    i think i know that error anyway just comment it out

  3. #3
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: Capture the flag help.

    post your

    MBMatchAuth.cpp

    in quoted text

  4. #4
    Account Upgraded | Title Enabled! flyffhelper is offline
    MemberRank
    Dec 2010 Join Date
    419Posts

    Re: Capture the flag help.

    Code:
    #include "stdafx.h"
    #include "MBMatchAuth.h"
    #include "Netmarble/CPSSOLib.h"
    #include <stdlib.h>
    #include "MDebug.h"
    #include "MMatchStatus.h"
    #include "CommonLog.h"
    
    #ifndef NEW_AUTH_MODULE
    
    bool MBMatchAuthBuilder::ParseAuthInfo(const char* pszData, MMatchAuthInfo** ppoutAutoInfo)
    {	
    	bool bResult = true;
    	MBMatchAuthInfo* pAuthInfo = new MBMatchAuthInfo;
    	
    	char szBuf[MAUTHINFO_BUFLEN] = {0,};
    	if ( bResult &= GetCPCookieValue(pszData, "UserID", szBuf) ) {
    		pAuthInfo->SetUserID(szBuf);
    	}
    	if ( bResult &= GetCPCookieValue(pszData, "UniID", szBuf) ) {
    		pAuthInfo->SetUniqueID(szBuf);
    	}
    	if ( bResult &= GetCPCookieValue(pszData, "Sex", szBuf) ) {
    		pAuthInfo->SetSex(atoi(szBuf));
    	}
    	if ( bResult &= GetCPCookieValue(pszData, "CCode", szBuf) ) {
    		pAuthInfo->SetCCode(atoi(szBuf));		
    	}
    	if ( bResult &= GetCPCookieValue(pszData, "Age", szBuf) ) {
    		pAuthInfo->SetAge(atoi(szBuf));
    	}
    
    	if (bResult) {
    		*ppoutAutoInfo = pAuthInfo;
    	}
    	else {
    		delete pAuthInfo;
    		*ppoutAutoInfo = 0;
    	}
    
    	return bResult;
    }
    
    #else
    
    #include "MBMatchAsyncDBJob_NetmarbleLogin.h"
    
    // ¡Ø ³Ý¸¶ºí Á¦°ø ÀÎÁõ ¶óÀ̺귯¸® ¸Å´º¾ó Gunz\MatchServer\Netmarble\NMAuthLib.chm ÂüÁ¶
    MBMatchNetmarbleModule::MBMatchNetmarbleModule()
    {
    	InitializeCriticalSection(&m_cs);
    
    	DWORD dwThreadId=0;
    	m_hThread = CreateThread(NULL, 0, WorkerThread, this, 0, &dwThreadId);
    	if (m_hThread == NULL)
    	{
    		Log("## FAILED TO CREATE NETMARBLE AUTH THREAD ##");
    		_ASSERT(0);
    	}
    }
    
    MBMatchNetmarbleModule::~MBMatchNetmarbleModule()
    {
    	WaitForSingleObject(m_hThread, INFINITE);
    
    	TerminateThread(m_hThread, 0);
    	CloseHandle(m_hThread);
    
    	DestroyModule();
    	DeleteCriticalSection(&m_cs);
    }
    
    MBMatchNetmarbleModule& MGetNetmarbleModule() 
    {
    	return MBMatchNetmarbleModule::GetInstance();
    }
    
    bool MBMatchNetmarbleModule::InitModule()
    {
    #ifndef _DEBUG
    	ERROR_NMAUTH error;
    	error = NMAuthLib::Initialize("gunz");	//³Ý¸¶ºí¿¡¼­ ¹ß±ÞÇÑ °ÇÁîÀÇ gamecode ¹®ÀÚ¿­
    
    	// ÀÎÁõ ½ÇÆÐ½Ã..
    	if ( error != ERROR_NMAUTH_SUCCESS )
    	{
    		this->ErrorLog(error, "init failed");
    		return false;
    	}
    	MLog("Netmarble auth server connected.\n");
    #endif
    	return true;
    }
    
    void MBMatchNetmarbleModule::DestroyModule()
    {
    	NMAuthLib::Destroy();
    }
    
    
    void MBMatchNetmarbleModule::ErrorLog()
    {
    	// ³Ý¸¶ºí ÀÎÁõ ¸ðµâ¿¡¼­ ÁØ ¿¡·¯Äڵ带 ±×´ë·Î ·Î±ë
    	ErrorLog( m_NMAuth.GetLastError(), "");
    }
    
    void MBMatchNetmarbleModule::ErrorLog(ERROR_NMAUTH error, const char* szMsg)
    {
    	// ³Ý¸¶ºí ÀÎÁõ ¸ðµâÀÌ ÁØ ¿¡·¯ÄÚµå¿Í Ãß°¡ ¸Þ½ÃÁö¸¦ ·Î±ë
    	LPCTSTR szErrorCode;
    	szErrorCode = NMAuthLib::ErrorCode2String(error);
    
    	if (szErrorCode)
    		mlog("Netmarble Auth Lib Error : %s (%s)\n", szMsg, szErrorCode);
    	else
    		mlog("Netmarble Auth Lib Error : %s (%d)\n", szMsg, error);
    }
    
    void MBMatchNetmarbleModule::RequestAuth(const MUID& commUid, const char* szAuth, const char* szData, const char* szCp,
    										 bool bFreeLoginIP,
    										 unsigned long nChecksumPack,
    										 bool bCheckPremiumIP,
    										 const char* szIP,
    										 DWORD dwIP,
    										 const char* szCountryCode3)
    {
    	MBMatchNetmarbleAuthQuery* pQuery = new MBMatchNetmarbleAuthQuery(
    		commUid, szAuth, szData, szCp,
    		bFreeLoginIP,
    		nChecksumPack,
    		bCheckPremiumIP,
    		szIP,
    		dwIP,
    		szCountryCode3);
    
    	EnterCriticalSection(&m_cs);
    		m_queries.push_back(pQuery);
    	LeaveCriticalSection(&m_cs);
    }
    
    MBMatchNetmarbleAuthQuery* MBMatchNetmarbleModule::GetNextQuery()
    {
    	MBMatchNetmarbleAuthQuery* pQuery = NULL;
    
    	EnterCriticalSection(&m_cs);
    		if (!m_queries.empty()) {
    			pQuery = *m_queries.begin();
    			m_queries.pop_front();
    		}
    	LeaveCriticalSection(&m_cs);
    
    	return pQuery;
    }
    
    DWORD WINAPI MBMatchNetmarbleModule::WorkerThread(LPVOID pJobContext)
    {
    	MBMatchNetmarbleModule* pAuthModule = (MBMatchNetmarbleModule*)pJobContext;
    	_ASSERT(pAuthModule);
    
    	ERROR_NMAUTH error;
    	MBMatchNetmarbleAuthQuery* pQuery = NULL;
    
    	while(1)
    	{
    		Sleep(1);
    
    		pQuery = pAuthModule->GetNextQuery();
    		if (pQuery == NULL)
    			continue;
    
    		// ÀÌÀü µ¥ÀÌÅÍ ÆÄ±«.
    		pAuthModule->m_NMAuth.Destroy();
    
    		//³Ý¸¶ºí ÀÎÁõ¸ðµâ¿¡ µ¿±â¹æ½ÄÀ¸·Î ¿äû
    		error = pAuthModule->m_NMAuth.Init(pQuery->m_strAuth.c_str(), pQuery->m_strData.c_str(), pQuery->m_strCp.c_str());
    
    		if ( error == ERROR_NMAUTH_SUCCESS )
    		{
    			// ŸÀӾƿôÀ» ÀÔ·ÂÇÏÁö ¾ÊÀ¸¸é ±âº»°ªÀ¸·Î ó¸®.
    			error = pAuthModule->m_NMAuth.LoadDataFromXML();
    
    			// ¼º°øÇϸé 
    			if ( error == ERROR_NMAUTH_SUCCESS )
    			{
    				//todok del
    				//MLog("Netmarble login Auth SUCCEED by XML\n");
    
    				// DB¿¡ À¯Àú Á¤º¸¸¦ ÁúÀÇ
    				MBMatchAsyncDBJob_NetmarbleLogin* pNewJob = new MBMatchAsyncDBJob_NetmarbleLogin(pQuery->m_commUid);
    				pNewJob->Input(new MMatchAccountInfo(), 
    					new MMatchAccountPenaltyInfo,
    					pAuthModule->m_NMAuth.GetData("UserID"), 
    					pAuthModule->m_NMAuth.GetData("UniID"), 
    					pAuthModule->m_NMAuth.GetData("Certificate"), 
    					pAuthModule->m_NMAuth.GetData("Name"), 
    					atoi(pAuthModule->m_NMAuth.GetData("Age")), 
    					atoi(pAuthModule->m_NMAuth.GetData("Sex")), 
    					atoi(pAuthModule->m_NMAuth.GetData("CCode")), 
    					pQuery->m_bFreeLoginIP, 
    					pQuery->m_nChecksumPack,
    					pQuery->m_bCheckPremiumIP,
    					pQuery->m_strIP.c_str(),
    					pQuery->m_dwIP,
    					pQuery->m_strCountryCode3);
    
    				MMatchServer::GetInstance()->PostAsyncJob(pNewJob);
    			}
    			else
    			{
    				// XML µ¥ÀÌÅÍ ·Îµå ½ÇÆÐ½Ã ¿À·ù¸¦ Ãâ·ÂÇϰí,
    				pAuthModule->ErrorLog(error, "Netmarble Login Auth Failed (by XML)");
    
    				// ÄíŰ·ÎºÎÅÍ µ¥ÀÌÅ͸¦ Á÷Á¢ ÃßÃâÇÑ´Ù.
    				error = pAuthModule->m_NMAuth.LoadDataFromCookie();
    
    				if ( error == ERROR_NMAUTH_SUCCESS )
    				{
    					//todok del
    					//MLog("Netmarble login Auth SUCCEED by CPCOOKIE\n");
    
    					// DB¿¡ À¯Àú Á¤º¸¸¦ ÁúÀÇ
    					MBMatchAsyncDBJob_NetmarbleLogin* pNewJob = new MBMatchAsyncDBJob_NetmarbleLogin(pQuery-
    
    >m_commUid);
    					pNewJob->Input(new MMatchAccountInfo(), 
    						new MMatchAccountPenaltyInfo,
    						pAuthModule->m_NMAuth.GetData("UserID"), 
    						pAuthModule->m_NMAuth.GetData("UniID"), 
    						pAuthModule->m_NMAuth.GetData("Certificate"), 
    						pAuthModule->m_NMAuth.GetData("Name"), 
    						atoi(pAuthModule->m_NMAuth.GetData("Age")), 
    						atoi(pAuthModule->m_NMAuth.GetData("Sex")), 
    						atoi(pAuthModule->m_NMAuth.GetData("CCode")), 
    						pQuery->m_bFreeLoginIP, 
    						pQuery->m_nChecksumPack,
    						pQuery->m_bCheckPremiumIP,
    						pQuery->m_strIP.c_str(),
    						pQuery->m_dwIP,
    						pQuery->m_strCountryCode3);
    
    					MMatchServer::GetInstance()->PostAsyncJob(pNewJob);
    				}
    				else
    				{
    					// ½ÇÆÐó¸®
    					MGetServerStatusSingleton()->SetRunStatus(5);
    
    					// ¿ø·¡´Â ÀÌ·¸°Ô µÇ¾î ÀÖ¾ú´Âµ¥ ½º·¹µå¿¡ ¾ÈÀüÇÏÁö ¾Ê¾Æ¼­ ÀÏ´Ü »­
    					//MCommand* pCmd = MGetMatchServer()->CreateCmdMatchResponseLoginFailed(pQuery->m_commUid, 
    
    MERR_CLIENT_WRONG_PASSWORD);
    					//MGetMatchServer()->Post(pCmd);
    
    					MLog("Netmarble Certification Failed\n");
    				}
    			}
    		}
    
    		delete pQuery;
    	}
    	return (0);
    } 
    
    #endif
    quote.
    Last edited by Phoenix; 15-10-12 at 10:44 AM. Reason: Use code tags, not quote tags.

  5. #5
    Account Upgraded | Title Enabled! Wish Q is offline
    MemberRank
    Jul 2012 Join Date
    LiveScoreLocation
    456Posts

    Re: Capture the flag help.

    Try to replace some files
    Last edited by Wish Q; 14-10-12 at 03:54 PM. Reason: a



Advertisement