mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-22 12:16:21 +03:00
Closes #69
This commit is contained in:
parent
c5a0a6c72c
commit
7a7c19af0c
2 changed files with 20 additions and 4 deletions
|
@ -10,7 +10,7 @@ module.exports.getAuth = function (username, password) {
|
||||||
client_token: uuid(),
|
client_token: uuid(),
|
||||||
uuid: uuid(),
|
uuid: uuid(),
|
||||||
name: username,
|
name: username,
|
||||||
user_properties: JSON.stringify({})
|
user_properties: '{}'
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolve(user)
|
return resolve(user)
|
||||||
|
@ -42,7 +42,7 @@ module.exports.getAuth = function (username, password) {
|
||||||
uuid: body.selectedProfile.id,
|
uuid: body.selectedProfile.id,
|
||||||
name: body.selectedProfile.name,
|
name: body.selectedProfile.name,
|
||||||
selected_profile: body.selectedProfile,
|
selected_profile: body.selectedProfile,
|
||||||
user_properties: JSON.stringify(body.user.properties || {})
|
user_properties: parsePropts(body.user.properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(userProfile)
|
resolve(userProfile)
|
||||||
|
@ -92,7 +92,7 @@ module.exports.refreshAuth = function (accessToken, clientToken, selectedProfile
|
||||||
client_token: uuid(),
|
client_token: uuid(),
|
||||||
uuid: body.selectedProfile.id,
|
uuid: body.selectedProfile.id,
|
||||||
name: body.selectedProfile.name,
|
name: body.selectedProfile.name,
|
||||||
user_properties: JSON.stringify(body.user.properties || {})
|
user_properties: parsePropts(body.user.properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(userProfile)
|
resolve(userProfile)
|
||||||
|
@ -141,3 +141,19 @@ module.exports.signOut = function (username, password) {
|
||||||
module.exports.changeApiUrl = function (url) {
|
module.exports.changeApiUrl = function (url) {
|
||||||
api_url = url
|
api_url = url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parsePropts (array) {
|
||||||
|
if (array) {
|
||||||
|
const newObj = {}
|
||||||
|
for (const entry of array) {
|
||||||
|
if (newObj[entry.name]) {
|
||||||
|
newObj[entry.name].push(entry.value)
|
||||||
|
} else {
|
||||||
|
newObj[entry.name] = [entry.value]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return JSON.stringify(newObj)
|
||||||
|
} else {
|
||||||
|
return '{}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "minecraft-launcher-core",
|
"name": "minecraft-launcher-core",
|
||||||
"version": "3.16.2",
|
"version": "3.16.3",
|
||||||
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
|
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue