Fixed multi-session config entries
Dieser Commit ist enthalten in:
Ursprung
72935a93bf
Commit
0b98600468
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren