Hercules Ultimate Storage System#2724
Conversation
|
from ci, look like shadow variable |
|
Windows compile fine for now, will be checking linux warnings and errors soon. |
4144
left a comment
There was a problem hiding this comment.
some checks probably already added in last commit, but i checked commit by commit from start
|
In my opinion the Xcode upgrade should not be part of this PR since it's not required. |
Ok, will remove it, I had just migrated it from old code to new code |
ab0a8dc to
772ff5e
Compare
14871b7 to
274ec5b
Compare
|
@4144 @Kenpachi2k13 can you review again? |
| return; | ||
| } | ||
|
|
||
| nullpo_retv(stor); |
There was a problem hiding this comment.
this nullpo probably need move into if block, because after if block, stor is non null
| struct storage_data *stor = storage->ensure(sd, sd->storage.current); | ||
| if (stor != NULL) | ||
| storage->get(sd, stor, item_index, item_amount); | ||
| } else if(sd->state.storage_flag == STORAGE_FLAG_GUILD) { |
| if ((stor = storage->ensure(sd, RFIFOW(fd, 8))) == NULL) | ||
| return; | ||
|
|
||
| Assert_retv(stor != NULL); |
| if ((stor = storage->ensure(sd, storage_id)) == NULL) | ||
| return; | ||
|
|
||
| Assert_retv(stor != NULL); |
|
nice bro |
|
Anyone currently using this on their server? |
|
@dastgirp you can complete this? |
|
dreams come true :D? |
| if( sd->sc_display_count ) { | ||
| int i; | ||
| for(i = 0; i < sd->sc_display_count; i++) { | ||
| for(int i = 0; i < sd->sc_display_count; i++) { |
There was a problem hiding this comment.
Missing space after for and the curly brackets could be removed.
| } | ||
| VECTOR_CLEAR(sd->channels); | ||
| VECTOR_CLEAR(sd->script_queues); | ||
|
|
There was a problem hiding this comment.
Any reason for this empty line?
There was a problem hiding this comment.
no, might be due to merge from old commit to here
|
|
||
| /** | ||
| * Get a storage id by its name (through @commands etc...) | ||
| * @param[in] storage_name pointer to the storage name char array. |
There was a problem hiding this comment.
Please separate the description and the parameter list with an empty comment line.
|
|
||
| /** | ||
| * Get storage with a particular ID from a player. | ||
| * @param[in] sd pointer to map session data. |
There was a problem hiding this comment.
Please separate the description and the parameter list with an empty comment line.
| int i = 0; | ||
| struct storage_data *stor = NULL; | ||
|
|
||
| nullpo_retr(NULL, sd); |
There was a problem hiding this comment.
Do the NULL pointer check prior to declaring/initialising the variables.
| { | ||
| int payload_size = RFIFOW(fd, 2) - 8, account_id = RFIFOL(fd, 4); | ||
| int payload_size = RFIFOW(fd, 2) - 10, account_id = RFIFOL(fd, 4); | ||
| short storage_id = RFIFOW(fd, 8); |
There was a problem hiding this comment.
| short storage_id = RFIFOW(fd, 8); | |
| int storage_id = RFIFOW(fd, 8); |
There was a problem hiding this comment.
It is of 2 bytes, only, but as I see other are using int, changed it. done
| * @packet 0x3808 [out] <account_id>.L <storage_id>.W <save_flag>.B | ||
| * @param fd [in] File/Socket Descriptor. | ||
| * @param account_id [in] Account ID of the storage in question. | ||
| * @param flag [in] Save flag, true for success and false for failure. |
| bool *matched_p = NULL; | ||
| int *delete = NULL; | ||
| int total_deletes = 0, total_updates = 0, total_inserts = 0; | ||
| int total_changes = 0; | ||
| int cp_size = 0; |
| CREATE TABLE IF NOT EXISTS `storage` ( | ||
| `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
| `account_id` INT UNSIGNED NOT NULL DEFAULT '0', | ||
| `storage_id` INT(11) UNSIGNED NOT NULL DEFAULT '1', |
There was a problem hiding this comment.
| `storage_id` INT(11) UNSIGNED NOT NULL DEFAULT '1', | |
| `storage_id` INT UNSIGNED NOT NULL DEFAULT '1', |
| -- You should have received a copy of the GNU General Public License | ||
| -- along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| ALTER TABLE `storage` ADD `storage_id` INT(11) UNSIGNED NOT NULL DEFAULT '1' AFTER `account_id`; |
There was a problem hiding this comment.
| ALTER TABLE `storage` ADD `storage_id` INT(11) UNSIGNED NOT NULL DEFAULT '1' AFTER `account_id`; | |
| ALTER TABLE `storage` ADD `storage_id` INT UNSIGNED NOT NULL DEFAULT '1' AFTER `account_id`; |
|
@dastgirp something about that? |
|
@Kenpachi2k13 updated to latest commit and made all changes that were mentioned by you. |
|
look like compilation errors in all or most jobs |
was problem with scope, fixed it. |
|
@dastgirp Can you complete this? Seems to be having conflicts again... =( |
It was already completed but for some reason not merged, |
|
By the way, quick question, is there a particular reason why you began storage IDs at 1 instead of 0 and did not made a default storage ID? (ie. When no storage ID is specified, default to 0 and open the basic storage)?Just curious, no need to rewrite anything on my account 😅As for milestones and etc I don't know, GitHub said it was waiting for @Kenpachi2k13 to review but I don't know if that's true or not =/But it might be related to why the PR has no tags and wasn't merged already?
|
| { | ||
| struct map_session_data *sd = script->rid2sd(st); | ||
| if (sd == NULL) | ||
| int storage_id = script_getnum(st, 2); |
There was a problem hiding this comment.
Why not making this optional, as you need to have a storage 1 configured (SQL, for example) and considering it would improve compatibility?
| int storage_id = script_getnum(st, 2); | |
| int storage_id = script_hasdata(st, 2) ? script_getnum(st, 2) : 1; |
There was a problem hiding this comment.
Having this as optional is a way, but it won't tell others something is wrong.
Specifying storage id is better as it's clear that storage 1 will be used.
You can have any id you want, (even remove the Id 1), so having this optional would make it more confusing
|
Does anyone have any news about? |
|
It was already completed but for some reason not merged, If it is going to be merged in next cycle, I can fix the conflicts again, but without confirmation, it would just keep on conflicting with every new release, so, I won't be fixing conflict as of now until confirmation is received or some changes are requested.
It's officially on hold, I believe.
…-- Sent from Yandex.Mail for mobile
12:10, July 1, 2021, Bruno Silva ***@***.***>:
Does anyone have any news about?
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
Any news about this? |
|
One day it will become a reality. Lol. |
|
@dastgirp @MishimaHaruna can we have a definitive merging window and finish this? |
|
Four years already :'( |
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
openstoragebuiltin command.Default storage mode : STORAGE_ACCESS_ALL
Script Commands
Changed:
openstorage(<storage_id>{, <storage_mode>})Issues addressed: