13
0

Fixed multi-session config entries

Dieser Commit ist enthalten in:
Zeanon 2021-05-12 16:39:36 +02:00
Ursprung 72935a93bf
Commit 0b98600468
6 geänderte Dateien mit 11 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -138,6 +138,9 @@ history:
size: 15
expiration: 10
multi-session:
size: 10
calculation:
timeout: 100
@ -151,4 +154,3 @@ debug: false
show-help-on-first-use: true
server-side-cui: true
command-block-support: false
multi-session-size: 10

Datei anzeigen

@ -162,6 +162,10 @@ public class SessionManager {
public boolean checkSize(SessionOwner owner) {
checkNotNull(owner);
if (MAX_MULTI_SESSION_SIZE == -1) {
return true;
}
Map<String, SessionHolder> playerSessions = sessions.get(getKey(owner));
if (playerSessions != null) {
return playerSessions.size() < MAX_MULTI_SESSION_SIZE;

Datei anzeigen

@ -113,7 +113,7 @@ public class YAMLConfiguration extends LocalConfiguration {
allowSymlinks = config.getBoolean("files.allow-symbolic-links", false);
LocalSession.MAX_HISTORY_SIZE = Math.max(0, config.getInt("history.size", 15));
SessionManager.MAX_MULTI_SESSION_SIZE = Math.max(0, config.getInt("multi-session-size", 10));
SessionManager.MAX_MULTI_SESSION_SIZE = Math.max(0, config.getInt("multi-session.size", 10));
SessionManager.EXPIRATION_GRACE = config.getInt("history.expiration", 10) * 60 * 1000;
showHelpInfo = config.getBoolean("show-help-on-first-use", true);

Datei anzeigen

@ -31,4 +31,4 @@ log-commands=false
butcher-max-radius=-1
max-polygon-points=20
max-radius=-1
multi-session-size: 10
multi-session-size=10

Datei anzeigen

@ -31,4 +31,4 @@ log-commands=false
butcher-max-radius=-1
max-polygon-points=20
max-radius=-1
multi-session-size: 10
multi-session-size=10

Datei anzeigen

@ -118,7 +118,7 @@ public class ConfigurateConfiguration extends LocalConfiguration {
allowSymlinks = node.getNode("files", "allow-symbolic-links").getBoolean(false);
LocalSession.MAX_HISTORY_SIZE = Math.max(0, node.getNode("history", "size").getInt(15));
SessionManager.MAX_MULTI_SESSION_SIZE = Math.max(0, node.getNode("multi-session-size").getInt(10));
SessionManager.MAX_MULTI_SESSION_SIZE = Math.max(0, node.getNode("multi-session", "size").getInt(10));
SessionManager.EXPIRATION_GRACE = node.getNode("history", "expiration").getInt(10) * 60 * 1000;
showHelpInfo = node.getNode("show-help-on-first-use").getBoolean(true);