Over 32767 items in storage

The general development forum for topics that are not specific to a single project, or ones that specifically relate to two or more projects collectively.


Forum rules

Welcome to the Home of Development!

The Mana World has multiple projects under development and most of these projects have their own development forum. However, some assets may be developed which are for the benefit of more than one or no single specific project. This forum houses any such assets.

You can also post on this forum if you are unsure which other development forum your post belongs to. Forum staff will help you by moving your post to the most appropriate section.

Post Reply
ThinkSome
Moubootaur Legends
Moubootaur Legends
Posts: 81
Joined: 02 Apr 2023, 16:47

Over 32767 items in storage

Post by ThinkSome »

Since this is a cross-repo issue/investigation/idea, I'm sharing my conclusions here:

  • TMWAthena can handle 32-bit amounts internally, if:

    • amount in src/proto2/net-Item.hpp is changed to int32_t/Little32

    • MAX_AMOUNT in src/mmo/consts.h is changed to 2000000000

  • Hercules was not tested, but seems to use 32-bit integer amounts internally as well. The provided database schema in ML also uses INTs for the back-end storage.

  • ManaVerse already uses 32-bit amounts internally.

  • TMWA protocol:

    • You can get to 1000000 of an item in your inventory by repeatedly adding up to 215-1 with @item BoneArrows 32000

    • All packets in TMWA are apparently 16-bit.

  • ML Hercules protocol: some packets use 32,some 16 bit amounts. Investigation may continue at later date.

test_1000000_arrows.png
test_1000000_arrows.png (20.18 KiB) Viewed 331 times

Idea: it might be easy enough (server-side change only) to enable storing multiple stacks of the same item. All packets use inventory indices and thus it's unambigous which stack you are taking from. When adding an item, the stack spill-over would happen server-side. Thoughts?

Post Reply