示例#1
0
bool ZApplication::InitLocale()
{
	ZGetLocale()->Init( GetCountryID(ZGetConfiguration()->GetLocale()->strCountry.c_str()));

	char szPath[MAX_PATH] = "system/";

	// 유저가 다른 언어를 선택했는지 확인
	if (!ZGetConfiguration()->IsUsingDefaultLanguage())
	{
		const char* szSelectedLanguage = ZGetConfiguration()->GetSelectedLanguage();

		// 디폴트 언어가 아니라면 언어를 새로 설정한다
		ZGetLocale()->SetLanguage( GetLanguageID(szSelectedLanguage) );

		// 스트링을 로딩할 경로를 선택된 언어에 맞추어 수정
		strcat(szPath, szSelectedLanguage);
		strcat(szPath, "/");
	}

	ZGetStringResManager()->Init(szPath, ZGetLocale()->GetLanguage(), GetFileSystem());

	return true;
}
bool AnalizeArgument( const char *lpArg)
{
	string strString;
	string strStatIndex;

	char ch;
	bool bSeperate = false;

	while ( *lpArg != 0)
	{
		ch = *lpArg++;

		if (ch == '\"')
			continue;
		else if (ch == ' ')
		{
			if ( bSeperate == true)
				return false;

			bSeperate = true;
		}
		else if ( bSeperate == false)
			strString += ch;
		else
			strStatIndex += ch;
	}


	if ( strString.empty() || strStatIndex.empty())
		return false;


	ZGameOnJPAuthInfo* pAuth = (ZGameOnJPAuthInfo*)ZGetLocale()->GetAuthInfo();

	if ( pAuth->ParseVersion() == false)
		return false;

	pAuth->SetString( strString.c_str());
	pAuth->SetStatIndex( strStatIndex.c_str());


	return true;
}
示例#3
0
bool ZApplication::ParseArguments(const char* pszArgs)
{
	strcpy(m_szCmdLine, pszArgs);

	// 파라미터가 리플레이 파일명인지 확인한다
	{
		size_t nLength;

		// 따옴표 있으면 제거한다
		if(pszArgs[0]=='"') 
		{
			strcpy(m_szFileName,pszArgs+1);

			nLength = strlen(m_szFileName);
			if(m_szFileName[nLength-1]=='"')
			{
				m_szFileName[nLength-1]=0;
				nLength--;
			}
		}
		else
		{
			strcpy(m_szFileName,pszArgs);
			nLength = strlen(m_szFileName);
		}

		if(stricmp(m_szFileName+nLength-strlen(GUNZ_REC_FILE_EXT),GUNZ_REC_FILE_EXT)==0){
			SetLaunchMode(ZLAUNCH_MODE_STANDALONE_REPLAY);
			m_nInitialState = GUNZ_GAME;
			ZGetLocale()->SetTeenMode(false);
			return true;
		}
	}


	// '/launchdevelop' 모드
	if ( pszArgs[0] == '/')
	{
#ifndef _PUBLISH
		if ( strstr( pszArgs, "launchdevelop") != NULL)
		{
			SetLaunchMode( ZLAUNCH_MODE_STANDALONE_DEVELOP);
			m_bLaunchDevelop = true;
			ZGetLocale()->SetTeenMode( false);

			return true;
		} 
		// '/launch' 모드
		else if ( strstr( pszArgs, "launch") != NULL)
		{
			SetLaunchMode(ZLAUNCH_MODE_STANDALONE);
			return true;
		}
#endif
	}

	// TODO: 일본넷마블 테스트하느라 주석처리 - bird
	// 디버그버전은 파라메타가 없어도 launch로 실행하도록 변경
#ifndef _PUBLISH
	{
		SetLaunchMode(ZLAUNCH_MODE_STANDALONE_DEVELOP);
		m_bLaunchDevelop=true;
#ifndef LOCALE_NHNUSA
		return true;
#endif
	}
#endif


/*	// RAON DEBUG ////////////////////////
	ZNetmarbleAuthInfo* pMNInfo = ZNetmarbleAuthInfo::GetInstance();
	pMNInfo->SetServerIP("192.168.0.30");
	pMNInfo->SetServerPort(6000);
	pMNInfo->SetAuthCookie("");
	pMNInfo->SetDataCookie("");
	pMNInfo->SetCpCookie("Certificate=4f3d7e1cf8d27bd0&Sex=f1553a2f8bd18a59&Name=018a1751ea0eaf54&UniID=25c1272f61aaa6ec8d769f14137cf298&Age=1489fa5ce12aeab7&UserID=e23616614f162e03");
	pMNInfo->SetSpareParam("Age=15");

	SetLaunchMode(ZLAUNCH_MODE_NETMARBLE);
	return true;
	//////////////////////////////////////
	*/		

	switch(ZGetLocale()->GetCountry()) {
	case MC_JAPAN:
	case MC_KOREA:
		{
			// 인증 정보 세팅
			if( !ZGetLocale()->ParseArguments(pszArgs) )
				return false;

			// 서비스 종류를 설정(현재 테스트, 리얼 서비스 두종류)
			if( ((ZNetmarbleAuthInfo*)(ZGetLocale()->GetAuthInfo()))->GetIsAlpha() )
				m_bLaunchTest = true;
			return true;
		}
		break;

	case MC_NHNUSA : 
#ifdef LOCALE_NHNUSA
		{
			if( !ZGetLocale()->ParseArguments(pszArgs) )
				return false;

			if ( ((ZNHN_USAAuthInfo*)(ZGetLocale()->GetAuthInfo()))->IsAlpha())
			{
				SetLaunchMode( ZLAUNCH_MODE_STANDALONE_DEVELOP);
				m_bLaunchDevelop = true;
				ZGetLocale()->SetTeenMode(false);
				m_bLaunchTest = true;
			}
			else if ( ((ZNHN_USAAuthInfo*)(ZGetLocale()->GetAuthInfo()))->IsReal())
			{
				SetLaunchMode( ZLAUNCH_MODE_STANDALONE);
				ZGetLocale()->SetTeenMode(false);
			}
			else
			{
#ifdef _DEBUG
				SetLaunchMode( ZLAUNCH_MODE_STANDALONE_DEVELOP);
				m_bLaunchDevelop = true;
				ZGetLocale()->SetTeenMode(false);
				m_bLaunchTest = true;
#endif
				mlog( "Cannot find server version.\n");
				ASSERT( 0);
			}

			return true;
		}
#endif
		break;

	case MC_US:
	case MC_BRAZIL:
	case MC_INDIA:
		{
			// 암호 코드 구하기
			CGLEncription cEncription;
			int nMode = cEncription.Decription();

			// launch 모드
			if ( nMode == GLE_LAUNCH_INTERNATIONAL)
			{
				SetLaunchMode( ZLAUNCH_MODE_STANDALONE);
				ZGetLocale()->SetTeenMode(false);
				return true;
			}
			// launchdevelop 모드
			else if ( nMode == GLE_LAUNCH_DEVELOP)
			{
				SetLaunchMode( ZLAUNCH_MODE_STANDALONE_DEVELOP);
				m_bLaunchDevelop = true;
				ZGetLocale()->SetTeenMode(false);
				return true;
			}
			// Test 모드
			else if ( nMode == GLE_LAUNCH_TEST)
			{
				SetLaunchMode( ZLAUNCH_MODE_STANDALONE_DEVELOP);
				m_bLaunchDevelop = true;
				ZGetLocale()->SetTeenMode(false);
				m_bLaunchTest = true;
				return true;
			}
		}
		break;
	case MC_INVALID:
	default:
		{
			mlog("Invalid Locale \n");
			return false;
		}
		break;
	};

	return false;
}