WIP: Online mode#16
WIP: Online mode#16realDragonium wants to merge 3 commits intowvffle:masterfrom realDragonium:online-mode
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.
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.
Isn't there a way to avoid setting username/email in settings?
There was a problem hiding this comment.
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.
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.
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.
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) |
| setSettings(settings){ | ||
| this.settings = settings | ||
| }, |
| if(this.settings.server.target_server_is_online){ | ||
| playerInfo.username = this.settings.client.username | ||
| playerInfo.password = this.settings.client.password | ||
| } |
|
|
||
|
|
||
|
|
| this.proxyClient.on('session', (session) => { | ||
| // console.log(session) | ||
| }) |
There was a problem hiding this comment.
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.
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.
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: