HeliosLauncher icon indicating copy to clipboard operation
HeliosLauncher copied to clipboard

Implementation for secret server codes for hidden servers

Open TheFlash787 opened this issue 5 years ago • 7 comments

Foreword: The screenshots used here are from my own fork, purely due to things being easier to read because I've upscaled most elements in the launcher. The functionality is exactly the same, I took these commits straight from my personal build.

What's This?

This is a new system that allows server administrators to attach a serverCode to each server in the distribution.json file.* When a code is attached to a server (as long as it's not empty), it will no longer show for all players on the launcher, and will only be available once your launcher has the correct 'server code' specified, similar to a password. Once you have a valid code in your launcher, the pack will show.

*Nebula will need an update to be able to use a serverCode key inside of the servermeta.json

This is useful for communities that might want to have beta testers for a modpack/server, or a 'staff only' server, or maybe you have that special someone who you would like to play RLCraft with on your own private server.

Okay, Go Ahead

Hey! I've been spending some time implementing this system, which was initially just a text box where you enter a code which will then be checked against with the other servers, but is now a dynamic styled list that allows you to add a number of server codes which can be removed at any time.

In the Launcher section of your settings, you will now see a Your Server Codes section which will contain an empty field and a description, with an Add Code button beside it:
image

(Example) If you have been given given access to a server for MC Eternal let's say, you can enter that code into the field and press Add Code, which will store the code as part of a configuration in your launcher and then display the list to you in the launcher. After this point, MC Eternal will now be available for you to navigate to inside of the server list:
image

You can remove your codes by pressing the Remove button on the opposite side of the list: image

From that screenshot, you can also see that you can easily identify between valid and invalid codes, due to the colour difference and the small coloured dot beside them. Valid server codes will also tell you which server they are valid for.

If your code becomes invalid because the server administrator has changed the code, you will will no longer be able to view that server in your server navigation overlay (because it no longer matches the code in the distribution.json)
image

What about if the player played it last and it's already selected? If a player already had a server selected that they no longer have access for, there's no need to worry. Upon clicking play, the launcher will check all available codes to see if the player has permission for that particular server, and if they don't, they will be met with this error overlay, where they will be prompted to switch servers:
image

Thanks

I hope this is a welcomed feature, and made use of since it seems pretty neat. Thank you!

TheFlash787 avatar Aug 13 '20 09:08 TheFlash787

Before we consider this, I'm going to add support for a multiple-server-code (i.e. if multiple servers have the same code, it'll show all servers that the code is applicable for, rather than just the first one it finds)

TheFlash787 avatar Aug 13 '20 21:08 TheFlash787

I've implemented support for showing multiple servers under one code.

image

TheFlash787 avatar Aug 14 '20 01:08 TheFlash787

that a good feature but i think there is a problem cause the serverCode is in the distribution.json and the distribution.json is downloaded to appdata\roaming\LauncherName so any player can have access to the code

alduish avatar May 18 '21 15:05 alduish

that a good feature but i think there is a problem cause the serverCode is in the distribution.json and the distribution.json is downloaded to appdata\roaming\LauncherName so any player can have access to the code

The only suggestion I can give is authing based on players MC UUID and holding the verifying config in a remote place i.e Helios pings off to your server checks if your MC UUID is in the list for access to the pack and if it's not then you get returned an invalid code otherwise if you are in the list it works as a valid code.

SirOMGitsYOU avatar Jul 09 '21 22:07 SirOMGitsYOU

that a good feature but i think there is a problem cause the serverCode is in the distribution.json and the distribution.json is downloaded to appdata\roaming\LauncherName so any player can have access to the code

The only suggestion I can give is authing based on players MC UUID and holding the verifying config in a remote place i.e Helios pings off to your server checks if your MC UUID is in the list for access to the pack and if it's not then you get returned an invalid code otherwise if you are in the list it works as a valid code.

or when enter a code make a request to a database where there is all the code and have nothing in the distro.json just make it work server way and not client way

alduish avatar Jul 12 '21 10:07 alduish

that a good feature but i think there is a problem cause the serverCode is in the distribution.json and the distribution.json is downloaded to appdata\roaming\LauncherName so any player can have access to the code

The only suggestion I can give is authing based on players MC UUID and holding the verifying config in a remote place i.e Helios pings off to your server checks if your MC UUID is in the list for access to the pack and if it's not then you get returned an invalid code otherwise if you are in the list it works as a valid code.

or when enter a code make a request to a database where there is all the code and have nothing in the distro.json just make it work server way and not client way

Yeah that works too, my solution was just an easy quick fix

SirOMGitsYOU avatar Jul 12 '21 10:07 SirOMGitsYOU

@TheFlash787 Tried to re-implement this back onto my launcher after updating with the latest changes from Helios, and it looks like it no longer works I am getting an error about PrepareSettings not being defined, any assistance on this PR would be great! :D

EDIT: I decided to use this as a learning opportunity and have got it working properly on the latest version again :) https://github.com/siromgitsyou/HeliosLauncher/tree/server-codes I can open a PR if needed for this :)

SirOMGitsYOU avatar Mar 24 '22 10:03 SirOMGitsYOU