forked from metin2/server
Added support for CLion, removed a lot of unused code in preparation of the rewriting of the network stack
This commit is contained in:
@@ -29,11 +29,6 @@ int (*check_name) (const char * str) = NULL;
|
||||
int (*is_twobyte) (const char * str) = NULL;
|
||||
bool LC_InitLocalization( const std::string& szLocal );
|
||||
|
||||
int is_twobyte_euckr(const char * str)
|
||||
{
|
||||
return ishan(*str);
|
||||
}
|
||||
|
||||
int is_twobyte_gb2312(const char * str)
|
||||
{
|
||||
if (!str || !*str)
|
||||
@@ -227,46 +222,6 @@ int check_name_big5(const char * str )
|
||||
return check_name_independent(str);
|
||||
}
|
||||
|
||||
int check_name_euckr(const char * str)
|
||||
{
|
||||
int code;
|
||||
const char* tmp;
|
||||
|
||||
if (!str || !*str)
|
||||
return 0;
|
||||
|
||||
if ( strlen(str) < 2 || strlen(str) > 12 )
|
||||
return 0;
|
||||
|
||||
for (tmp = str; *tmp; ++tmp)
|
||||
{
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> <20>ƴϰ<C6B4> <20><>ĭ<EFBFBD≯<EFBFBD> <20>߸<EFBFBD><DFB8><EFBFBD> <20><>
|
||||
if (isnhspace(*tmp))
|
||||
return 0;
|
||||
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> <20>ƴϰ<C6B4> <20><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
if (isnhdigit(*tmp))
|
||||
continue;
|
||||
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> <20>ƴϰ<C6B4> <20><><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
if (!ishan(*tmp) && isalpha(*tmp))
|
||||
continue;
|
||||
|
||||
code = *tmp;
|
||||
code += 256;
|
||||
|
||||
if (code < 176 || code > 200)
|
||||
return 0;
|
||||
|
||||
++tmp;
|
||||
|
||||
if (!*tmp)
|
||||
break;
|
||||
}
|
||||
|
||||
return check_name_independent(str);
|
||||
}
|
||||
|
||||
int check_name_latin1(const char * str)
|
||||
{
|
||||
int code;
|
||||
@@ -281,15 +236,15 @@ int check_name_latin1(const char * str)
|
||||
for (tmp = str; *tmp; ++tmp)
|
||||
{
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> <20>ƴϰ<C6B4> <20><>ĭ<EFBFBD≯<EFBFBD> <20>߸<EFBFBD><DFB8><EFBFBD> <20><>
|
||||
if (isnhspace(*tmp))
|
||||
if (isspace(*tmp))
|
||||
return 0;
|
||||
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> <20>ƴϰ<C6B4> <20><><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
if (isnhdigit(*tmp))
|
||||
if (isdigit(*tmp))
|
||||
continue;
|
||||
|
||||
// <20>ѱ<EFBFBD><D1B1><EFBFBD> <20>ƴϰ<C6B4> <20><><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
||||
if (!ishan(*tmp) && isalpha(*tmp))
|
||||
if (isalpha(*tmp))
|
||||
continue;
|
||||
|
||||
unsigned char uc_tmp = *tmp;
|
||||
@@ -1197,10 +1152,10 @@ bool LocaleService_Init(const std::string& c_rstServiceName)
|
||||
void LocaleService_TransferDefaultSetting()
|
||||
{
|
||||
if (!check_name)
|
||||
check_name = check_name_euckr;
|
||||
check_name = check_name_independent;
|
||||
|
||||
if (!is_twobyte)
|
||||
is_twobyte = is_twobyte_euckr;
|
||||
is_twobyte = is_twobyte_gb2312;
|
||||
|
||||
if (!exp_table)
|
||||
exp_table = exp_table_common;
|
||||
|
Reference in New Issue
Block a user