void CUICharacterCreateNew::OpenUI() { if (IsVisible() == TRUE) return; SetVisible(TRUE); Hide(FALSE); CUIManager* pUimgr = CUIManager::getSingleton(); GameDataManager* pGame = GameDataManager::getSingleton(); if (pGame == NULL) return; CharacterCreateNew* pCharCreate = pGame->GetCharCreate(); if (pCharCreate == NULL) return; pCharCreate->Reset(); Lock(FALSE); ResetName(); ResetSelect(); // 캐릭터 생성창 셋팅 SetSelectJobInfo(); pUimgr->RearrangeOrder(UI_CREATE_CHAR, TRUE); }
void Input::Reset() { ResetName(); ResetPassword(); Field = GET_NAME; Action = WAIT; }
void CUICharacterCreateNew::PressOk() { CUIManager* pUIManager = CUIManager::getSingleton(); GameDataManager* pGame = GameDataManager::getSingleton(); if (pGame == NULL) return; CharacterCreateNew* pCharCreate = pGame->GetCharCreate(); if (pCharCreate == NULL) return; if (m_pebCharName == NULL) return; // Get input string if( m_pebCharName->GetString() ) { CTString strNewName = m_pebCharName->GetString(); pCharCreate->SetNewName(strNewName); // 공백 체크. const char *chr = pCharCreate->GetName(); for( ; *chr != 0; chr++) { if( (*chr) == ' ' || (*chr) == '\t' || (*chr) == '\n' || (*chr) == '\r' || (*chr) == '%' || (*chr) == '#' || (*chr) == '&' || (*chr) == '?' || (*chr) == '+' || (*chr) == '=') { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); CTString strMessage = _S( 146, "캐릭터명에 공백이 들어갈 수 없습니다." ); MsgBoxInfo.AddString( strMessage ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } #if defined(G_RUSSIA) if( !((*chr) >= 48 && (*chr) <= 57 ) && !((*chr) >= -64 && (*chr) <= -1) && !((*chr) == -88) && !((*chr) == -72) ) { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); CTString strMessage = _S(2980, "아이디는 영문과 숫자만 허용됩니다." ); MsgBoxInfo.AddString( strMessage ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } #elif !defined(G_KOR) && !defined(G_THAI) if( !((*chr) >= 48 && (*chr) <=57) //! 0 ~ 9 && !((*chr) >= 65 && (*chr) <=90) // ! A ~ Z && !((*chr) >= 97 && (*chr) <=122) // ! a ~ z ) { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); CTString strMessage = _S(2980, "아이디는 영문과 숫자만 허용됩니다." ); MsgBoxInfo.AddString( strMessage ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } #endif } } //#define RESTRICT_SOUND _pSound->Mute(); CreateCharacter(); #ifdef RESTRICT_SOUND extern BOOL _bNTKernel; //if( _bNTKernel ) _pSound->UpdateSounds(); #endif }
void CUICharacterCreateNew::CreateCharacter() { CUIManager* pUIManager = CUIManager::getSingleton(); GameDataManager* pGame = GameDataManager::getSingleton(); CTString strMessage; if (pGame == NULL) return; CharacterCreateNew* pCharCreate = pGame->GetCharCreate(); if (pCharCreate == NULL) return; #if defined(G_BRAZIL) || defined(G_KOR) { // 이기환 수정 시작 ( 11.29 ) : 캐랙터명 오류 메세지 처리 char szBuffer[MAX_STR_LENGTH]; CTString szbuf = pCharCreate->GetName(); strcpy ( szBuffer, szbuf ); if( strlen( pCharCreate->GetName() ) <= 0 ) { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); MsgBoxInfo.AddString( _S( 432, "캐릭터 이름을 입력하여 주십시오.\n(한글 4~8자, 영문 2~16자)" ) ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } else if(strlen(pCharCreate->GetName()) < MIN_NAME_LEN ) { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); MsgBoxInfo.AddString( _S( 433, "캐릭터 이름이 너무 짧습니다.\n(한글 4~8자, 영문 2~16자)" ) ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } else if ( strlen(pCharCreate->GetName()) > MAX_NAME_LEN ) { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); MsgBoxInfo.AddString( _S( 434, "캐릭터 이름이 너무 깁니다.\n(한글 4~8자, 영문 2~16자)" ) ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } else if( _UIFilteringCharacter.Filtering ( szBuffer ) == TRUE ) // find ... { pUIManager->CloseMessageBox(MSGCMD_CREATE_ERROR); CUIMsgBox_Info MsgBoxInfo; MsgBoxInfo.SetMsgBoxInfo( _S( 145, "캐릭터 생성 오류" ), UMBS_OK, UI_CREATE_CHAR, MSGCMD_CREATE_ERROR ); CTString strName = pCharCreate->GetName(); CTString strMessage = _S( 435, "잘못된 문자[" ); strMessage += strName; strMessage += _S( 436, "]가 포함되어 있습니다." ); MsgBoxInfo.AddString( strMessage ); pUIManager->CreateMessageBox( MsgBoxInfo ); ResetName(); return; } // 이기환 수정 끝 } #else strMessage = pCharCreate->GetName(); if(!pUIManager->checkName(strMessage,0)) return; #endif if(_pNetwork->m_bSendMessage) return; pCharCreate->SendCreateChar(); Lock(TRUE); }
CTextseq_id& CTextseq_id::Set (const CTempString& acc_in, const CTempString& name_in, int version, const CTempString& release_in, bool allow_dot_version) { // Perform general sanity checks up front. if (version < 0) { NCBI_THROW(CSeqIdException, eFormat, "Unexpected negative version " + NStr::IntToString(version) + " for accession " + string(acc_in)); } CTempString acc = NStr::TruncateSpaces_Unsafe(acc_in, NStr::eTrunc_Both); CTempString name = NStr::TruncateSpaces_Unsafe(name_in, NStr::eTrunc_Both); CTempString release = NStr::TruncateSpaces_Unsafe(release_in, NStr::eTrunc_Both); if (acc.empty() && name.empty()) { } if (acc.empty()) { ResetAccession(); } else { SIZE_TYPE idx = NPOS; if (allow_dot_version) { idx = acc.rfind('.'); } if (idx == NPOS) { // no version within acc SetAccession(acc); // any standalone version is ok if (version > 0) { SetVersion(version); } else { ResetVersion(); } } else { // accession.version CTempString accession = acc.substr(0, idx); CTempString acc_ver = acc.substr(idx + 1); int ver = NStr::StringToNonNegativeInt(acc_ver); if (ver <= 0) { NCBI_THROW(CSeqIdException, eFormat, "Version embedded in accession " + string(acc) + " is not a positive integer"); } else if (version > 0 && ver != version) { NCBI_THROW(CSeqIdException, eFormat, "Incompatible version " + NStr::IntToString(version) + " supplied for accession " + string(acc)); } SetAccession(accession); SetVersion(ver); } } if (name.empty()) { ResetName(); } else { SetName(name); } if (acc.empty() && name.empty()) { NCBI_THROW(CSeqIdException, eFormat, "Accession and name missing for Textseq-id (but got" " version " + NStr::IntToString(version) + ", release " + string(release) + ')'); } else if (release.empty()) { ResetRelease(); } else { SetRelease(release); } return *this; }