PDA

View Full Version : Container content data dump



phunqe
23-01-13, 21:23
I was trying to find something over about 40 cabinets today and I remember a certain mod in that game with elves, where you could list and search your inventory over all your characters.

Let's say you put the following in your necoron.ini file:

ENABLEINVENTORYLOG = 1

Then, every time you open your inventory, goguardian or a cabinet, the following would be printed in a console log (I am going to use XML here just to illustrate it, format could be something else):



<inventory type="cabinet" id="00FDA1B">
<slots>
<slot id="1">
<item>Perfect Uranium Winding Argument</item>
<stacks>1</stacks>
</slot>
<slot id="2">
<item>Artifact Synapse Soldier Mod S-13</item>
<stacks>1</stacks>
</slot>
</slots>
</inventory>
<inventory type="goguardian" id="24FFE22">
<slots>
<slot id="1">
<item>Uranium Grenades</item>
<stacks>249</stacks>
</slot>
</slots>
</inventory>
<inventory type="inventory" id="AAEFB21">
<slots>
<slot id="1">
<item>Survival Kit</item>
<stacks>54</stacks>
</slot>
<slot id="2">
<item>Stamina Booster 3</item>
<stacks>30</stacks>
</slot>
</slots>
</inventory>


Here I assume that every container in the game has some kind of unique id (here represented in hex).
With this information we would be able to create a tool that basically can keep track of all our stuff and eventually even be able to tie into a rares db such as TH.

Things to consider:

1. One challenge here is the data storage. You probably don't want to just append it to a file everytime a container is opened. Even if a program parsing the file would understand that it should use only the latest entry of a any given id, it's quite inefficient. Even if the writing obviously is very fast. Consider for example using some kind of per login session storage with all the information about opened cabinets that is flushed to disk at specific intervals. If this is some kind of unique key storage it's easy to make sure you have the latest information in there for a specific container all the time.
2. Updating the data on container close is probably a better approach than on open (since you might modify it).
3. This is a thing suited for an API obviously, but I neither know the state of nor the plans for it.

This whole thing may just be over the top, but since I thought about it, I'll put it here :)