Skip to content

Save file versioning support + usecases

Player Name requested to merge PlayerName/2009scape:versioning into master

What has been done in this MR?

This MR adds a new "version" key to the player save file. It also adds a new login hook that can perform arbitrary tasks if the save file's current version is less than ServerConstants.CURRENT_SAVEFILE_VERSION, and subsequently updates the player's save version number. The idea is that this will be used if future MRs need to make one-time changes to save files. Four cases are already used in this MR:

  • Now that !1762 (merged) has made the master crafter give out hoods as well, players who own crafting capes but no hoods (i.e., players who most likely bought their crafting capes back when the hood was not obtainable yet) will be given the complementary hoods.
    • Implemented a new function addItemOrBank to make this possible, based on the already existing login deequip listener (the stuff that removes your barrows gloves every time oven releases a new quest) and
    • Ported the login deequip listener as well as getting the kitten when Gertrude's Cat completes to use this new function
  • Unlock Surok's Theme for players who are eligible, now that we have an open MR making it available during the quest (but not after)
  • Migrate the following attributes - "/save:drilldemon:original-loc","/save:evilbob:prevlocation","/save:freakyf:location","supexam:loc" - to a new, common, name "/save:original-loc"
    • Also update the grave logic to drop the grave at this original location if you die inside the event (e.g. due to poison). Fixes #1750 (closed)
    • Also restore the interface buttons and the logout button if you die inside a random event
    • Also disable firing a murder message if the killing damage is attributed to yourself. Fixes "Player Name has murdered Player Name" news message if Player Name died from unattributed damage, such as from the swarm of bugs that attacks you if you're in a dark cave without a light source
  • Set the missing tutorial island varp from !1793 (merged). This turns the Learning the Ropes quest green and makes it possible to collapse the interface stones (inventory, spellbook, etc etc) in resizeable HD mode.

What should testers check?

  • When you first log in after this MR is applied, you get a message informing you of the ongoing migration
  • If eligible, you will receive crafting hoods and unlock Surok's Theme
  • Use ::noobme to make yourself ineligible to wear something you're currently wearing and relog to check that the deequip listener still works as it should. Also try completing Gertrude's Quest with a full inventory and a familiar out and confirm that the kitten gets sent to your bank.
  • Relog inside a random event and confirm that you still relog inside the random
  • Die inside a random event and confirm that your grave is where the random snatched you, not inside the random
  • Confirm that random events still teleport you back to your original spot as they should. Test Drill Demon, Evil Bob, Freaky Forester, and Surprise Exam.
  • Learning the ropes quest is green when you log in after this MR.
  • I have tested these changes thoroughly.
  • I used the relevant Zaros tool for any JSON edits where possible, and have attached screenshots of any changes.
Edited by Player Name

Merge request reports