Çözüldü No-Txt yaparken build hatası

  • Konuyu açan Konuyu açan Kaiser
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 17
  • Gösterim Gösterim 1K
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

Kaiser

Admin
Admin
Geliştirici
Yardımsever Üye
Mesaj
4.042
Çözümler
398
Beğeni
4.216
Puan
1.849
Ticaret Puanı
0
Arkadaşlar filesı no-txt ye çeviriyorum adımların hepsini eksiksiz yaptım fakat db/ClientManagerBoot.cpp hata veriyor nedense.

Bilgisi olan var mı acaba ?

Adsız.webp
 
Daha öncesinde yazan bir şeylerde var. Ctrl + A ile yazan her şeyi seçip kod bloguna hepsini ekler misiniz?
 
2-3 tane adım vardı zaten onları da uyguladım, %100 çalışıyor falan yazılmış ama build takılıyor niyeyse

Kod:
Genişlet Daralt Kopyala
ClientManagerBoot.cpp: In member function 'bool CClientManager::InitializeMobTab                                                                                        leTXT()':
ClientManagerBoot.cpp:596: error: invalid array assignment
ClientManagerBoot.cpp:599: error: invalid array assignment
ClientManagerBoot.cpp: In member function 'bool CClientManager::InitializeItemTa                                                                                        bleTXT()':
ClientManagerBoot.cpp:1222: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:1222: error: request for member 'bType' in 'tempTable->SIt                                                                                        emTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:1223: error: request for member 'lValue' in 'item_table->S                                                                                        ItemTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:1223: error: request for member 'lValue' in 'tempTable->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:1225: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:1228: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:1234: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aApplies', which is of non-class type 'TItemApply [3]'
ClientManagerBoot.cpp:1234: error: request for member 'bType' in 'tempTable->SIt                                                                                        emTable::aApplies', which is of non-class type 'TItemApply [3]'
ClientManagerBoot.cpp:1235: error: request for member 'lValue' in 'item_table->S                                                                                        ItemTable::aApplies', which is of non-class type 'TItemApply [3]'
ClientManagerBoot.cpp:1235: error: request for member 'lValue' in 'tempTable->SI                                                                                        temTable::aApplies', which is of non-class type 'TItemApply [3]'
ClientManagerBoot.cpp:1239: error: invalid array assignment
ClientManagerBoot.cpp: In member function 'bool CClientManager::InitializeMobTab                                                                                        leSQL()':
ClientManagerBoot.cpp:2011: error: no matching function for call to 'str_to_numb                                                                                        er(char [6], char*&)'
../../common/utils.h:2: note: candidates are: bool str_to_number(bool&, const ch                                                                                        ar*)
../../common/utils.h:10: note:                 bool str_to_number(char&, const c                                                                                        har*)
../../common/utils.h:18: note:                 bool str_to_number(unsigned char&                                                                                        , const char*)
../../common/utils.h:26: note:                 bool str_to_number(short int&, co                                                                                        nst char*)
../../common/utils.h:34: note:                 bool str_to_number(short unsigned                                                                                         int&, const char*)
../../common/utils.h:42: note:                 bool str_to_number(int&, const ch                                                                                        ar*)
../../common/utils.h:50: note:                 bool str_to_number(unsigned int&,                                                                                         const char*)
../../common/utils.h:58: note:                 bool str_to_number(long int&, con                                                                                        st char*)
../../common/utils.h:66: note:                 bool str_to_number(long unsigned                                                                                         int&, const char*)
../../common/utils.h:74: note:                 bool str_to_number(long long int&                                                                                        , const char*)
../../common/utils.h:82: note:                 bool str_to_number(float&, const                                                                                         char*)
../../common/utils.h:90: note:                 bool str_to_number(double&, const                                                                                         char*)
../../common/utils.h:99: note:                 bool str_to_number(long double&,                                                                                         const char*)
ClientManagerBoot.cpp:2014: error: no matching function for call to 'str_to_numb                                                                                        er(char [11], char*&)'
../../common/utils.h:2: note: candidates are: bool str_to_number(bool&, const ch                                                                                        ar*)
../../common/utils.h:10: note:                 bool str_to_number(char&, const c                                                                                        har*)
../../common/utils.h:18: note:                 bool str_to_number(unsigned char&                                                                                        , const char*)
../../common/utils.h:26: note:                 bool str_to_number(short int&, co                                                                                        nst char*)
../../common/utils.h:34: note:                 bool str_to_number(short unsigned                                                                                         int&, const char*)
../../common/utils.h:42: note:                 bool str_to_number(int&, const ch                                                                                        ar*)
../../common/utils.h:50: note:                 bool str_to_number(unsigned int&,                                                                                         const char*)
../../common/utils.h:58: note:                 bool str_to_number(long int&, con                                                                                        st char*)
../../common/utils.h:66: note:                 bool str_to_number(long unsigned                                                                                         int&, const char*)
../../common/utils.h:74: note:                 bool str_to_number(long long int&                                                                                        , const char*)
../../common/utils.h:82: note:                 bool str_to_number(float&, const                                                                                         char*)
../../common/utils.h:90: note:                 bool str_to_number(double&, const                                                                                         char*)
../../common/utils.h:99: note:                 bool str_to_number(long double&,                                                                                         const char*)
ClientManagerBoot.cpp:2022: error: request for member 'dwVnum' in 'mob_table->SM                                                                                        obTable::Skills', which is of non-class type 'TMobSkillLevel [5]'
ClientManagerBoot.cpp:2023: error: request for member 'bLevel' in 'mob_table->SM                                                                                        obTable::Skills', which is of non-class type 'TMobSkillLevel [5]'
ClientManagerBoot.cpp: In member function 'bool CClientManager::InitializeItemTa                                                                                        bleSQL()':
ClientManagerBoot.cpp:2107: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:2108: error: request for member 'lValue' in 'item_table->S                                                                                        ItemTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:2110: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:2113: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aLimits', which is of non-class type 'TItemLimit [2]'
ClientManagerBoot.cpp:2119: error: request for member 'bType' in 'item_table->SI                                                                                        temTable::aApplies', which is of non-class type 'TItemApply [3]'
ClientManagerBoot.cpp:2120: error: request for member 'lValue' in 'item_table->S                                                                                        ItemTable::aApplies', which is of non-class type 'TItemApply [3]'
ClientManagerBoot.cpp:2124: error: no matching function for call to 'str_to_numb                                                                                        er(long int [6], char*&)'
../../common/utils.h:2: note: candidates are: bool str_to_number(bool&, const ch                                                                                        ar*)
../../common/utils.h:10: note:                 bool str_to_number(char&, const c                                                                                        har*)
../../common/utils.h:18: note:                 bool str_to_number(unsigned char&                                                                                        , const char*)
../../common/utils.h:26: note:                 bool str_to_number(short int&, co                                                                                        nst char*)
../../common/utils.h:34: note:                 bool str_to_number(short unsigned                                                                                         int&, const char*)
../../common/utils.h:42: note:                 bool str_to_number(int&, const ch                                                                                        ar*)
../../common/utils.h:50: note:                 bool str_to_number(unsigned int&,                                                                                         const char*)
../../common/utils.h:58: note:                 bool str_to_number(long int&, con                                                                                        st char*)
../../common/utils.h:66: note:                 bool str_to_number(long unsigned                                                                                         int&, const char*)
../../common/utils.h:74: note:                 bool str_to_number(long long int&                                                                                        , const char*)
../../common/utils.h:82: note:                 bool str_to_number(float&, const                                                                                         char*)
../../common/utils.h:90: note:                 bool str_to_number(double&, const                                                                                         char*)
../../common/utils.h:99: note:                 bool str_to_number(long double&,                                                                                         const char*)
Makefile:51: recipe for target 'OBJDIR/ClientManagerBoot.o' failed
gmake: *** [OBJDIR/ClientManagerBoot.o] Error 1
 
ClientManagerBoot.cpp dosyanızı eklermisiniz konuya
 
.cpp uzantısına forum izin vermediği için yükleyemedim, rar halinde vereyim. İçinde hem orjinali var hem düzenlenmiş hali var.

V.T:
Linkleri görebilmek için giriş yap veya kayıt ol.
 

Dosya Eklentileri

  • db.rar
    db.rar
    19,4 KB · Gösterim: 37
Düzenlenmiş Dosyanızda tab hataları mevcut
1313131.webp
 
Evet farkındayım, tüm anlatımlarda kodlar o şekilde verilmiş. Ama işe yaradığı söylenmiş hep.
Yapılan yorumlar da olumlu yönde, anlamadım gitti..
 
C++ kodlarında tab hatalarının pek önemi yok. Kodun rahat okunabilmesi için gerekli ama :)
@Yenicerii no_txt yapımı için kodları nereden aldınız? Belki eksik kod verilmiş olabilir
 
Tüm anlatım tek sayfada verilmiş. Belki böyle biraz kör edici olabilir:D ben dosyayı da vereyim eğer incelemek isterseniz..
Eksik olacağını sanmıyorum düzenlemeler çok basit açıkcası, sorunsuzca yaptım ama olmadı nedense. Yorumlarda da kefil kullanıcılar falan da var :confused:


Kod:
Genişlet Daralt Kopyala
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
 

Dosya Eklentileri

Direk olarak kodların paylaşıldığı yerin linkini verebilirsiniz. :)
Şunu bi dener misiniz?

ClientManagerBoot.cpp dosyasında aratın;
C++:
Genişlet Daralt Kopyala
#include "ProtoReader.h"

Altına ekleyin;
C++:
Genişlet Daralt Kopyala
#include "Config.h"
#include <cstddef>

#if !defined(nullptr)
#define nullptr NULL
#endif
 
C++ kodlarında tab hatalarının pek önemi yok. Kodun rahat okunabilmesi için gerekli ama :)
@Yenicerii no_txt yapımı için kodları nereden aldınız? Belki eksik kod verilmiş olabilir
Karşılaştırma yaparken zorlanıyorum :D oralarda fark oldugu için oralarıda işaretliyor
 
Çözüm
Metin2.dev de anlatılanları uyguladım tamamen.
Fakat ch ler açılmıyor şu an.

Ch1 syserr:
Kod:
Genişlet Daralt Kopyala
SYSERR: Apr 30 23:08:50.692694 :: pid_init:
Start of pid: 948

SYSERR: Apr 30 23:09:20.399366 :: ReadSpecialDropItemFile: ReadSpecialDropItemFile : there is no item 110010 : node °·ÂÇÑ¿ëÈ¥¿ø¼®_ÀϹİ-È·Á
SYSERR: Apr 30 23:09:20.400841 :: Boot: cannot load SpecialItemGroup: locale/turkey/special_item_group.txt
SYSERR: Apr 30 23:09:20.691192 :: pid_deinit:
End of pid

Db syserr:
Kod:
Genişlet Daralt Kopyala
SYSERR: Apr 30 23:08:40.622132 :: pid_init:
Start of pid: 942

SYSERR: Apr 30 23:08:40.622318 :: Start: TABLE_POSTFIX not configured use default
SYSERR: Apr 30 23:08:41.169515 :: Load:  DirectQuery failed(SELECT IP_FROM, IP_TO, COUNTRY_NAME FROM iptocountry)
SYSERR: Apr 30 23:08:54.527301 :: __GetHostInfo: __GetHostInfo() ==> DirectQuery failed(SELECT mIP FROM gmhost)
SYSERR: Apr 30 23:08:56.111255 :: __GetHostInfo: __GetHostInfo() ==> DirectQuery failed(SELECT mIP FROM gmhost)
SYSERR: Apr 30 23:09:20.743078 :: Process: FDWATCH: peer null in event: ident 22
SYSERR: Apr 30 23:09:20.942849 :: Process: FDWATCH: peer null in event: ident 21
 
special group item içerisinde 110010 böyle birşey var mı ? silin veya ekleyin
 
Teşekkür ederim :)
Her defasına 110010-120010-130010 şeklinde artarak syserr vermeye devam ediyordu, special_item_group.txt dosyasını komple değiştirdim şu an giriş yapılıyor ancak db syserr de ki hatalar(hata mı ondan da emin değilim:D) devam ediyor. Bir sorun oluşturur mu acaba ?
 
Tamamdır çok teşekkür ediyorum yardımlarınız için :)
Konu kapatılabilir
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst