HCache | Item Packages Update

Ind

Development Administrator
Staff member
Messages
1,655
Points
113
Item Packages: Update
In this commit we've modified the 'Random' field so that it can be used to define a group id to that item, as to allow packages to have more than one random group of items as its official equivalents do.
The updated documentation is as follows, note that random field is no longer optional, and for "Must" types it should be 0, this commit has updated package_items.conf in both pre-re and re, the remaining fields remain optional when their value isn't necessary, e.g. you don't need to specify Count if it is 1, Expire if it is 0, Announce/Named if it is false.

<Container_Item_Name>: {
    <Entry_Item_Name>: {
        Random: 0 - Signs what group type this item belongs to, 0 is "Must", a group of items that come out whenever the package is open (doesn't use rate), anything above 0 is considered "random_group_<value>", a package with 2 random groups for example gets 2 items whenever open, one from each group
        Count: 30 - Stands for how much <Entry_Item_Name> will be obtained.
        Expire: 2 - Signs how many hours this item will last (makes a rental item).
        Announce: True/False - Signs whether to relay a special item obtain announcement when this item comes out of the package.
        Rate: 50 - If 'Random' is not 0, a rate from 1 to 10000 (0.01% - 100%) will be given.
        Named: True/False - Signs whether the item should have the owner's name in it.
    }
}
HCache
Reading these new files takes more processing time than the previous as the format is more flexible (or complex), and as we are always trying to improve we couldn't let this stand, we've designed a caching method to make this processing time overhead happen only when the files are modified.
 
Smart
The feature checks when a file has been last modified, and if it hasn't been modified since the cache was made it relies on the cache instead of reading the file over. This feature also is capable of realizing when the server been recompiled and re-writes the caches when it happens so the data in them is always up to date with the latest source code.
 
The Future
As we have a number of other planned things we'll be slowly extending this to the other files that would benefit from it.
This feature can be employed in any files and used to store any data we like, we have intent to boost NPC parsing/reload with it in the near future, our estimates expect NPC parse time to drop by over 80%, reload time will drop just as much.
 
Special Thanks to

  • Beret and hemagx, its thanks to them we became aware of the missing feature in item packages.
  • Muad_Dib for all the data he provided to this update
  • mkbu95 for his help in the development of HCache
Link~u

 
Last edited by a moderator:
Sir in the item_packages the ID<item_id> is not working?

Some items are not working like  Mama's_Knife

 
Last edited by a moderator:
> Moves mouse to give Ind his fist +1
> Sees Ind has already 3 +1 when I click.

> Dumb face.

Looking forward to see that caching feature to be as aggresive as it can!

 
This feature can be employed in any files and used to store any data we like, we have intent to boost NPC parsing/reload with it in the near future, our estimates expect NPC parse time to drop by over 80%, reload time will drop just as much
Wew..."instant reload" for everything ......xD /no1

 
Next goal for Ind will be someting like making the server already be loaded just before executing it. xD

 
I can't open obbs, weapon boxes, anymore. Is there like an sql update I should've applied? When I try to open an old blue box it says "any work in progress(NPC dialog manufacturing...) quit and try again.

If I relog/character select, I can open them again. But after if I use the "Change Cart" skill, i get the same message and can't open boxes or talk to npcs anymore.

 
Last edited by a moderator:
I can't open obbs, weapon boxes, anymore. Is there like an sql update I should've applied? When I try to open an old blue box it says "any work in progress(NPC dialog manufacturing...) quit and try again.

If I relog/character select, I can open them again. But after if I use the "Change Cart" skill, i get the same message and can't open boxes or talk to npcs anymore.
The issue you're experiencing is unrelated to this change, please refer to the bug tracker.Thank you

 
Woo. What a nice update.

 
The functions of the HCache_check contains a typo, most likely as a result of Ctrl+C & Ctrl+V:

fstat(fileno(first), &bufa);fstat(fileno(first), &bufb); 


likely entry should be this:

Code:
fstat(fileno(first), &bufa);fstat(fileno(second), &bufb); 
 
  • Upvote
Reactions: Ind
Back
Top