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