bool CClientManager::MirrorItemTableIntoDB() { for (itertype(m_vec_itemTable) it = m_vec_itemTable.begin(); it != m_vec_itemTable.end(); it++) { if (g_stLocaleNameColumn != "name") { const TItemTable& t = *it; char query[4096]; snprintf(query, sizeof(query), "replace into item_proto%s (" //1 "vnum, type, subtype, name, %s, gold, shop_buy_price, weight, size, " //2 "flag, wearflag, antiflag, immuneflag, " "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 ) " "values (" "%d, %d, %d, \"%s\", \"%s\", %lld, %lld, %d, %d, " //11 "%u, %u, %u, %u, " //15 "%u, %d, %u, %u, %d, " //20 "%u, %ld, %u, %ld, " //24 "%u, %ld, %u, %ld, %u, %ld, " //30 "%ld, %ld, %ld, %ld, %ld, %ld )", //36 GetTablePostfix(), g_stLocaleNameColumn.c_str(), //2 t.dwVnum, t.bType, t.bSubType, t.szName, t.szLocaleName, t.dwGold, t.dwShopBuyPrice, t.bWeight, t.bSize, //11 t.dwFlags, t.dwWearFlags, t.dwAntiFlags, t.dwImmuneFlag, //15 t.dwRefinedVnum, t.wRefineSet, t.bAlterToMagicItemPct, t.bGainSocketPct, t.sAddonType, //20 t.aLimits[0].bType, t.aLimits[0].lValue, t.aLimits[1].bType, t.aLimits[1].lValue, //24 t.aApplies[0].bType, t.aApplies[0].lValue, t.aApplies[1].bType, t.aApplies[1].lValue, t.aApplies[2].bType, t.aApplies[2].lValue, //30 t.alValues[0], t.alValues[1], t.alValues[2], t.alValues[3], t.alValues[4], t.alValues[5]); //36 CDBManager::instance().AsyncQuery(query); } else { const TItemTable& t = *it; char query[4096]; snprintf(query, sizeof(query), "replace into item_proto%s (" "vnum, type, subtype, name, gold, shop_buy_price, weight, size, " "flag, wearflag, antiflag, immuneflag, " "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 ) " "values (" "%d, %d, %d, \"%s\", %lld, %lld, %d, %d, " "%d, %d, %d, %d, " "%d, %d, %d, %d, %d, " "%d, %ld, %d, %ld, " "%d, %ld, %d, %ld, %d, %ld, " "%ld, %ld, %ld, %ld, %ld, %ld )", GetTablePostfix(), t.dwVnum, t.bType, t.bSubType, t.szName, t.dwGold, t.dwShopBuyPrice, t.bWeight, t.bSize, t.dwFlags, t.dwWearFlags, t.dwAntiFlags, t.dwImmuneFlag, t.dwRefinedVnum, t.wRefineSet, t.bAlterToMagicItemPct, t.bGainSocketPct, t.sAddonType, t.aLimits[0].bType, t.aLimits[0].lValue, t.aLimits[1].bType, t.aLimits[1].lValue, t.aApplies[0].bType, t.aApplies[0].lValue, t.aApplies[1].bType, t.aApplies[1].lValue, t.aApplies[2].bType, t.aApplies[2].lValue, t.alValues[0], t.alValues[1], t.alValues[2], t.alValues[3], t.alValues[4], t.alValues[5]); CDBManager::instance().AsyncQuery(query); } } return true; }