Jump to content

Special Storage - Items disappearing at reboot


Recommended Posts

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Acum 39 minute, Artefact a spus:

Hello, i recently installed special storage and fixed some problems but I still got one which is big.

If I have items in the special storage and I`m rebooting the server the items are disappearing but they still appear in  database. I mean in navicat the items are still there.

Any tips? Thank you

void CInputDB::ItemLoad(LPDESC d, const char * c_pData)

// You missed this part
switch (p->window)
{
	case INVENTORY:
	case DRAGON_SOUL_INVENTORY:
	{
		item->AddToCharacter(ch, TItemPos(p->window, p->pos));
	}
	break;

	case EQUIPMENT:
	{
		if (item->CheckItemUseLevel(ch->GetLevel()))
		{
			if (!item->EquipTo(ch, p->pos))
			{
				v.push_back(item);
			}
		}
		else
		{
			v.push_back(item);
		}
	}
	break;
}

 

Link to comment
Share on other sites

11 hours ago, ridetpro said:

void CInputDB::ItemLoad(LPDESC d, const char * c_pData)

// You missed this part
switch (p->window)
{
	case INVENTORY:
	case DRAGON_SOUL_INVENTORY:
	{
		item->AddToCharacter(ch, TItemPos(p->window, p->pos));
	}
	break;

	case EQUIPMENT:
	{
		if (item->CheckItemUseLevel(ch->GetLevel()))
		{
			if (!item->EquipTo(ch, p->pos))
			{
				v.push_back(item);
			}
		}
		else
		{
			v.push_back(item);
		}
	}
	break;
}

 

			switch (p->window)
			{
				case INVENTORY:
				case DRAGON_SOUL_INVENTORY:
#ifdef ENABLE_SPECIAL_STORAGE
				case UPGRADE_INVENTORY:
				case BOOK_INVENTORY:
				case STONE_INVENTORY:
				{
					//sys_err("Load shit window = %d // pos = %d", p->window, p->pos);
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
				}
				break;
#endif	
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
					break;

				case EQUIPMENT:
					if (item->CheckItemUseLevel(ch->GetLevel()) == true )
					{
						if (item->EquipTo(ch, p->pos) == false )
						{
							v.push_back(item);
						}
					}
					else
					{
						v.push_back(item);
					}
					break;
			}
		}

 

Link to comment
Share on other sites

  • Contributor
48 minutes ago, Artefact said:

			switch (p->window)
			{
				case INVENTORY:
				case DRAGON_SOUL_INVENTORY:
#ifdef ENABLE_SPECIAL_STORAGE
				case UPGRADE_INVENTORY:
				case BOOK_INVENTORY:
				case STONE_INVENTORY:
				{
					//sys_err("Load shit window = %d // pos = %d", p->window, p->pos);
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
				}
				break;
#endif	
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
					break;

				case EQUIPMENT:
					if (item->CheckItemUseLevel(ch->GetLevel()) == true )
					{
						if (item->EquipTo(ch, p->pos) == false )
						{
							v.push_back(item);
						}
					}
					else
					{
						v.push_back(item);
					}
					break;
			}
		}

 

here :

				case STONE_INVENTORY:
				{
					//sys_err("Load shit window = %d // pos = %d", p->window, p->pos);
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
				}
				break;
#endif	
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
					break;

try deleting :

item->AddToCharacter(ch, TItemPos(p->window, p->pos));
					break;

My only accounts are here and on M2D, Don't trust anyone else from other shitty sites.
266868740522639360.png

Link to comment
Share on other sites

19 minut temu, Artefact napisał:

Yeah but if the system is not enabled the inventory and dragon soul cases wont work.

Then use directive properly.
 

				case INVENTORY:
				case DRAGON_SOUL_INVENTORY:
#ifdef ENABLE_SPECIAL_STORAGE
				case UPGRADE_INVENTORY:
				case BOOK_INVENTORY:
				case STONE_INVENTORY:
#endif
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
				break;

 

Link to comment
Share on other sites

1 hour ago, Kreciok said:

Then use directive properly.
 


				case INVENTORY:
				case DRAGON_SOUL_INVENTORY:
#ifdef ENABLE_SPECIAL_STORAGE
				case UPGRADE_INVENTORY:
				case BOOK_INVENTORY:
				case STONE_INVENTORY:
#endif
					item->AddToCharacter(ch, TItemPos(p->window, p->pos));
				break;

 

Yep but still there`s nothing wrong with my version

Link to comment
Share on other sites

Make sure you load items in every windows. ClientManagerPlayer.cpp
 

		#ifdef ENABLE_SPECIAL_STORAGE
		snprintf(queryStr, sizeof(queryStr),
			"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
			"FROM item%s WHERE owner_id=%d AND (window in ('INVENTORY','EQUIPMENT','DRAGON_SOUL_INVENTORY','BELT_INVENTORY','UPGRADE_INVENTORY','BOOK_INVENTORY','STONE_INVENTORY'))",
			GetTablePostfix(), packet->player_id);
		#else
		snprintf(queryStr, sizeof(queryStr),
				"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
				"FROM item%s WHERE owner_id=%d AND (window < %d or window = %d)",
				GetTablePostfix(), packet->player_id, SAFEBOX, DRAGON_SOUL_INVENTORY);
		#endif

		#ifdef ENABLE_SPECIAL_STORAGE
			snprintf(szQuery, sizeof(szQuery),
				"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
				"FROM item%s WHERE owner_id=%d AND (window in ('INVENTORY','EQUIPMENT','DRAGON_SOUL_INVENTORY','BELT_INVENTORY','UPGRADE_INVENTORY','BOOK_INVENTORY','STONE_INVENTORY'))",
				GetTablePostfix(), pTab->id);
			#else
			snprintf(szQuery, sizeof(szQuery), 
					"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "
					"FROM item%s WHERE owner_id=%d AND (window < %d or window = %d)",
					GetTablePostfix(), pTab->id, SAFEBOX, DRAGON_SOUL_INVENTORY);
			#endif

Also u should check a delete query:
 

#ifdef ENABLE_SPECIAL_STORAGE
		snprintf(queryStr, sizeof(queryStr), "DELETE FROM item%s WHERE owner_id=%d AND (window in ('INVENTORY','EQUIPMENT','DRAGON_SOUL_INVENTORY','BELT_INVENTORY','UPGRADE_INVENTORY','BOOK_INVENTORY','STONE_INVENTORY'))", GetTablePostfix(), pi->player_id);
#else
		snprintf(queryStr, sizeof(queryStr), "DELETE FROM item%s WHERE owner_id=%d AND (window < %d or window = %d)", GetTablePostfix(), pi->player_id, SAFEBOX, DRAGON_SOUL_INVENTORY);
#endif

You can also check it easier by changing just this lines in a query: SAFEBOX, DRAGON_SOUL_INVENTORY -> on a SAFEBOX, STONE_INVENTORY.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.