- Mesaj
- 1.241
- Çözümler
- 81
- Beğeni
- 678
- Puan
- 1.109
- Ticaret Puanı
- 0
Bazı warningler alıyorum hepsini çözdüm ama bunları çözemedim bir türlü;
İlgili kod bloğu;
Diğer bir warning;
İlgili kod bloğu;
Son warning ise;
İlgili kod bloğu;
C++:
input_db.cpp: In function 'long int fix_shop_event(LPEVENT, long int)':
input_db.cpp:490:23: warning: ', socket' directive writing 8 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
490 | sprintf(query, "%s, socket%d='%d'", query, s, socket[s]);
| ^~~~~~~~
input_db.cpp:490:20: note: directive argument in the range [0, 2]
490 | sprintf(query, "%s, socket%d='%d'", query, s, socket[s]);
| ^~~~~~~~~~~~~~~~~~~
input_db.cpp:490:20: note: using the range [-2147483648, 2147483647] for directive argument
input_db.cpp:490:12: note: 'sprintf' output between 14 and 1047 bytes into a destination of size 1024
490 | sprintf(query, "%s, socket%d='%d'", query, s, socket[s]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input_db.cpp:490:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
input_db.cpp:484:9: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
484 | char query[1024];
| ^~~~~
input_db.cpp:496:24: warning: ', attrtype' directive writing 10 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
496 | sprintf(query, "%s, attrtype%d='%d'", query, ia, attr[ia][0]);
| ^~~~~~~~~~
input_db.cpp:496:21: note: directive argument in the range [0, 6]
496 | sprintf(query, "%s, attrtype%d='%d'", query, ia, attr[ia][0]);
| ^~~~~~~~~~~~~~~~~~~~~
input_db.cpp:496:21: note: using the range [-2147483648, 2147483647] for directive argument
input_db.cpp:496:13: note: 'sprintf' output between 16 and 1049 bytes into a destination of size 1024
496 | sprintf(query, "%s, attrtype%d='%d'", query, ia, attr[ia][0]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input_db.cpp:496:13: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
input_db.cpp:484:9: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
484 | char query[1024];
| ^~~~~
input_db.cpp:497:24: warning: ', attrvalue' directive writing 11 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
497 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr[ia][1]);
| ^~~~~~~~~~~
input_db.cpp:497:21: note: directive argument in the range [0, 6]
497 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr[ia][1]);
| ^~~~~~~~~~~~~~~~~~~~~~
input_db.cpp:497:21: note: using the range [-2147483648, 2147483647] for directive argument
input_db.cpp:497:13: note: 'sprintf' output between 17 and 1050 bytes into a destination of size 1024
497 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr[ia][1]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input_db.cpp:497:13: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
input_db.cpp:484:9: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
484 | char query[1024];
İlgili kod bloğu;
C++:
EVENTFUNC(fix_shop_event)
{
char szSockets[1024] = { '\0' };
char *tempSockets = szSockets;
for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
{
tempSockets += sprintf(tempSockets, "ps.socket%d", i);
if (i<ITEM_SOCKET_MAX_NUM - 1)
tempSockets += sprintf(tempSockets, ",");
}
char szAttrs[1024] = { '\0' };
char *tempAttrs = szAttrs;
for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++)
{
if (i < 7)
tempAttrs += sprintf(tempAttrs, "ps.attrtype%d,attrvalue%d", i, i);
else
tempAttrs += sprintf(tempAttrs, "ps.applytype%d,applyvalue%d", i - 7, i - 7);
if (i<ITEM_ATTRIBUTE_MAX_NUM - 1)
tempAttrs += sprintf(tempAttrs, ",");
}
SQLMsg * pkMsg(DBManager::instance().DirectQuery("SELECT ps.id,ps.player_id,REPLACE('%s','#PLAYER_NAME#',p.name),ps.vnum,ps.count,ps.price,%s,%s FROM `player_shop_items` ps LEFT JOIN player p ON p.id=ps.player_id where not EXISTS(select name from player_shop WHERE id=ps.shop_id) and not ISNULL(p.name)", LC_TEXT("SHOP_NAME"), szSockets, szAttrs));
SQLResult * pRes = pkMsg->Get();
if (pRes->uiNumRows>0)
{
MYSQL_ROW row;
while ((row = mysql_fetch_row(pRes->pSQLResult)) != NULL)
{
DWORD id = 0, pid = 0, vnum = 0, count = 0, socket[6], attr[7][2];
int col = 0;
str_to_number(id, row[col++]);
str_to_number(pid, row[col++]);
col++;
str_to_number(vnum, row[col++]);
str_to_number(count, row[col++]);
for (int i = 0;i < ITEM_SOCKET_MAX_NUM;i++)
str_to_number(socket[i], row[col++]);
for (int i = 0;i < ITEM_ATTRIBUTE_MAX_NUM;i++)
{
str_to_number(attr[i][0], row[col++]);
str_to_number(attr[i][1], row[col++]);
}
char query[1024];
sprintf(query, "INSERT INTO player_gift SET owner_id=%d,vnum=%d,count=%d,reason='%s',`from`=replace(\"%s\",' ','_'),status='WAIT',date_add=NOW()",
pid, vnum,count, LC_TEXT("SHOP_REASON"), row[3]);
for (int s = 0; s < ITEM_SOCKET_MAX_NUM; s++)
{
sprintf(query, "%s, socket%d='%d'", query, s, socket[s]);
}
for (int ia = 0; ia < ITEM_ATTRIBUTE_MAX_NUM; ia++)
{
if (ia < 7)
{
sprintf(query, "%s, attrtype%d='%d'", query, ia, attr[ia][0]);
sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr[ia][1]);
}
else{
sprintf(query, "%s, applytype%d='%d'", query, ia-7, attr[ia][0]);
sprintf(query, "%s, applyvalue%d='%d'", query, ia-7, attr[ia][1]);
}
}
DBManager::instance().DirectQuery(query);
DBManager::instance().DirectQuery("delete from player_shop_items where id=%d",id);
}
}
return PASSES_PER_SEC(SHOP_TIME_REFRESH*60);
}
Diğer bir warning;
C++:
shop.cpp: In member function 'bool CShop::GetItems()':
shop.cpp:465:22: warning: ', socket' directive writing 8 bytes into a region of size between 1 and 8192 [-Wformat-overflow=]
465 | sprintf(query, "%s, socket%d='%ld'", query, s, m_itemVector[i].pkItem->GetSocket(s));
| ^~~~~~~~
shop.cpp:465:19: note: directive argument in the range [0, 2]
465 | sprintf(query, "%s, socket%d='%ld'", query, s, m_itemVector[i].pkItem->GetSocket(s));
| ^~~~~~~~~~~~~~~~~~~~
shop.cpp:465:11: note: 'sprintf' output between 14 and 8215 bytes into a destination of size 8192
465 | sprintf(query, "%s, socket%d='%ld'", query, s, m_itemVector[i].pkItem->GetSocket(s));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop.cpp:465:11: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop.cpp:458:8: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
458 | char query[8192];
| ^~~~~
shop.cpp:472:23: warning: ', attrtype' directive writing 10 bytes into a region of size between 1 and 8192 [-Wformat-overflow=]
472 | sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
| ^~~~~~~~~~
shop.cpp:472:20: note: directive argument in the range [0, 6]
472 | sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
| ^~~~~~~~~~~~~~~~~~~~~
shop.cpp:472:20: note: directive argument in the range [0, 255]
shop.cpp:472:12: note: 'sprintf' output between 16 and 8209 bytes into a destination of size 8192
472 | sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop.cpp:472:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop.cpp:458:8: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
458 | char query[8192];
| ^~~~~
shop.cpp:473:23: warning: ', attrvalue' directive writing 11 bytes into a region of size between 1 and 8192 [-Wformat-overflow=]
473 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
| ^~~~~~~~~~~
shop.cpp:473:20: note: directive argument in the range [0, 6]
473 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
| ^~~~~~~~~~~~~~~~~~~~~~
shop.cpp:473:20: note: directive argument in the range [-32768, 32767]
shop.cpp:473:12: note: 'sprintf' output between 17 and 8213 bytes into a destination of size 8192
473 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop.cpp:473:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop.cpp:458:8: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
458 | char query[8192];
İlgili kod bloğu;
C#:
bool CShop::GetItems()
{
if (!m_pkPC)
return false;
if (!m_pkPC)
return false;
for (DWORD i = 0; i < m_itemVector.size() && i < SHOP_HOST_ITEM_MAX_NUM; ++i)
{
if (!m_itemVector[i].pkItem)
continue;
char query[8192];
sprintf(query, "INSERT INTO player_gift SET \
owner_id=%d,vnum=%d,count=%d,reason='%s',`from`=replace(\"%s\",' ','_'),status='WAIT',date_add=NOW()",
m_pkPC->GetPrivShopOwner(), m_itemVector[i].vnum, m_itemVector[i].count, LC_TEXT("SHOP_REASON"), m_pkPC->GetName());
for (int s = 0; s < ITEM_SOCKET_MAX_NUM; s++)
{
sprintf(query, "%s, socket%d='%ld'", query, s, m_itemVector[i].pkItem->GetSocket(s));
}
for (int ia = 0; ia < ITEM_ATTRIBUTE_MAX_NUM; ia++)
{
const TPlayerItemAttribute& attr = m_itemVector[i].pkItem->GetAttribute(ia);
if (ia < 7)
{
sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
}
else
{
sprintf(query, "%s, applytype%d='%u'", query, ia-7, attr.bType);
sprintf(query, "%s, applyvalue%d='%d'", query, ia-7, attr.sValue);
}
}
DBManager::instance().DirectQuery(query);
DBManager::instance().DirectQuery("delete from player_shop_items where id='%d'", m_itemVector[i].itemid);
m_itemVector[i].pkItem->RemoveFromCharacter();
m_itemVector[i].pkItem = NULL;
BroadcastUpdateItem(i);
}
return true;
}
Son warning ise;
C++:
shop_manager.cpp: In member function 'bool CShopManager::CreateOfflineShop(LPCHARACTER, const char*, std::vector<SShopItemTable*>, DWORD)':
shop_manager.cpp:204:23: warning: ' player_id='' directive writing 12 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
204 | sprintf(query, "%s player_id='%d'", query, owner->GetPlayerID());
| ^~~~~~~~~~~~
shop_manager.cpp:204:20: note: using the range [-2147483648, 2147483647] for directive argument
204 | sprintf(query, "%s player_id='%d'", query, owner->GetPlayerID());
| ^~~~~~~~~~~~~~~~~~~
shop_manager.cpp:204:12: note: 'sprintf' output between 15 and 1048 bytes into a destination of size 1024
204 | sprintf(query, "%s player_id='%d'", query, owner->GetPlayerID());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:204:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:205:23: warning: ', shop_id='' directive writing 11 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
205 | sprintf(query, "%s, shop_id='%d'", query, shop_id);
| ^~~~~~~~~~~
shop_manager.cpp:205:20: note: using the range [-2147483648, 2147483647] for directive argument
205 | sprintf(query, "%s, shop_id='%d'", query, shop_id);
| ^~~~~~~~~~~~~~~~~~
shop_manager.cpp:205:12: note: 'sprintf' output between 14 and 1047 bytes into a destination of size 1024
205 | sprintf(query, "%s, shop_id='%d'", query, shop_id);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:205:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:206:23: warning: ', vnum='' directive writing 8 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
206 | sprintf(query, "%s, vnum='%d'", query, item->GetVnum());
| ^~~~~~~~
shop_manager.cpp:206:20: note: using the range [-2147483648, 2147483647] for directive argument
206 | sprintf(query, "%s, vnum='%d'", query, item->GetVnum());
| ^~~~~~~~~~~~~~~
shop_manager.cpp:206:12: note: 'sprintf' output between 11 and 1044 bytes into a destination of size 1024
206 | sprintf(query, "%s, vnum='%d'", query, item->GetVnum());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:206:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:207:23: warning: ', count='' directive writing 9 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
207 | sprintf(query, "%s, count='%d'", query, item->GetCount());
| ^~~~~~~~~
shop_manager.cpp:207:20: note: using the range [-2147483648, 2147483647] for directive argument
207 | sprintf(query, "%s, count='%d'", query, item->GetCount());
| ^~~~~~~~~~~~~~~~
shop_manager.cpp:207:12: note: 'sprintf' output between 12 and 1045 bytes into a destination of size 1024
207 | sprintf(query, "%s, count='%d'", query, item->GetCount());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:207:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:208:23: warning: ', price='' directive writing 9 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
208 | sprintf(query, "%s, price='%d'", query, pTable[i]->price);
| ^~~~~~~~~
shop_manager.cpp:208:20: note: using the range [-2147483648, 2147483647] for directive argument
208 | sprintf(query, "%s, price='%d'", query, pTable[i]->price);
| ^~~~~~~~~~~~~~~~
shop_manager.cpp:208:12: note: 'sprintf' output between 12 and 1045 bytes into a destination of size 1024
208 | sprintf(query, "%s, price='%d'", query, pTable[i]->price);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:208:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:209:23: warning: ', display_pos='' directive writing 15 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
209 | sprintf(query, "%s, display_pos='%u'", query, pTable[i]->display_pos);
| ^~~~~~~~~~~~~~~
shop_manager.cpp:209:20: note: directive argument in the range [0, 255]
209 | sprintf(query, "%s, display_pos='%u'", query, pTable[i]->display_pos);
| ^~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:209:12: note: 'sprintf' output between 18 and 1043 bytes into a destination of size 1024
209 | sprintf(query, "%s, display_pos='%u'", query, pTable[i]->display_pos);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:209:12: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:212:24: warning: ', socket' directive writing 8 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
212 | sprintf(query, "%s, socket%d='%ld'", query, s, item->GetSocket(s));
| ^~~~~~~~
shop_manager.cpp:212:21: note: directive argument in the range [0, 2]
212 | sprintf(query, "%s, socket%d='%ld'", query, s, item->GetSocket(s));
| ^~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:212:13: note: 'sprintf' output between 14 and 1047 bytes into a destination of size 1024
212 | sprintf(query, "%s, socket%d='%ld'", query, s, item->GetSocket(s));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:212:13: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:220:25: warning: ', attrtype' directive writing 10 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
220 | sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
| ^~~~~~~~~~
shop_manager.cpp:220:22: note: directive argument in the range [0, 6]
220 | sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
| ^~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:220:22: note: directive argument in the range [0, 255]
shop_manager.cpp:220:14: note: 'sprintf' output between 16 and 1041 bytes into a destination of size 1024
220 | sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:220:14: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
| ^~~~~
shop_manager.cpp:221:25: warning: ', attrvalue' directive writing 11 bytes into a region of size between 1 and 1024 [-Wformat-overflow=]
221 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
| ^~~~~~~~~~~
shop_manager.cpp:221:22: note: directive argument in the range [0, 6]
221 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
| ^~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:221:22: note: directive argument in the range [-32768, 32767]
shop_manager.cpp:221:14: note: 'sprintf' output between 17 and 1045 bytes into a destination of size 1024
221 | sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shop_manager.cpp:221:14: warning: 'sprintf' argument 3 overlaps destination object 'query' [-Wrestrict]
shop_manager.cpp:202:10: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
202 | char query[1024];
İlgili kod bloğu;
C++:
extern std::map<int, TShopCost> g_ShopCosts;
bool CShopManager::CreateOfflineShop(LPCHARACTER owner, const char *szSign, const std::vector<TShopItemTable *> pTable, DWORD id)
{
if (g_ShopCosts.find(id) == g_ShopCosts.end())
{
sys_log(0, "CreateOfflineShop:Shop days error %d", id);
return false;
}
DWORD map_index = owner->GetMapIndex();
long x = (owner->GetX() + number(50, 200));
long y = (owner->GetY() + number(50, 200));
long z = owner->GetZ();
char szQuery[4096];
DWORD date_close = get_global_time() + (g_ShopCosts[id].time * g_ShopCosts[id].days);
sprintf(szQuery, "insert into player_shop set item_count=%d,player_id=%d,name=\"%s\",map_index=%d,x=%ld,y=%ld,z=%ld,ip='%s',date=NOW(),date_close=FROM_UNIXTIME(%d),channel=%d",
pTable.size(), owner->GetPlayerID(), szSign, map_index, x, y, z, inet_ntoa(owner->GetDesc()->GetAddr().sin_addr), date_close, g_bChannel);
SQLMsg * pkMsg(DBManager::instance().DirectQuery(szQuery));
SQLResult * pRes = pkMsg->Get();
DWORD shop_id = pRes->uiInsertID;
if (shop_id>0)
{
for (int i = 0;i < pTable.size();i++)
{
LPITEM item = owner->GetItem(pTable[i]->pos);
if (item)
{
char query[1024];
sprintf(query, "INSERT INTO player_shop_items SET");
sprintf(query, "%s player_id='%d'", query, owner->GetPlayerID());
sprintf(query, "%s, shop_id='%d'", query, shop_id);
sprintf(query, "%s, vnum='%d'", query, item->GetVnum());
sprintf(query, "%s, count='%d'", query, item->GetCount());
sprintf(query, "%s, price='%d'", query, pTable[i]->price);
sprintf(query, "%s, display_pos='%u'", query, pTable[i]->display_pos);
for (int s = 0; s < ITEM_SOCKET_MAX_NUM; s++)
{
sprintf(query, "%s, socket%d='%ld'", query, s, item->GetSocket(s));
}
for (int ia = 0; ia < ITEM_ATTRIBUTE_MAX_NUM; ia++)
{
const TPlayerItemAttribute& attr = item->GetAttribute(ia);
if (ia < 7)
{
sprintf(query, "%s, attrtype%d='%u'", query, ia, attr.bType);
sprintf(query, "%s, attrvalue%d='%d'", query, ia, attr.sValue);
}
else{
sprintf(query, "%s, applytype%d='%u'", query, ia - 7, attr.bType);
sprintf(query, "%s, applyvalue%d='%d'", query, ia - 7, attr.sValue);
}
}
DBManager::instance().DirectQuery(query);
ITEM_MANAGER::Instance().RemoveItem(item, "Priv shop");
}
}
StartOfflineShop(shop_id);
owner->SendShops();
return true;
}
return false;
}