Jump to content
  • 0
Sign in to follow this  
Artefact

solved Special Storage - Items disappearing at reboot

Question

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

Share this post


Link to post

14 answers to this question

Recommended Posts

  • 0

Could be Python error, i mean if they still are in database ? 

 

Which one did you install ? 

Share this post


Link to post
  • 0

It`s from another forum, it`s called the last version and has some files with fixes in it. But i`ll recheck my python part, ty.

Share this post


Link to post
  • 0
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;
}

 

Share this post


Link to post
  • 0
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;
			}
		}

 

Share this post


Link to post
  • 0
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;

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0
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;

 

Share this post


Link to post
  • 0
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

Share this post


Link to post
  • 0

Can you post screen of items in database? After reboot. Primary "window"

Share this post


Link to post
  • 0
11 hours ago, flexio said:

Can you post screen of items in database? After reboot. Primary "window"

Sure

unknown-4.png

Share this post


Link to post
  • 0

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.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.