Originally posted by Zaphod
I'm currently in the process of updating the item capabilities of ShowEQ to deal with the current EQ packet format. I've currently got my own notes, some from UnGod, and have been looking at what the EQEmu guys have figured out. But if you would care to share your own notes/data/code for dealing with the new items it would be greatly appreciated because there are still fields that none of us have figured out yet. So, please share your insight.
I'm watching the ItemCode and ItemInfoCode opcodes. The data is '|' delimited strings rather than anything resembling a C struct.
Here's the important parts of what I put in packet.cpp:
Code:
// print out contents - data is '|' delimited strings
FILE *itmFile;
// on bazaar queries data[6] == 0, filter them out
if (data[6] && (itmFile = fopen("./items.raw", "a")))
{
for (int i = 6; i < (int)len - 1; i++)
fprintf(itmFile, "%c", (char)data[ i ]);
fprintf(itmFile, "\n");
fclose(itmFile)
}
Everything before data[6] doesn't seem to have anything to do with the item data, and data[len - 1] is just a NULL. That leaves us with
Code:
1|0|4|0|0|"0|Earring of the Solstice|*Earring of the Solstice|IT63|28771|
1|255|0|0|18|1000|1072|-1|-1|0|0|5|0|0|5|5|0|5|0|0|
0|8|8|55|55|5|0|0|0|0|0|0|0|0|44|0|0|0|0|0|51|0|0|
0|2|0|0|0|32767|32767|0|1298|-1|29|0|1.000000|0|
0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||0|1|
0|0|0|0|0|0|0|0|0|0|0|0|0||0|0"||||||||||
Well, that refused to properly line up at all, but it's all one big string, no spaces or newlines, just 102 '|' delimited fields.
Our work is not done yet though. Containers and items with augments add in some extra fun stuff so that all the information about the container and its contents are sent in one packet. Container packets have the same opcode, but the data looks like this:
Code:
junk "item" "junk \"item\" junk" "junk \"item\" junk" junk
To get the item data out of that, I break up the whole thing like this:
Code:
@fields = split(/\|/, $data);
for $i (0..$#fields) {
$value = $fields[$i];
if ($value =~ /^\"./ && $fields[$i+5] !~ /^\\\"/) {
print_item($i);
}
if ($value =~ /^\\\"/) {
print_item($i);
}
print "\n";
}
The function 'print_item($i)' just prints from $data[$i] to $data[$i + 102] into a file.
As for the field names, they're in exactly the same order that is listed in my first post in this thread.
PM me if you want to know more Zaphod.