Skip to content

Modernised website for easier use#2

Open
Joseleelsuper wants to merge 25 commits intofsih:gh-pagesfrom
Joseleelsuper:gh-pages
Open

Modernised website for easier use#2
Joseleelsuper wants to merge 25 commits intofsih:gh-pagesfrom
Joseleelsuper:gh-pages

Conversation

@Joseleelsuper
Copy link

Description

I recently set up a server with friends and had to investigate how to change the host to a 24/7 server.

I found your code and decided to update it to make it easier for people to change the host of their games.

The summary of the changes are:

  • New GUI.
  • Fixed a problem that prevented the correct parsing of the data on the old page.
  • Maintained legacy mode.
  • Now users will download a .zip file with their game folder with the modified files, a copy of the original file and other files if they exist.

If you have any questions, don't hesitate to ask so that we can merge this pr and help more people.

Images

script_use_case image

Video Tutorial

2025-07-16.18-48-02.mp4

- Added configuration module for global variables and settings.
- Created data processor module for handling save file data manipulation.
- Developed file handler module for file upload, processing, and download functionality.
- Introduced main module as the entry point for the application.
- Built UI controller module to manage user interface interactions and character display.
- Added utility functions for error handling, message display, and XML tag isolation.
- Refactored legacy code into a modern structure, supporting ZIP file handling and improved save file processing.
- Translated comments and documentation from Spanish to English across multiple modules for better accessibility.
- Improved code readability by standardizing import statements and removing unnecessary comments.
- Enhanced error handling and user feedback messages to provide clearer guidance.
- Updated UI handling functions to ensure compatibility with the new structure.
- Refactored file handling logic to streamline the process of uploading and processing save files.
- Improved the ZIP file generation process to ensure better compression and organization of modified files.
@fsih
Copy link
Owner

fsih commented Jul 16, 2025

Wow, this looks incredible! Thank you for doing all this, so glad that my old code is still helping people! I'll take a look when I get a chance.

@Joseleelsuper
Copy link
Author

I'm really glad you like it!

I just modified the code again to fix a bug that prevented the modified content from being written to the .zip that the user downloads.

I didn't post it before, but you can see the live version at this URL of my fork: https://joseleelsuper.github.io/stardew-host-swap/

In addition, there are certain events and mails that are also transferred to try to fix possible errors. I discovered this by having the artificial intelligence fully parse the XML and how it works, so I don't have proof that it works completely correctly. Anyway, these are the changes:

Main structural changes

  • Player tags: Conversion between and or
  • Unique identifiers: Exchange of between old and new host

Progression data transferred

  • Received mail: Content inside , especially:

    • Community Centre related items (ccDoorUnlock, ccPantry, etc.)
    • Joja items (jojaPantry, jojaFishTank, etc.)
    • Joja membership status (JojaMember)
    • Important mail (spring_2_1 to unlock Willy's shop)
  • Viewed events: Content within , including:

    • Event #65 (choice between bats or mushrooms)
    • Events #1590166 and #897405 (Marnie gives you a pet)
    • Events #611439, #191393, #502261 (related to Community Centre/Joja)

Housing data

  • Home location: is set to "FarmHouse"
  • House upgrade level: is transferred to the new host
  • Upgrade waiting time: is transferred to the new host.

Copy link
Owner

@fsih fsih left a comment

Choose a reason for hiding this comment

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

Thank you for all your contributions here, the new interface looks great! And the video tutorials will be a huge help for a lot of people.

My initial thinking behind having players copy and paste text was so that they wouldn't be scared that they were downloading a virus or something, but it's probably fine.

I actually haven't played Stardew Valley in a really long time, so I'll trust that you tested out the transferred save file in-game. If you want, I can add you as a manager of this repo, since after this pull request you would own it more than I do :p

I did test my 7-years-old save files on https://joseleelsuper.github.io/stardew-host-swap/. The zip file seemed to work well, but when I used the legacy mode, the interface froze after the processing was completed, and my Chrome tab crashed. I didn't see any errors in the console. I vaguely remember encountering this issue with the old site, and fixing it by emptying out the input field. You could also possibly ditch the legacy mode, or keep the old site around and simply link to it from the new one.

<li>New host may get outdated mail</li>
</ul>

<h3>Issues Fixed</h3>
Copy link
Owner

Choose a reason for hiding this comment

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

You could add your new fixes here, like house upgrade level

Copy link
Author

Choose a reason for hiding this comment

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

Yes sir. 🫡

const farmhandContent = farmhandMatch[1];
const nameMatch = farmhandContent.match(/<name>(.*?)<\/name>/);

if (nameMatch && nameMatch[1] !== "Axe" && nameMatch[1] !== "Pickaxe") {
Copy link
Owner

Choose a reason for hiding this comment

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

Why the special cases here? What happens when farmhands are named "axe" and "pickaxe"?

Copy link
Author

Choose a reason for hiding this comment

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

At first, I thought it was a regex error that I had generated by not programming it correctly.

When I realised, it seemed that the empty slots in a save game were responsible for generating the ‘users’ called the tools.

This will be a bug that I should keep an eye on, not only because I probably missed something, but also because if the steam user called ‘Axe’ comes, he might freak out because he doesn't see his name.

@Joseleelsuper
Copy link
Author

Description

I have fixed the memory overflow errors that occurred when trying to paste the XML directly with legacy paste (my fault, I didn't optimise it well and it is possible that in some devices it failed, as in your case).

Also, I decided to add the improved legacy copy. With these changes, the user will be able to copy directly the XML changes from the Farm XML and SaveGameInfo XML.

Images

image image

@Joseleelsuper
Copy link
Author

For now, I think I cover all the critical elements, in this last update I added a few more console logs and errors, apart from having more tags transferred between the new host and the old one.

From now on, the only thing left for me to do is to make a final long video of the correct functioning of the page with all its functionalities and wait for some user to find bugs.

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