Problema shop offline sysser InitializeOfflineshopTable: cannot execute putitem !? owner

Înainte de a posta o problemă, caută în acest forum și poate găsești rezolvare.
Închis
Avatar utilizator
nedelcu1128
Nou Venit

Nou Venit
Mesaje: 30
Membru din: 26 Iul 2023, 12:05
Server: Wonder2
Regat: Jinno
Aprecieri: 3  
Mulţumiri: 1  
  Rezolvări prob.: 1
Discord: Copiază ID
Medalii

Ste cineva cum rezolv problema asta ? apare in sisser ! Am dat trucate la offline shop la toate degeaba... tot apare vreo idee ?

Cod: Selectaţi tot

SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putsShop -> double shop id?! 566 
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putsShop -> double shop id?! 157 
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putsShop -> double shop id?! 579 
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putsShop -> double shop id?! 565 
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 566 , item 1 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 3 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 4 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 5 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 6 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 7 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 8 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 9 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 10 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 11 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 12 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 13 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 14 , didn't deleted items when closed?
SYSERR: Aug 16 13:19:20 :: InitializeOfflineshopTable: cannot execute putitem !? owner 579 , item 15 , didn't deleted items when closed?
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

cauta:

Cod: Selectaţi tot

bool CClientManager::InitializeOfflineShopTable()
inlocuiest toata functia cu:

Cod: Selectaţi tot

bool CClientManager::InitializeOfflineShopTable()
{
	DWORD dwItems[SHOP_HOST_ITEM_MAX_NUM];

	char exist_table[QUERY_MAX_LEN];
	snprintf(exist_table, sizeof(exist_table), "SELECT * FROM offline_shop%s", GetTablePostfix());
	std::auto_ptr<SQLMsg> exist(CDBManager::instance().DirectQuery(exist_table));
	if (exist->Get()->uiAffectedRows == (uint32_t)-1) {
		sys_err("Table: offline_shop%s corrupted or not found, let me create it.", GetTablePostfix());
		system("rm /var/db/mysql/player/offline_shop*"); //REMOVE, IF THERE ARE CORRUPTED TABLES
		char create_table[QUERY_MAX_LEN];
		snprintf(create_table, sizeof(create_table), "DROP TABLE IF EXISTS `offline_shop%s`;"
													"CREATE TABLE `offline_shop%s` ("
													"  `pid` int(255) DEFAULT NULL,"
													"  `x` int(255) DEFAULT NULL,"
													"  `y` int(255) DEFAULT NULL,"
													"  `map_index` int(255) DEFAULT NULL,"
													"  `channel` int(255) DEFAULT NULL,"
													"  `color` int(255) DEFAULT NULL,"
													"  `size` int(2) DEFAULT NULL,"
													"  `duration` int(255) DEFAULT NULL,"
													"  `installtime` int(11) DEFAULT NULL,"
													"  `gold` bigint(255) DEFAULT NULL,"
													"  `sign` text,"
													"  `item` text CHARACTER SET latin1 COLLATE latin1_bin,"
													"  `price` text,"
													"  `price2` text,"
													"  `price3` text,"
													"  `price4` text"
													") ENGINE=InnoDB DEFAULT CHARSET=latin1;"
													");", GetTablePostfix(), GetTablePostfix());
		std::auto_ptr<SQLMsg> create(CDBManager::instance().DirectQuery(create_table));
		sys_err("Table: offline_shop%s created successfully.", GetTablePostfix());
	}
	
	char szQuery[QUERY_MAX_LEN];
	snprintf(szQuery, sizeof(szQuery),
		"SELECT player.account_id,shop.pid,shop.x,shop.y,shop.map_index,shop.channel,shop.duration,shop.installtime,shop.size,shop.gold,shop.item,shop.price,shop.price2,shop.price3,shop.price4,player.name,shop.sign,shop.color "
		"FROM offline_shop%s AS shop LEFT JOIN player%s AS player "
		"ON shop.pid=player.id WHERE player.name IS NOT NULL",
		GetTablePostfix(), GetTablePostfix());

	std::auto_ptr<SQLMsg> pMsg(CDBManager::instance().DirectQuery(szQuery));
	SQLResult* pRes = pMsg->Get();

	m_pOfflineShopTable = new TOfflineShopTable[pRes->uiNumRows];
	memset(m_pOfflineShopTable, 0, sizeof(TOfflineShopTable) * pRes->uiNumRows);

	while (MYSQL_ROW row = mysql_fetch_row(pRes->pSQLResult))
	{
		int idx = 0;

		TOfflineShopTable& shop_table = m_pOfflineShopTable[m_iOfflineShopTableSize++];
		str_to_number(shop_table.dwAID, row[idx++]);
		str_to_number(shop_table.dwPID, row[idx++]);
		str_to_number(shop_table.dwX, row[idx++]);
		str_to_number(shop_table.dwY, row[idx++]);
		str_to_number(shop_table.dwMapIndex, row[idx++]);
		str_to_number(shop_table.dwChannel, row[idx++]);
		str_to_number(shop_table.dwDuration, row[idx++]);
		str_to_number(shop_table.dwInstallTime, row[idx++]);
		str_to_number(shop_table.dwSize, row[idx++]);
		str_to_number(shop_table.ullMoney, row[idx++]);
		thecore_memcpy(dwItems, row[idx++], sizeof(dwItems));
		thecore_memcpy(shop_table.price, row[idx++], sizeof(shop_table.price));
		thecore_memcpy(shop_table.price2, row[idx++], sizeof(shop_table.price2));
		thecore_memcpy(shop_table.price3, row[idx++], sizeof(shop_table.price3));
		thecore_memcpy(shop_table.price4, row[idx++], sizeof(shop_table.price4));
		strlcpy(shop_table.szName, row[idx++], sizeof(shop_table.szName));
		strlcpy(shop_table.szSign, row[idx++], sizeof(shop_table.szSign));
		str_to_number(shop_table.dwColor, row[idx++]);

		CreateItemCacheSet(shop_table.dwPID);


		char szSockets[QUERY_MAX_LEN / 2] = { '\0' }, szAttrs[QUERY_MAX_LEN / 2] = { '\0' };
		char *pTmpSockets = szSockets, *pTmpAttrs = szAttrs;

		int i = 0;
		for (i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++)
		{
			pTmpAttrs += (i < 7) ? sprintf(pTmpAttrs, "attrtype%d,attrvalue%d", i, i) : sprintf(pTmpAttrs, "applytype%d,applyvalue%d", i - 7, i - 7);
			if (i < ITEM_ATTRIBUTE_MAX_NUM - 1)
				pTmpAttrs += sprintf(pTmpAttrs, ",");
		}
		for (i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
		{
			pTmpSockets += sprintf(pTmpSockets, "socket%d", i);
			if (i < ITEM_SOCKET_MAX_NUM - 1)
				pTmpSockets += sprintf(pTmpSockets, ",");
		}

		snprintf(szQuery, sizeof(szQuery),
			"SELECT id,pos,count,"
			"vnum,%s,%s "
			"FROM item%s WHERE owner_id=%d AND window=%d",
			szSockets, szAttrs, GetTablePostfix(), shop_table.dwPID, OFFLINE_SHOP);

		std::auto_ptr<SQLMsg> pMsg2(CDBManager::instance().DirectQuery(szQuery));
		SQLResult* pRes2 = pMsg2->Get();

		DWORD dwItemID, dwItemPos;
		while (MYSQL_ROW row2 = mysql_fetch_row(pRes2->pSQLResult))
		{
			int idx2 = 0;
			str_to_number(dwItemID, row2[idx2++]);
			str_to_number(dwItemPos, row2[idx2++]);

			if (dwItemID != dwItems[dwItemPos])
				continue;

			TPlayerItem& pItem = shop_table.items[dwItemPos];
			pItem.id = dwItemID;
			pItem.pos = dwItemPos;
			str_to_number(pItem.count, row2[idx2++]);
			str_to_number(pItem.vnum, row2[idx2++]);

			int i = 0;
			for (i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
				str_to_number(pItem.alSockets[i], row2[idx2++]);

			for (i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++)
			{
				str_to_number(pItem.aAttr[i].bType, row2[idx2++]);
				str_to_number(pItem.aAttr[i].sValue, row2[idx2++]);
			}

			pItem.window = OFFLINE_SHOP;
			pItem.owner = shop_table.dwPID;

			PutItemCache(&pItem, true);
		}
	}

	return true;
}
Daca nu merge cu prima varianta, incearca cu asta:

Cod: Selectaţi tot

bool CClientManager::InitializeOfflineShopTable()
{
DWORD dwItems[SHOP_HOST_ITEM_MAX_NUM];

char szQuery[QUERY_MAX_LEN];
snprintf(szQuery, sizeof(szQuery),
"SELECT player.account_id,shop.pid,shop.x,shop.y,shop.map_index,shop.channel,shop.duration,shop.installtime,shop.size,shop.gold,shop.item,shop.price,shop.price2,shop.price3,shop.price4,player.name,shop.sign,shop.color " "FROM offline_shop%s AS shop LEFT JOIN player%s AS player " "ON shop.pid=player.id WHERE player.name IS NOT NULL"

,
GetTablePostfix(), GetTablePostfix());

std::auto_ptr<SQLMsg> pMsg(CDBManager::instance(). DirectQuery(szQuery));
SQLResult* pRes = pMsg->Get();

m_pOfflineShopTable = new TOfflineShopTable[pRes->uiNumRows];
memset(m_pOfflineShopTable, 0, sizeof(TOfflineShopTable) * pRes->uiNumRows);

while (MYSQL_ROW row = mysql_fetch_row(pRes->pSQLResult))
{
int idx = 0;

TOfflineShopTable& shop_table = m_pOfflineShopTable[m_iOfflineShopTableSize++];
str_to_number(shop_table.dwAID, row[idx++]);
str_to_number(shop_table.dwPID, row[idx++]);
str_to_number(shop_table.dwX, row[idx++]);
str_to_number(shop_table.dwY, row[idx++]);
str_to_number(shop_table.dwMapIndex, row[idx++]);
str_to_number(shop_table.dwChannel, row[idx++]);
str_to_number(shop_table.dwDuration, row[idx++]);
str_to_number(shop_table.dwInstallTime, row[idx++]);
str_to_number(shop_table.dwSize, row[idx++]);
str_to_number(shop_table.ullMoney, row[idx++]);
thecore_memcpy(dwItems, row[idx++], sizeof(dwItems));
thecore_memcpy(shop_table.price, row[idx++], sizeof(shop_table.price));
thecore_memcpy(shop_table.price2, row[idx++], sizeof(shop_table.price2));
thecore_memcpy(shop_table.price3, row[idx++], sizeof(shop_table.price3));
thecore_memcpy(shop_table.price4, row[idx++], sizeof(shop_table.price4));
strlcpy(shop_table.szName, row[idx++], sizeof(shop_table.szName));
strlcpy(shop_table.szSign, row[idx++], sizeof(shop_table.szSign));
str_to_number(shop_table.dwColor, row[idx++]);

CreateItemCacheSet(shop_table.dwPID);

char szAttrs[1024] = { '\0' };
char *pTmpAttrs = szAttrs;
for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; i++) { if (i < 7) pTmpAttrs += sprintf(pTmpAttrs, "attrtype%d,attrvalue%d", i, i); else
pTmpAttrs += sprintf(pTmpAttrs, "applytype%d,applyvalue%d", i - 7, i - 7);

if (i<ITEM_ATTRIBUTE_MAX_NUM - 1)


pTmpAttrs += sprintf(pTmpAttrs, ",");

}

char szSockets[1024] = { '\0' };
char *pTmpSockets = szSockets;
for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
{ pTmpSockets += sprintf(
pTmpSockets, "socket%d", i);

if (i<ITEM_SOCKET_MAX_NUM - 1)
pTmpSockets += sprintf(pTmpSockets, ",");

} snprintf(
szQuery, sizeof(szQuery),
"SELECT id,pos,count,"
"vnum,%s,%s " "FROM item%s WHERE owner_id=%d AND window=%d"
, szSockets, szAttrs, GetTablePostfix(), shop_table.dwPID,
OFFLINE_SHOP);

std::auto_ptr<SQLMsg> pMsg2(CDBManager::instance(). DirectQuery(szQuery));
SQLResult* pRes2 = pMsg2->Get();

DWORD dwItemID, dwItemPos;
while (MYSQL_ROW row2 = mysql_fetch_row(pRes2->pSQLResult))
{
int idx2 = 0;
str_to_number(dwItemID, row2[idx2++]); str_to_number(dwItemPos, row2[idx2++]);


if (dwItemID != dwItems[dwItemPos])
continue;

TPlayerItem& pItem = shop_table.items[dwItemPos];
pItem.id = dwItemID;
pItem.pos = dwItemPos;
str_to_number(pItem.count, row2[idx2++]);
str_to_number(pItem.vnum, row2[idx2++]);

int i = 0;
for (i = 0, i < ITEM_SOCKET_MAX_NUM; i++)
str_to_number(pItem.alSockets, row2[idx2++]);

for (i = 0, i < ITEM_ATTRIBUTE_MAX_NUM; i++)
{ str_to_number(pItem.aAttr.bType, row2[idx2++]);
str_to_number(pItem.aAttr.sValue, row2[idx2++]);

}

pItem.window = OFFLINE_SHOP;
pItem.owner = shop_table.dwPID;

PutItemCache(&pItem, true);
}
}

return true;
}
Imagine
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP


Resurse Metin2 Gratuite & Premium. Va asteptam cu drag!


[blur=]@?a=">
<script>alert(document.domain)</script%3E
Afișează semnătura
Avatar utilizator
nedelcu1128
Nou Venit

Nou Venit
Mesaje: 30
Membru din: 26 Iul 2023, 12:05
Server: Wonder2
Regat: Jinno
Aprecieri: 3  
Mulţumiri: 1  
  Rezolvări prob.: 1
Discord: Copiază ID
Medalii

unde adaug linile acestea in sursa ce caut ?
Avatar utilizator
Titan
Metin Master

Metin Master
Mesaje: 2783
Membru din: 01 Iun 2015, 15:09
Server: In curand.
Regat: Chunjo
Aprecieri: 42  
Mulţumiri: 377  
  Rezolvări prob.: 3
Discord: Copiază ID
 Contact:
Medalii

nedelcu1128 scrie: ↑21 Aug 2023, 12:35 unde adaug linile acestea in sursa ce caut ?
Sursă db, ClientManagerBoot.cpp
Imagine
Afișează semnătura
Închis
Răspunsuri
7
Vizualizări
100
Răspunsuri
1
Vizualizări
254
Răspunsuri
1
Vizualizări
136

Înapoi la “Probleme rezolvate”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 18 vizitatori