Skip to content

Commit

Permalink
added bunch of qol functionalities, fixing bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fefedu973 committed Jun 24, 2023
1 parent 5d61306 commit 4b0bb78
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 1,470 deletions.
1,465 changes: 86 additions & 1,379 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fefe_du_973-launcher",
"preductname": "Fefe_du_973 Launcher",
"version": "1.3.5",
"version": "1.3.6",
"description": "Launcher minecraft custom pour le serveur minecraft Fefe_du_973 avec modpack (premium + crack)",
"main": "src/app.js",
"author": "Autheur et créateur principal : Luuxis - Fork : Fefe_du_973",
Expand All @@ -20,7 +20,7 @@
},
"dependencies": {
"electron-updater": "^5.0.1",
"minecraft-java-core": "^2.1.1",
"minecraft-java-core": "^3.5.7",
"node-fetch": "^2.6.7"
},
"devDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions src/assets/css/launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ img {
opacity: 0;
z-index: 0;
pointer-events: none;
transition: opacity .2s;
}

.active {
Expand All @@ -157,6 +158,10 @@ img {
pointer-events: all;
}

.transition {
opacity:0;
}

.rotation {
animation: rotation 5s infinite linear;
}
Expand Down
2 changes: 2 additions & 0 deletions src/assets/css/panels/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
pointer-events: none;
background: transparent;
max-width: 2000px;
transition: opacity .2s;
}

.active-tab-content {
Expand Down Expand Up @@ -158,6 +159,7 @@
transition: 0.2s ease-in-out;
cursor: pointer;
border: 4px solid transparent;
color: #F1F1F1;
}

.account:hover {
Expand Down
17 changes: 16 additions & 1 deletion src/assets/js/panels/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ class Home {
}
}

if (!launcherSettings.launcher.autoConnect) {
//delete inside this.config.game_args array the element --server and the element that comes after him and the element --port and the element that comes after him if they exist
let indexServer = this.config.game_args.indexOf('--server');
if (indexServer > -1) {
this.config.game_args.splice(indexServer, 2);
}
let indexPort = this.config.game_args.indexOf('--port');
if (indexPort > -1) {
this.config.game_args.splice(indexPort, 2);
}

console.log(this.config.game_args)
}

let opts = {
url: this.config.game_url === "" || this.config.game_url === undefined ? `${urlpkg}/files` : this.config.game_url,
authenticator: account,
Expand All @@ -120,7 +134,8 @@ class Home {
detached: launcherSettings.launcher.close === 'close-all' ? false : true,
java: this.config.java,
javapath: javaPath.path,
args: [...javaArgs.args, ...this.config.game_args],
JVM_ARGS: [...javaArgs.args],
GAME_ARGS: [...this.config.game_args],
screen,
modde: this.config.modde,
verify: this.config.verify,
Expand Down
135 changes: 71 additions & 64 deletions src/assets/js/panels/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ class Login {
name: account_connect.name,
refresh_token: account_connect.refresh_token,
user_properties: account_connect.user_properties,
meta: {
type: account_connect.meta.type,
demo: account_connect.meta.demo
}
meta: account_connect.meta
}

let profile = {
Expand Down Expand Up @@ -94,7 +91,7 @@ class Login {
})
}

loginMojang() {
async loginMojang() {
let mailInput = document.querySelector('.Mail')
let passwordInput = document.querySelector('.Password')
let cancelMojangBtn = document.querySelector('.cancel-mojang')
Expand All @@ -112,7 +109,7 @@ class Login {
document.querySelector(".login-card-mojang").style.display = "none";
})

loginBtn.addEventListener("click", () => {
loginBtn.addEventListener("click", async () => {
cancelMojangBtn.disabled = true;
loginBtn.disabled = true;
mailInput.disabled = true;
Expand All @@ -138,54 +135,59 @@ class Login {
return
}

Mojang.getAuth(mailInput.value, passwordInput.value).then(account_connect => {
let account = {
access_token: account_connect.access_token,
client_token: account_connect.client_token,
uuid: account_connect.uuid,
name: account_connect.name,
user_properties: account_connect.user_properties,
meta: {
type: account_connect.meta.type,
offline: account_connect.meta.offline
}
}

this.database.add(account, 'accounts')
this.database.update({ uuid: "1234", selected: account.uuid }, 'accounts-selected');

addAccount(account)
accountSelect(account.uuid)
changePanel("home");
let account_connect = await Mojang.login(mailInput.value, passwordInput.value)

cancelMojangBtn.disabled = false;
cancelMojangBtn.click();
loginBtn.disabled = false;
mailInput.disabled = false;
passwordInput.disabled = false;
loginBtn.style.display = "none";
}).catch(err => {
if (account_connect == null || account_connect.error) {
console.log(err)
cancelMojangBtn.disabled = false;
loginBtn.disabled = false;
mailInput.disabled = false;
passwordInput.disabled = false;
infoLogin.innerHTML = 'Adresse E-mail ou mot de passe invalide'
})
return
}

let account = {
access_token: account_connect.access_token,
client_token: account_connect.client_token,
uuid: account_connect.uuid,
name: account_connect.name,
user_properties: account_connect.user_properties,
meta: {
type: account_connect.meta.type,
offline: account_connect.meta.offline
}
}

this.database.add(account, 'accounts')
this.database.update({ uuid: "1234", selected: account.uuid }, 'accounts-selected');

addAccount(account)
accountSelect(account.uuid)
changePanel("home");

cancelMojangBtn.disabled = false;
cancelMojangBtn.click();
mailInput.value = "";
loginBtn.disabled = false;
mailInput.disabled = false;
passwordInput.disabled = false;
loginBtn.style.display = "block";
infoLogin.innerHTML = " ";
})
}

loginOffline() {
async loginOffline() {
let mailInput = document.querySelector('.Mail')
let passwordInput = document.querySelector('.Password')
let cancelMojangBtn = document.querySelector('.cancel-mojang')
let infoLogin = document.querySelector('.info-login')
let loginBtn = document.querySelector(".login-btn")
let mojangBtn = document.querySelector('.mojang')

mojangBtn.innerHTML = "Compte Crack"
mojangBtn.innerHTML = "Crack"

mojangBtn.addEventListener("click", () => {
document.querySelector(".login-btn").style.display = "block";
document.querySelector(".login-card").style.display = "none";
document.querySelector(".login-card-mojang").style.display = "block";
})
Expand All @@ -195,7 +197,7 @@ class Login {
document.querySelector(".login-card-mojang").style.display = "none";
})

loginBtn.addEventListener("click", () => {
loginBtn.addEventListener("click", async () => {
cancelMojangBtn.disabled = true;
loginBtn.disabled = true;
mailInput.disabled = true;
Expand All @@ -221,40 +223,45 @@ class Login {
return
}

Mojang.getAuth(mailInput.value, passwordInput.value).then(async account_connect => {
let account = {
access_token: account_connect.access_token,
client_token: account_connect.client_token,
uuid: account_connect.uuid,
name: account_connect.name,
user_properties: account_connect.user_properties,
meta: {
type: account_connect.meta.type,
offline: account_connect.meta.offline
}
}
let account_connect = await Mojang.login(mailInput.value, passwordInput.value)

this.database.add(account, 'accounts')
this.database.update({ uuid: "1234", selected: account.uuid }, 'accounts-selected');

addAccount(account)
accountSelect(account.uuid)
changePanel("home");

cancelMojangBtn.disabled = false;
cancelMojangBtn.click();
loginBtn.disabled = false;
mailInput.disabled = false;
passwordInput.disabled = false;
loginBtn.style.display = "none";
}).catch(err => {
if (account_connect == null || account_connect.error) {
console.log(err)
cancelMojangBtn.disabled = false;
loginBtn.disabled = false;
mailInput.disabled = false;
passwordInput.disabled = false;
infoLogin.innerHTML = 'Adresse E-mail ou mot de passe invalide'
})
return
}

let account = {
access_token: "null",
client_token: "null",
uuid: account_connect.uuid,
name: account_connect.name,
user_properties: account_connect.user_properties,
meta: {
type: account_connect.meta.type,
offline: true
}
}

this.database.add(account, 'accounts')
this.database.update({ uuid: "1234", selected: account.uuid }, 'accounts-selected');

addAccount(account)
accountSelect(account.uuid)
changePanel("home");

cancelMojangBtn.disabled = false;
cancelMojangBtn.click();
mailInput.value = "";
loginBtn.disabled = false;
mailInput.disabled = false;
passwordInput.disabled = false;
loginBtn.style.display = "block";
infoLogin.innerHTML = " ";
})
}
}
Expand Down
Loading

0 comments on commit 4b0bb78

Please sign in to comment.