Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Small changes
Dieser Commit ist enthalten in:
Ursprung
45596a87a9
Commit
9500da2ef0
@ -77,7 +77,7 @@ public class FormCache {
|
|||||||
|
|
||||||
Consumer<String> responseConsumer = form.getResponseHandler();
|
Consumer<String> responseConsumer = form.getResponseHandler();
|
||||||
if (responseConsumer != null) {
|
if (responseConsumer != null) {
|
||||||
responseConsumer.accept(response.getFormData().trim());
|
responseConsumer.accept(response.getFormData());
|
||||||
}
|
}
|
||||||
|
|
||||||
removeWindow(response.getFormId());
|
removeWindow(response.getFormId());
|
||||||
|
@ -154,17 +154,15 @@ public class LoginEncryptionUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void buildAndShowLoginWindow(GeyserSession session) {
|
public static void buildAndShowLoginWindow(GeyserSession session) {
|
||||||
String userLanguage = session.getClientData().getLanguageCode();
|
|
||||||
|
|
||||||
session.sendForm(
|
session.sendForm(
|
||||||
SimpleForm.builder()
|
SimpleForm.builder()
|
||||||
.translator(LanguageUtils::getPlayerLocaleString, userLanguage)
|
.translator(LanguageUtils::getPlayerLocaleString, session.getLocale())
|
||||||
.title("geyser.auth.login.form.notice.title")
|
.title("geyser.auth.login.form.notice.title")
|
||||||
.content("geyser.auth.login.form.notice.desc")
|
.content("geyser.auth.login.form.notice.desc")
|
||||||
.button("geyser.auth.login.form.notice.btn_login") // id = 0
|
.button("geyser.auth.login.form.notice.btn_login") // id = 0
|
||||||
.button("geyser.auth.login.form.notice.btn_disconnect")
|
.button("geyser.auth.login.form.notice.btn_disconnect")
|
||||||
.responseHandler((form, responseData) -> {
|
.responseHandler((form, responseData) -> {
|
||||||
SimpleFormResponse response = form.parseResponse(responseData.trim());
|
SimpleFormResponse response = form.parseResponse(responseData);
|
||||||
if (!response.isCorrect()) {
|
if (!response.isCorrect()) {
|
||||||
buildAndShowLoginWindow(session);
|
buildAndShowLoginWindow(session);
|
||||||
return;
|
return;
|
||||||
@ -180,16 +178,15 @@ public class LoginEncryptionUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void buildAndShowLoginDetailsWindow(GeyserSession session) {
|
public static void buildAndShowLoginDetailsWindow(GeyserSession session) {
|
||||||
String userLanguage = session.getLocale();
|
|
||||||
session.sendForm(
|
session.sendForm(
|
||||||
CustomForm.builder()
|
CustomForm.builder()
|
||||||
.translator(LanguageUtils::getPlayerLocaleString, userLanguage)
|
.translator(LanguageUtils::getPlayerLocaleString, session.getLocale())
|
||||||
.title("geyser.auth.login.form.details.title")
|
.title("geyser.auth.login.form.details.title")
|
||||||
.label("geyser.auth.login.form.details.desc")
|
.label("geyser.auth.login.form.details.desc")
|
||||||
.input("geyser.auth.login.form.details.email", "account@geysermc.org", "")
|
.input("geyser.auth.login.form.details.email", "account@geysermc.org", "")
|
||||||
.input("geyser.auth.login.form.details.pass", "123456", "")
|
.input("geyser.auth.login.form.details.pass", "123456", "")
|
||||||
.responseHandler((form, responseData) -> {
|
.responseHandler((form, responseData) -> {
|
||||||
CustomFormResponse response = form.parseResponse(responseData.trim());
|
CustomFormResponse response = form.parseResponse(responseData);
|
||||||
if (!response.isCorrect()) {
|
if (!response.isCorrect()) {
|
||||||
buildAndShowLoginDetailsWindow(session);
|
buildAndShowLoginDetailsWindow(session);
|
||||||
return;
|
return;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren