Skip to content

Conversation

@realDragonium
Copy link
Contributor

Hey! Here I am again.

Its not completely working how I want it to yet. But the basic is here. When you have time could you check it out and let me know what you think about it? I'm also seeing some benefits in separating the App.vue and making more components out of it and in starting/controlling the proxy from the web-server. But those should probably be in another PR.

Current problem I know about and which needs to be worked on are:

  • making the server restart if you change targetHost
  • passing the settings correctly from web to proxy
  • trying to make it so that you dont have to relog if you want to join another server if you login with a online account in minecraft self.
  • when you login into a online-mode server you see yourself as alexa skin. But other people see you as your normal skin.

Things that already work:

  • capable of changing minecraft version on settings page
  • joining servers in online-mode
  • changing target on settings page
  • filling in your login credentials

added login credentials for creating a client.
You can change your version now and
WIP for:
 - making the server restart if you change targetHost
 - passing the settings correctly from web to proxy
 - trying to make it so that you dont have to relog if you want to join another server if you login with a online account in minecraft self.
Copy link
Owner

@wvffle wvffle left a comment

Choose a reason for hiding this comment

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

I'm wondering if we can skip configuring username and password in config

Comment on lines +52 to +54
client: {
username: 'username/email',
password: 'password123'
Copy link
Owner

Choose a reason for hiding this comment

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

Isn't there a way to avoid setting username/email in settings?

Copy link
Contributor Author

@realDragonium realDragonium Aug 5, 2020

Choose a reason for hiding this comment

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

yea, its possible. But for that you need to have the username, clientToken and accessToken. So that means that we would need to read the launcher_profiles.json which is located in your .minecraft folder.

Copy link
Owner

Choose a reason for hiding this comment

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

Reading .minecraft is as bad as hell. For example multimc keeps separate .minecraft per instance. I'll look into the client implementation to check if there's a way to skip the credentials. For now leave it be.

Copy link
Contributor Author

@realDragonium realDragonium Aug 6, 2020

Choose a reason for hiding this comment

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

Edit: using the username, clienttoken and accesstoken is the way when you want to skip the credentials. Underneath I used credentials but it should have been validation which makes it not important since you said that you wanted to skip the credentials and not the validation.
--end edit

Not skipping the credentials is the whole point of adding an option to join online mode servers since thats how the server can validate or your account is real or not cracked?

What if we make the path to the launcher_profile.json as config value so you can change it. And make the creation of a client more dynamic so you can set the config after you have started up the proxy.
Or maybe just start the webserver and start the proxy after setting the file path if you want to use online mode servers?

Copy link
Owner

Choose a reason for hiding this comment

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

launcher_profile.json path as config is too much. I mean that this tool should be as simple as we can make it. Let's leave it be right now, I'll make an issue after merging it. It's not a must have to skip the credentials it's just that I don't really like an idea of putting my minecraft credentials to some tool I found on the internet. For a regular user it may (or may not) sound sketchy.

I'm totally aware that those credentials won't leak if you host it locally. But let's be honest there is a chance that someone would use it over the net/on exposed port. In theory, after enabling the online-mode setting, inputting the credentials and saving, we could remove the username and password from the frontend entirely. Next time the settings will be opened, the password field will be filled with some random string, and username with (idk, maybe) email.hidden@example.com, both inputs disabled and a text with an open padlock icon saying 🔓 Change credentials or something like that.

Second option, the one I'm more convinced to is to make the credentials as a server side settings. No inputs in the frontend, just in the server config file.

}

if (data.server.host !== config.server.host || data.server.proxyPort !== config.server.proxyPort) {
proxyInstance.setSettings(data)
Copy link
Owner

Choose a reason for hiding this comment

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

proxyInstance.settings = data

Comment on lines +18 to +20
setSettings(settings){
this.settings = settings
},
Copy link
Owner

Choose a reason for hiding this comment

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

Unneeded

Comment on lines +42 to +45
if(this.settings.server.target_server_is_online){
playerInfo.username = this.settings.client.username
playerInfo.password = this.settings.client.password
}
Copy link
Owner

Choose a reason for hiding this comment

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

Newlines around this section

Comment on lines +51 to +53



Copy link
Owner

Choose a reason for hiding this comment

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

Fix multiple newlines

Comment on lines +112 to +114
this.proxyClient.on('session', (session) => {
// console.log(session)
})
Copy link
Owner

Choose a reason for hiding this comment

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

Is this block necessary or is it just for debugging

Comment on lines +29 to +31
<input v-model='settings.client.username' type="text" placeholder="Username" class="bg-white border-b-2 focus:border-teal-400 focus:outline-none rounded py-2 px-4 block w-full appearance-none leading-normal placeholder-gray-600 focus:shadow">
<p class="mb-1 mt-3">Password: </p>
<input v-model='settings.client.password' type="text" placeholder="Pa$$w0rd123" class="bg-white border-b-2 focus:border-teal-400 focus:outline-none rounded py-2 px-4 block w-full appearance-none leading-normal placeholder-gray-600 focus:shadow">
Copy link
Owner

Choose a reason for hiding this comment

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

Those should be server side, clients be exposed to the web in some rare cases...

Copy link
Owner

@wvffle wvffle left a comment

Choose a reason for hiding this comment

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

Also missing:

  • password show/hide button
  • hidding username and password inputs when online-mode is disabled

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