removed ponintless ENABLE_PORT_SECURITY define & reorganized config loading
This commit is contained in:
@@ -146,7 +146,7 @@ bool CClientManager::Initialize()
|
||||
|
||||
if (!CConfig::instance().GetValue("PLAYER_DELETE_LEVEL_LIMIT", &m_iPlayerDeleteLevelLimit))
|
||||
{
|
||||
sys_err("conf.txt: Cannot find PLAYER_DELETE_LEVEL_LIMIT, use default level %d", PLAYER_MAX_LEVEL_CONST + 1);
|
||||
sys_err("conf/db.txt: Cannot find PLAYER_DELETE_LEVEL_LIMIT, use default level %d", PLAYER_MAX_LEVEL_CONST + 1);
|
||||
m_iPlayerDeleteLevelLimit = PLAYER_MAX_LEVEL_CONST + 1;
|
||||
}
|
||||
|
||||
@@ -3324,7 +3324,7 @@ bool CClientManager::InitializeNowItemID()
|
||||
//아이템 ID를 초기화 한다.
|
||||
if (!CConfig::instance().GetTwoValue("ITEM_ID_RANGE", &dwMin, &dwMax))
|
||||
{
|
||||
sys_err("conf.txt: Cannot find ITEM_ID_RANGE [start_item_id] [end_item_id]");
|
||||
sys_err("conf/db.txt: Cannot find ITEM_ID_RANGE [start_item_id] [end_item_id]");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,9 +202,9 @@ bool CClientManager::InitializeMobTable()
|
||||
bool isNameFile = true;
|
||||
//<파일 읽기>
|
||||
cCsvTable nameData;
|
||||
if(!nameData.Load("mob_names.txt",'\t'))
|
||||
if(!nameData.Load("conf/mob_names.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "mob_names.txt 파일을 읽어오지 못했습니다\n");
|
||||
fprintf(stderr, "conf/mob_names.txt 파일을 읽어오지 못했습니다\n");
|
||||
isNameFile = false;
|
||||
} else {
|
||||
nameData.Next(); //설명row 생략.
|
||||
@@ -264,8 +264,8 @@ bool CClientManager::InitializeMobTable()
|
||||
|
||||
//1. 파일 읽기.
|
||||
cCsvTable data;
|
||||
if(!data.Load("mob_proto.txt",'\t')) {
|
||||
fprintf(stderr, "mob_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
if(!data.Load("conf/mob_proto.txt",'\t')) {
|
||||
fprintf(stderr, "conf/mob_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //설명 row 넘어가기
|
||||
@@ -282,9 +282,9 @@ bool CClientManager::InitializeMobTable()
|
||||
}
|
||||
//data를 다시 첫줄로 옮긴다.(다시 읽어온다;;)
|
||||
data.Destroy();
|
||||
if(!data.Load("mob_proto.txt",'\t'))
|
||||
if(!data.Load("conf/mob_proto.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "mob_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
fprintf(stderr, "conf/mob_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
|
||||
@@ -602,9 +602,9 @@ bool CClientManager::InitializeItemTable()
|
||||
bool isNameFile = true;
|
||||
map<int,const char*> localMap;
|
||||
cCsvTable nameData;
|
||||
if(!nameData.Load("item_names.txt",'\t'))
|
||||
if(!nameData.Load("conf/item_names.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_names.txt 파일을 읽어오지 못했습니다\n");
|
||||
fprintf(stderr, "conf/item_names.txt 파일을 읽어오지 못했습니다\n");
|
||||
isNameFile = false;
|
||||
} else {
|
||||
nameData.Next();
|
||||
@@ -665,9 +665,9 @@ bool CClientManager::InitializeItemTable()
|
||||
|
||||
//파일 읽어오기.
|
||||
cCsvTable data;
|
||||
if(!data.Load("item_proto.txt",'\t'))
|
||||
if(!data.Load("conf/item_proto.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
fprintf(stderr, "conf/item_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
|
||||
@@ -692,9 +692,9 @@ bool CClientManager::InitializeItemTable()
|
||||
}
|
||||
//data를 다시 첫줄로 옮긴다.(다시 읽어온다;;)
|
||||
data.Destroy();
|
||||
if(!data.Load("item_proto.txt",'\t'))
|
||||
if(!data.Load("conf/item_proto.txt",'\t'))
|
||||
{
|
||||
fprintf(stderr, "item_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
fprintf(stderr, "conf/item_proto.txt 파일을 읽어오지 못했습니다\n");
|
||||
return false;
|
||||
}
|
||||
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
|
||||
|
||||
@@ -128,7 +128,7 @@ bool CConfig::LoadFile(const char* filename)
|
||||
|
||||
case 2:
|
||||
mode = 0;
|
||||
m_valueMap.insert(TValueMap::value_type(comment, szTmp));
|
||||
m_valueMap.insert(std::make_pair(comment, szTmp));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,9 +133,9 @@ void emptybeat(LPHEART heart, int pulse)
|
||||
//
|
||||
int Start()
|
||||
{
|
||||
if (!CConfig::instance().LoadFile("conf.txt"))
|
||||
if (!CConfig::instance().LoadFile("conf/db.txt"))
|
||||
{
|
||||
fprintf(stderr, "Loading conf.txt failed.\n");
|
||||
fprintf(stderr, "Loading conf/db.txt failed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,16 +46,7 @@ bool CPeerBase::Accept(socket_t fd_accept)
|
||||
{
|
||||
Destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_PORT_SECURITY
|
||||
if (strcmp(inet_ntoa(peer.sin_addr), "127.0.0.1")) // refuse if remote host != localhost (only the same machine must be able to connect in here)
|
||||
{
|
||||
sys_log(0, "PORT_SECURITY: BLOCK CONNECTION FROM %s", inet_ntoa(peer.sin_addr));
|
||||
Destroy();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
//socket_block(m_fd);
|
||||
socket_sndbuf(m_fd, 233016);
|
||||
|
||||
Reference in New Issue
Block a user