Skip to content
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

[Discussion] Alternatives to current server finder system #3

Closed
ItzSwirlz opened this issue Jan 28, 2022 · 2 comments
Closed

[Discussion] Alternatives to current server finder system #3

ItzSwirlz opened this issue Jan 28, 2022 · 2 comments

Comments

@ItzSwirlz
Copy link
Owner

Currently, we check for a specifically crafted input and warp the user to the server based on that. However we could also

a) put it into a yml/json file
b) do a and then use a json downloader and parser

The issue with B is that I've tried doing something similar before; I think I used HttpURLConnection in https://github.com/ItzSwirlz/PitPandaMod/blob/main/src/main/java/com/github/itzswirlz/PitPandaMod/api/APIFetcher.java but it causes the game to basically freeze for some time as it downloads. Also, if GitHub is down then the mod would not work. A local file would be ideal but it is probably easier to just leave it to a switch statement.

@SmylerMC
Copy link
Contributor

I can tell you how Terramap handles map styles, maybe that can give you some ideas.

  1. When the game starts, it loads a basic set of backup styles from the jar.
  2. It then looks-up the domain name mapstyles.terramap.thesmyler.fr for a TXT record, and if that record exists and is a url redirect, it downloads the file from the said url using Terra++ async http methods and loads styles from there.
  3. It then loads a user config file from the config directory.
  4. Servers and proxy can latter send additional configurations, but is irrelevant in your case.

@ItzSwirlz ItzSwirlz pinned this issue Feb 18, 2022
@ItzSwirlz
Copy link
Owner Author

We use a json file now

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

No branches or pull requests

2 participants