mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 16:32:14 +00:00
Merge branch 'development' of https://github.com/Grasscutters/Grasscutter into development
This commit is contained in:
commit
759cd6ae37
@ -1,4 +1,17 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
# This can also be replaced with another IP address.
|
# This can also be replaced with another IP address.
|
||||||
USE_SSL = True
|
USE_SSL = True
|
||||||
REMOTE_HOST = "127.0.0.1"
|
REMOTE_HOST = "localhost"
|
||||||
REMOTE_PORT = 443
|
REMOTE_PORT = 443
|
||||||
|
|
||||||
|
if os.getenv('MITM_REMOTE_HOST') != None:
|
||||||
|
REMOTE_HOST = os.getenv('MITM_REMOTE_HOST')
|
||||||
|
if os.getenv('MITM_REMOTE_PORT') != None:
|
||||||
|
REMOTE_PORT = int(os.getenv('MITM_REMOTE_PORT'))
|
||||||
|
if os.getenv('MITM_USE_SSL') != None:
|
||||||
|
USE_SSL = bool(os.getenv('MITM_USE_SSL'))
|
||||||
|
|
||||||
|
print('MITM Remote Host: ' + REMOTE_HOST)
|
||||||
|
print('MITM Remote Port: ' + str(REMOTE_PORT))
|
||||||
|
print('MITM Use SSL ' + str(USE_SSL))
|
||||||
|
@ -93,7 +93,7 @@ public final class Grasscutter {
|
|||||||
ResourceLoader.loadAll();
|
ResourceLoader.loadAll();
|
||||||
ScriptLoader.init();
|
ScriptLoader.init();
|
||||||
|
|
||||||
// Database
|
// Initialize database.
|
||||||
DatabaseManager.initialize();
|
DatabaseManager.initialize();
|
||||||
|
|
||||||
// Create server instances.
|
// Create server instances.
|
||||||
|
@ -334,7 +334,7 @@ public final class DispatchServer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LoginResultJson responseData = new LoginResultJson();
|
LoginResultJson responseData = new LoginResultJson();
|
||||||
Grasscutter.getLogger().info(translate("messages.dispatch.account.login_token_attempt"));
|
Grasscutter.getLogger().info(translate("messages.dispatch.account.login_token_attempt", req.ip()));
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
Account account = DatabaseHelper.getAccountById(requestData.uid);
|
Account account = DatabaseHelper.getAccountById(requestData.uid);
|
||||||
|
@ -29,7 +29,13 @@ public final class Language {
|
|||||||
* @return A translated value with arguments substituted.
|
* @return A translated value with arguments substituted.
|
||||||
*/
|
*/
|
||||||
public static String translate(String key, Object... args) {
|
public static String translate(String key, Object... args) {
|
||||||
return Grasscutter.getLanguage().get(key).formatted(args);
|
String translated = Grasscutter.getLanguage().get(key);
|
||||||
|
try {
|
||||||
|
return translated.formatted(args);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
Grasscutter.getLogger().error("Failed to format string: " + key, exception);
|
||||||
|
return translated;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user