• 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
150
Reaction score
14
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 by a moderator:
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);
 
But I use gesior acc not myacc
Copy this file contents from MyAAC:
to Gesior2012 subfolder classes with filename ots_buffer.php (lowercase name of PHP class) and then you use OTS_Buffer class anywhere in Gesior2012 code ex. code like in @tobi132 post:
 
Yeah, but not works

1727975511684.webp

1727975525050.webp1727975538728.webp1727975584217.webp

Look that Roleta Reward is attributes information (description) and is reading.
But abilities column not works...
Post automatically merged:

Now i changed the folder to classes like gesior suggest:

1727975827621.webp

1727975849714.webp

1727975857484.webp
Post automatically merged:

When I use this page broke:

1727976000242.webp
 
Last edited:
Back
Top