-
-
Notifications
You must be signed in to change notification settings - Fork 7
WIP: Online mode #16
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
base: master
Are you sure you want to change the base?
WIP: Online mode #16
Conversation
added login credentials for creating a client.
…acket-debugger into online-mode � Conflicts: � lib/config.js
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.
wvffle
left a comment
There was a problem hiding this 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
| client: { | ||
| username: 'username/email', | ||
| password: 'password123' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxyInstance.settings = data
| setSettings(settings){ | ||
| this.settings = settings | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded
| if(this.settings.server.target_server_is_online){ | ||
| playerInfo.username = this.settings.client.username | ||
| playerInfo.password = this.settings.client.password | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newlines around this section
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix multiple newlines
| this.proxyClient.on('session', (session) => { | ||
| // console.log(session) | ||
| }) |
There was a problem hiding this comment.
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
| <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"> |
There was a problem hiding this comment.
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...
wvffle
left a comment
There was a problem hiding this 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
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:
Things that already work: