Add setting to disable/enable free-flight-mode in the webapp

This commit is contained in:
Blue (Lukas Rieger) 2021-06-09 15:54:19 +02:00
parent 0e1e4056bb
commit e78071115d
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800
24 changed files with 65 additions and 2 deletions

@ -1 +1 @@
Subproject commit 037be99995746574e7b48c55a4dc4ef5d63e8747
Subproject commit b230e582a29333eae3595f58c14528436ddf19cc

View File

@ -102,6 +102,7 @@ public synchronized void createOrUpdateWebApp(boolean force) throws IOException
public synchronized WebSettings updateWebAppSettings() throws IOException, InterruptedException {
WebSettings webSettings = new WebSettings(new File(getRenderConfig().getWebRoot(), "data" + File.separator + "settings.json"));
webSettings.set(getRenderConfig().isUseCookies(), "useCookies");
webSettings.set(getRenderConfig().isEnableFreeFlight(), "freeFlightEnabled");
webSettings.setAllMapsEnabled(false);
for (BmMap map : getMaps().values()) {
webSettings.setMapEnabled(true, map.getId());

View File

@ -35,6 +35,7 @@ public class RenderConfig {
private File webRoot = new File("web");
private boolean useCookies;
private boolean enableFreeFlight;
private List<MapConfig> mapConfigs = new ArrayList<>();
public RenderConfig(ConfigurationNode node) throws IOException {
@ -46,6 +47,9 @@ public RenderConfig(ConfigurationNode node) throws IOException {
//cookies
useCookies = node.node("useCookies").getBoolean(true);
// free-flight mode
enableFreeFlight = node.node("enableFreeFlight").getBoolean(true);
//maps
mapConfigs = new ArrayList<>();
@ -62,7 +66,11 @@ public File getWebRoot() {
public boolean isUseCookies() {
return useCookies;
}
public boolean isEnableFreeFlight() {
return enableFreeFlight;
}
public List<MapConfig> getMapConfigs(){
return mapConfigs;
}

View File

@ -1,3 +1,4 @@
webroot: "web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [

View File

@ -1,3 +1,4 @@
webroot: "bluemap/web"
useCookies: true
enableFreeFlight: true
maps: []

View File

@ -11,6 +11,10 @@ webroot: "bluemap/web"
# Default is true
useCookies: true
# If the free-flight-mode in the web-application is enabled or not.
# Default is true
enableFreeFlight: true
# This is an array with multiple configured maps.
# You can define multiple maps, for different worlds with different render-settings here
maps: [