/*! * \file AutoTestManager.cpp * \brief AutoTestManager class * \author ÀÌÁö¿¬ (kiki@webzen.co.kr) * \version 2009/07/02 first release */ #include "SunClientPrecompiledHeader.h" #include "AutoTestManager.h" #if defined(_DEBUG) || defined(_GAMECLIENT_VER) #include #include "uiLoginMan/uiLoginMan.h" #include "CharacterScene.h" #include #include "ClientVer.h" #include "GlobalFunc.h" bool AutoTestManagerEx::LoadTestCase() { SetActive(false); TCHAR file_path[MAX_PATH]; GetCurrentDirectoryA( MAX_PATH, file_path); strcat( file_path, "\\autotestex.ini"); if( _access(file_path, 0) != 0 ) { ////ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾ÊÀ¸¸é autotest ¸ðµå·Î µ¹¸± ¼ö ¾øÀ½. ±×³É Á¾·á½ÃŲ´Ù. //SaveLog(true, _T("autotest.ini°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù. AutoTest ¸ðµå¸¦ ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù.")); return false; } TCHAR category_name[1024]; ////////////////////////////////////////////////////////////////////////////////////////////////////////////// m_AutoLogin.m_Enable = false; for( size_t i=0;i!=10;++i) { wsprintf(category_name, "autologin%d", i ); UINT IsEnable = GetPrivateProfileInt(category_name, "enable", 0, file_path ); if( IsEnable == 0 ) continue; m_AutoLogin.m_Enable = IsEnable == 1; CHAR temp[1024]; GetPrivateProfileString(category_name, "testid", 0, temp, 1024, file_path ); m_AutoLogin.m_Account = temp; GetPrivateProfileString(category_name, "testpw", 0, temp, 1024, file_path ); m_AutoLogin.m_Passward = temp; GetPrivateProfileString(category_name, "server_name", 0, temp, 1024, file_path ); m_AutoLogin.m_ServerName = temp; GetPrivateProfileString(category_name, "character_name", 0, temp, 1024, file_path ); m_AutoLogin.m_CharacterName = temp; break; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// for( size_t i=0;i!=10;++i) { wsprintf(category_name, "command%d", i ); UINT IsEnable = GetPrivateProfileInt(category_name, "enable", 0, file_path ); if( IsEnable == 0 ) continue; m_Command.m_Enable = IsEnable == 1; CHAR temp[1024]; CHAR command_name[1024]; for( size_t j=0;j!=10;++j) { wsprintf(command_name, "command%d", j); if( GetPrivateProfileString(category_name, command_name, NULL, temp, 1024, file_path ) != 0 ) { m_Command.m_CommandArray.push_back(temp); } } break; } if( m_AutoLogin.m_Enable == true ) { SetActive(true); } return true; } void AutoTestManagerEx::RunStartGame() { // ij¸¯ÅÍÀÇ À̸§ÀÌ ¼³Á¤µÇ¾îÀÖ´Â °æ¿ì À̸§À¸·Î ij¸¯Å͸¦ ã¾Æ¼­ Á¢¼Ó if( g_CharSelectScene.SetSelectCharacterAutoTestByName( m_AutoLogin.m_CharacterName.c_str() ) == FALSE ) { g_CharSelectScene.SetSelectCharacterAutoTest(0); } g_CharSelectScene.SendCharSelectPacket(); } void AutoTestManagerEx::RunLogin() { uiLoginMan* pUILoginMan = GET_DIALOG_MANAGER(uiLoginMan, UIMAN_LOGIN); if(pUILoginMan) { pUILoginMan->SetIDPW4AutoTest(m_AutoLogin.m_Account.c_str(), m_AutoLogin.m_Passward.c_str() ); pUILoginMan->SEND_AUTH_ID_PASSWORD_CHECK_SYN(); } } void AutoTestManagerEx::RunSelectServer() { uiLoginMan* pUILoginMan = GET_DIALOG_MANAGER(uiLoginMan, UIMAN_LOGIN); bool bSelectServer = false; if(pUILoginMan) { // ¼­¹ö¸íÀÌ ¼³Á¤µÇ¾îÀִ°æ¿ì ¼­¹öÀ̸§À¸·Î ã¾Æ¼­ Á¢¼Ó if( AuthSetverData* pAuthSetverData = pUILoginMan->GetServerDataByServerName( m_AutoLogin.m_ServerName.c_str() ) ) { #ifdef _DEV_VER//_DH_LOGIN_LOG_ID_AND_CHANNEL TCHAR szTitle[MAX_PATH]; TCHAR temp_string[MAX_PATH]; GetWindowText(g_hWndMain, temp_string, sizeof(szTitle)); sprintf(szTitle, "%s@%s", strtok(temp_string, "@"), pAuthSetverData->m_ServerName.c_str()); ::SetWindowText(g_hWndMain, szTitle); #endif//_DH_LOGIN_LOG_ID_AND_CHANNEL pUILoginMan->SEND_AUTH_SERVER_SELECT_SYN(pAuthSetverData); bSelectServer = true; } } } void AutoTestManagerEx::RunAutoCommand() { for( size_t i=0;i!=m_Command.m_CommandArray.size();++i) { CHAR temp[1024]; strcpy(temp, m_Command.m_CommandArray[i].c_str()); GlobalFunc::ProcessChatMessage(temp); } } #endif