Skip to content

Implementation of import/export functionality for favourite servers list #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

itsneufox
Copy link
Contributor

@itsneufox itsneufox commented Mar 6, 2025

This PR adds functionality to export and import favorite server lists.

Changes:

  • Added two new buttons in the Advanced settings section:

    • Export favorites list to file
    • Import favorites list from file
  • Added necessary translation strings for both English and Portuguese languages

  • Included error handling for various scenarios:

    • No favorites to export
    • Invalid file format
    • File access errors

Details:

  • Export format uses JSON with a version compatibility marker (currently version 1) to allow for future format changes.

Example omp_servers.JSON:

{
  "version": 1,
  "servers": [
    {
      "ip": "99.999.999.999",
      "port": 7777,
      "name": "MACACO RP | 1",
      "password": ""
    },
    {
      "ip": "99.999.999.999",
      "port": 7777,
      "name": "MACACO RP | 2",
      "password": ""
    },
    {
      "ip": "99.999.999.999",
      "port": 7777,
      "name": "MACACO RP | 3",
      "password": ""
    },
    {
      "ip": "99.999.999.999",
      "port": 7777,
      "name": "MACACO RP | 4",
      "password": ""
    }
  ]
}

Video on how it works:

Note: Video represents an older commit.
Youtube video

Screenshot:

Screenshot 2025-03-06 005422

@itsneufox
Copy link
Contributor Author

itsneufox commented Mar 6, 2025

Also, as commented on discord, dll-syringe is broken on the latest rust nightly.

I used rustc 1.87.0-nightly (794c12416 2025-02-21)

@itsneufox
Copy link
Contributor Author

itsneufox commented Mar 6, 2025

As discussed on discord, removed server names to avoid encoding issues, also added fetchServers(true) to force an update to the list.

@itsneufox
Copy link
Contributor Author

image

🎉🎉
Now dll-syringe is fixed.

I want to thank my mother for believing in me and Dobby for letting me steal SAT source code...

Thank you.

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.

1 participant