std::string CreateOfflineshopSelectShopItemsQuery() { char szQuery[512] = "SELECT `item_id`, `owner_id`, `price_yang`, " #ifdef ENABLE_CHEQUE_SYSTEM "`price_cheque`," #endif " `vnum`, `count` "; size_t len = strlen(szQuery); for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++) len += snprintf(szQuery + len, sizeof(szQuery) - len, ",`socket%d` ", i); for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++) len += snprintf(szQuery + len, sizeof(szQuery) - len, ",`attr%d` , `attrval%d` ", i, i); len += snprintf(szQuery + len, sizeof(szQuery) - len, "%s", " ,`is_sold` " #ifdef ENABLE_CHANGELOOK_SYSTEM " , `trans` " #endif //patch 08-03-2020 ", `expiration` " " FROM `player`.`offlineshop_shop_items`;"); return szQuery; }