Respected seniors, I live in Korea and am studying using the w2pp code project for content development purposes.
As the title says, you cannot create a character with a Korean nickname.
In basedef.cpp and Cfiledb.cpp among w2pp code
basedef.cpp
/*char KorFirst[36] = {0,};//"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ";*/
unsigned char KorFirst[58] = "ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ";
// 가:0 까:171 나:291 다:432 따: 라:646 마:773 바:902 빠:1031 사:1104 싸:1237 아:1353 자:1561 짜:1696 차:1770 카:1890 타:1997 파:2103 하:2208 끝:2350
int KorIndex[19] = {171, 291, 432, 560, 646, 773, 902, 1031, 1104, 1237, 1353, 1561, 1696, 1770, 1890, 1997, 2103, 2208, 2350};
void BASE_GetFirstKey(char* source, char* dest)
{
if ((source[0] >= 'A' && source[0] <= 'Z') || (source[0] >= 'a' && source[0] <= 'z'))
{
dest[0] = source[0];
dest[1] = 0;
return;
}
else if (source[0] < 0)
{
unsigned char * unsource = (unsigned char *)source;
int Point = (unsource[0] - 0xB0) * 94 + unsource[1] - 0xA1;
if (Point < 0 || Point >= 2350)
{
strcpy(dest, "etc");
return;
}
int a;
for (a = 0; a < 18; a++)
{
if (Point < KorIndex[a])
break;
}
if (a >= 0 && a <= 17)
{
dest[0] = KorFirst[a * 2];
dest[1] = KorFirst[a * 2 + 1];
dest[2] = 0;
}
else
{
strcpy(dest, "etc");
return;
}
}
else
strcpy(dest, "etc");
return;
}
void BASE_GetKorFirst(int temp, int *a)
{
int word1;
int temp1;
word1 = (temp >> 10) & 31;
word1 = word1-1;
temp1 = word1;
*a = temp1;
}
CFileDB.cpp
int CFileDB::CreateCharacter(char *ac, char *ch)
{
char check[ACCOUNTNAME_LENGTH];
strncpy(check, ac, ACCOUNTNAME_LENGTH);
_strupr(check);
if (check[0] == 'C' && check[1] == 'O' && check[2] == 'M' && check[3] >= '0' && check[3] <= '9' && check[4] == 0)
return FALSE;
if (check[0] == 'L' && check[1] == 'P' && check[2] == 'T' && check[3] >= '0' && check[3] <= '9' && check[4] == 0)
return FALSE;
strncpy(check, ch, NAME_LENGTH);
_strupr(check);
if (check[0] == 'C' && check[1] == 'O' && check[2] == 'M' && check[3] >= '0' && check[3] <= '9' && check[4] == 0)
return FALSE;
if (check[0] == 'L' && check[1] == 'P' && check[2] == 'T' && check[3] >= '0' && check[3] <= '9' && check[4] == 0)
return FALSE;
char First[128];
char temp[128];
BASE_GetFirstKey(check, First);
sprintf(temp, "./char/%s/%s", First, check);
FILE* fp = NULL;
fp = fopen(temp, "r");
if (fp != NULL)
{
fclose(fp);
Log("err createchar EEXIST", ch, 0);
return FALSE;
}
int Handle = _open(temp, O_RDWR | O_CREAT | O_BINARY, _S_IREAD | _S_IWRITE);
if(Handle == -1)
{
if (errno == EEXIST)
Log("err createchar EEXIST", ch, 0); // _O_EXCL 일때 이미 파일이 있는경우
if (errno == EACCES)
Log("err createchar EACCES", ch, 0); // readonly를 쓰려고 한경우, 쉐어모드가 불가인경우, 디렉토리가 invalid
if (errno == EINVAL)
Log("err createchar EINVAL", ch, 0); // invalid oflag or pmode argument
if (errno == EMFILE)
Log("err createchar EMFILE", ch, 0); // 파일 핸들이 없다.
if (errno == ENOENT)
Log("err createchar ENOENT", ch, 0); // File or Path not found
else
Log("err createchar UNKNOWN", ch, 0);
return FALSE;
}
_write(Handle, ac, ACCOUNTNAME_LENGTH);
_close(Handle);
return TRUE;
}
Am I missing something or do I need to take any additional steps to make my character's nickname in Korean?