Hi Guys! How can I expand the refine proto? Vnum4, count4 does not work!
Thanks for the helping!
I think it should be expanded here!
Code
- bool CClientManager::InitializeRefineTable()
- {
- char query[2048];
- snprintf(query, sizeof(query),
- "SELECT id, cost, prob, vnum0, count0, vnum1, count1, vnum2, count2, vnum3, count3, vnum4, count4 FROM refine_proto%s",
- GetTablePostfix());
- std::auto_ptr<SQLMsg> pkMsg(CDBManager::instance().DirectQuery(query));
- SQLResult * pRes = pkMsg->Get();
- if (!pRes->uiNumRows)
- return true;
- if (m_pRefineTable)
- {
- sys_log(0, "RELOAD: refine_proto");
- delete [] m_pRefineTable;
- m_pRefineTable = NULL;
- }
- m_iRefineTableSize = pRes->uiNumRows;
- m_pRefineTable = new TRefineTable[m_iRefineTableSize];
- memset(m_pRefineTable, 0, sizeof(TRefineTable) * m_iRefineTableSize);
- TRefineTable* prt = m_pRefineTable;
- MYSQL_ROW data;
- while ((data = mysql_fetch_row(pRes->pSQLResult)))
- {
- //const char* s_szQuery = "SELECT src_vnum, result_vnum, cost, prob, "
- //"vnum0, count0, vnum1, count1, vnum2, count2, vnum3, count3, vnum4, count4 "
- int col = 0;
- //prt->src_vnum = atoi(data[col++]);
- //prt->result_vnum = atoi(data[col++]);
- str_to_number(prt->id, data[col++]);
- str_to_number(prt->cost, data[col++]);
- str_to_number(prt->prob, data[col++]);
- for (int i = 0; i < REFINE_MATERIAL_MAX_NUM; i++)
- {
- str_to_number(prt->materials[i].vnum, data[col++]);
- str_to_number(prt->materials[i].count, data[col++]);
- if (prt->materials[i].vnum == 0)
- {
- prt->material_count = i;
- break;
- }
- }
- sys_log(0, "REFINE: id %ld cost %d prob %d mat1 %lu cnt1 %d", prt->id, prt->cost, prt->prob, prt->materials[0].vnum, prt->materials[0].count);
- prt++;
- }
- return true;
- }