Over 32767 items in storage

Content and general development discussion, including quest scripts and server code. The Mana World is a project comprising the original tmwAthena server & a designated improved engine server based on evolHercules


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board. Its current use is for the continued development of the server and game it has always served: The Mana World.

Post Reply
ThinkSome
Moubootaur Legends
Moubootaur Legends
Posts: 123
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 6088 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