Disappearing items from itemshop

12/19/2013 00:14 kombajnik#1
Hello everyone.

First at all i would to say "sorry" for my english language.

So, i have 2 servers, both based on game2089 and i have problem...

On first server several days in a row players complain about problem with item shop. The items which they bought suddenly disappear after relog / teleport. 3/4 days in month is good but sometimes as i say "several days in a row" the problem appear

On second server i have problem all time. Players lost items from item-shop after relog / teleport. Dont know how to fix this.

I have enabled logging all mysql queries, and i check in logs and those queries (which add items which later are lost exists).


I looked into item (in player database) and I wonder why id of items starts from

10000010

then suddenly jumps to

30017846

and

50009733

and

70002772

and again jumps to

90000310

?? Why they are not continously from 1....?


I found also in CONFIG of auth something like that

ITEM_ID_RANGE: 000000001 000000002


And something like that in conf.txt from db folder

ITEM_ID_RANGE = 2000000000 2100000000

What is this?
12/19/2013 02:44 Coniesan#2
Hey, it's a problem of, how they get their Items!
I think your itemshop script inserts the item directly into the item table?
That's wrong, and is the reason, why items are disappearing!
You should better use the item_award for itemshop items! ;)
12/19/2013 03:03 Mashkin#3
Just about your curiosity about the ID ranges:


Now this also affects your itemshop for several reasons:
  • You need to care for IDs you use for items you (manually - e.g. shop script) add to your item table
  • Items in the database will not be known by the game cores until they are explicitly loaded (which happens e.g. when logging in or opening the safebox or mall box)
You were better off to use the item_award table as already suggested, just have a look at the column names and you will understand how to use it.

However, on one server I used to work on, the item_award table handling was buggy, causing single items to be delayed seemingly randomly (from minutes to days).
12/19/2013 16:55 kombajnik#4
Quote:
Originally Posted by Coniesan View Post
Hey, it's a problem of, how they get their Items!
I think your itemshop script inserts the item directly into the item table?
That's wrong, and is the reason, why items are disappearing!
You should better use the item_award for itemshop items! ;)
Ye ye bro, my query for adding items is:

Code:
$item_added = $players->query('INSERT INTO `item` (`owner_id`, `window`, `pos`, `count`, `vnum`, `socket0`, `socket1`, `socket2`) VALUES ('.$logged_account->getId().', \'MALL\', '.$free_stock.', '.$item['item_count'].', '.$item['item_id'].', \'1\', \'1\', (SELECT `value0` FROM `item_proto` WHERE `vnum` = '.$item['item_id'].'));');

@Mashkin

thanks for the info!

so, my actually settings of ITEM_ID_RANGE are corretly?

in CONFIG from auth directory
ITEM_ID_RANGE: 000000001 000000002

and in conf.txt from db directory
ITEM_ID_RANGE = 2000000000 2100000000


edit:
anyway i make new script for IS and so far all works !!
02/15/2014 15:26 kombajnik#5
Hello guys, maybe You will know how to fix disappearing items from itemshop which have time left to use? When i create these items (for example costumes) by GM via command all is ok, but when i bought it in IS (using item_award table) the item disappearing in few seconds.