Skip to content
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) #3330

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jasonch35
Copy link
Contributor

@jasonch35 jasonch35 commented Nov 4, 2024

Pull Request Prelude

Changes Proposed

  • Implementation of the Hercules Ultimate Storage System
  • Storages can now be created through a configuration file that describes their attributes.
  • Integrated storage_constants (Constant) into the configuration so that it can be assigned dynamically
  • Capacity is capped by MAX_STORAGE at config reading

Storage Configuration

{
        Id: (int)			Unique Identifier
        Name: (string)			Name of the storage sent to the client.
        Constant: (string)		Storage constant to be used by scripts
        Capacity: (int)			Maximum capacity of the storage.
}

Script Command
openstorage(<storage_constant>{, <storage_mode>});

Storage Modes

  • STORAGE_ACCESS_VIEW: View storage only.
  • STORAGE_ACCESS_GET: Allow retrieving items from storage.
  • STORAGE_ACCESS_PUT: Allow depositing items into storage.
  • STORAGE_ACCESS_ALL: (Default mode) Full access for viewing, retrieving, and depositing items.

All atcommands utilizing storage has been updated as well:

  • @storage <storage name/id>
  • @storeall <storage name/id>
  • @clearstorage <storage name/id>
  • @storagelist command only list Main storage for now

Issues addressed:

Credits to: @sagunkho and @dastgirp

Let's gooooo let's push this through!

This commit includes:
- HUSS main implementation
- openstorage script command update
- @storage atcommand update
- @clearstorage atcommand update
- @storeall atcommand update
- @storagelist atcommand update
- There can be an unlimited amount of storages and limits.
- All setting names are case-sensitive and must be keyed accurately.
- The storage capacity will default to MAX_STORAGE in mmo.h if it is set higher
- Storage ID 1 is the default (official) storage for accounts.
- Integrated storage_constants (Constant) into the configuration so that it can be assigned dynamically
@vBrenth
Copy link

vBrenth commented Nov 6, 2024

Thank you @jasonch35 hope this one will get implemented.
Also i want to ask about Storage Limit its still 600 correct?

@jasonch35
Copy link
Contributor Author

Thank you @jasonch35 hope this one will get implemented.
Also i want to ask about Storage Limit its still 600 correct?

Yes, Limit is capped by MAX_STORAGE which is 600 by default.

@jasonch35
Copy link
Contributor Author

jasonch35 commented Nov 7, 2024

Btw, I kept the "default" storage without warning/errors as it is set as default in original Herc's branch.
Commands and scripts will result in "no storage found" message if it is removed/changed.
Or parameter error on server start if its constant isn't found.
I believe server owners should be responsible for adjusting the configuration file, just as they would if they manually remove Red_Potion in item_db.conf, they'd have to manually remove them in scripts if they choose to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants