Skip to content

Make tp tubes use mod storage with prefixed keys#179

Merged
wsor4035 merged 3 commits intomt-mods:masterfrom
Watilin:tptube-storage-prefix
Dec 25, 2025
Merged

Make tp tubes use mod storage with prefixed keys#179
wsor4035 merged 3 commits intomt-mods:masterfrom
Watilin:tptube-storage-prefix

Conversation

@Watilin
Copy link
Contributor

@Watilin Watilin commented Nov 30, 2025

Change every call to storage:* to use prefixed keys. Also cleans up previous prefix-less keys upon migrating.
It is worth noting that this might inadvertently erase keys set by other parts of Pipeworks if those keys happen to match the position hash of an existing teleport tube. But I assume that it won't happen, because I trust that nobody will use prefix-less keys in future extensions of Pipeworks.

Fixes #177.

@Watilin Watilin marked this pull request as draft December 1, 2025 12:53
@Watilin
Copy link
Contributor Author

Watilin commented Dec 1, 2025

Whoops, just found a bug with negative z coordinates. Position hashes lose precision when converted to string. Fixing this in a minute ^^"

@Watilin Watilin marked this pull request as ready for review December 1, 2025 13:36
@SwissalpS
Copy link
Contributor

SwissalpS commented Dec 20, 2025

Edit: nvm this part, mod storage doesn't work like that

see my comment in #177
My suggestion there would require periodic saving of the already cached tp-tube-db to mod storage. (Also at shutdown)

In essence I'm looking for a way to minimize string manipulations. Unfortunately the storage api doesn't seem to allow us to use an entirely separate storage object.

Copy link
Member

@BuckarooBanzay BuckarooBanzay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, didn't test though

@wsor4035 wsor4035 merged commit 62b966a into mt-mods:master Dec 25, 2025
1 check passed
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.

Teleport tubes forbid other uses of mod storage

4 participants