Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
131 lines
3.1 KiB
C++
131 lines
3.1 KiB
C++
// AkhanChrCreate.h: interface for the CAkhanChrCreate class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_AKHANCHRCREATE_H__8BA5391E_7C4E_4470_B081_868014DD3261__INCLUDED_)
|
|
#define AFX_AKHANCHRCREATE_H__8BA5391E_7C4E_4470_B081_868014DD3261__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include "GUIWindow.h"
|
|
|
|
static const unsigned short ALLOW_HAN_NUM = 39;
|
|
static unsigned short AllowHans[ALLOW_HAN_NUM] =
|
|
{
|
|
'갉', '갊', '걺', '괆', '녠',
|
|
'닒', '롼', '뢸', '룀', '룁',
|
|
'룅', '뤠', '륄', '륌', '륏',
|
|
'륑', '륩', '륫', '릊', '릍',
|
|
'멂', '몲', '뭬', '뮴', '밗',
|
|
'뱝', '뾔', '쓿', '줴', '쥣',
|
|
'짢', '췽', '퀭', '푤', '푭',
|
|
'풩', '핥', '홅', '흖'
|
|
};
|
|
|
|
static const unsigned short ALLOW_LETTER_NUM = 2;
|
|
static char AllowLetters[ALLOW_LETTER_NUM] =
|
|
{
|
|
'-', '_'
|
|
};
|
|
|
|
class CAkhanChrCreate : public CGUIWindow
|
|
{
|
|
unsigned short m_wClass;
|
|
unsigned long m_dwStr;
|
|
unsigned long m_dwDex;
|
|
unsigned long m_dwCon;
|
|
unsigned long m_dwInt;
|
|
unsigned long m_dwWis;
|
|
unsigned long m_dwIP;
|
|
char m_strName[16];
|
|
unsigned long m_dwEndTimer;
|
|
unsigned long m_dwSex;
|
|
unsigned long m_dwHair;
|
|
unsigned long m_dwFace;
|
|
|
|
inline bool CheckCharCreateName(char *Name_In)
|
|
{
|
|
const unsigned short MIN_CHAR_NAME = 4;
|
|
const unsigned short MAX_CHAR_NAME = 15;
|
|
|
|
if(Name_In == NULL)
|
|
return false;
|
|
|
|
// 길이 제한
|
|
size_t Len = strlen(Name_In);
|
|
if(Len < MIN_CHAR_NAME || Len > MAX_CHAR_NAME)
|
|
return false;
|
|
|
|
LPBYTE CheckName = (LPBYTE)Name_In;
|
|
|
|
// 제한 문자 검사
|
|
int ACount = 0;
|
|
for(unsigned short LCount = 0; LCount < Len; LCount++)
|
|
{
|
|
if((CheckName[LCount] & 0x80) == 0x80)
|
|
{
|
|
// 2Byte 문자 체크
|
|
if(CheckName[LCount + 1] == NULL)
|
|
return false;
|
|
|
|
// 허용 범위 체크 (한글)
|
|
if(CheckName[LCount] < 0xB0 || CheckName[LCount] > 0xC9)
|
|
return false;
|
|
|
|
if(CheckName[LCount + 1] < 0xA1 || CheckName[LCount + 1] > 0xFE)
|
|
return false;
|
|
|
|
// 한글 부분 불 허용
|
|
for(ACount = 0; ACount < ALLOW_HAN_NUM; ACount++)
|
|
{
|
|
if(MAKEWORD(CheckName[LCount + 1], CheckName[LCount]) == AllowHans[ACount])
|
|
break;
|
|
}
|
|
|
|
if(ACount != ALLOW_HAN_NUM)
|
|
return false;
|
|
|
|
LCount += 1;
|
|
continue;
|
|
}
|
|
else
|
|
{
|
|
// 영문자 허용
|
|
if((CheckName[LCount] >= 'A' && CheckName[LCount] <= 'Z') || (CheckName[LCount] >= 'a' && CheckName[LCount] <= 'z'))
|
|
continue;
|
|
|
|
// 숫자 허용
|
|
if(CheckName[LCount] >= '0' && CheckName[LCount] <= '9')
|
|
continue;
|
|
|
|
// 특수 기호 부분 허용
|
|
for(ACount = 0; ACount < ALLOW_LETTER_NUM; ACount++)
|
|
{
|
|
if(CheckName[LCount] == AllowLetters[ACount])
|
|
break;
|
|
}
|
|
|
|
if(ACount == ALLOW_LETTER_NUM)
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public:
|
|
void CreateCancel(void);
|
|
CAkhanChrCreate();
|
|
~CAkhanChrCreate();
|
|
|
|
BOOL Init(unsigned short x, unsigned short y);
|
|
void InitValue(void);
|
|
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
|
void ShowWindow(BOOL bShow) { }
|
|
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
|
};
|
|
|
|
#endif // !defined(AFX_AKHANCHRCREATE_H__8BA5391E_7C4E_4470_B081_868014DD3261__INCLUDED_)
|