Fixed login issue
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="login-page" style="padding: 10% 0 0;">
|
<div class="login-page" style="padding: 10% 0 0;">
|
||||||
<div class="form">
|
<div class="form">
|
||||||
<h2 id="playerName"></h2>
|
|
||||||
<div class="isa_error">
|
<div class="isa_error">
|
||||||
ERROR TEXT
|
ERROR TEXT
|
||||||
</div>
|
</div>
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="package://Dependencies/jquery-3.3.1.min.js"></script>
|
<script src="package://Dependencies/jquery-3.3.1.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(".message a").click(function () {
|
$(".message a").click(() => {
|
||||||
$(".form-l").animate({ height: "toggle", opacity: "toggle" }, "slow");
|
$(".form-l").animate({ height: "toggle", opacity: "toggle" }, "slow");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -43,13 +42,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function showError(error) {
|
function showError(error) {
|
||||||
$(".isa_error").html(error);
|
$(".isa_error").html(error.toString());
|
||||||
$(".isa_error").slideDown();
|
$(".isa_error").slideDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendDisplayname(name) {
|
|
||||||
$("h2#playerName").text(name);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<script src="login.js" type="text/javascript"></script>
|
<script src="login.js" type="text/javascript"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function registerPlayer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (password !== passwordRepeat) {
|
if (password !== passwordRepeat) {
|
||||||
showError("Die beiden Passwörter stimmen nicht überein!")
|
showError("Die beiden Passwörter stimmen nicht überein!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,11 @@ mp.events.add('registerSuccess', () => {
|
|||||||
mp.game.ui.displayHud(true);
|
mp.game.ui.displayHud(true);
|
||||||
});
|
});
|
||||||
mp.events.add('loginSuccess', () => {
|
mp.events.add('loginSuccess', () => {
|
||||||
mp.gui.chat.push("Erfolgreich eingeloggt!")
|
mp.gui.chat.push("Erfolgreich eingeloggt!");
|
||||||
if (loginBrowser)
|
if (loginBrowser)
|
||||||
{
|
{
|
||||||
loginBrowser.destroy();
|
loginBrowser.destroy();
|
||||||
|
loginBrowser = undefined;
|
||||||
}
|
}
|
||||||
mp.gui.cursor.show(false, false);
|
mp.gui.cursor.show(false, false);
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
@@ -47,19 +48,13 @@ mp.events.add('loginSuccess', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('loginFail', (reason) => {
|
mp.events.add('loginFail', (reason) => {
|
||||||
|
|
||||||
showCefError(reason);
|
showCefError(reason);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('loginDeny', (reason) => {
|
mp.events.add('loginDeny', (reason) => {
|
||||||
if (loginBrowser) {
|
|
||||||
loginBrowser.destroy();
|
|
||||||
}
|
|
||||||
mp.gui.cursor.show(false, false);
|
mp.gui.cursor.show(false, false);
|
||||||
mp.gui.chat.activate(true);
|
mp.gui.chat.activate(true);
|
||||||
showCefError(reason);
|
showCefError(reason.toString());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add('registerFail', (reason) => {
|
mp.events.add('registerFail', (reason) => {
|
||||||
@@ -87,9 +82,5 @@ mp.events.add('disableLogin', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function showCefError(error) {
|
function showCefError(error) {
|
||||||
try {
|
|
||||||
loginBrowser.execute(`showError('${error}')`);
|
loginBrowser.execute(`showError('${error}')`);
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user