db /src /clientmanagerboot.cpp acıp
arat
extern std::string g_stLocaleNameColumn;
altına ekle
extern int g_noTXT;
--------------------------------------------------
arat
bool CClientManager::InitializeTables()
komple kod blogunu değiştir
bool CClientManager::InitializeTables()
{
// NOTXT_STARTUP_BEGIN
if (g_noTXT) // item and mob proto
{
if (!InitializeMobTableSQL())
{
sys_err("InitializeMobTableSQL FAILED");
return false;
}
if (!InitializeItemTableSQL())
{
sys_err("InitializeItemTableSQL FAILED");
return false;
}
}
else
{
if (!InitializeMobTableTXT())
{
sys_err("InitializeMobTableTXT FAILED");
return false;
}
if (!MirrorMobTableIntoDB())
{
sys_err("MirrorMobTableIntoDB FAILED");
return false;
}
if (!InitializeItemTableTXT())
{
sys_err("InitializeItemTableTXT FAILED");
return false;
}
if (!MirrorItemTableIntoDB())
{
sys_err("MirrorItemTableIntoDB FAILED");
return false;
}
}
// NOTXT_STARTUP_END
if (!InitializeShopTable())
{
sys_err("InitializeShopTable FAILED");
return false;
}
if (!InitializeSkillTable())
{
sys_err("InitializeSkillTable FAILED");
return false;
}
if (!InitializeRefineTable())
{
sys_err("InitializeRefineTable FAILED");
return false;
}
if (!InitializeItemAttrTable())
{
sys_err("InitializeItemAttrTable FAILED");
return false;
}
if (!InitializeItemRareTable())
{
sys_err("InitializeItemRareTable FAILED");
return false;
}
if (!InitializeBanwordTable())
{
sys_err("InitializeBanwordTable FAILED");
return false;
}
if (!InitializeLandTable())
{
sys_err("InitializeLandTable FAILED");
return false;
}
if (!InitializeObjectProto())
{
sys_err("InitializeObjectProto FAILED");
return false;
}
if (!InitializeObjectTable())
{
sys_err("InitializeObjectTable FAILED");
return false;
}
if (!InitializeMonarch())
{
sys_err("InitializeMonarch FAILED");
return false;
}
return true;
}
--------------------------------------------------
arat
bool CClientManager::MirrorItemTableIntoDB()
kod blogundan sonra altına ekle varsa komple değiştir
// NOTXT_STARTUP_BEGIN
bool CClientManager::InitializeMobTableSQL()
{
char query[4096];
snprintf(query, sizeof(query),
"SELECT vnum, name, %s, type, rank, battle_type, level, "
"size+0, ai_flag+0, setRaceFlag+0, setImmuneFlag+0, "
"on_click, empire, drop_item, resurrection_vnum, folder, "
"st, dx, ht, iq, damage_min, damage_max, max_hp, regen_cycle, regen_percent, exp, "
"gold_min, gold_max, def, attack_speed, move_speed, "
"aggressive_hp_pct, aggressive_sight, attack_range, polymorph_item, "
"enchant_curse, enchant_slow, enchant_poison, enchant_stun, enchant_critical, enchant_penetrate, "
"resist_sword, resist_twohand, resist_dagger, resist_bell, resist_fan, resist_bow, "
"resist_fire, resist_elect, resist_magic, resist_wind, resist_poison, "
"dam_multiply, summon, drain_sp, "
"skill_vnum0, skill_level0, skill_vnum1, skill_level1, skill_vnum2, skill_level2,"
"skill_vnum3, skill_level3, skill_vnum4, skill_level4 , sp_berserk, sp_stoneskin, "
"sp_godspeed, sp_deathblow, sp_revive "
"FROM mob_proto%s ORDER BY vnum",
g_stLocaleNameColumn.c_str(), GetTablePostfix());
std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query));
SQLResult * pRes = pkMsg->Get();
if (!pRes->uiNumRows)
{
sys_err("Could not load mob_proto. No results!");
return false;
}
sys_log(0, "MOB_PROTO loading...");
if (!m_vec_mobTable.empty())
{
sys_log(0, "RELOAD: mob_proto");
m_vec_mobTable.clear();
}
m_vec_mobTable.resize(pRes->uiNumRows);
memset(&m_vec_mobTable[0], 0, sizeof(TMobTable) * m_vec_mobTable.size());
TMobTable * mob_table = &m_vec_mobTable[0];
MYSQL_ROW data;
int col;
while ((data = mysql_fetch_row(pRes->pSQLResult)))
{
col = 0;
str_to_number(mob_table->dwVnum, data[col++]);
strlcpy(mob_table->szName, data[col++], sizeof(mob_table->szName));
strlcpy(mob_table->szLocaleName, data[col++], sizeof(mob_table->szLocaleName));
str_to_number(mob_table->bType, data[col++]);
str_to_number(mob_table->bRank, data[col++]);
str_to_number(mob_table->bBattleType, data[col++]);
str_to_number(mob_table->bLevel, data[col++]);
str_to_number(mob_table->bSize, data[col++]);
str_to_number(mob_table->dwAIFlag, data[col++]);
str_to_number(mob_table->dwRaceFlag, data[col++]);
str_to_number(mob_table->dwImmuneFlag, data[col++]);
str_to_number(mob_table->bOnClickType, data[col++]);
str_to_number(mob_table->bEmpire, data[col++]);
str_to_number(mob_table->dwDropItemVnum, data[col++]);
str_to_number(mob_table->dwResurrectionVnum, data[col++]);
strlcpy(mob_table->szFolder, data[col++], sizeof(mob_table->szFolder));
str_to_number(mob_table->bStr, data[col++]);
str_to_number(mob_table->bDex, data[col++]);
str_to_number(mob_table->bCon, data[col++]);
str_to_number(mob_table->bInt, data[col++]);
str_to_number(mob_table->dwDamageRange[0], data[col++]);
str_to_number(mob_table->dwDamageRange[1], data[col++]);
str_to_number(mob_table->dwMaxHP, data[col++]);
str_to_number(mob_table->bRegenCycle, data[col++]);
str_to_number(mob_table->bRegenPercent, data[col++]);
str_to_number(mob_table->dwExp, data[col++]);
str_to_number(mob_table->dwGoldMin, data[col++]);
str_to_number(mob_table->dwGoldMax, data[col++]);
str_to_number(mob_table->wDef, data[col++]);
str_to_number(mob_table->sAttackSpeed, data[col++]);
str_to_number(mob_table->sMovingSpeed, data[col++]);
str_to_number(mob_table->bAggresiveHPPct, data[col++]);
str_to_number(mob_table->wAggressiveSight, data[col++]);
str_to_number(mob_table->wAttackRange, data[col++]);
str_to_number(mob_table->dwPolymorphItemVnum, data[col++]);
int i;
for (i = 0; i < MOB_ENCHANTS_MAX_NUM; ++i)
str_to_number(mob_table->cEnchants, data[col++]);
for (i = 0; i < MOB_RESISTS_MAX_NUM; ++i)
str_to_number(mob_table->cResists, data[col++]);
str_to_number(mob_table->fDamMultiply, data[col++]);
str_to_number(mob_table->dwSummonVnum, data[col++]);
str_to_number(mob_table->dwDrainSP, data[col++]);
for (i = 0; i < MOB_SKILL_MAX_NUM; ++i)
{
str_to_number(mob_table->Skills.dwVnum, data[col++]);
str_to_number(mob_table->Skills.bLevel, data[col++]);
}
str_to_number(mob_table->bBerserkPoint, data[col++]);
str_to_number(mob_table->bStoneSkinPoint, data[col++]);
str_to_number(mob_table->bGodSpeedPoint, data[col++]);
str_to_number(mob_table->bDeathBlowPoint, data[col++]);
str_to_number(mob_table->bRevivePoint, data[col++]);
sys_log(1, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
++mob_table;
}
sort(m_vec_mobTable.begin(), m_vec_mobTable.end(), FCompareVnum());
sys_log(0, "CClientManager::InitializeMobTable:: %d mobs loaded.\n", m_vec_mobTable.size());
return true;
}
bool CClientManager::InitializeItemTableSQL()
{
char query[4096];
snprintf(query, sizeof(query),
"SELECT vnum, name, %s, type, subtype, gold, shop_buy_price, weight, size, flag, wearflag, "
"antiflag, immuneflag+0, refined_vnum, refine_set, magic_pct, socket_pct, addon_type, "
"limittype0, limitvalue0, limittype1, limitvalue1, "
"applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, "
"value0, value1, value2, value3, value4, value5 "
"FROM item_proto%s ORDER BY vnum",
g_stLocaleNameColumn.c_str(), GetTablePostfix());
std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query));
SQLResult * pRes = pkMsg->Get();
if (!pRes->uiNumRows)
{
sys_err("Could not load item_proto. No results!");
return false;
}
sys_log(0, "ITEM_PROTO loading...");
if (!m_vec_itemTable.empty())
{
sys_log(0, "RELOAD: item_proto");
m_vec_itemTable.clear();
m_map_itemTableByVnum.clear();
}
m_vec_itemTable.resize(pRes->uiNumRows);
memset(&m_vec_itemTable[0], 0, sizeof(TItemTable) * m_vec_itemTable.size());
TItemTable * item_table = &m_vec_itemTable[0];
MYSQL_ROW data;
int col;
while ((data = mysql_fetch_row(pRes->pSQLResult)))
{
col = 0;
str_to_number(item_table->dwVnum, data[col++]);
strlcpy(item_table->szName, data[col++], sizeof(item_table->szName));
strlcpy(item_table->szLocaleName, data[col++], sizeof(item_table->szLocaleName));
str_to_number(item_table->bType, data[col++]);
str_to_number(item_table->bSubType, data[col++]);
str_to_number(item_table->dwGold, data[col++]);
str_to_number(item_table->dwShopBuyPrice, data[col++]);
str_to_number(item_table->bWeight, data[col++]);
str_to_number(item_table->bSize, data[col++]);
str_to_number(item_table->dwFlags, data[col++]);
str_to_number(item_table->dwWearFlags, data[col++]);
str_to_number(item_table->dwAntiFlags, data[col++]);
str_to_number(item_table->dwImmuneFlag, data[col++]);
str_to_number(item_table->dwRefinedVnum, data[col++]);
str_to_number(item_table->wRefineSet, data[col++]);
str_to_number(item_table->bAlterToMagicItemPct, data[col++]);
str_to_number(item_table->bGainSocketPct, data[col++]);
str_to_number(item_table->sAddonType, data[col++]);
item_table->cLimitRealTimeFirstUseIndex = -1;
item_table->cLimitTimerBasedOnWearIndex = -1;
int i;
for (i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
{
str_to_number(item_table->aLimits.bType, data[col++]);
str_to_number(item_table->aLimits.lValue, data[col++]);
if (LIMIT_REAL_TIME_START_FIRST_USE == item_table->aLimits.bType)
item_table->cLimitRealTimeFirstUseIndex = (char)i;
if (LIMIT_TIMER_BASED_ON_WEAR == item_table->aLimits.bType)
item_table->cLimitTimerBasedOnWearIndex = (char)i;
}
for (i = 0; i < ITEM_APPLY_MAX_NUM; ++i)
{
str_to_number(item_table->aApplies.bType, data[col++]);
str_to_number(item_table->aApplies.lValue, data[col++]);
}
for (i = 0; i < ITEM_VALUES_MAX_NUM; ++i)
str_to_number(item_table->alValues, data[col++]);
sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u",
item_table->dwVnum,item_table->szName,item_table->szLocaleName,
item_table->alValues[0],item_table->alValues[1],item_table->alValues[2],
item_table->alValues[3],item_table->alValues[4],item_table->alValues[5],
item_table->dwWearFlags,item_table->dwAntiFlags,item_table->dwImmuneFlag,
item_table->dwRefinedVnum,item_table->wRefineSet,item_table->bAlterToMagicItemPct);
m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
++item_table;
}
sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());
sys_log(0, "CClientManager::InitializeMobTable:: %d items loaded.\n", m_vec_itemTable.size());
return true;
}
// NOTXT_STARTUP_END
------------------------------------------------------------------------------------------------------------------------------------------------------
bool CClientManager::InitializeItemTableTXT()
üsttekini arat varsa değiştir yoksa bool CClientManager::InitializeSkillTable() bunu aratıp üstüne ekle
bool CClientManager::InitializeItemTableTXT()
{
bool isNameFile = true;
map<int,const char*> localMap;
cCsvTable nameData;
if(!nameData.Load("item_names.txt",'\t'))
{
fprintf(stderr, "item_names.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
isNameFile = false;
} else {
nameData.Next();
while(nameData.Next()) {
localMap[atoi(nameData.AsStringByIndex(0))] = nameData.AsStringByIndex(1);
}
}
map<DWORD, TItemTable *> test_map_itemTableByVnum;
cCsvTable test_data;
if(!test_data.Load("item_proto_test.txt",'\t'))
{
fprintf(stderr, "item_proto_test.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
} else {
test_data.Next();
TItemTable * test_item_table = NULL;
int test_itemTableSize = test_data.m_File.GetRowCount()-1;
test_item_table = new TItemTable[test_itemTableSize];
memset(test_item_table, 0, sizeof(TItemTable) * test_itemTableSize);
while(test_data.Next()) {
if (!Set_Proto_Item_Table(test_item_table, test_data, localMap))
{
fprintf(stderr, "¾ÆÀÌÅÛ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆĞ.\n");
}
test_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(test_item_table->dwVnum, test_item_table));
test_item_table++;
}
}
set<int> vnumSet;
cCsvTable data;
if(!data.Load("item_proto.txt",'\t'))
{
fprintf(stderr, "item_proto.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
return false;
}
data.Next();
if (!m_vec_itemTable.empty())
{
sys_log(0, "RELOAD: item_proto");
m_vec_itemTable.clear();
m_map_itemTableByVnum.clear();
}
int addNumber = 0;
while(data.Next()) {
int vnum = atoi(data.AsStringByIndex(0));
std::map<DWORD, TItemTable *>::iterator it_map_itemTable;
it_map_itemTable = test_map_itemTableByVnum.find(vnum);
if(it_map_itemTable != test_map_itemTableByVnum.end()) {
addNumber++;
}
}
data.Destroy();
if(!data.Load("item_proto.txt",'\t'))
{
fprintf(stderr, "item_proto.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
return false;
}
data.Next();
m_vec_itemTable.resize(data.m_File.GetRowCount() - 1 + addNumber);
memset(&m_vec_itemTable[0], 0, sizeof(TItemTable) * m_vec_itemTable.size());
int testValue = m_vec_itemTable.size();
TItemTable * item_table = &m_vec_itemTable[0];
while (data.Next())
{
int col = 0;
std::map<DWORD, TItemTable *>::iterator it_map_itemTable;
it_map_itemTable = test_map_itemTableByVnum.find(atoi(data.AsStringByIndex(col)));
if(it_map_itemTable == test_map_itemTableByVnum.end()) {
if (!Set_Proto_Item_Table(item_table, data, localMap))
{
fprintf(stderr, "¾ÆÀÌÅÛ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆĞ.\n");
}
} else {
TItemTable *tempTable = it_map_itemTable->second;
item_table->dwVnum = tempTable->dwVnum;
strlcpy(item_table->szName, tempTable->szName, sizeof(item_table->szName));
strlcpy(item_table->szLocaleName, tempTable->szLocaleName, sizeof(item_table->szLocaleName));
item_table->bType = tempTable->bType;
item_table->bSubType = tempTable->bSubType;
item_table->bSize = tempTable->bSize;
item_table->dwAntiFlags = tempTable->dwAntiFlags;
item_table->dwFlags = tempTable->dwFlags;
item_table->dwWearFlags = tempTable->dwWearFlags;
item_table->dwImmuneFlag = tempTable->dwImmuneFlag;
item_table->dwGold = tempTable->dwGold;
item_table->dwShopBuyPrice = tempTable->dwShopBuyPrice;
item_table->dwRefinedVnum =tempTable->dwRefinedVnum;
item_table->wRefineSet =tempTable->wRefineSet;
item_table->bAlterToMagicItemPct = tempTable->bAlterToMagicItemPct;
item_table->cLimitRealTimeFirstUseIndex = -1;
item_table->cLimitTimerBasedOnWearIndex = -1;
int i;
for (i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
{
item_table->aLimits.bType = tempTable->aLimits.bType;
item_table->aLimits.lValue = tempTable->aLimits.lValue;
if (LIMIT_REAL_TIME_START_FIRST_USE == item_table->aLimits.bType)
item_table->cLimitRealTimeFirstUseIndex = (char)i;
if (LIMIT_TIMER_BASED_ON_WEAR == item_table->aLimits.bType)
item_table->cLimitTimerBasedOnWearIndex = (char)i;
}
for (i = 0; i < ITEM_APPLY_MAX_NUM; ++i)
{
item_table->aApplies.bType = tempTable->aApplies.bType;
item_table->aApplies.lValue = tempTable->aApplies.lValue;
}
for (i = 0; i < ITEM_VALUES_MAX_NUM; ++i)
item_table->alValues = tempTable->alValues;
item_table->bGainSocketPct = tempTable->bGainSocketPct;
item_table->sAddonType = tempTable->sAddonType;
item_table->bWeight = tempTable->bWeight;
}
vnumSet.insert(item_table->dwVnum);
m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
++item_table;
}
test_data.Destroy();
if(!test_data.Load("item_proto_test.txt",'\t'))
{
fprintf(stderr, "item_proto_test.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
} else {
test_data.Next();
while (test_data.Next())
{
set<int>::iterator itVnum;
itVnum=vnumSet.find(atoi(test_data.AsStringByIndex(0)));
if (itVnum != vnumSet.end()) {
continue;
}
if (!Set_Proto_Item_Table(item_table, test_data, localMap))
{
fprintf(stderr, "¾ÆÀÌÅÛ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆĞ.\n");
}
m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
item_table++;
}
}
m_map_itemTableByVnum.clear();
itertype(m_vec_itemTable) it = m_vec_itemTable.begin();
while (it != m_vec_itemTable.end())
{
TItemTable * item_table = &(*(it++));
sys_log(1, "ITEM: #%-5lu %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %lu ANTI %lu IMMUNE %lu REFINE %lu REFINE_SET %u MAGIC_PCT %u",
item_table->dwVnum,
item_table->szName,
item_table->szLocaleName,
item_table->alValues[0],
item_table->alValues[1],
item_table->alValues[2],
item_table->alValues[3],
item_table->alValues[4],
item_table->alValues[5],
item_table->dwWearFlags,
item_table->dwAntiFlags,
item_table->dwImmuneFlag,
item_table->dwRefinedVnum,
item_table->wRefineSet,
item_table->bAlterToMagicItemPct);
m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
}
sort(m_vec_itemTable.begin(), m_vec_itemTable.end(), FCompareVnum());
return true;
}
------------------------------------------------------------------------------------------------------------------------------------------------------
arat
bool CClientManager::InitializeMobTableTXT()
varsa değiştir yoksa bool CClientManager::InitializeShopTable() bunu aratıp üstüne ekle
bool CClientManager::InitializeMobTableTXT()
{
map<int,const char*> localMap;
bool isNameFile = true;
cCsvTable nameData;
if(!nameData.Load("mob_names.txt",'\t'))
{
fprintf(stderr, "mob_names.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
isNameFile = false;
} else {
nameData.Next();
while(nameData.Next()) {
localMap[atoi(nameData.AsStringByIndex(0))] = nameData.AsStringByIndex(1);
}
}
set<int> vnumSet;
bool isTestFile = true;
cCsvTable test_data;
if(!test_data.Load("mob_proto_test.txt",'\t'))
{
fprintf(stderr, "Å×½ºÆ® ÆÄÀÏÀÌ ¾ø½À´Ï´Ù. ±×´ë·Î ÁøÇàÇÕ´Ï´Ù.\n");
isTestFile = false;
}
map<DWORD, TMobTable *> test_map_mobTableByVnum;
if (isTestFile) {
test_data.Next();
TMobTable * test_mob_table = NULL;
int test_MobTableSize = test_data.m_File.GetRowCount()-1;
test_mob_table = new TMobTable[test_MobTableSize];
memset(test_mob_table, 0, sizeof(TMobTable) * test_MobTableSize);
while(test_data.Next()) {
if (!Set_Proto_Mob_Table(test_mob_table, test_data, localMap))
{
fprintf(stderr, "¸÷ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆĞ.\n");
}
test_map_mobTableByVnum.insert(std::map<DWORD, TMobTable *>::value_type(test_mob_table->dwVnum, test_mob_table));
++test_mob_table;
}
}
cCsvTable data;
if(!data.Load("mob_proto.txt",'\t')) {
fprintf(stderr, "mob_proto.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
return false;
}
data.Next();
int addNumber = 0;
while(data.Next()) {
int vnum = atoi(data.AsStringByIndex(0));
std::map<DWORD, TMobTable *>::iterator it_map_mobTable;
it_map_mobTable = test_map_mobTableByVnum.find(vnum);
if(it_map_mobTable != test_map_mobTableByVnum.end()) {
addNumber++;
}
}
data.Destroy();
if(!data.Load("mob_proto.txt",'\t'))
{
fprintf(stderr, "mob_proto.txt ÆÄÀÏÀ» Àоî¿ÀÁö ¸øÇß½À´Ï´Ù\n");
return false;
}
data.Next();
if (!m_vec_mobTable.empty())
{
sys_log(0, "RELOAD: mob_proto");
m_vec_mobTable.clear();
}
m_vec_mobTable.resize(data.m_File.GetRowCount()-1 + addNumber);
memset(&m_vec_mobTable[0], 0, sizeof(TMobTable) * m_vec_mobTable.size());
TMobTable * mob_table = &m_vec_mobTable[0];
while (data.Next())
{
int col = 0;
bool isSameRow = true;
std::map<DWORD, TMobTable *>::iterator it_map_mobTable;
it_map_mobTable = test_map_mobTableByVnum.find(atoi(data.AsStringByIndex(col)));
if(it_map_mobTable == test_map_mobTableByVnum.end()) {
isSameRow = false;
}
if(isSameRow) {
TMobTable *tempTable = it_map_mobTable->second;
mob_table->dwVnum = tempTable->dwVnum;
strlcpy(mob_table->szName, tempTable->szName, sizeof(tempTable->szName));
strlcpy(mob_table->szLocaleName, tempTable->szLocaleName, sizeof(tempTable->szName));
mob_table->bRank = tempTable->bRank;
mob_table->bType = tempTable->bType;
mob_table->bBattleType = tempTable->bBattleType;
mob_table->bLevel = tempTable->bLevel;
mob_table->bSize = tempTable->bSize;
mob_table->dwAIFlag = tempTable->dwAIFlag;
mob_table->dwRaceFlag = tempTable->dwRaceFlag;
mob_table->dwImmuneFlag = tempTable->dwImmuneFlag;
mob_table->bEmpire = tempTable->bEmpire;
strlcpy(mob_table->szFolder, tempTable->szFolder, sizeof(tempTable->szName));
mob_table->bOnClickType = tempTable->bOnClickType;
mob_table->bStr = tempTable->bStr;
mob_table->bDex = tempTable->bDex;
mob_table->bCon = tempTable->bCon;
mob_table->bInt = tempTable->bInt;
mob_table->dwDamageRange[0] = tempTable->dwDamageRange[0];
mob_table->dwDamageRange[1] = tempTable->dwDamageRange[1];
mob_table->dwMaxHP = tempTable->dwMaxHP;
mob_table->bRegenCycle = tempTable->bRegenCycle;
mob_table->bRegenPercent = tempTable->bRegenPercent;
mob_table->dwGoldMin = tempTable->dwGoldMin;
mob_table->dwGoldMax = tempTable->dwGoldMax;
mob_table->dwExp = tempTable->dwExp;
mob_table->wDef = tempTable->wDef;
mob_table->sAttackSpeed = tempTable->sAttackSpeed;
mob_table->sMovingSpeed = tempTable->sMovingSpeed;
mob_table->bAggresiveHPPct = tempTable->bAggresiveHPPct;
mob_table->wAggressiveSight = tempTable->wAggressiveSight;
mob_table->wAttackRange = tempTable->wAttackRange;
mob_table->dwDropItemVnum = tempTable->dwDropItemVnum;
mob_table->dwResurrectionVnum = tempTable->dwResurrectionVnum;
for (int i = 0; i < MOB_ENCHANTS_MAX_NUM; ++i)
mob_table->cEnchants = tempTable->cEnchants;
for (int i = 0; i < MOB_RESISTS_MAX_NUM; ++i)
mob_table->cResists = tempTable->cResists;
mob_table->fDamMultiply = tempTable->fDamMultiply;
mob_table->dwSummonVnum = tempTable->dwSummonVnum;
mob_table->dwDrainSP = tempTable->dwDrainSP;
mob_table->dwPolymorphItemVnum = tempTable->dwPolymorphItemVnum;
mob_table->Skills[0].bLevel = tempTable->Skills[0].bLevel;
mob_table->Skills[0].dwVnum = tempTable->Skills[0].dwVnum;
mob_table->Skills[1].bLevel = tempTable->Skills[1].bLevel;
mob_table->Skills[1].dwVnum = tempTable->Skills[1].dwVnum;
mob_table->Skills[2].bLevel = tempTable->Skills[2].bLevel;
mob_table->Skills[2].dwVnum = tempTable->Skills[2].dwVnum;
mob_table->Skills[3].bLevel = tempTable->Skills[3].bLevel;
mob_table->Skills[3].dwVnum = tempTable->Skills[3].dwVnum;
mob_table->Skills[4].bLevel = tempTable->Skills[4].bLevel;
mob_table->Skills[4].dwVnum = tempTable->Skills[4].dwVnum;
mob_table->bBerserkPoint = tempTable->bBerserkPoint;
mob_table->bStoneSkinPoint = tempTable->bStoneSkinPoint;
mob_table->bGodSpeedPoint = tempTable->bGodSpeedPoint;
mob_table->bDeathBlowPoint = tempTable->bDeathBlowPoint;
mob_table->bRevivePoint = tempTable->bRevivePoint;
} else {
if (!Set_Proto_Mob_Table(mob_table, data, localMap))
{
fprintf(stderr, "¸÷ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆĞ.\n");
}
}
vnumSet.insert(mob_table->dwVnum);
sys_log(1, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
++mob_table;
}
test_data.Destroy();
isTestFile = true;
test_data;
if(!test_data.Load("mob_proto_test.txt",'\t'))
{
fprintf(stderr, "Å×½ºÆ® ÆÄÀÏÀÌ ¾ø½À´Ï´Ù. ±×´ë·Î ÁøÇàÇÕ´Ï´Ù.\n");
isTestFile = false;
}
if(isTestFile) {
test_data.Next();
while (test_data.Next())
{
set<int>::iterator itVnum;
itVnum=vnumSet.find(atoi(test_data.AsStringByIndex(0)));
if (itVnum != vnumSet.end()) {
continue;
}
if (!Set_Proto_Mob_Table(mob_table, test_data, localMap))
{
fprintf(stderr, "¸÷ ÇÁ·ÎÅä Å×ÀÌºí ¼ÂÆà ½ÇÆĞ.\n");
}
sys_log(0, "MOB #%-5d %-24s %-24s level: %-3u rank: %u empire: %d", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
++mob_table;
}
}
sort(m_vec_mobTable.begin(), m_vec_mobTable.end(), FCompareVnum());
return true;
}
------------------------------------------------------------------------------------------------------------------------------------------------------
clientmanager.h ac
arat
bool InitializeShopTable();
altına ekle
bool InitializeMobTableTXT();
bool InitializeItemTableTXT();
bool InitializeMobTableSQL();
bool InitializeItemTableSQL();
------------------------------------------------------------------------------------------------------------------------------------------------------
main.cpp acılır
arat
BOOL g_test_server = false;
altına ekle
BOOL g_noTXT = false;
arat
if (!CConfig::instance().GetValue("TABLE_POSTFIX", szBuf, 256))
üstüne ekle
int iNoTXT;
if (CConfig::instance().GetValue("NO_TXT", &iNoTXT))
{
if (iNoTXT)
{
sys_log(0, "CONFIG: NO_TXT");
g_noTXT = true;
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------
db conf.txt acılır NO_TXT = 1 olusturulur