04-11-2012 01:11 AM
|
 |
Administrator, Lead Coder
|
|
Glitch with using items
The item system is glitchy in a way that it cannot distinguish owners
As Silverdragontears was reporting problems of her using certain items, I found a serious mistake within the file classes/class_item.php. The problem is with the constructor, as it grabs item info from inventory solely based on the itemname, but not itemowner. For this reason only the first user to ever purchase it from itemshop can use it. It is hilarious when other users attempt to use the item, they see a list of pets that do not belong to themselves at all.
I've reuploaded Mys v1.3.1 to fix this glitch for good, and I apologize for this mistake. Again it was caused by the fact that it was only me on my dev demo site, which makes debugging over features that involve multiple users difficult and sometimes impossible. I will upload the new classes/class_item.php a few minutes later, it is actually quite easy to fix though if you wanna do it manually.
|
|
Issue Details
|
Category Unknown
Status Fixed
Priority 3
Affected Version Mys v1.3.1
Fixed Version Mys v1.3.2
Users able to reproduce bug
0
Users unable to reproduce bug
0
Assigned Users
Hall of Famer
Tags
(none)
|
|
04-11-2012 01:49 AM
|
 |
I am your Nemesis.
|
|
|
What are the edits?
|
04-11-2012 01:55 AM
|
 |
Administrator, Lead Coder
|
|
|
This is the difference from line 97 of the two versions:
Old version:
PHP Code:
$row = $GLOBALS['adopts']->select("inventory", array(), "itemname ='{$itemname}'")->fetchObject();
New version:
PHP Code:
$row = $GLOBALS['adopts']->select("inventory", array(), "itemname ='{$itemname}' and owner = '{$itemowner}'")->fetchObject();
The old version does not check the item owner, which was perfectly fine for table prefix.items but not for prefix.inventory. The itemname alone is insufficient to identify each item in inventory, it must be coupled with itemowner. In the old script it will be a problem if you have two or more users buying the same items(as the script cannot distinguish the owners), the new script resolve this issue.
|
04-11-2012 01:57 AM
|
 |
I am your Nemesis.
|
|
|
Ok I changed it but you still can't target the adopts.
|
04-11-2012 03:16 AM
|
 |
Administrator, Lead Coder
|
|
|
Then you are probably having a different issue. This one is related to how the system is unable to identify item owners because the info is not executed by the constructor.
|
04-11-2012 03:17 AM
|
 |
I am your Nemesis.
|
|
|
Do I start a bug report for it or what?
|
04-11-2012 03:28 AM
|
 |
Administrator, Lead Coder
|
|
|
umm I dont think you should unless it is confirmed to be a glitch in the script. If it affects your site because your adoptable ids are not numeric, its better to ask in questions/support section. But yeah, if a few hours later I confirm this is a glitch that affects everyone, you may go ahead and start a bug report.
|
09-11-2012 04:31 PM
|
 |
A Headache Embodied
|
|
|
The current link to upload 1.3.1 has this problem fixed, correct?
|
09-14-2012 02:03 AM
|
 |
Administrator, Lead Coder
|
|
|
I think so, please let me know if it is still not fixed.
|
All times are GMT -5. The time now is 12:21 PM.
Currently Active Users: 5563 (0 members and 5563 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members,
jolob.