|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Support::Windows Servers Support forum for Windows EQEMu users. |

07-26-2010, 11:31 PM
|
Sarnak
|
|
Join Date: Jul 2010
Posts: 61
|
|
Quote:
Originally Posted by GeorgeS
Coins are in the profile struct BLOB in the database under table character_
I think the inventory of bank items should be in the inventory table
GeorgeS
|
Well I had already checked the inventory table but it only contains character inventory items... It doesn't hold the coin amounts for inventory or regular bank slots...
Also what is the structure for the coin held in the BLOB of character_ table??
I can see it is in HEX format but what is the structure that tells the system what item is where?
I appreciate the help...
|

07-27-2010, 12:24 AM
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
Here's the relevant profile struct
Quote:
'/*4720*/ sint32 platinum; // Platinum Pieces on player
'/*4724*/ sint32 gold; // Gold Pieces on player
'/*4728*/ sint32 silver; // Silver Pieces on player
'/*4732*/ sint32 copper; // Copper Pieces on player
'/*4736*/ sint32 platinum_bank; // Platinum Pieces in Bank
'/*4740*/ sint32 gold_bank; // Gold Pieces in Bank
'/*4744*/ sint32 silver_bank; // Silver Pieces in Bank
'/*4748*/ sint32 copper_bank; // Copper Pieces in Bank
|
use little endian byte order to decode
GeorgeS
|
 |
|
 |

07-27-2010, 12:33 AM
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
Here's the inventory table data
Quote:
Equipped slots
(somebody should make this prettier some day)
SLOT_CHARM = 0,
SLOT_EAR01 = 1,
SLOT_HEAD = 2,
SLOT_FACE = 3,
SLOT_EAR02 = 4,
SLOT_NECK = 5,
SLOT_SHOULDER = 6,
SLOT_ARMS = 7,
SLOT_BACK = 8,
SLOT_BRACER01 = 9,
SLOT_BRACER02 = 10,
SLOT_RANGE = 11,
SLOT_HANDS = 12,
SLOT_PRIMARY = 13,
SLOT_SECONDARY = 14,
SLOT_RING01 = 15,
SLOT_RING02 = 16,
SLOT_CHEST = 17,
SLOT_LEGS = 18,
SLOT_FEET = 19,
SLOT_WAIST = 20,
SLOT_AMMO = 21,
Inventory Slots
NOTE: Numbering for personal inventory goes top to bottom, then left to right
It's the opposite for inside bags: left to right, then top to bottom
Example:
inventory: containers:
1 6 1 2
2 7 3 4
3 8 5 6
4 9 7 8
5 10 9 10
Personal Inventory
Personal inventory slots 22 through 29.
Bags in personal inventory are:
22: 251->260
23: 261->270
24: 271->280
25: 281->290
26: 291->300
27: 301->310
28: 311->320
29: 321->330
Cursor
Cursor is slot 30, and the bag slots for the cursor are 331->340.
Tribute
Tribute items are slots 400->404, these items are not visible, but are counted for stats/effects.
Bank
Bank slots are 2000->2015
Bags in the bank are:
2000: 2031->2040
2001: 2041->2050
2002: 2051->2060
2003: 2061->2070
2004: 2071->2080
2005: 2081->2090
2006: 2091->2100
2007: 2101->2110
2008: 2111->2120
2009: 2121->2130
2010: 2131->2140
2011: 2141->2150
2012: 2151->2160
2013: 2161->2170
2014: 2171->2180
2015: 2181->2190
Shared Bank
Shared bank slots are 2500 and 2501
Bags in the shared bank are:
2500: 2531->2540
2501: 2541->2550
|
|
 |
|
 |

07-27-2010, 12:43 AM
|
Sarnak
|
|
Join Date: Jul 2010
Posts: 61
|
|
Much appreciated GeorgeS.... With that info and some investigations on my own I am slowly getting it...
|

07-27-2010, 09:39 PM
|
Sarnak
|
|
Join Date: Jul 2010
Posts: 61
|
|
Ok I have figured it out mostly...I appreciate the help so far but I have another question...
Sorry for all the questions but when I hit a road block that I just cannot figure out on my own I must ask someone...
I got the idea to look at the code for the PEQ PHP editor and found out a lot of what I needed...
This block of code in the "player.php" file is obviously what I have been needing but apparently it is somehow lacking....
Code:
$player_array['platinum'] = ord(substr($profile,4720,4));
The problem is it only returns 2 HEX characters... So if your platinum hits 256 it returns 0... I have looked everywhere and tried everything that makes sense trying to get it to return more than just the 2 characters to no avail... I am semi-new to PHP and cannot figure this one out... It is the first time I have had to deal with BLOB's and pulling HEX from a database...
Any suggestions on what would be a better solution??
|
 |
|
 |

07-27-2010, 09:47 PM
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
That does not sound correct. You need to remember these are short integers as in 4 bytes per record (1 word = 4 bytes)
Little endian - as in reverse byte order, so the order is -
(example of a conversion 4 HEX bytes => 4 byte integer)
0A 0B 0C 0D
0D*16777216 + 0C*65536 + 0B*256 + 0A*1
So convert the 8 bit -Hex into 8 bit decimal - so that $FF = 255 etc..
and use the formula above.
here's my code for the above
Code:
Function getbytes_convert32bit(location As Integer, bytes As Integer)
Dim result32 As Long
Dim byte1 As Byte
Dim byte2 As Byte
Dim byte3 As Byte
Dim byte4 As Byte
'start position=location , bytes=#bytes to read
Open "profile.bin" For Binary As #1
Get #1, location + 1, byte1: Get #1, location + 2, byte2: Get #1, location + 3, byte3: Get #1, location + 4, byte4
result32 = (byte4 * 16777216#) + (byte3 * 65536#) + (byte2 * 256#) + (byte1 * 1#)
getbytes_convert32bit = result32
Close #1
End Function
..btw my program serverstats does profile editing of toons and other things..
GeorgeS
Last edited by GeorgeS; 07-27-2010 at 09:54 PM..
|
 |
|
 |

07-27-2010, 09:57 PM
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
Also continues - editing directly via sql
Code:
Quote:
UPDATE character_ SET profile = INSERT((SELECT profile FROM (SELECT * FROM character_)
AS x WHERE id = 748),(4720+1),4,RPAD(CHAR(100),4,CHAR(0))) WHERE id = 748;
This would give a character with an ID of 748 100 platinum.
In theory, you can change 4720 to any field # in the profile blob & the 100 to whatever numeric value you want it set to. You would then need to change the 4's to correspond with however many characters the data takes up (32-bit integers are 4, for example), otherwise the blob will become corrupt (too many/too few characters).
Some might be wondering why there are 2 subqueries. The answer is discussed here, and it's basically a workaround for not being able to query the same table in an update.
GeorgeS
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:18 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |