Files
Client/GameTools/NeoRylClient/HumanChrCreateLeft.h
LGram16 dd97ddec92 Restructure repository to include all source folders
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>
2025-11-29 20:17:20 +09:00

133 lines
3.2 KiB
C++

// HumanChrCreateLeft.h: interface for the CHumanChrCreateLeft class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_HUMANCHRCREATELEFT_H__BAAE8B73_C563_4F0D_8E7D_45FAF1B50D38__INCLUDED_)
#define AFX_HUMANCHRCREATELEFT_H__BAAE8B73_C563_4F0D_8E7D_45FAF1B50D38__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 CHumanChrCreate : public CGUIWindow
{
protected:
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;
unsigned long m_dwShirt;
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);
CHumanChrCreate();
~CHumanChrCreate();
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_HUMANCHRCREATELEFT_H__BAAE8B73_C563_4F0D_8E7D_45FAF1B50D38__INCLUDED_)