Jump to content
Ind

HCache | Item Packages Update

Recommended Posts

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

Edited by Ridley

Share this post


Link to post
Share on other sites

Reload time 80% less? Im like.. What? D: that sounds amazing!

Share this post


Link to post
Share on other sites

Sir in the item_packages the ID<item_id> is not working?

Some items are not working like  Mama's_Knife

Edited by kyeme

Share this post


Link to post
Share on other sites

> 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!

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

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

And only 12mb ram 0: falcon punch AEGIS!

Share this post


Link to post
Share on other sites

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.

Edited by mofo

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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:

 

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

Share this post


Link to post
Share on other sites

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:

 

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

 

 

You're absolutely correct, fixed in https://github.com/HerculesWS/Hercules/commit/939d15818b6f17913a12175e197ac7aea1e2e05d

Thank you very much

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.