-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of Hercules Ultimate Storage System (HUSS) #1763
Conversation
9629ee6
to
429b8c4
Compare
9a60418
to
7a4989c
Compare
@Smokexyz any news on this? |
@@ -64,7 +64,7 @@ | |||
// 20120307 - 2012-03-07aRagexeRE+ - 0x970 | |||
|
|||
#ifndef PACKETVER | |||
#define PACKETVER 20141022 | |||
#define PACKETVER 20150513 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you change it for testing or the default PACKETVER
will really change? If it will change, I think it should be in a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this was for testing only, I forgot to revert the change.
@@ -5537,9 +5539,15 @@ storage window, to avoid any disruption when both windows overlap. | |||
|
|||
mes("I will now open your stash for you"); | |||
close2(); | |||
openstorage(); | |||
openstorage(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to use openstorage(STORAGE_TYPE_MAIN)
with the new constant for storage type.
@HerculesWS/developers Is there anything to be done on this? If so, I can work on it as I rebase for conflict resolution. @4144 @MishimaHaruna |
int i = 0; | ||
struct storage_data *stor = NULL; | ||
|
||
nullpo_retr(NULL, sd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here need return not NULL but some kind of default storage.
Because in other code no checks for return from storage->ensure
src/map/storage.c
Outdated
{ | ||
struct item_data *data = NULL; | ||
struct item *it = NULL; | ||
const struct storage_settings *stst = storage->get_settings(stor->uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing nullpo check for stor variable
src/map/storage.c
Outdated
{ | ||
const struct storage_settings *stst = storage->get_settings(stor->uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing nullpo check for stor variable
src/map/storage.c
Outdated
{ | ||
const struct storage_settings *stst = storage->get_settings(stor->uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing nullpo check for stor variable.
Check after this line is useless, because here server already crashed
src/map/storage.c
Outdated
{ | ||
const struct storage_settings *stst = storage->get_settings(stor->uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here missing nullpo check for stor too.
Next check for stor is useless
src/map/storage.c
Outdated
{ | ||
int flag = 0; | ||
struct item *it = NULL; | ||
|
||
nullpo_ret(sd); | ||
|
||
Assert_ret(sd->storage.received == true); | ||
Assert_ret(stor->received == true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing nullpo for stor variable
@Smokexyz If you have some time please look at PR, thanks. |
@Asheraf you think of rebase in this in that PR, it seems that it exists in the official a long time? |
@dastgirp Do you think of rebase? using more than one storage is good for private server. |
I forgot that this wasn't merged, will see what I can do |
Thanks @dastgirp for looking at this. |
@dastgirp @4144 @Asheraf @MishimaHaruna @sagunkho Something about it? it would be interesting to implement this in hercules |
just wanna tell this is already in rathena -> rathena/rathena@46b1de7 |
@dastgirp yeah boi!!! your the man! |
Umm will this System merged? |
not yet merged, here code too outdated... |
Pull Request Prelude
Changes Proposed
Design
Implementation of the Hercules Ultimate Storage System
Storages can now be created through a configuration file that describes their attributes.
Example storage configuration:
Additional storages are handled with dynamic arrays that will save a tonne of memory when created, as opposed to a design in which they were implemented using fixed length arrays. In simple terms, a storage of 600 items would approximately cost the same amount of memory as 600 storages with 1 item each.
They are saved in the same storage database (SQL) as the original separating them by a storage identifier.
An infinite number of storages can be created, there are no limits.
The current design implementation only allow saving/loading of approximately 1600 items per storage due to packet size limits.
PS. Make sure you apply SQL upgrades for this patch!
Access Modes
Storage access modes can be set through the
openstorage
builtin command.Default storage mode : STORAGE_ACCESS_ALL
Script Commands
Changed:
openstorage(<storage_id>{, <storage_mode>})
Affected Branches: master
Issues addressed: #1762
Known Issues and TODO List
clif_storagelist
clause instorage_storageopen