• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP How I read player_items.attributes?

Engradiel

Member
Joined
May 3, 2009
Messages
120
Reaction score
7
Location
Brazil
1710964270148.png

When I use this in php:

PHP:
$test = $SQL->query('SELECT attributes FROM `player_items` WHERE player_id = 13352 and pid = 1 and itemtype = 2496')->fetch();         
print $test['attributes'];

1710964387928.png

How Can I decrypt this information?
 
You can find the necessary information in those functions
and here are the header attributes (numbers)

The header is always a size of uint8_t followed by the attribute itself which can vary between types of uint int or string
With the provided links you should be able to replicate everything needed
 
But I can read it on php.
Using it:
SQL:
SELECT CONVERT(attributes USING utf8) FROM player_items
Shows. But other table that I want seems different format.
 
Souls of Elysium | RPG (https://mortalis.soerpg.com/characterprofile.php?name=Eva)
I accomplished this here (hover over the equipment), and on many other OT sites I've worked on.

First, as Evil Hero suggested, you need to see how your server is deserializing the attribute data.
Second, build a lib with all your unpacking functions, such as unpacking int8, uint8, int16 etc.. and getString(). (there are many open-source options you can look into)
Third, Build a lib that mimics the deserialization code from the game server. If you follow the code correctly, you will arrive at the expected result.
 
Last edited:
If you use myaac, then you can use this class


usage:

PHP:
$buffer = new OTS_Buffer($test['attributes ']);

Then use the functions to read the data:
PHP:
$buffer->getChar();
$buffer->getShort();
$buffer->getLong();
$buffer->getString();

$buffer->skip($x);
 
Back
Top