diff --git a/.classpath b/.classpath
index f65b511b60..bdc87b9706 100644
--- a/.classpath
+++ b/.classpath
@@ -16,7 +16,6 @@
-
@@ -24,7 +23,7 @@
-
-
-
+
+
+
diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml
new file mode 100644
index 0000000000..710be77781
--- /dev/null
+++ b/.github/workflows/android-build.yml
@@ -0,0 +1,62 @@
+name: Android Build Test
+
+on:
+ push:
+ paths:
+ - 'app/android/**'
+ pull_request:
+ paths:
+ - 'app/android/**'
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - id: job_info
+ uses: daleyjem/gh-job-id@v1
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ job_name: 'build'
+
+ - name: Checkout Repository
+ uses: actions/checkout@v3
+
+ - name: Set Up JDK
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'adopt'
+
+ - name: Validate Gradle Wrapper .jar
+ run: |
+ cd app/android/gradle/wrapper
+ curl --location --output gradle-wrapper.jar.sha256 \
+ https://services.gradle.org/distributions/gradle-7.5.1-wrapper.jar.sha256
+ echo " gradle-wrapper.jar" >> gradle-wrapper.jar.sha256
+ sha256sum --check gradle-wrapper.jar.sha256
+
+ - name: Build APKs with Ant
+ uses: cedx/setup-ant@v6
+ with:
+ version: '1.10'
+ - run: ant -noinput -buildfile build.xml android -Dgradle.params="assembleDebug assembleRelease"
+
+ - name: Failure Report
+ uses: sarisia/actions-status-discord@v1
+ if: failure()
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_DEVELOPMENT }}
+ with:
+ title: 'Android Build Failed'
+ description: '${{ steps.job_info.outputs.html_url }}'
+ nodetail: true
+ - uses: sarisia/actions-status-discord@v1
+ if: failure()
+ env:
+ DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_DEVLOG }}
+ with:
+ title: 'Android Build Failed'
+ description: '${{ steps.job_info.outputs.html_url }}'
+ nodetail: true
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 1aaaeb4e51..3c5094235c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -29,15 +29,15 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@v2
+ uses: github/codeql-action/init@v3
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v2
+ #- name: Autobuild
+ # uses: github/codeql-action/autobuild@v3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -46,9 +46,7 @@ jobs:
# and modify them (or add more) to build your code if your project
# uses a compiled language
- #- run: |
- # make bootstrap
- # make release
+ - run: ant -noinput -f build.xml clean compile
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/prerelease_webview_client.yml b/.github/workflows/prerelease_webview_client.yml
index 3a43777f48..b66f74adfa 100644
--- a/.github/workflows/prerelease_webview_client.yml
+++ b/.github/workflows/prerelease_webview_client.yml
@@ -39,7 +39,7 @@ jobs:
- name: Build APKs
run: >
ant -noinput -buildfile build.xml dist_android_client
- -Dgradle.params="--no-daemon -Pandroid.ver=${{ steps.ver.outputs.value }} assembleDebug assemblePrerelease"
+ -Dgradle.params="-Pandroid.ver=${{ steps.ver.outputs.value }} assembleDebug assembleRelease"
- name: Publish
uses: softprops/action-gh-release@v1
diff --git a/.gitignore b/.gitignore
index 7b1c018c4b..adf7a8202c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,7 +40,6 @@ javadocs
statserver_stats.xml
/*.ks
build_client_data
-/bin
.byecycle
build_server_xmlconf
*.umlproject
@@ -49,3 +48,5 @@ build_server_xmlconf
/map.map
/hs_err_*.log
/node_modules/
+/log/
+/build-archive/
diff --git a/.project b/.project
index 8aa95068ea..a3d0298ad9 100644
--- a/.project
+++ b/.project
@@ -20,4 +20,15 @@
org.eclipse.jdt.core.javanature
org.eclipse.wst.common.project.facet.core.nature
+
+
+ 1771748271774
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c6556475f0..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-language: java
-before_install:
- - pip install --user codecov
-dist: bionic
-addons:
- apt:
- packages:
- - ant-optional
-service:
- - xvfb
-script: xvfb-run -e /dev/stdout -a ant test
-notifications:
- irc:
- channels:
- - "irc.libera.chat#arianne"
- - "irc.libera.chat#arianne-devel"
- on_success: change
- on_failure: change
- use_notice: false
- skip_join: false
-after_success:
- - codecov
diff --git a/README.md b/README.md
index bc2efc588a..8b25a90318 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Stendhal is a fully fledged multiplayer online adventures game (MORPG). It is co
Stendhal features a new, rich and expanding world in which you can explore towns, buildings, plains, caves and dungeons.
You will meet NPCs and acquire tasks and quests for valuable experience.
-Your character will develop and grow and with each new level up become stronger and better. With the money you acquire you can buy new items and improve your armour and weapons. And for the blood thirsty of you; satisfy your killing desires by roaming the world in search of evil monsters!
+Your character will develop and grow and with each new level up become stronger and better. With the money you acquire you can buy new items and improve your armor and weapons. And for the blood thirsty of you; satisfy your killing desires by roaming the world in search of evil monsters!
Stendhal is platform independent, and completely open source.
@@ -20,19 +20,38 @@ So what are you waiting for?! A whole new world awaits...
## How to play
-[](https://stendhalgame.org/account/mycharacters.html)
+### Web Browser
+
+[](https://stendhalgame.org/account/mycharacters.html)
+
+Play in any web browser for desktop or mobile with JavaScript support. Click on the "play now"
+button to create or log in to your account.
+
+### Mobile
+
+Play using the [progressive web app](https://en.wikipedia.org/wiki/Progressive_web_app). Just visit
+[stendhalgame.org](https://stendhalgame.org/) in your mobile browser and click "install" when prompted.
+
+[
](https://f-droid.org/packages/org.stendhalgame.client/)
+
+Play on your Android device using the dedicated app. You can get it from the
+[F-Droid App Store](https://f-droid.org/) or download it from [stendhalgame.org](https://stendhalgame.org/download.html).
+
+### Classic Desktop
+
[](https://arianne-project.org/download/stendhal.zip)
-You need Java which you can download from [https://www.java.com](https://www.java.com/en/download) on Microsoft Windows. Java is included in most Linux distributions. Both Oracle Java and OpenJDK are supported.
+Play using the classic desktop client. You will need Java which you can download from
+[java.com](https://www.java.com/en/download) on Microsoft Windows. Java is included in
+most Linux distributions. Both Oracle Java and OpenJDK are supported.
-Please download Stendhal from [https://stendhalgame.org](https://stendhalgame.org)
-You can double click on stendhal-starter.jar and the client will run.
-If you prefer to run from command line, then just execute this command
-in the stendhal folder:
+Please download Stendhal from [stendhalgame.org](https://stendhalgame.org/download.html).
+You can double click on `stendhal-starter.jar` and the client will run.
+If you prefer to run from command line, then just execute this command in the stendhal folder:
`java -jar stendhal-starter.jar`
-There is a [manual](https://stendhalgame.org/wiki/Stendhal_Manual), and there is Help from the client menu icons in the upper right hand side of the game screen.
+There is a [manual](https://stendhalgame.org/wiki/Stendhal_Manual), and there is Help from the client menu icons in the upper right hand side of the game screen.
## Development environment
@@ -44,13 +63,18 @@ There is a [manual](https://stendhalgame.org/wiki/Stendhal_Manual), and there i
## Legal
-The server and java client are free software; you can redistribute it and/or modify it under the terms of the **GNU General Public License** 2 or later as published by the Free Software Foundation.
-The web client is free software; you can redistribute it and/or modify it under the terms of the **GNU Affero General Public License** 3 or later as published by the Free Software Foundation.
+Stendhal is free software. You can redistribute it and/or modify under the following terms:
-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [LICENSE.txt](LICENSE.txt) file for more details.
+- The **server**, **java client**, and **Android client**: *GNU General Public License* 2 or later as published by the Free Software Foundation
+- The **web client** and **native client**: *GNU Affero General Public License* 3 or later as published by the Free Software Foundation with the definition of "System libraries" being extended to include authentication providers and software distribution platforms.
+- The **nativehelper** extensions: *GNU Lesser General Public License* 3 or later as published by the Free Software Foundation
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
+even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+[LICENSE.txt](LICENSE.txt) and [src/js/LICENSE.html](src/js/LICENSE.html) file for more details.
Stendhal(c) is copyright of Miguel Angel Blanch Lardin, 2005-2008, arianne_rpg at users dot sourceforge dot net and others
-Stendhal(c) is copyright of the Arianne Project, 2006-2023, arianne-general at lists dot sourceforge dot net
+Stendhal(c) is copyright of the Arianne Project, 2006-2026, arianne-general at lists dot sourceforge dot net
-Please have a look at the list of [contributors](https://github.com/arianne/stendhal/blob/master/doc/contributors.md#contributors).
+Please have a look at the list of [contributors](doc/contributors.md#contributors).
diff --git a/android/TODO.txt b/android/TODO.txt
deleted file mode 100644
index 50d5bf8d8f..0000000000
--- a/android/TODO.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-
-TODO:
-- show input preview when typing
-- scale page to fit inside view
-- create activity for about information
-- add credits to about information
-- switch to Log4j for logging (maybe)
-- use center of d-pad for setting position
-- d-pads need to be different sizes for different resolutions
- - either use unique PNGs or convert to scalable SVGs
-
-BUILD TODO:
-- script to download Android SDK
diff --git a/android/app/build.gradle b/android/app/build.gradle
deleted file mode 100644
index 6d0d72c02d..0000000000
--- a/android/app/build.gradle
+++ /dev/null
@@ -1,79 +0,0 @@
-plugins {
- id 'com.android.application'
-}
-
-android {
- compileSdk 32
-
- def buildDate = new Date().format("yyyyMMdd")
-
- def appVer
- if (project.hasProperty("android.ver") && project["android.ver"]) {
- appVer = project["android.ver"]
- } else {
- appVer = "${buildDate}"
- }
-
- if (project.hasProperty("android.rev") && project["android.rev"]) {
- appVer += "-" + project["android.rev"]
- }
-
- def outputName = "stendhal-webview-${appVer}"
-
- defaultConfig {
- applicationId "org.arianne.stendhal.client"
- minSdk 21
- targetSdk 32
- versionCode 1
- versionName "${appVer}"
- setProperty("archivesBaseName", "${outputName}")
- setProperty("buildDir", "${projectDir}/../../build/build_android_client")
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- targetSdkVersion 32
- minSdkVersion 21
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
-
- prerelease {
- versionNameSuffix "-pre"
- signingConfig signingConfigs.debug
- }
-
- debug {
- applicationIdSuffix ".debug"
- versionNameSuffix "-debug"
- }
- }
-
- buildTypes.all { type ->
- if (!type.name.equals("debug")) {
- sourceSets[type.name].java { srcDirs "src/shared/java/" }
- }
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- compileSdkVersion 32
- buildToolsVersion '32.0.0'
-
- lintOptions {
- abortOnError false
- }
-}
-
-dependencies {
- implementation 'androidx.appcompat:appcompat:1.4.1'
- implementation 'com.google.android.material:material:1.4.0'
- //testImplementation 'junit:junit:4.+'
- //androidTestImplementation 'androidx.test.ext:junit:1.1.2'
- //androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
- implementation files('../../libs/marauroa-client-only.jar')
-}
diff --git a/android/app/src/debug/java/org/arianne/stendhal/client/DebugLog.java b/android/app/src/debug/java/org/arianne/stendhal/client/DebugLog.java
deleted file mode 100644
index a8c9d90109..0000000000
--- a/android/app/src/debug/java/org/arianne/stendhal/client/DebugLog.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client;
-
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.util.Log;
-import androidx.appcompat.app.AppCompatActivity;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-
-/**
- * A class to output debugging information to logcat file.
- */
-public class DebugLog {
-
- private static File logsDir;
-
- private static AppCompatActivity mainActivity;
-
- public static enum DebugLevel {
- INFO("INFO"),
- WARN("WARN"),
- ERROR("ERROR"),
- DEBUG("DEBUG");
-
- private final String label;
-
- private DebugLevel(final String label) {
- this.label = label;
- }
-
- public String getLabel() {
- return label;
- }
- }
-
- private static DebugLog instance;
-
-
- public static DebugLog get() {
- if (instance == null) {
- instance = new DebugLog();
- }
-
- return instance;
- }
-
- public static void init(final File dir, final AppCompatActivity activity) {
- logsDir = new File(dir.getPath() + "/logs");
- mainActivity = activity;
-
- writeLine("\n // -- debugging initialized -- //", null);
- writeLine("logs directory: " + logsDir.getPath());
- }
-
- public static void writeLine(final String text) {
- writeLine(text, DebugLevel.DEBUG);
- }
-
- public static void writeLine(String text, final DebugLevel level) {
- if (logsDir == null) {
- System.err.println("ERROR: DebugLog not initialized. Call DebugLog.init.");
- return;
- }
-
- if (!logsDir.exists()) {
- logsDir.mkdirs();
- }
-
- if (level != null) {
- text = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date())
- + ": " + level.label + ": " + text;
- }
- text = text + "\n";
-
- final String logFile = logsDir.getPath() + "/debug-"
- + new SimpleDateFormat("yyyy.MM.dd").format(new Date()) + ".txt";
-
- BufferedWriter buffer;
- try {
- buffer = new BufferedWriter(new FileWriter(logFile, true));
- buffer.write(text);
- if (buffer != null) {
- buffer.close();
- }
- } catch (final IOException e) {
- System.err.println("ERROR: " + e.getMessage());
- }
- }
-
- public static void info(final String text) {
- Log.i("DebugLog", text);
- writeLine(text, DebugLevel.INFO);
- }
-
- public static void warn(final String text) {
- Log.w("DebugLog", text);
- writeLine(text, DebugLevel.WARN);
- }
-
- public static void error(final String text) {
- Log.e("DebugLog", text);
- writeLine(text, DebugLevel.ERROR);
- }
-
- public static void debug(final String text) {
- Log.d("DebugLog", text);
- writeLine(text, DebugLevel.DEBUG);
- }
-
- public static void notify(final String message) {
- notify(message, DebugLevel.DEBUG);
- }
-
- public static void notify(final String message, DebugLevel level) {
- if (mainActivity == null) {
- System.err.println("ERROR: DebugLog not initialized. Call DebugLog.init.");
- return;
- }
-
- if (level == null) {
- level = DebugLevel.DEBUG;
- }
-
- final AlertDialog.Builder builder = new AlertDialog.Builder(mainActivity);
- builder.setTitle(level.label);
- builder.setMessage(message);
-
- builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
- public void onClick(final DialogInterface dialog, final int id) {
- dialog.cancel();
- }
- });
-
- builder.create().show();
- }
-
- public static String getLogsDir() {
- return logsDir.getPath();
- }
-}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 6e35947c74..0000000000
--- a/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/ClientView.java b/android/app/src/main/java/org/arianne/stendhal/client/ClientView.java
deleted file mode 100644
index bc60dd81c7..0000000000
--- a/android/app/src/main/java/org/arianne/stendhal/client/ClientView.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client;
-
-import android.app.AlertDialog;
-import android.content.pm.ApplicationInfo;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.Uri;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.view.inputmethod.BaseInputConnection;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodManager;
-import android.view.inputmethod.InputConnection;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.view.View;
-import android.webkit.DownloadListener;
-import android.webkit.WebChromeClient;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.ImageView;
-
-import marauroa.common.Pair;
-
-import org.arianne.stendhal.client.input.DPad;
-import org.arianne.stendhal.client.js.JSInterface;
-import org.arianne.stendhal.client.sound.MusicPlayer;
-
-
-public class ClientView extends WebView {
-
- private static ClientView instance;
-
- private ImageView splash;
-
- private final String defaultServer = "https://stendhalgame.org/";
- private String clientUrlSuffix = "client";
-
- private boolean testing = false;
- private Boolean debugging;
- private static PageId currentPage;
- // denotes previous touch was remapped to mouse event
- private boolean touchOverridden = false;
-
-
- /**
- * Retrieves the static instance.
- */
- public static ClientView get() {
- return instance;
- }
-
- public ClientView(final Context ctx) {
- super(ctx);
- onInit();
- }
-
- public ClientView(final Context ctx, final AttributeSet attrs) {
- super(ctx, attrs);
- onInit();
- }
-
- public ClientView(final Context ctx, final AttributeSet attrs, final int style) {
- super(ctx, attrs, style);
- onInit();
- }
-
- public ClientView(final Context ctx, final AttributeSet attrs, final int style,
- final boolean prvtBrowse) {
- super(ctx, attrs, style, prvtBrowse);
- onInit();
- }
-
- private void onInit() {
- instance = this;
-
- setBackgroundColor(android.graphics.Color.TRANSPARENT);
-
- final WebSettings viewSettings = getSettings();
- viewSettings.setJavaScriptEnabled(true);
- viewSettings.setDomStorageEnabled(true);
-
- // keep elements in position in portrait mode
- viewSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);// <-- SINGLE_COLUMN deprecated
- viewSettings.setLoadWithOverviewMode(true);
- viewSettings.setUseWideViewPort(true);
-
- // disable zoom
- viewSettings.setSupportZoom(false);
- viewSettings.setBuiltInZoomControls(false);
- viewSettings.setDisplayZoomControls(false);
-
- if (debugEnabled()) {
- // make WebView debuggable for debug builds
- setWebContentsDebuggingEnabled(true);
- }
-
- initWebViewClient();
- initTouchHandler();
- initJSInterface();
- initDownloadHandler();
- }
-
- private void initWebViewClient() {
- // XXX: not sure setting WebChromClient is doing anything, was recommended to
- // fix touchmove events not registering
- setWebChromeClient(new WebChromeClient());
-
- setWebViewClient(new WebViewClient() {
- /* handle changing URLs */
- @Override
- public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
- if (!isInternalUrl(url)) {
- // FIXME: should we ask for confirmation?
- MainActivity.get().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
- return true;
- }
-
- view.loadUrl(checkClientUrl(url));
- return false;
- }
-
- @Override
- public void onPageStarted(final WebView view, final String url, final Bitmap favicon) {
- DebugLog.debug("loading URL: " + url);
-
- MusicPlayer.stopMusic();
- super.onPageStarted(view, url, favicon);
- }
-
- @Override
- public void onPageFinished(final WebView view, final String url) {
- super.onPageFinished(view, url);
-
- if (isClientUrl(url)) {
- currentPage = PageId.WEBCLIENT;
- } else if (url.equals("") || url.equals("about:blank")) {
- currentPage = PageId.TITLE;
- if (PreferencesActivity.getBoolean("title_music", true)) {
- playTitleMusic();
- }
- } else {
- currentPage = PageId.OTHER;
- }
- Menu.get().updateButtons();
-
- // only show d-pad on client screen
- final DPad pad = DPad.getCurrentPad();
- if (pad != null && PreferencesActivity.getBoolean("show_dpad", false)) {
- if (isGameActive()) {
- pad.show();
- } else {
- pad.hide();
- }
- }
-
- DebugLog.debug("page id: " + currentPage);
- }
- });
- }
-
- private void initTouchHandler() {
- setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(final View view, final MotionEvent event) {
- if (touchOverridden) {
- // reset touch event state
- touchOverridden = false;
- return false;
- }
-
- final MotionEvent.PointerProperties[] props = {new MotionEvent.PointerProperties()};
- event.getPointerProperties(0, props[0]);
-
- if (isGameActive() && PreferencesActivity.getBoolean("map_touches", false)
- && (props[0].toolType == MotionEvent.TOOL_TYPE_FINGER
- || props[0].toolType == MotionEvent.TOOL_TYPE_STYLUS)) {
- Integer action = event.getAction();
-
- /*
- switch (action) {
- case MotionEvent.ACTION_DOWN:
- action = MotionEvent.ACTION_BUTTON_PRESS;
- break;
- case MotionEvent.ACTION_UP:
- action = MotionEvent.ACTION_BUTTON_RELEASE;
- break;
- }
- */
-
- DebugLog.debug("mapping touch to mouse event");
-
- props[0].toolType = MotionEvent.TOOL_TYPE_MOUSE;
-
- final MotionEvent.PointerCoords[] coords = {new MotionEvent.PointerCoords()};
- event.getPointerCoords(0, coords[0]);
-
- touchOverridden = true;
-
- view.dispatchTouchEvent(MotionEvent.obtain(event.getDownTime(),
- event.getEventTime(), event.getAction(), event.getPointerCount(), props,
- coords, event.getMetaState(), MotionEvent.BUTTON_PRIMARY,
- event.getXPrecision(), event.getYPrecision(), event.getDeviceId(),
- event.getEdgeFlags(), event.getSource(), event.getFlags()));
-
- return true; // consume old event
- }
-
- return false;
- }
- });
- }
-
- @Override
- public InputConnection onCreateInputConnection(final EditorInfo outAttrs) {
- // allows capturing soft keyboard events
- return new BaseInputConnection(this, false);
- }
-
- @Override
- public boolean dispatchKeyEvent(final KeyEvent event) {
- final boolean ret = super.dispatchKeyEvent(event);
-
- // hide keyboard when "enter" pressed
- if (isGameActive() && event.getAction() == KeyEvent.ACTION_UP
- && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
- ((InputMethodManager) MainActivity.get()
- .getSystemService(Context.INPUT_METHOD_SERVICE))
- .hideSoftInputFromWindow(this.getWindowToken(), 0);
- }
-
- return ret;
- }
-
- private void initJSInterface() {
- addJavascriptInterface(JSInterface.get(), "jsi");
- }
-
- /**
- * Handles downloading screenshot created by web client.
- */
- private void initDownloadHandler() {
- setDownloadListener(new DownloadListener() {
- @Override
- public void onDownloadStart(final String url, final String userAgent,
- final String contentDisposition, final String mimetype,
- final long contentLength) {
-
- final Pair res = new DownloadHandler().download(url, mimetype);
- if (res.first()) {
- final String msg = "Downloaded file: " + res.second();
- DebugLog.debug(msg);
- Notifier.toast(msg);
- } else {
- final String msg = res.second();
- DebugLog.error(msg);
- Notifier.toast("ERROR: " + msg);
- }
- }
- });
- }
-
- /**
- * Shows initial title screen.
- */
- public void loadTitleScreen() {
- setSplashResource(R.drawable.splash);
- loadUrl("about:blank");
- Menu.get().show();
- }
-
- /**
- * Attempts to connect to client host.
- */
- public void loadLogin() {
- if (debugEnabled() && PreferencesActivity.getString("client_url").trim().equals("")) {
- // debug builds support choosing between main & test server
- selectServer();
- } else {
- onSelectServer();
- }
- }
-
- /**
- * Sets the background image.
- *
- * @param resId
- * Resource ID.
- */
- private void setSplashResource(final int resId) {
- if (splash == null) {
- splash = (ImageView) MainActivity.get().findViewById(R.id.splash);
- splash.setBackgroundColor(android.graphics.Color.TRANSPARENT);
- }
-
- splash.setImageResource(resId);
- }
-
- /**
- * Opens a message dialog for user to choose between main & test servers.
- */
- private void selectServer() {
- final AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.get());
- builder.setMessage("Select a server");
-
- builder.setPositiveButton("Main", new DialogInterface.OnClickListener() {
- public void onClick(final DialogInterface dialog, final int id) {
- testing = false;
- dialog.cancel();
- onSelectServer();
- }
- });
-
- builder.setNegativeButton("Testing", new DialogInterface.OnClickListener() {
- public void onClick(final DialogInterface dialog, final int id) {
- testing = true;
- clientUrlSuffix = "testclient";
- dialog.cancel();
- onSelectServer();
- }
- });
-
- final AlertDialog selectServer = builder.create();
- selectServer.show();
- }
-
- private void onSelectServer() {
- // remove splash image
- setSplashResource(android.R.color.transparent);
-
- final String custom_page = checkCustomServer();
- if (custom_page != null) {
- DebugLog.debug("Connecing to custom page: " + custom_page);
-
- loadUrl(custom_page);
- } else {
- // initial page
- loadUrl(defaultServer + "account/mycharacters.html");
-
- if (testing) {
- DebugLog.debug("Connecting to test server");
- } else {
- DebugLog.debug("Connecting to main server");
-
- Notifier.get().showMessage("CAUTION: This software is in early development and not recommended"
- + " for use on the main server. Proceed with caution.", false);
- }
- }
-
- currentPage = PageId.OTHER;
- // hide menu after exiting title screen
- Menu.get().hide();
- }
-
- private String checkCustomServer() {
- final String cs = PreferencesActivity.getString("client_url", "").trim();
-
- if (cs.equals("")) {
- return null;
- }
-
- return cs;
- }
-
- /**
- * Checks if a URL is a link to one of the web clients.
- *
- * @param url
- * URL to be checked.
- * @return
- * true if url links to "client" or "testclient".
- */
- private boolean isClientUrl(final String url) {
- final String custom_client = PreferencesActivity.getString("client_url").trim();
- if (!custom_client.equals("")) {
- return url.contains(custom_client);
- }
-
- return url.contains("stendhalgame.org/client/")
- || url.contains("stendhalgame.org/testclient/");
- }
-
- /**
- * Formats client URL for currently selected server.
- *
- * @param url
- * URL to be checked.
- * @return
- * URL to be loaded.
- */
- private String checkClientUrl(String url) {
- if (isClientUrl(url)) {
- String replaceSuffix = "/testclient/";
- if (testing) {
- replaceSuffix = "/client/";
- }
-
- url = url.replace(replaceSuffix, "/" + clientUrlSuffix + "/");
- }
-
- return url;
- }
-
- /**
- * Checks if requested URL is whitelisted to be opened within WebView client.
- *
- * @param url
- * URL to be checked.
- * @return
- * true if URL is under domain stendhalgame.org or localhost.
- */
- private boolean isInternalUrl(final String url) {
- final String domain = getDomain(url);
- final String cs = checkCustomServer();
-
- if (cs != null) {
- return domain.startsWith(getDomain(cs));
- } else {
- return domain.startsWith("stendhalgame.org") || domain.startsWith("localhost");
- }
- }
-
- private String getDomain(final String url) {
- return url.replaceAll("^https://", "").replaceAll("^http://", "")
- .replaceAll("^www\\.", "");
- }
-
- public static boolean onTitleScreen() {
- return currentPage == PageId.TITLE;
- }
-
- public static boolean isGameActive() {
- return currentPage == PageId.WEBCLIENT;
- }
-
- public static PageId getCurrentPageId() {
- return currentPage;
- }
-
- public static void playTitleMusic(String musicId) {
- if (musicId == null) {
- musicId = PreferencesActivity.getString("song_list");
- }
-
- int id = R.raw.title_01;
- switch (musicId) {
- case "title_02":
- id = R.raw.title_02;
- break;
- case "title_03":
- id = R.raw.title_03;
- break;
- case "title_04":
- id = R.raw.title_04;
- break;
- case "title_05":
- id = R.raw.title_05;
- break;
- }
-
- DebugLog.debug("playing music: " + musicId);
-
- MusicPlayer.playMusic(id, true);
- }
-
- public static void playTitleMusic() {
- playTitleMusic(null);
- }
-
- /**
- * Checks if this is a debug build.
- *
- * @return
- * true if debug flag set.
- */
- private boolean debugEnabled() {
- if (debugging != null) {
- return debugging;
- }
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- debugging = (MainActivity.get().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
- } else {
- debugging = false;
- }
-
- return debugging;
- }
-}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/DownloadHandler.java b/android/app/src/main/java/org/arianne/stendhal/client/DownloadHandler.java
deleted file mode 100644
index e1008543aa..0000000000
--- a/android/app/src/main/java/org/arianne/stendhal/client/DownloadHandler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client;
-
-import android.net.Uri;
-import android.os.Environment;
-import android.util.Base64;
-
-import java.io.File;
-import java.io.FileOutputStream;
-
-import marauroa.common.Pair;
-
-
-/**
- * The main purpose of this class is to handle downloading screenshots
- * created by the web client page.
- */
-public class DownloadHandler {
-
- public Pair download(final String url, final String mimetype) {
- final Pair res = new Pair(false, null);
-
- final Uri uri = Uri.parse(url);
- final String scheme = uri.getScheme();
- final String storageState = Environment.getExternalStorageState();
-
- if (!ClientView.get().isGameActive()) {
- res.setSecond("downloading from this page not supported");
- } else if (!"data".equals(scheme)) {
- res.setSecond("download type \"" + scheme + "\" not supported");
- } else if (!"image/png".equals(mimetype) || !url.startsWith("data:image/png;base64,")) {
- res.setSecond("mimetype not supported: " + mimetype);
- } else if (!Environment.MEDIA_MOUNTED.equals(storageState)) {
- res.setSecond("storage not available for writing (state: " + storageState + ")");
- } else {
- final File targetDir = new File(Environment.getExternalStorageDirectory()
- + "/Pictures/Screenshots");
- // TODO: format output name using YYYYMMDD_HH.MM.SS.MS
- final String targetName = "stendhal_" + System.currentTimeMillis() + ".png";
-
- DebugLog.debug("Saving screenshot: " + targetDir.getPath()
- + "/" + targetName + " (" + mimetype + ")");
-
- String msg;
- String stacktrace = null;
- try {
- if (!targetDir.exists()) {
- targetDir.mkdirs();
- }
-
- final byte[] data = Base64.decode(url.split("base64,")[1], Base64.DEFAULT);
- final FileOutputStream fos = new FileOutputStream(new File(targetDir, targetName));
- fos.write(data);
- fos.close();
-
- res.setFirst(true);
- msg = "saved screenshot to " + targetDir.getPath() + "/" + targetName;
- } catch (final java.lang.NoClassDefFoundError e) {
- msg = "an error occurred while decoding data (see debug log for more info)";
- stacktrace = stackTraceToString(e);
- } catch (java.io.IOException e) {
- msg = "an error occurred while attempting to write file (see debug log for more info)";
- stacktrace = stackTraceToString(e);
- }
-
- res.setSecond(msg);
- if (stacktrace != null) {
- DebugLog.error(stacktrace.toString());
- }
- }
-
- return res;
- }
-
- /**
- * Converts an exception stacktrace to string.
- *
- * @param e
- * The error with stacktrace information.
- * @return
- * String formatted stacktrace.
- */
- private String stackTraceToString(final Throwable e) {
- final StringBuilder sb = new StringBuilder();
- sb.append(e.toString());
- for (final StackTraceElement ste: e.getStackTrace()) {
- if (sb.length() > 0) {
- sb.append("\n");
- }
- sb.append(ste.toString());
- }
-
- return sb.toString();
- }
-}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/MainActivity.java b/android/app/src/main/java/org/arianne/stendhal/client/MainActivity.java
deleted file mode 100644
index 519ba2e00b..0000000000
--- a/android/app/src/main/java/org/arianne/stendhal/client/MainActivity.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client;
-
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.os.Bundle;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.constraintlayout.widget.ConstraintLayout;
-
-import org.arianne.stendhal.client.input.DPad;
-import org.arianne.stendhal.client.input.DPadArrows;
-import org.arianne.stendhal.client.input.DPadJoy;
-
-
-public class MainActivity extends AppCompatActivity {
-
- private static MainActivity instance;
-
- private ConstraintLayout layout;
- private ClientView client;
- private Menu menu;
-
-
- public static MainActivity get() {
- return instance;
- }
-
- @Override
- protected void onCreate(final Bundle savedInstanceState) {
- try {
- super.onCreate(savedInstanceState);
- instance = this;
-
- // initialize debug logging mechanism
- DebugLog.init(getExternalFilesDir(null), this);
-
- setContentView(R.layout.activity_main);
- layout = (ConstraintLayout) findViewById(R.id.content);
- menu = new Menu(this);
- client = (ClientView) findViewById(R.id.clientWebView);
-
- // initialize d-pads
- final DPad arrowPad = DPadArrows.get();
- final DPad joyPad = DPadJoy.get();
-
- if (PreferencesActivity.getBoolean("dpad_joy", true)) {
- DPad.setCurrentPad(joyPad);
- } else {
- DPad.setCurrentPad(arrowPad);
- }
-
- layout.addView(arrowPad.getLayout());
- layout.addView(joyPad.getLayout());
-
- client.loadTitleScreen();
- } catch (final Exception e) {
- e.printStackTrace();
- DebugLog.error(e.toString());
- DebugLog.error("// -- //");
- for (final StackTraceElement ste: e.getStackTrace()) {
- DebugLog.error(ste.toString());
- }
- DebugLog.error("// -- //");
- Notifier.get().showPrompt(
- "An unhandled exception has occurred: " + e.getMessage()
- + "\n\nYou can report this error at: https://stendhalgame.org/development/bug.html",
- new Notifier.Action() {
- protected void onCall() {
- finish();
- }
- });
- }
- }
-
- @Override
- public void onBackPressed() {
- menu.toggleVisibility();
- }
-
- /**
- * Attempts to connect to client host.
- */
- public void loadLogin() {
- client.loadLogin();
- }
-
- /**
- * Opens a dialog confirm exiting activity.
- */
- public void onRequestQuit() {
- final AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage("Quit Stendhal?");
-
- builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
- public void onClick(final DialogInterface dialog, final int id) {
- finish();
- }
- });
-
- builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
- public void onClick(final DialogInterface dialog, final int id) {
- dialog.cancel();
- }
- });
-
- final AlertDialog confirmQuit = builder.create();
- confirmQuit.show();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
-
- DPadArrows.get().onRefreshView();
- DPadJoy.get().onRefreshView();
- }
-
- /**
- * Updates direction pad position when screen orientation changes.
- */
- @Override
- public void onConfigurationChanged(final Configuration config) {
- super.onConfigurationChanged(config);
-
- DPadArrows.get().onRefreshView();
- DPadJoy.get().onRefreshView();
- }
-
- @Override
- public void finish() {
- DebugLog.debug(MainActivity.class.getName() + ".finish() called");
-
- super.finish();
- }
-
- @Override
- protected void onDestroy() {
- DebugLog.debug(MainActivity.class.getName() + ".onDestroy() called");
-
- super.onDestroy();
- }
-
- public void showSettings() {
- startActivity(new Intent(MainActivity.this, PreferencesActivity.class));
- }
-}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/input/DPad.java b/android/app/src/main/java/org/arianne/stendhal/client/input/DPad.java
deleted file mode 100644
index ab9a32b252..0000000000
--- a/android/app/src/main/java/org/arianne/stendhal/client/input/DPad.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client.input;
-
-import android.view.View;
-import androidx.constraintlayout.widget.ConstraintLayout;
-
-import marauroa.common.Pair;
-
-
-public abstract class DPad {
-
- public static enum Dir {
- NONE,
- LEFT,
- RIGHT,
- UP,
- DOWN;
- }
-
- private static DPad currentPad = null;
-
-
- public abstract ConstraintLayout getLayout();
-
- public abstract void setVisibility(final int vis);
-
- public abstract boolean isVisible();
-
- public void show() {
- setVisibility(View.VISIBLE);
- }
-
- public void hide() {
- setVisibility(View.GONE);
- }
-
- public abstract void setPosition(final int x, final int y);
-
- public abstract Pair getPosition();
-
- public abstract Pair getSize();
-
- public abstract void onRefreshView();
-
- public static void setCurrentPad(final DPad pad) {
- currentPad = pad;
- }
-
- public static DPad getCurrentPad() {
- return currentPad;
- }
-}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java b/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java
deleted file mode 100644
index c64b9b57a5..0000000000
--- a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadArrows.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client.input;
-
-import android.content.Context;
-import android.graphics.Point;
-import android.view.Display;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.ImageView;
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.constraintlayout.widget.ConstraintLayout.LayoutParams;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import marauroa.common.Pair;
-import org.arianne.stendhal.client.DebugLog;
-import org.arianne.stendhal.client.MainActivity;
-import org.arianne.stendhal.client.PreferencesActivity;
-import org.arianne.stendhal.client.R;
-
-
-/**
- * A directional pad on the screen.
- *
- * TODO: Option to use joystick style d-pad. Currently setting "dpad_joy"
- * is disabled in preferences manager.
- */
-public class DPadArrows extends DPad {
-
- private static DPadArrows instance;
-
- private static Context ctx;
-
- private final List arrows;
- private final ConstraintLayout layout;
-
-
- public static DPadArrows get() {
- if (instance == null) {
- instance = new DPadArrows();
- }
-
- return instance;
- }
-
- private DPadArrows() {
- ctx = (Context) MainActivity.get();
-
- arrows = new LinkedList<>();
- layout = new ConstraintLayout(ctx);
- layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
-
- final ArrowView arrow_l = new ArrowView(ctx, Dir.LEFT);
- final ArrowView arrow_r = new ArrowView(ctx, Dir.RIGHT);
- final ArrowView arrow_u = new ArrowView(ctx, Dir.UP);
- final ArrowView arrow_d = new ArrowView(ctx, Dir.DOWN);
-
- arrows.add(arrow_l);
- arrows.add(arrow_r);
- arrows.add(arrow_u);
- arrows.add(arrow_d);
-
- for (final ArrowView av: arrows) {
- layout.addView(av);
- }
-
- // hidden by default
- hide();
- }
-
- public ConstraintLayout getLayout() {
- return layout;
- }
-
- public void setVisibility(final int vis) {
- for (final ArrowView av: arrows) {
- av.setVisibility(vis);
- }
- }
-
- public boolean isVisible() {
- for (final ArrowView av: arrows) {
- if (av.getVisibility() != View.VISIBLE) {
- return false;
- }
- }
-
- return true;
- }
-
- public void setPosition(final int x, final int y) {
- ArrowView av = arrows.get(0);
- av.setX(x);
- av.setY(y + 60);
-
- av = arrows.get(1);
- av.setX(x + 150);
- av.setY(y + 60);
-
- av = arrows.get(2);
- av.setX(x + 60);
- av.setY(y);
-
- av = arrows.get(3);
- av.setX(x + 60);
- av.setY(y + 150);
- }
-
- private int getX() {
- return (int) arrows.get(0).getX();
- }
-
- private int getY() {
- return (int) arrows.get(2).getY();
- }
-
- public Pair getPosition() {
- return new Pair(getX(), getY());
- }
-
- private int getWidth() {
- final ArrowView aRight = arrows.get(1);
- final int absX = ((int) aRight.getX()) + aRight.getWidth();
-
- return absX - getX();
- }
-
- private int getHeight() {
- final ArrowView aDown = arrows.get(3);
- final int absY = ((int) aDown.getY()) + aDown.getHeight();
-
- return absY - getY();
- }
-
- public Pair getSize() {
- return new Pair(getWidth(), getHeight());
- }
-
- public void onRefreshView() {
- final Point size = new Point();
- final Display disp = MainActivity.get().getWindowManager().getDefaultDisplay();
- disp.getSize(size);
-
- final PreferencesActivity prefs = PreferencesActivity.get();
- final int x = prefs.getInt("dpad_offset_x", 100);
- final int y = size.y - prefs.getInt("dpad_offset_y", 300);
-
- setPosition(x, y);
-
- if (isVisible()) {
- DebugLog.debug("DPadArrows: pos (" + getX() + "," + getY() + "), size ("
- + getWidth() + "," + getHeight() + ")");
- DebugLog.debug("DPadArrows: left arrow: x (" + arrows.get(0).getX() + "), width ("
- + arrows.get(0).getWidth() + ")");
- DebugLog.debug("DPadArrows: down arrow: y (" + arrows.get(3).getY() + "), height ("
- + arrows.get(3).getHeight() + ")");
- }
- }
-
-
- private static class ArrowView extends ImageView {
-
- private final Dir dir;
- private final int id;
- private final int id_active;
-
- private boolean keyDown = false;
-
-
- public ArrowView(final Context ctx, final Dir dir) {
- super(ctx);
-
- this.dir = dir;
-
- switch (dir) {
- case LEFT:
- id = R.drawable.dpad_arrow_left;
- id_active = R.drawable.dpad_arrow_left_active;
- break;
- case RIGHT:
- id = R.drawable.dpad_arrow_right;
- id_active = R.drawable.dpad_arrow_right_active;
- break;
- case UP:
- id = R.drawable.dpad_arrow_up;
- id_active = R.drawable.dpad_arrow_up_active;
- break;
- default:
- id = R.drawable.dpad_arrow_down;
- id_active = R.drawable.dpad_arrow_down_active;
- break;
- }
-
- setBackgroundColor(android.graphics.Color.TRANSPARENT);
- setImageResource(id);
-
- setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(final View view, final MotionEvent event) {
- final int action = event.getAction();
-
- Integer newAction = null;
- Integer keyCode = null;
-
- if (action == MotionEvent.ACTION_DOWN && !keyDown) {
- setImageResource(id_active);
- newAction = KeyEvent.ACTION_DOWN;
- keyDown = true;
- } else if (action == MotionEvent.ACTION_UP && keyDown) {
- setImageResource(id);
- newAction = KeyEvent.ACTION_UP;
- keyDown = false;
- }
-
- if (newAction != null) {
-
- switch (dir) {
- case LEFT:
- keyCode = KeyEvent.KEYCODE_DPAD_LEFT;
- break;
- case RIGHT:
- keyCode = KeyEvent.KEYCODE_DPAD_RIGHT;
- break;
- case UP:
- keyCode = KeyEvent.KEYCODE_DPAD_UP;
- break;
- case DOWN:
- keyCode = KeyEvent.KEYCODE_DPAD_DOWN;
- break;
- }
-
- MainActivity.get().dispatchKeyEvent(new KeyEvent(newAction, keyCode));
- return true; // consume event
- }
-
- return false;
- }
- });
- }
- }
-}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java b/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java
deleted file mode 100644
index 08445530a3..0000000000
--- a/android/app/src/main/java/org/arianne/stendhal/client/input/DPadJoy.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client.input;
-
-import android.content.Context;
-import android.graphics.Point;
-import android.view.Display;
-import android.view.KeyEvent;
-import android.view.MotionEvent;
-import android.view.View;
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.constraintlayout.widget.ConstraintLayout.LayoutParams;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import marauroa.common.Pair;
-import org.arianne.stendhal.client.DebugLog;
-import org.arianne.stendhal.client.MainActivity;
-import org.arianne.stendhal.client.PreferencesActivity;
-import org.arianne.stendhal.client.R;
-
-
-public class DPadJoy extends DPad {
-
- private static DPadJoy instance;
-
- private static Context ctx;
-
- private static ConstraintLayout layout;
-
- private static OuterButton outerButton;
- private static int sensitivity;
-
-
- public static DPadJoy get() {
- if (instance == null) {
- instance = new DPadJoy();
- }
-
- return instance;
- }
-
- private DPadJoy() {
- ctx = (Context) MainActivity.get();
- layout = new ConstraintLayout(ctx);
- layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
-
- outerButton = new OuterButton(ctx);
- outerButton.addToLayout();
-
- setSensitivity(PreferencesActivity.getInt("joypad_sensitivity", 25));
-
- // hidden by default
- hide();
- }
-
- public ConstraintLayout getLayout() {
- return layout;
- }
-
- public void setVisibility(final int vis) {
- outerButton.setVisibility(vis);
- }
-
- public boolean isVisible() {
- return outerButton.isVisible();
- }
-
- public void setPosition(final int x, final int y) {
- outerButton.setPosition(x, y);
- }
-
- private int getX() {
- return (int) outerButton.getX();
- }
-
- private int getY() {
- return (int) outerButton.getY();
- }
-
- public Pair getPosition() {
- return new Pair(getX(), getY());
- }
-
- private int getWidth() {
- return outerButton.getWidth();
- }
-
- private int getHeight() {
- return outerButton.getHeight();
- }
-
- public Pair getSize() {
- return new Pair(getWidth(), getHeight());
- }
-
- public void setSensitivity(final int value) {
- sensitivity = value;
- }
-
- public void onRefreshView() {
- final Point size = new Point();
- final Display disp = MainActivity.get().getWindowManager().getDefaultDisplay();
- disp.getSize(size);
-
- final PreferencesActivity prefs = PreferencesActivity.get();
- final int x = prefs.getInt("dpad_offset_x", 100);
- final int y = size.y - prefs.getInt("dpad_offset_y", 300);
-
- setPosition(x, y);
-
- if (isVisible()) {
- DebugLog.debug("DPadJoy: pos (" + getX() + "," + getY() + "), size ("
- + getWidth() + "," + getHeight() + ")");
- }
- }
-
-
- private static class OuterButton extends JoyPadButton {
-
- private final InnerButton innerButton;
-
- private DPad.Dir currentDir = DPad.Dir.NONE;
- private boolean keyDown = false;
- private final List pressedKeys;
-
-
- public OuterButton(final Context ctx) {
- super(ctx);
-
- pressedKeys = new ArrayList<>();
-
- setBackgroundColor(android.graphics.Color.TRANSPARENT);
- setImageResource(R.drawable.dpad_circle_outer);
-
- innerButton = new InnerButton(ctx);
- innerButton.setBackgroundColor(android.graphics.Color.TRANSPARENT);
- innerButton.setImageResource(R.drawable.dpad_circle_inner);
-
- setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(final View view, final MotionEvent event) {
- final int action = event.getAction();
-
- DebugLog.debug("joypad action: " + action);
-
- if (action == MotionEvent.ACTION_DOWN && !keyDown) {
- keyDown = true;
- innerButton.setImageResource(R.drawable.dpad_circle_inner_active);
- innerButton.setRelativeX(event.getX());
- innerButton.setRelativeY(event.getY());
-
- final DPad.Dir newDir = getTouchDirection();
- if (newDir != currentDir) {
- currentDir = newDir;
- onDirectionChange(KeyEvent.ACTION_DOWN);
- }
- } else if (action == MotionEvent.ACTION_UP && keyDown) {
- keyDown = false;
- innerButton.setImageResource(R.drawable.dpad_circle_inner);
- innerButton.centerOn((JoyPadButton) view);
-
- clearPresses();
- currentDir = DPad.Dir.NONE;
- } else if (action == MotionEvent.ACTION_MOVE && keyDown) {
- innerButton.setRelativeX(event.getX());
- innerButton.setRelativeY(event.getY());
-
- final DPad.Dir newDir = getTouchDirection();
- if (newDir != currentDir) {
- currentDir = newDir;
- onDirectionChange(KeyEvent.ACTION_DOWN);
- }
- }
-
- return true;
- }
- });
- }
-
- public void addToLayout() {
- layout.addView(this);
- layout.addView(innerButton);
-
- // FIXME: inner button not centering at startup
- innerButton.centerOn(this);
- }
-
- @Override
- public void setVisibility(final int vis) {
- innerButton.setVisibility(vis);
- super.setVisibility(vis);
- }
-
- public boolean isVisible() {
- return getVisibility() == View.VISIBLE
- && innerButton.getVisibility() == View.VISIBLE;
- }
-
- public void setPosition(final int x, final int y) {
- setX(x);
- setY(y);
-
- innerButton.centerOn(this);
- }
-
- /**
- * Determines pressed direction based on inner button position
- * relative to outer button position.
- */
- private DPad.Dir getTouchDirection() {
- final float outerX = getCenterX();
- final float outerY = getCenterY();
- final float innerX = innerButton.getCenterX();
- final float innerY = innerButton.getCenterY();
- final float offsetX = outerX - innerX;
- final float offsetY = outerY - innerY;
-
- final int absX = (int) Math.abs(offsetX);
- final int absY = (int) Math.abs(offsetY);
-
- if (absX < sensitivity && absY < sensitivity) {
- return DPad.Dir.NONE;
- }
-
- // horizontal directions take precedence if they are the same as vertical
- if (absX >= absY) {
- if (innerX < outerX) {
- return DPad.Dir.LEFT;
- } else if (innerX > outerX) {
- return DPad.Dir.RIGHT;
- }
- } else {
- if (innerY < outerY) {
- return DPad.Dir.UP;
- } else if (innerY > outerY) {
- return DPad.Dir.DOWN;
- }
- }
-
- return DPad.Dir.NONE;
- }
-
- private void clearPresses() {
- for (final int key: pressedKeys) {
- MainActivity.get().dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, key));
- }
- }
-
- /**
- * Sends a direction key press event to client.
- */
- private void onDirectionChange(final int action) {
- Integer keyCode = null;
-
- switch (currentDir) {
- case LEFT:
- keyCode = KeyEvent.KEYCODE_DPAD_LEFT;
- break;
- case RIGHT:
- keyCode = KeyEvent.KEYCODE_DPAD_RIGHT;
- break;
- case UP:
- keyCode = KeyEvent.KEYCODE_DPAD_UP;
- break;
- case DOWN:
- keyCode = KeyEvent.KEYCODE_DPAD_DOWN;
- break;
- }
-
- if (keyCode != null) {
- // clear pressed keys before dispatching new key press
- clearPresses();
-
- if (action == KeyEvent.ACTION_DOWN) {
- MainActivity.get().dispatchKeyEvent(new KeyEvent(action, keyCode));
- pressedKeys.add(keyCode);
- }
- }
- }
- }
-
-
- private static class InnerButton extends JoyPadButton {
-
- public InnerButton(final Context ctx) {
- super(ctx);
- }
-
- /**
- * Sets X coordinate relative to OuterButton.
- */
- public void setRelativeX(float x) {
- x = x + outerButton.getX();
-
- final float maxL = outerButton.getX();
- final float maxR = maxL + outerButton.getWidth();
-
- // don't move outside bounds of outer button
- if (x >= maxL && x <= maxR) {
- // use circle center
- setX(x - (getWidth() / 2));
- }
- }
-
- /**
- * Sets Y coordinate relative to OuterButton.
- */
- public void setRelativeY(float y) {
- y = y + outerButton.getY();
-
- final float maxT = outerButton.getY();
- final float maxB = maxT + outerButton.getHeight();
-
- // don't move outside bounds of outer button
- if (y >= maxT && y <= maxB) {
- // use circle center
- setY(y - (getHeight() / 2));
- }
- }
- }
-}
diff --git a/android/app/src/main/res/drawable/dpad_arrow_down.png b/android/app/src/main/res/drawable/dpad_arrow_down.png
deleted file mode 100644
index 1a133e2f7b..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_down.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_down_active.png b/android/app/src/main/res/drawable/dpad_arrow_down_active.png
deleted file mode 100644
index 878c087459..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_down_active.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_left.png b/android/app/src/main/res/drawable/dpad_arrow_left.png
deleted file mode 100644
index ec1f361e05..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_left.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_left_active.png b/android/app/src/main/res/drawable/dpad_arrow_left_active.png
deleted file mode 100644
index 0d160a5c6f..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_left_active.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_right.png b/android/app/src/main/res/drawable/dpad_arrow_right.png
deleted file mode 100644
index 4a4c819304..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_right.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_right_active.png b/android/app/src/main/res/drawable/dpad_arrow_right_active.png
deleted file mode 100644
index e56cfb7697..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_right_active.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_up.png b/android/app/src/main/res/drawable/dpad_arrow_up.png
deleted file mode 100644
index 9a74322f3f..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_up.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_arrow_up_active.png b/android/app/src/main/res/drawable/dpad_arrow_up_active.png
deleted file mode 100644
index 935508ce23..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_arrow_up_active.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_circle_inner.png b/android/app/src/main/res/drawable/dpad_circle_inner.png
deleted file mode 100644
index dd82532d29..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_circle_inner.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_circle_inner_active.png b/android/app/src/main/res/drawable/dpad_circle_inner_active.png
deleted file mode 100644
index fe204db8ac..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_circle_inner_active.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/dpad_circle_outer.png b/android/app/src/main/res/drawable/dpad_circle_outer.png
deleted file mode 100644
index 3e6dc4fd20..0000000000
Binary files a/android/app/src/main/res/drawable/dpad_circle_outer.png and /dev/null differ
diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index f7ec721633..0000000000
--- a/android/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/app/src/main/res/layout/activity_preferences.xml b/android/app/src/main/res/layout/activity_preferences.xml
deleted file mode 100644
index b0149fcbab..0000000000
--- a/android/app/src/main/res/layout/activity_preferences.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/android/app/src/main/res/values/array.xml b/android/app/src/main/res/values/array.xml
deleted file mode 100644
index 7121028d22..0000000000
--- a/android/app/src/main/res/values/array.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
- - Treasure Hunter
- - Woodland Fantasy
- - Land of Fearless
- - Medieval: Rejoicing
- - Medieval: The Old Tower Inn
-
-
-
- - title_01
- - title_02
- - title_03
- - title_04
- - title_05
-
-
-
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
deleted file mode 100644
index 6580879bff..0000000000
--- a/android/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
- Stendhal
-
-
diff --git a/android/app/src/main/res/xml/preferences.xml b/android/app/src/main/res/xml/preferences.xml
deleted file mode 100644
index 4c8bdf2e14..0000000000
--- a/android/app/src/main/res/xml/preferences.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/app/src/shared/java/org/arianne/stendhal/client/DebugLog.java b/android/app/src/shared/java/org/arianne/stendhal/client/DebugLog.java
deleted file mode 100644
index 1d258f59b3..0000000000
--- a/android/app/src/shared/java/org/arianne/stendhal/client/DebugLog.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/***************************************************************************
- * Copyright © 2022 - Arianne *
- ***************************************************************************
- ***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-package org.arianne.stendhal.client;
-
-import java.io.File;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-
-/**
- * Dummy class for release builds.
- */
-public class DebugLog {
-
- private static File logsDir;
-
- public static enum DebugLevel {
- INFO,
- WARN,
- ERROR,
- DEBUG
- }
-
- private static DebugLog instance;
-
-
- public static DebugLog get() {
- if (instance == null) {
- instance = new DebugLog();
- }
-
- return instance;
- }
-
- public static void init(final File dir, final AppCompatActivity activity) {
- logsDir = new File(dir.getPath() + "/logs");
- }
-
- public static void writeLine(final String text) {
- // do nothing
- }
-
- public static void writeLine(final String text, final DebugLevel level) {
- // do nothing
- }
-
- public static void info(final String text) {
- // do nothing
- }
-
- public static void warn(final String text) {
- // do nothing
- }
-
- public static void error(final String text) {
- // do nothing
- }
-
- public static void debug(final String text) {
- // do nothing
- }
-
- public static void notify(final String message) {
- // do nothing
- }
-
- public static void notify(final String message, final DebugLevel level) {
- // do nothing
- }
-
- public static String getLogsDir() {
- return logsDir.getPath();
- }
-}
diff --git a/android/gradlew b/android/gradlew
deleted file mode 100755
index 4f906e0c81..0000000000
--- a/android/gradlew
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env sh
-
-#
-# Copyright 2015 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=`expr $i + 1`
- done
- case $i in
- 0) set -- ;;
- 1) set -- "$args0" ;;
- 2) set -- "$args0" "$args1" ;;
- 3) set -- "$args0" "$args1" "$args2" ;;
- 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=`save "$@"`
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-exec "$JAVACMD" "$@"
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000000..a82f7921f3
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/godot/
diff --git a/android/.gitignore b/app/android/.gitignore
similarity index 93%
rename from android/.gitignore
rename to app/android/.gitignore
index 10cfdbfaf8..fe830f1d95 100644
--- a/android/.gitignore
+++ b/app/android/.gitignore
@@ -8,3 +8,4 @@
.externalNativeBuild
.cxx
local.properties
+/deps/
diff --git a/app/android/TODO.txt b/app/android/TODO.txt
new file mode 100644
index 0000000000..85087b78db
--- /dev/null
+++ b/app/android/TODO.txt
@@ -0,0 +1,7 @@
+
+TODO:
+- create activity for about information
+- add credits to about information
+- switch to Log4j for logging (maybe)
+- write debugging logs to sub-directory in user's home instead of ~/Android/data/org.stendhalgame.client
+- replace title_03 (Land of Fearless), title_04 (Rejoicing), & title_05 (The Old Tower Inn) music with non-looping versions or fix loops
diff --git a/android/build.gradle b/app/android/build.gradle
similarity index 89%
rename from android/build.gradle
rename to app/android/build.gradle
index 7a27a78553..51f1f1a40d 100644
--- a/android/build.gradle
+++ b/app/android/build.gradle
@@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath "com.android.tools.build:gradle:7.1.1"
+ classpath 'com.android.tools.build:gradle:7.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/android/app/.gitignore b/app/android/client/.gitignore
similarity index 100%
rename from android/app/.gitignore
rename to app/android/client/.gitignore
diff --git a/app/android/client/build.gradle b/app/android/client/build.gradle
new file mode 100644
index 0000000000..d5f56cb075
--- /dev/null
+++ b/app/android/client/build.gradle
@@ -0,0 +1,149 @@
+plugins {
+ id 'com.android.application'
+}
+
+android {
+ namespace "org.stendhalgame.client"
+ compileSdk 32
+
+ defaultConfig {
+ applicationId namespace
+ minSdk 21
+ targetSdk 32
+ versionCode 1049005
+ versionName "1.49.5"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ targetSdkVersion 32
+ minSdkVersion 21
+ }
+
+ // F-Droid doesn't allow encrypted DependencyInfoBlock in APK
+ dependenciesInfo {
+ // disables dependency metadata when building APKs
+ includeInApk = false
+ // disables dependency metadata when building Android App Bundles
+ includeInBundle = false
+ }
+
+ // build output
+ project.setProperty("archivesBaseName", "${namespace}-${defaultConfig.versionName}")
+ project.setProperty("buildDir", "${projectDir}/../../../build/build_android_client")
+
+ /* A keystore.properties file can be placed in the root Android project directory and must
+ * include the following values:
+ * storeFile=
+ * storePassword=
+ * keyPassword=
+ * keyAlias=
+ * The `storeFile` path value must use double backslashes (\\) on Windows.
+ */
+ def keystorePropertiesFile = rootProject.file("keystore.properties")
+ def keystoreProperties = new Properties()
+ if (keystorePropertiesFile.exists()) {
+ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
+ }
+
+ // denotes whether a signing key is found/configured
+ def unsigned = true;
+ // property to force use of ~/.android/debug.keystore signing key & generate if not found
+ def generateDebugKey = project.properties["generate-debug-key"] != null;
+
+ signingConfigs {
+ main {
+ if (keystorePropertiesFile.exists()) {
+ // use key configured in keystore.properties file
+ storeFile file(keystoreProperties["storeFile"])
+ storePassword keystoreProperties["storePassword"]
+ keyPassword keystoreProperties["keyPassword"]
+ keyAlias keystoreProperties["keyAlias"]
+ unsigned = false;
+ } else if (signingConfigs.debug.storeFile.exists()) {
+ // use debug key
+ initWith signingConfigs.debug
+ unsigned = false;
+ }
+ }
+
+ if (generateDebugKey && signingConfigs.main != signingConfigs.debug) {
+ // force using debug key
+ main {
+ initWith signingConfigs.debug
+ }
+ unsigned = false;
+ }
+ }
+
+ if (!unsigned && !generateDebugKey && !signingConfigs.main.storeFile.exists()) {
+ throw new Error("Signing key not found: " + signingConfigs.main.storeFile);
+ }
+
+ buildTypes {
+ debug {
+ applicationIdSuffix ".debug"
+ versionNameSuffix "-debug"
+ // prevent automatic generation of ~/.android/debug.keystore
+ signingConfig null
+ }
+
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+
+ if (generateDebugKey) {
+ // force using debug key & generate if not found
+ debug.signingConfig signingConfigs.debug
+ release.signingConfig signingConfigs.debug
+ } else if (!unsigned) {
+ // apply configured signing key to builds
+ debug.signingConfig signingConfigs.main
+ release.signingConfig signingConfigs.main
+ }
+ }
+
+ buildTypes.all { type ->
+ if (!type.name.equals("debug")) {
+ sourceSets[type.name].java { srcDirs "src/shared/java/" }
+ }
+ }
+
+ applicationVariants.all { variant ->
+ variant.outputs.all {
+ def buildRoot = "../../../../"
+ if (variant.name.equals("release")) {
+ // exclude "-release" suffix
+ outputFileName = outputFileName.replaceAll("(-release)(?!.*-release)", "")
+ }
+ // output to /build
+ outputFileName = new File("${buildRoot}", "${outputFileName}")
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ }
+ compileSdkVersion 32
+ buildToolsVersion '32.0.0'
+
+ lintOptions {
+ abortOnError false
+ }
+
+ // print some build info for debugging
+ println("Package: " + namespace)
+ println("Application ID: " + defaultConfig.applicationId)
+ println("Version: " + defaultConfig.versionCode)
+ println("Output basename: " + archivesBaseName)
+ println("Signing key: " + (unsigned ? "unsigned" : signingConfigs.main.storeFile))
+ println("Build directory: " + project.buildDir)
+}
+
+dependencies {
+ implementation "androidx.appcompat:appcompat:1.4.1"
+ implementation "com.google.android.material:material:1.4.0"
+ implementation "androidx.preference:preference-ktx:1.2.0"
+ //testImplementation 'junit:junit:4.+'
+ //androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ //androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+}
diff --git a/android/app/proguard-rules.pro b/app/android/client/proguard-rules.pro
similarity index 100%
rename from android/app/proguard-rules.pro
rename to app/android/client/proguard-rules.pro
diff --git a/app/android/client/src/debug/AndroidManifest.xml b/app/android/client/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000000..09fb137bc1
--- /dev/null
+++ b/app/android/client/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/app/android/client/src/debug/java/org/stendhalgame/client/Logger.java b/app/android/client/src/debug/java/org/stendhalgame/client/Logger.java
new file mode 100644
index 0000000000..2b01a6eb9a
--- /dev/null
+++ b/app/android/client/src/debug/java/org/stendhalgame/client/Logger.java
@@ -0,0 +1,277 @@
+/***************************************************************************
+ * Copyright © 2022-2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.util.Log;
+
+
+/**
+ * A class to output debugging information to logcat file.
+ */
+public class Logger {
+
+ /** Attribute denoting state of initialization. */
+ private static boolean initialized = false;
+ /** Logs directory. */
+ private static File logsDir;
+
+ /** Singleton instance. */
+ private static Logger instance;
+
+
+ /**
+ * Retrieves singleton instance.
+ */
+ public static Logger get() {
+ if (Logger.instance == null) {
+ Logger.instance = new Logger();
+ }
+ return Logger.instance;
+ }
+
+ /**
+ * Hidden singleton constructor.
+ */
+ private Logger() {
+ // do nothing
+ }
+
+ /**
+ * Initializes logs directory.
+ */
+ public static void init(final File dir) {
+ if (Logger.initialized) {
+ Logger.warn(true, "tried to re-initialize logger");
+ return;
+ }
+ Logger.initialized = true;
+ logsDir = new File(dir.getPath() + "/logs");
+ writeLine("\n // -- debugging initialized -- //", null);
+ writeLine("logs directory: " + logsDir.getPath());
+ }
+
+ /**
+ * Writes a line of text to log file.
+ *
+ * @param text
+ * Text to be written.
+ */
+ public static void writeLine(final String text) {
+ writeLine(text, LogLevel.DEBUG);
+ }
+
+ /**
+ * Writes a line of text to log file.
+ *
+ * @param text
+ * Text to be written.
+ * @param level
+ * Logging verbosity level.
+ */
+ public static void writeLine(String text, final LogLevel level) {
+ if (logsDir == null) {
+ System.err.println("ERROR: Logger not initialized. Call Logger.init.");
+ return;
+ }
+
+ if (!logsDir.exists()) {
+ logsDir.mkdirs();
+ }
+
+ if (level != null) {
+ text = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date())
+ + ": " + level.label + ": " + text;
+ }
+ text = text + "\n";
+
+ final String logFile = logsDir.getPath() + "/debug-"
+ + new SimpleDateFormat("yyyy.MM.dd").format(new Date()) + ".txt";
+
+ BufferedWriter buffer;
+ try {
+ buffer = new BufferedWriter(new FileWriter(logFile, true));
+ buffer.write(text);
+ if (buffer != null) {
+ buffer.close();
+ }
+ } catch (final IOException e) {
+ System.err.println("ERROR: " + e.getMessage());
+ }
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.INFO` verbosity.
+ *
+ * @param text
+ * Text to be written.
+ */
+ public static void info(final String text) {
+ Log.i("Logger", text);
+ writeLine(text, LogLevel.INFO);
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.INFO` verbosity.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be written.
+ */
+ public static void info(final boolean notify, final String text) {
+ Logger.info(text);
+ if (notify) {
+ Logger.notify(text, LogLevel.INFO);
+ }
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.WARN` verbosity.
+ *
+ * @param text
+ * Text to be written.
+ */
+ public static void warn(final String text) {
+ Log.w("Logger", text);
+ writeLine(text, LogLevel.WARN);
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.WARN` verbosity.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be written.
+ */
+ public static void warn(final boolean notify, final String text) {
+ Logger.warn(text);
+ if (notify) {
+ Logger.notify(text, LogLevel.WARN);
+ }
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.ERROR` verbosity.
+ *
+ * @param text
+ * Text to be written.
+ */
+ public static void error(final String text) {
+ Log.e("Logger", text);
+ writeLine(text, LogLevel.ERROR);
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.ERROR` verbosity.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be written.
+ */
+ public static void error(final boolean notify, final String text) {
+ Logger.error(text);
+ if (notify) {
+ Logger.notify(text, LogLevel.ERROR);
+ }
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.DEBUG` verbosity.
+ *
+ * @param text
+ * Text to be written.
+ */
+ public static void debug(final String text) {
+ Log.d("Logger", text);
+ writeLine(text, LogLevel.DEBUG);
+ }
+
+ /**
+ * Writes a line of text to log file at `LogLevel.DEBUG` verbosity.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be written.
+ */
+ public static void debug(final boolean notify, final String text) {
+ Logger.debug(text);
+ if (notify) {
+ Logger.notify(text, LogLevel.DEBUG);
+ }
+ }
+
+ /**
+ * Displays a toast notification to user.
+ *
+ * @param text
+ * Text to display in notification.
+ */
+ public static void notify(final String text) {
+ notify(text, LogLevel.INFO);
+ }
+
+ /**
+ * Displays a toast notification to user.
+ *
+ * Does not output to log file.
+ *
+ * @param text
+ * Text to display in notification.
+ * @param level
+ * Logging verbosity level.
+ */
+ public static void notify(final String text, LogLevel level) {
+ if (!Logger.initialized) {
+ System.err.println("ERROR: Logger not initialized. Call Logger.init.");
+ return;
+ }
+
+ if (level == null) {
+ level = LogLevel.INFO;
+ }
+
+ final AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.get());
+ builder.setTitle(level.label);
+ builder.setMessage(text);
+
+ builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ dialog.cancel();
+ }
+ });
+
+ builder.create().show();
+ }
+
+ /**
+ * Retrieves logs directory.
+ *
+ * @return
+ * Directory path to outpu logs.
+ */
+ public static String getLogsDir() {
+ return logsDir.getPath();
+ }
+}
diff --git a/android/app/src/debug/res/values/strings.xml b/app/android/client/src/debug/res/values/strings.xml
similarity index 51%
rename from android/app/src/debug/res/values/strings.xml
rename to app/android/client/src/debug/res/values/strings.xml
index a16a3ac620..c1d4e5fae9 100644
--- a/android/app/src/debug/res/values/strings.xml
+++ b/app/android/client/src/debug/res/values/strings.xml
@@ -3,5 +3,7 @@
Stendhal (debug)
+ stendhaldebug8gps5y99pu
+ debug
diff --git a/app/android/client/src/main/AndroidManifest.xml b/app/android/client/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..1bba5a16c7
--- /dev/null
+++ b/app/android/client/src/main/AndroidManifest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/ic_launcher-playstore.png b/app/android/client/src/main/ic_launcher-playstore.png
similarity index 100%
rename from android/app/src/main/ic_launcher-playstore.png
rename to app/android/client/src/main/ic_launcher-playstore.png
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/AppInfo.java b/app/android/client/src/main/java/org/stendhalgame/client/AppInfo.java
new file mode 100644
index 0000000000..7517f5a5b5
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/AppInfo.java
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright © 2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+package org.stendhalgame.client;
+
+
+/**
+ * App configuration information.
+ */
+class AppInfo {
+
+ /**
+ * Retrieves configured build type string.
+ */
+ public static String getBuildType() {
+ return MainActivity.get().getResources().getString(R.string.build_type);
+ }
+
+ /**
+ * Retrieves configured build version string.
+ */
+ public static String getBuildVersion() {
+ return MainActivity.get().getResources().getString(R.string.build_version);
+ }
+
+ /**
+ * Retrieves configured intent URL scheme string.
+ */
+ public static String getIntentUrlScheme() {
+ return MainActivity.get().getResources().getString(R.string.intent_url_scheme);
+ }
+}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/ClientView.java b/app/android/client/src/main/java/org/stendhalgame/client/ClientView.java
new file mode 100644
index 0000000000..d3bb03015a
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/ClientView.java
@@ -0,0 +1,603 @@
+/***************************************************************************
+ * Copyright © 2022-2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import java.util.Random;
+
+import android.app.AlertDialog;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.graphics.Bitmap;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.ViewGroup;
+import android.view.inputmethod.InputMethodManager;
+import android.webkit.DownloadListener;
+import android.webkit.WebChromeClient;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+
+/**
+ * Interface to handle web content.
+ */
+public class ClientView extends WebView {
+
+ /** Client URL path. */
+ private String clientUrlSuffix = "client";
+
+ /** Determines type of client to connect to. */
+ private boolean testClient = false;
+ /** Determines type of server to connect to. */
+ private boolean testServer = false;
+ private Boolean debugging;
+ /** ID of page currently loaded. */
+ private PageId currentPage;
+ /** ID of page previously loaded. */
+ private PageId previousPage;
+
+ private String stateId = "";
+ private String seed = "";
+
+
+ /**
+ * Creates a new view.
+ *
+ * @param ctx
+ * Activity Context to access application assets.
+ */
+ public ClientView(final Context ctx) {
+ super(ctx);
+ onInit();
+ }
+
+ /**
+ * Creates a new view.
+ *
+ * @param ctx
+ * Activity Context to access application assets.
+ * @param attrs
+ * AttributeSet passed to parent (may be `null`).
+ */
+ public ClientView(final Context ctx, final AttributeSet attrs) {
+ super(ctx, attrs);
+ onInit();
+ }
+
+ /**
+ * Creates a new view.
+ *
+ * @param ctx
+ * Activity Context to access application assets.
+ * @param attrs
+ * AttributeSet passed to parent (may be `null`).
+ * @param style
+ * Attribute in the current theme that contains a reference to a style resource that supplies
+ * default values for the view (can be 0 to not look for defaults).
+ */
+ public ClientView(final Context ctx, final AttributeSet attrs, final int style) {
+ super(ctx, attrs, style);
+ onInit();
+ }
+
+ /**
+ * Initializes client WebView interface.
+ */
+ private void onInit() {
+ setActive(false); // main activity manages initial visibility
+ setBackgroundColor(Color.TRANSPARENT);
+
+ // expand to size of parent constraints
+ setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+
+ final WebSettings viewSettings = getSettings();
+ viewSettings.setJavaScriptEnabled(true);
+ viewSettings.setDomStorageEnabled(true);
+
+ // keep elements in position in portrait mode
+ viewSettings.setLoadWithOverviewMode(true);
+ viewSettings.setUseWideViewPort(true);
+
+ // zoom controls
+ viewSettings.setSupportZoom(true);
+ viewSettings.setBuiltInZoomControls(true);
+ viewSettings.setDisplayZoomControls(false);
+
+ // allow autoplay of music
+ viewSettings.setMediaPlaybackRequiresUserGesture(false);
+
+ if (debugEnabled()) {
+ // make WebView debuggable for debug builds
+ setWebContentsDebuggingEnabled(true);
+ }
+
+ initWebViewClient();
+ initDownloadHandler();
+ }
+
+ /**
+ * Sets active state of this client view.
+ *
+ * @param active
+ * If `true` shows this client view, otherwise hides it.
+ */
+ public void setActive(final boolean active) {
+ if (active) {
+ setVisibility(ClientView.VISIBLE);
+ return;
+ }
+ setVisibility(ClientView.GONE);
+ }
+
+ /**
+ * Checks active state of client view.
+ *
+ * @return
+ * `true` is this view is visible.
+ */
+ public boolean isActive() {
+ return getVisibility() == ClientView.VISIBLE;
+ }
+
+ /**
+ * Initializes method overrides to handle page loading.
+ */
+ private void initWebViewClient() {
+ // XXX: not sure setting WebChromClient is doing anything, was recommended to
+ // fix touchmove events not registering
+ setWebChromeClient(new WebChromeClient());
+
+ setWebViewClient(new WebViewClient() {
+ /**
+ * Handles pages loaded indirectly.
+ *
+ * @param view
+ * The default WebView instance handling the request.
+ * @param request
+ * Web request including the URL to be loaded.
+ * @return
+ * `true` to abort default loading.
+ */
+ @Override
+ public boolean shouldOverrideUrlLoading(final WebView view, final WebResourceRequest request) {
+ Uri uri = request.getUrl();
+ final Uri.Builder builder = uri.buildUpon();
+ if (UrlHelper.isLoginUri(uri)) {
+ builder.appendQueryParameter("build", AppInfo.getBuildType());
+ builder.appendQueryParameter("version", AppInfo.getBuildVersion());
+ builder.appendQueryParameter("state", stateId);
+ builder.appendQueryParameter("seed", seed);
+ }
+ uri = builder.build();
+ if (!UrlHelper.isInternalUri(uri)) {
+ // open external links in default browser/app
+ // FIXME: should we ask for confirmation?
+ try {
+ MainActivity.get().startActivity(new Intent(Intent.ACTION_VIEW, uri));
+ } catch (final ActivityNotFoundException e) {
+ Notifier.toast("No app found to open this link");
+ }
+ return true;
+ }
+ view.loadUrl(UrlHelper.checkClientUrl(uri.toString()));
+ return true;
+ }
+
+ /**
+ * Called before a URL is loaded.
+ *
+ * @param view
+ * WebView instance handling page contents.
+ * @param url
+ * HTTP string of target page.
+ * @param favicon
+ * Favicon bitmap image.
+ */
+ @Override
+ public void onPageStarted(final WebView view, final String url, final Bitmap favicon) {
+ MusicPlayer.stopMusic();
+ super.onPageStarted(view, url, favicon);
+ }
+
+ /**
+ * Called after a URL is loaded.
+ *
+ * @param view
+ * WebView instance handling page contents.
+ * @param url
+ * HTTP string of target page.
+ */
+ @Override
+ public void onPageFinished(final WebView view, final String url) {
+ super.onPageFinished(view, url);
+ if (UrlHelper.isClientUrl(url)) {
+ setPage(PageId.WEBCLIENT);
+ } else if (url.equals("") || url.equals("about:blank")) {
+ setPage(PageId.TITLE);
+ if (PreferencesActivity.getBoolean("title_music", true)) {
+ MusicPlayer.playTitleMusic();
+ }
+ } else {
+ setPage(PageId.OTHER);
+ }
+ Menu.get().updateButtons();
+ Logger.debug("page id: " + currentPage);
+ }
+ });
+ }
+
+ /**
+ * deprecated?
+ */
+ @Override
+ public boolean dispatchKeyEvent(final KeyEvent event) {
+ final boolean ret = super.dispatchKeyEvent(event);
+ // hide keyboard when "enter" pressed
+ if (isGameActive() && event.getAction() == KeyEvent.ACTION_UP
+ && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
+ ((InputMethodManager) MainActivity.get()
+ .getSystemService(Context.INPUT_METHOD_SERVICE))
+ .hideSoftInputFromWindow(this.getWindowToken(), 0);
+ }
+ return ret;
+ }
+
+ /**
+ * Initializes interface for handling screenshots.
+ */
+ private void initDownloadHandler() {
+ setDownloadListener(new DownloadListener() {
+ /**
+ * Handles downloading screenshot created by web client.
+ *
+ * TODO: get filename to pass to `DownloadHandler.download` from "download" property of
+ * anchor
+ *
+ * @param url
+ * Content URL to the screenshot image.
+ * @param userAgent
+ * User agent used for download.
+ * @param contentDisposition
+ * Content-disposition HTTP header, if present.
+ * @param mimetype
+ * Content type reported by server (web client creates PNG image).
+ * @param contentLength
+ * File size reported by server.
+ */
+ @Override
+ public void onDownloadStart(final String url, final String userAgent,
+ final String contentDisposition, final String mimetype, final long contentLength) {
+ final DownloadHandler handler = new DownloadHandler();
+ handler.download(url, mimetype);
+ if (handler.getResult()) {
+ final String msg = "Downloaded file: " + handler.getMessage();
+ Logger.debug(msg);
+ Notifier.toast(msg);
+ } else {
+ final String msg = handler.getMessage();
+ Logger.error(msg);
+ Notifier.toast("ERROR: " + msg);
+ }
+ }
+ });
+ }
+
+ /**
+ * Verifies intent state & parses & loads target URL.
+ *
+ * @param intent
+ * Called login intent with state verification.
+ */
+ public void checkLoginIntent(final Intent intent) {
+ final Uri intentUri = intent.getData();
+ final String url = intentUri.getQueryParameter("url");
+ final String loginseed = intentUri.getQueryParameter("loginseed");
+ final String intentStateId = intentUri.getQueryParameter("state");
+ if (stateId == null || intentStateId == null || url == null || "".equals(stateId) || !stateId.equals(intentStateId)) {
+ final String err = "There was an error verifying login";
+ Logger.error(err + " (\"" + stateId + "\" == \"" + intentStateId + "\")");
+ Notifier.showMessage(err);
+ if (currentPage == null || PageId.TITLE.equals(previousPage)) {
+ // reload title
+ loadTitleScreen();
+ }
+ return;
+ }
+ String completeUrl = url + "&loginseed=" + loginseed + seed;
+ loadUrl(UrlHelper.checkClientUrl(completeUrl));
+ }
+
+ /**
+ * Determines if URL to load is test web client.
+ */
+ public boolean isTestClient() {
+ return testClient;
+ }
+
+ /**
+ * Determines if connection is to test server.
+ */
+ public boolean isTestServer() {
+ return testServer;
+ }
+
+ /**
+ * Retrieves a string representing the selected client.
+ *
+ * @return
+ * One of "main", "test", or "none".
+ */
+ public String getSelectedClient() {
+ if (onTitleScreen()) {
+ return "none";
+ }
+ return testClient ? "test" : "main";
+ }
+
+ /**
+ * Retrieves a string representing the selected server.
+ *
+ * @return
+ * One of "main", "test", or "none".
+ */
+ public String getSelectedServer() {
+ if (onTitleScreen()) {
+ return "none";
+ }
+ return testServer ? "test" : "main";
+ }
+
+ /**
+ * Resets selected client & server values to default.
+ */
+ private void reset() {
+ testClient = false;
+ testServer = false;
+ clientUrlSuffix = "client";
+ stateId = "";
+ seed = "";
+ }
+
+ /**
+ * Retrieves client type string.
+ *
+ * @return
+ * Either "client" or "testclient".
+ */
+ public String getClientUrlSuffix() {
+ return clientUrlSuffix;
+ }
+
+ /**
+ * Generates a random string for identifying state.
+ */
+ private String generateRandomString() {
+ // ensure state is reset before generating
+ String result = "";
+
+ // useable characters
+ String charList = "0123456789";
+ for (char c = 'A'; c <= 'Z'; c++) {
+ charList += c;
+ }
+ for (char c = 'a'; c <= 'z'; c++) {
+ charList += c;
+ }
+
+ // generate random state
+ final Random rand = new Random();
+ final int ccount = charList.length();
+ for (int idx = 0; idx <= 20 ; idx++) {
+ result += charList.charAt(rand.nextInt(ccount));
+ }
+ return result;
+ }
+
+ /**
+ * Opens location in client WebView.
+ *
+ * @param url
+ * URL to load.
+ */
+ @Override
+ public void loadUrl(final String url) {
+ Logger.debug("Loading URL: " + url);
+ super.loadUrl(url);
+ }
+
+ /**
+ * Shows initial title screen.
+ */
+ public void loadTitleScreen() {
+ reset();
+ setPage(PageId.TITLE);
+ SplashUtil.get().setVisible(true);
+ loadUrl("about:blank");
+ Menu.get().show();
+ }
+
+ /**
+ * Attempts to connect to client host.
+ *
+ * FIXME: rename as it may cause confusion in regards to loading page "account/login.html"
+ */
+ public void loadLogin() {
+ if (debugEnabled() && PreferencesActivity.getString("client_url").trim().equals("")) {
+ // debug builds support choosing between main & test client/server
+ selectClient();
+ } else {
+ onSelectServer();
+ }
+ }
+
+ /**
+ * Opens a message dialog for user to choose between main & test clients.
+ */
+ private void selectClient() {
+ final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ builder.setMessage("Select client");
+
+ builder.setPositiveButton("Main", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ testClient = false;
+ clientUrlSuffix = "client";
+ // skip server confirmation as only test client has this option
+ onSelectServer();
+ dialog.cancel();
+ }
+ });
+
+ builder.setNegativeButton("Test", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ testClient = true;
+ clientUrlSuffix = "testclient";
+ selectServer();
+ dialog.cancel();
+ }
+ });
+
+ builder.create().show();
+ }
+
+ /**
+ * Opens a message dialog for user to choose between main & test servers.
+ */
+ private void selectServer() {
+ final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+ builder.setMessage("Select server");
+
+ builder.setPositiveButton("Main", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ testServer = false;
+ dialog.cancel();
+ onSelectServer();
+ }
+ });
+
+ builder.setNegativeButton("Test", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ testServer = true;
+ dialog.cancel();
+ onSelectServer();
+ }
+ });
+
+ builder.create().show();
+ }
+
+ /**
+ * Connects to server & loads initial page.
+ */
+ private void onSelectServer() {
+ // create a unique state
+ stateId = generateRandomString();
+ seed = generateRandomString();
+ // hide splash image
+ SplashUtil.get().setVisible(false);
+
+ final String initialPage = UrlHelper.getInitialPageUrl();
+ Logger.debug("Loading initial page: " + initialPage);
+ loadUrl(initialPage);
+ setPage(PageId.OTHER);
+ // hide menu after exiting title screen
+ Menu.get().hide();
+ }
+
+ /**
+ * Checks if user has specified a URL pointing to a custom server/client.
+ *
+ * @return
+ * Server address specified in preferences or `null`.
+ */
+ public String checkCustomServer() {
+ final String cs = PreferencesActivity.getString("client_url", "").trim();
+ if (cs.equals("")) {
+ return null;
+ }
+ return cs;
+ }
+
+ /**
+ * Checks if title page is currently loaded.
+ *
+ * @return
+ * `true` if current page matches `PageId.TITLE`.
+ */
+ public boolean onTitleScreen() {
+ return currentPage == PageId.TITLE;
+ }
+
+ /**
+ * Checks if web client page is currently loaded.
+ *
+ * @return
+ * `true` if current page matches `PageId.WEBCLIENT`.
+ */
+ public boolean isGameActive() {
+ return currentPage == PageId.WEBCLIENT;
+ }
+
+ /**
+ * Retrieves ID of current page.
+ *
+ * @return
+ * Current `PageId`.
+ */
+ public PageId getCurrentPageId() {
+ return currentPage;
+ }
+
+ /**
+ * Sets current page ID.
+ *
+ * @param newPage
+ * Page ID to be used.
+ */
+ private void setPage(final PageId newPage) {
+ previousPage = currentPage;
+ currentPage = newPage;
+ if (previousPage == null) {
+ previousPage = currentPage;
+ }
+ }
+
+ /**
+ * Checks if this is a debug build.
+ *
+ * @return
+ * `true` if debug flag set.
+ */
+ public boolean debugEnabled() {
+ if (debugging != null) {
+ return debugging;
+ }
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ debugging = (MainActivity.get().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
+ } else {
+ debugging = false;
+ }
+ return debugging;
+ }
+}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/DownloadHandler.java b/app/android/client/src/main/java/org/stendhalgame/client/DownloadHandler.java
new file mode 100644
index 0000000000..29a423d24d
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/DownloadHandler.java
@@ -0,0 +1,228 @@
+/***************************************************************************
+ * Copyright © 2022-2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import android.net.Uri;
+import android.os.Environment;
+import android.util.Base64;
+
+
+/**
+ * The main purpose of this class is to handle downloading screenshots
+ * created by the web client page.
+ */
+public class DownloadHandler {
+
+ private static enum DownloadType {
+ IMAGE_PNG("image/png"),
+ TEXT_PLAIN("text/plain"),
+ UNSUPPORTED(null);
+
+ private String value;
+
+ private DownloadType(final String value) {
+ this.value = value;
+ }
+
+ public static DownloadType fromString(final String value) {
+ for (final DownloadType v: DownloadType.values()) {
+ if (v.value != null && v.value.equals(value)) {
+ return v;
+ }
+ }
+ return DownloadType.UNSUPPORTED;
+ }
+ }
+
+ private boolean result = false;
+ private String message = null;
+
+
+ /**
+ * Checks for a supported MIME type.
+ *
+ * @param url
+ * File or data URL.
+ * @param mimetype
+ * Detected MIME type.
+ * @return
+ * Download type or unsupported.
+ */
+ private DownloadType checkMimeType(final String url, final String mimetype) {
+ final DownloadType dtype = DownloadType.fromString(mimetype);
+ if (DownloadType.UNSUPPORTED.equals(dtype) && url.startsWith("data:image/png;base64,")) {
+ return DownloadType.IMAGE_PNG;
+ }
+ return dtype;
+ }
+
+ /**
+ * Writes file data to device storage.
+ *
+ * @param dir
+ * Directory where new file is to be created.
+ * @param basename
+ * Filename of new file.
+ * @param data
+ * File contents to be written to storage.
+ */
+ private void downloadInternal(final File dir, final String basename, final byte[] data) {
+ String stacktrace = null;
+ try {
+ if (!dir.exists()) {
+ dir.mkdirs();
+ }
+ final FileOutputStream fos = new FileOutputStream(new File(dir, basename));
+ fos.write(data);
+ fos.close();
+ this.result = true;
+ } catch (final java.lang.NoClassDefFoundError e) {
+ this.message = "an error occurred while decoding data (see debug log for more info)";
+ stacktrace = stackTraceToString(e);
+ } catch (java.io.IOException e) {
+ this.message = "an error occurred while attempting to write file (see debug log for more info)";
+ stacktrace = stackTraceToString(e);
+ }
+
+ if (stacktrace != null) {
+ Logger.error(stacktrace.toString());
+ }
+ }
+
+ /**
+ * Writes file data to device storage.
+ *
+ * @param url
+ * A data URL.
+ * @param mimetype
+ * Detected MIME type.
+ * @param targetName
+ * Filename for new file.
+ */
+ public void download(final String url, final String mimetype, String targetName) {
+
+ final Uri uri = Uri.parse(url);
+ final String scheme = uri.getScheme();
+ final String storageState = Environment.getExternalStorageState();
+ final DownloadType dtype = checkMimeType(url, mimetype);
+
+ if (!MainActivity.get().getActiveClientView().isGameActive()) {
+ this.message = "downloading from this page not supported";
+ } else if (!"data".equals(scheme)) {
+ // only data URL supported
+ this.message = "download type \"" + scheme + "\" not supported";
+ } else if (DownloadType.UNSUPPORTED.equals(dtype)) {
+ this.message = "mimetype not supported: " + mimetype;
+ } else if (!Environment.MEDIA_MOUNTED.equals(storageState)) {
+ this.message = "storage not available for writing (state: " + storageState + ")";
+ } else if (DownloadType.IMAGE_PNG.equals(dtype)) {
+ final File targetDir = new File(Environment.getExternalStorageDirectory()
+ + "/Pictures/Screenshots");
+ if (targetName == null) {
+ // default filename
+ targetName = "stendhal_" + new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(new Date())
+ + ".png";
+ }
+
+ Logger.debug("Saving screenshot: " + targetDir.getPath()
+ + "/" + targetName + " (" + mimetype + ")");
+
+ final byte[] data = Base64.decode(url.split("base64,")[1], Base64.DEFAULT);
+ downloadInternal(targetDir, targetName, data);
+ if (this.result) {
+ this.message = "saved screenshot to " + targetDir.getPath() + "/" + targetName;
+ }
+ } else if (DownloadType.TEXT_PLAIN.equals(dtype)) {
+ // `Environment.DIRECTORY_DOWNLOADS` fails on newer Android versions
+ //final File targetDir = new File(Environment.DIRECTORY_DOWNLOADS);
+ final File targetDir = new File(Environment.getExternalStorageDirectory() + "/Download");
+ if (targetName == null) {
+ // default filename
+ targetName = "stendhal_" + new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(new Date())
+ + ".txt";
+ }
+
+ Logger.debug("Saving file: " + targetDir.getPath()
+ + "/" + targetName + " (" + mimetype + ")");
+
+ final String[] parts = url.split(",");
+ byte[] data;
+ if (parts[0].endsWith(";base64")) {
+ data = Base64.decode(parts[1], Base64.DEFAULT);
+ } else {
+ try {
+ data = URLDecoder.decode(parts[1], StandardCharsets.UTF_8.name())
+ .getBytes(StandardCharsets.UTF_8);
+ } catch (final java.io.UnsupportedEncodingException e) {
+ this.message = "an error occurred while attempting to decode data URL (see debug log for more info)";
+ Logger.error(stackTraceToString(e));
+ return;
+ }
+ }
+
+ downloadInternal(targetDir, targetName, data);
+ if (this.result) {
+ this.message = "file saved to " + targetDir.getPath() + "/" + targetName;
+ }
+ } else {
+ this.message = "an unknown error occurred";
+ }
+ }
+
+ /**
+ * Writes file data to device storage.
+ *
+ * @param url
+ * A data URL.
+ * @param mimetype
+ * Detected MIME type.
+ */
+ public void download(final String url, final String mimetype) {
+ download(url, mimetype, null);
+ }
+
+ public boolean getResult() {
+ return result;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Converts an exception stacktrace to string.
+ *
+ * @param e
+ * The error with stacktrace information.
+ * @return
+ * String formatted stacktrace.
+ */
+ private String stackTraceToString(final Throwable e) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append(e.toString());
+ for (final StackTraceElement ste: e.getStackTrace()) {
+ if (sb.length() > 0) {
+ sb.append("\n");
+ }
+ sb.append(ste.toString());
+ }
+
+ return sb.toString();
+ }
+}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/LogLevel.java b/app/android/client/src/main/java/org/stendhalgame/client/LogLevel.java
new file mode 100644
index 0000000000..0e3281bc77
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/LogLevel.java
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright © 2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+
+/**
+ * Logger verbosity levels.
+ */
+public enum LogLevel {
+
+ // available verbosity levels
+ INFO("INFO"),
+ WARN("WARN"),
+ ERROR("ERROR"),
+ DEBUG("DEBUG");
+
+ /** String identifier. */
+ public final String label;
+
+
+ /**
+ * Creates a new logging verbosity level.
+ *
+ * @param label
+ * String identifier.
+ */
+ private LogLevel(final String label) {
+ this.label = label;
+ }
+}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/MainActivity.java b/app/android/client/src/main/java/org/stendhalgame/client/MainActivity.java
new file mode 100644
index 0000000000..cd30145b99
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/MainActivity.java
@@ -0,0 +1,282 @@
+/***************************************************************************
+ * Copyright © 2022-2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.view.ViewGroup;
+import androidx.appcompat.app.AppCompatActivity;
+
+
+/**
+ * Main app activity.
+ */
+public class MainActivity extends AppCompatActivity {
+
+ /** Menu instance. */
+ private Menu menu;
+ /** Active clients. **/
+ private ViewGroup clientList;
+
+ /** Static activity instance. */
+ private static MainActivity instance;
+
+
+ /**
+ * Retrieves activity instance.
+ *
+ * NOTE: This may not be necessary if Android has built-in methods to retrieve current activity.
+ */
+ public static MainActivity get() {
+ return MainActivity.instance;
+ }
+
+ /**
+ * Called when main activity is created.
+ */
+ @Override
+ protected void onCreate(final Bundle savedInstanceState) {
+ try {
+ super.onCreate(savedInstanceState);
+ // FIXME: may be considered unsafe as this is not technically a singleton
+ MainActivity.instance = this;
+
+ // initialize debug logging mechanism
+ Logger.init(getExternalFilesDir(null));
+
+ setContentView(R.layout.activity_main);
+ clientList = findViewById(R.id.clientList);
+ createClientView();
+ // NOTE: client view instance must be created before initializing menu
+ menu = Menu.get();
+ updateOrientation();
+ } catch (final Exception e) {
+ // TODO: add option to save to file or copy to clipboard the error
+ e.printStackTrace();
+ Logger.error(e.toString());
+ Logger.error("// -- //");
+ final StringBuilder sb = new StringBuilder();
+ for (final StackTraceElement ste: e.getStackTrace()) {
+ final String traceLine = ste.toString();
+ if (sb.length() > 0) {
+ sb.append("\n");
+ }
+ sb.append(traceLine);
+ Logger.error(traceLine);
+ }
+ Logger.error("// -- //");
+ Notifier.showPrompt(
+ "An unhandled exception has occurred: \"" + e.getMessage() + "\""
+ + "\n\nYou can report this error at: https://stendhalgame.org/development/bug.html"
+ + "\n\nStack trace:\n" + sb.toString(),
+ new Notifier.Action() {
+ @Override
+ protected void onCall() {
+ finish();
+ }
+ });
+ }
+ }
+
+ /**
+ * Handles toggling menu when the system "back" button is pressed.
+ */
+ @Override
+ public void onBackPressed() {
+ menu.toggleVisibility();
+ }
+
+ /**
+ * Creates view to host a client instance.
+ */
+ private void createClientView() {
+ final ClientView clientView = new ClientView(this);
+ setActiveClientView(clientView);
+ clientList.addView(clientView);
+ clientView.loadTitleScreen();
+ // show splash when a new view is created
+ SplashUtil.get().setVisible(true);
+ }
+
+ /**
+ * Sets client view to be shown and hides all others.
+ *
+ * @param clientView
+ * The `ClientView` instance to be visible.
+ */
+ private void setActiveClientView(final ClientView clientView) {
+ for (int idx = 0; idx < clientList.getChildCount(); idx++) {
+ ((ClientView) clientList.getChildAt(idx)).setActive(false);
+ }
+ clientView.setActive(true);
+ }
+
+ /**
+ * Sets client view to be shown and hides all others.
+ *
+ * @param clientIndex
+ * The index of `ClientView` instance to be visible.
+ */
+ private void setActiveClientView(final int clientIndex) {
+ if (clientIndex < 0 || clientIndex >= clientList.getChildCount()) {
+ Logger.error(true, "Tried to access invalid client index: " + clientIndex);
+ return;
+ }
+ setActiveClientView((ClientView) clientList.getChildAt(clientIndex));
+ }
+
+ /**
+ * Retrieves active client view.
+ *
+ * @return
+ * `ClientView` instance that is visible.
+ */
+ public ClientView getActiveClientView() {
+ for (int idx = 0; idx < clientList.getChildCount(); idx++) {
+ final ClientView clientView = (ClientView) clientList.getChildAt(idx);
+ if (clientView.isActive()) {
+ return clientView;
+ }
+ }
+ // default to first client view
+ return (ClientView) clientList.getChildAt(0);
+ }
+
+ /**
+ * Retrieves list of available client views.
+ *
+ * @return
+ * List containing all created `ClientView` instances.
+ */
+ public List getClientViewList() {
+ final List available = new LinkedList<>();
+ for (int idx = 0; idx < clientList.getChildCount(); idx++) {
+ available.add((ClientView) clientList.getChildAt(idx));
+ }
+ return available;
+ }
+
+ /**
+ * Attempts to connect to client host.
+ */
+ public void loadLogin() {
+ getActiveClientView().loadLogin();
+ }
+
+ /**
+ * Retrieves app orientation.
+ *
+ * @return
+ * One of `Configuration.ORIENTATION_PORTRAIT` (1), `Configuration.ORIENTATION_LANDSCAPE` (2),
+ * or `Configuration.ORIENTATION_UNDEFINED` (0).
+ */
+ public int getOrientation() {
+ return getResources().getConfiguration().orientation;
+ }
+
+ /**
+ * Sets screen orientation to user setting or locks in landscape or portrait.
+ */
+ public void updateOrientation() {
+ final String value = PreferencesActivity.getString("orientation");
+ int orient = ActivityInfo.SCREEN_ORIENTATION_USER;
+ switch (value) {
+ case "landscape":
+ orient = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
+ break;
+ case "portrait":
+ orient = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
+ break;
+ }
+ // set orientation for main & sub activities
+ setRequestedOrientation(orient);
+ final PreferencesActivity preferencesActivity = PreferencesActivity.get();
+ if (preferencesActivity != null) {
+ preferencesActivity.setRequestedOrientation(orient);
+ }
+ }
+
+ /**
+ * Opens a dialog to confirm exiting activity.
+ */
+ public void onRequestQuit() {
+ final AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage("Quit Stendhal?");
+
+ builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ finish();
+ android.os.Process.killProcess(android.os.Process.myPid());
+ }
+ });
+
+ builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ dialog.cancel();
+ }
+ });
+
+ final AlertDialog confirmQuit = builder.create();
+ confirmQuit.show();
+ }
+
+ //~ @Override
+ //~ protected void onResume() {
+ //~ super.onResume();
+ //~ }
+
+ /**
+ * Listens for changes to orientation.
+ */
+ @Override
+ public void onConfigurationChanged(final Configuration config) {
+ super.onConfigurationChanged(config);
+ final ClientView clientView = getActiveClientView();
+ if (clientView != null && PageId.TITLE.equals(clientView.getCurrentPageId())) {
+ SplashUtil.get().update();
+ }
+ }
+
+ /**
+ * Called when main activity ends.
+ */
+ @Override
+ public void finish() {
+ Logger.debug(MainActivity.class.getName() + ".finish() called");
+ super.finish();
+ }
+
+ /**
+ * Called when main activity is destroyed.
+ */
+ @Override
+ protected void onDestroy() {
+ Logger.debug(MainActivity.class.getName() + ".onDestroy() called");
+ super.onDestroy();
+ }
+
+ /**
+ * Creates preferences activity.
+ */
+ public void showSettings() {
+ startActivity(new Intent(this, PreferencesActivity.class));
+ }
+}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/Menu.java b/app/android/client/src/main/java/org/stendhalgame/client/Menu.java
similarity index 62%
rename from android/app/src/main/java/org/arianne/stendhal/client/Menu.java
rename to app/android/client/src/main/java/org/stendhalgame/client/Menu.java
index 656e593f72..ec649cd6ab 100644
--- a/android/app/src/main/java/org/arianne/stendhal/client/Menu.java
+++ b/app/android/client/src/main/java/org/stendhalgame/client/Menu.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright © 2022 - Arianne *
+ * Copyright © 2022-2024 - Faiumoni e. V. *
***************************************************************************
***************************************************************************
* *
@@ -9,40 +9,45 @@
* (at your option) any later version. *
* *
***************************************************************************/
-package org.arianne.stendhal.client;
+package org.stendhalgame.client;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.Context;
-import android.content.DialogInterface;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.Toolbar;
+/**
+ * Main menu for navigation & configuration.
+ */
public class Menu {
- private static Menu instance;
-
- private final Context ctx;
+ /** Toolbar representing menu. */
private final Toolbar nav;
private Button btn_connect;
private Button btn_title;
private Button btn_reload;
+ /** Singleton instance. */
+ private static Menu instance;
+
+ /**
+ * Retrieves menu singleton instance.
+ */
public static Menu get() {
+ if (Menu.instance == null) {
+ Menu.instance = new Menu();
+ }
return instance;
}
- public Menu(final Context ctx) {
- instance = this;
- this.ctx = ctx;
-
- nav = (Toolbar) ((Activity) ctx).findViewById(R.id.menu_main);
-
+ /**
+ * Hidden singleton constructor.
+ */
+ private Menu() {
+ nav = (Toolbar) MainActivity.get().findViewById(R.id.menu_main);
nav.setTag(nav.getVisibility());
nav.getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
@@ -53,20 +58,30 @@ public class Menu {
}
}
});
-
initButtonHandlers();
-
- DebugLog.debug("menu initialized");
+ Logger.debug("menu initialized");
}
+ /**
+ * Retrieves the menu toolbar.
+ */
public Toolbar getInternal() {
return nav;
}
+ /**
+ * Shows or hides menu.
+ *
+ * @param vType
+ * Visibility type. One of `View.VISIBLE`, `View.INVISIBLE`, or `View.GONE`.
+ */
public void setVisibility(final int vType) {
nav.setVisibility(vType);
}
+ /**
+ * Toggles visible state of menu.
+ */
public void toggleVisibility() {
if (nav.getVisibility() == View.GONE) {
nav.setVisibility(View.VISIBLE);
@@ -75,16 +90,25 @@ public class Menu {
}
}
+ /**
+ * Sets menu visibility to visible.
+ */
public void show() {
nav.setVisibility(View.VISIBLE);
}
+ /**
+ * Sets menu visibility to hidden.
+ */
public void hide() {
nav.setVisibility(View.GONE);
}
+ /**
+ * Refreshes displayed menu buttons.
+ */
public void updateButtons() {
- final PageId page = ClientView.getCurrentPageId();
+ final PageId page = MainActivity.get().getActiveClientView().getCurrentPageId();
btn_connect.setVisibility(View.GONE);
btn_title.setVisibility(View.GONE);
@@ -102,10 +126,11 @@ public class Menu {
* Sets actions when buttons are pressed.
*/
private void initButtonHandlers() {
- final MainActivity activity = (MainActivity) ctx;
+ final MainActivity activity = MainActivity.get();
btn_connect = (Button) activity.findViewById(R.id.btn_connect);
btn_connect.setOnClickListener(new View.OnClickListener() {
+ @Override
public void onClick(final View v) {
activity.loadLogin();
}
@@ -113,17 +138,20 @@ public class Menu {
btn_title = (Button) activity.findViewById(R.id.btn_title);
btn_title.setOnClickListener(new View.OnClickListener() {
+ @Override
public void onClick(final View v) {
nav.setVisibility(View.GONE);
- Notifier.get().showPrompt("Return to title screen?",
+ Notifier.showPrompt("Return to title screen?",
new Notifier.Action() {
+ @Override
protected void onCall() {
- ClientView.get().loadTitleScreen();
+ MainActivity.get().getActiveClientView().loadTitleScreen();
updateButtons();
}
},
new Notifier.Action() {
+ @Override
protected void onCall() {/* do nothing */}
}
);
@@ -132,14 +160,15 @@ public class Menu {
btn_reload = (Button) activity.findViewById(R.id.btn_reload);
btn_reload.setOnClickListener(new View.OnClickListener() {
+ @Override
public void onClick(final View v) {
nav.setVisibility(View.GONE);
- Notifier.get().showPrompt("Reload page?",
+ Notifier.showPrompt("Reload page?",
new Notifier.Action() {
@Override
protected void onCall() {
- ClientView.get().reload();
+ MainActivity.get().getActiveClientView().reload();
}
},
new Notifier.Action() {
@@ -153,38 +182,57 @@ public class Menu {
final Button btn_settings = (Button) activity.findViewById(R.id.btn_settings);
btn_settings.setOnClickListener(new ClickListener() {
+ @Override
public void onClick(final View v) {
super.onClick(v);
- ((MainActivity) ctx).showSettings();
+ activity.showSettings();
}
});
+ /*
final Button btn_about = (Button) activity.findViewById(R.id.btn_about);
btn_about.setOnClickListener(new ClickListener() {
+ @Override
public void onClick(final View v) {
super.onClick(v);
// TODO: create proper about activity
- String server_ver = "unavailable";
- if (!(ClientView.getCurrentPageId() == PageId.WEBCLIENT)) {
- server_ver = "not connected";
+ final ClientView client = MainActivity.get().getCurrentView();
+ final AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.get());
+ final String buildType = AppInfo.getBuildType();
+ String msg = "Android client version: " + AppInfo.getBuildVersion();
+ if (!"prod".equals(buildType)) {
+ msg += "\nAndroid client build: " + AppInfo.getBuildType();
}
-
- // FIXME: how to find server version if connected?
-
- final AlertDialog.Builder builder = new AlertDialog.Builder((Activity) ctx);
- builder.setMessage("WebView client version: "
- + BuildConfig.VERSION_NAME + "\nServer version: " + server_ver
- + "\n\nTitle Music:"
- + "\n- \"Treasure Hunter\": Tad Miller (TAD)"
- + "\n- \"Woodland Fantasy\": Matthew Pablo http://www.matthewpablo.com/"
- + "\n- \"Land of Fearless\": Alexandr Zhelanov https://soundcloud.com/alexandr-zhelanov"
- + "\n- \"Medieval: Rejoicing\": RandomMind"
- + "\n- \"Medieval: The Old Tower Inn\": RandomMind");
+ if (client.debugEnabled()) {
+ msg += "\nClient type: " + client.getSelectedClient()
+ + "\nServer type: " + client.getSelectedServer()
+ + "\nLogs directory: " + Logger.getLogsDir();
+ }
+ msg += "\n\nTitle Music:"
+ + "\n\n- Treasure Hunter"
+ + "\n by Tad Miller (TAD)"
+ + "\n - opengameart.org/node/127124"
+ + "\n\n- Woodland Fantasy"
+ + "\n by Matthew Pablo"
+ + "\n - matthewpablo.com"
+ + "\n - opengameart.org/node/31929"
+ + "\n\n- Land of Fearless"
+ + "\n by Alexandr Zhelanov"
+ + "\n - soundcloud.com/alexandr-zhelanov"
+ + "\n - opengameart.org/node/79931"
+ + "\n\n- Rejoicing"
+ + "\n by RandomMind"
+ + "\n - opengameart.org/node/100213"
+ + "\n\n- The Old Tower Inn"
+ + "\n by RandomMind"
+ + "\n - opengameart.org/node/87510";
+ builder.setMessage(msg);
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+ @Override
public void onClick(final DialogInterface dialog, final int id) {
dialog.cancel();
}
@@ -193,9 +241,11 @@ public class Menu {
builder.create().show();
}
});
+ */
final Button btn_quit = (Button) activity.findViewById(R.id.btn_quit);
btn_quit.setOnClickListener(new ClickListener() {
+ @Override
public void onClick(final View v) {
super.onClick(v);
activity.onRequestQuit();
@@ -205,9 +255,13 @@ public class Menu {
updateButtons();
}
+ /**
+ * Listener to handle menu button presses.
+ */
private class ClickListener implements View.OnClickListener {
+ @Override
public void onClick(final View v) {
- if (!ClientView.onTitleScreen()) {
+ if (!MainActivity.get().getActiveClientView().onTitleScreen()) {
nav.setVisibility(View.GONE);
}
}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/sound/MusicPlayer.java b/app/android/client/src/main/java/org/stendhalgame/client/MusicPlayer.java
similarity index 66%
rename from android/app/src/main/java/org/arianne/stendhal/client/sound/MusicPlayer.java
rename to app/android/client/src/main/java/org/stendhalgame/client/MusicPlayer.java
index 2e5421888b..3270e69206 100644
--- a/android/app/src/main/java/org/arianne/stendhal/client/sound/MusicPlayer.java
+++ b/app/android/client/src/main/java/org/stendhalgame/client/MusicPlayer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright © 2022 - Arianne *
+ * Copyright © 2022-2024 - Faiumoni e. V. *
***************************************************************************
***************************************************************************
* *
@@ -9,17 +9,14 @@
* (at your option) any later version. *
* *
***************************************************************************/
-package org.arianne.stendhal.client.sound;
+package org.stendhalgame.client;
+
+import java.io.IOException;
import android.content.Context;
import android.media.MediaPlayer;
import android.net.Uri;
-import java.io.IOException;
-
-import org.arianne.stendhal.client.DebugLog;
-import org.arianne.stendhal.client.MainActivity;
-
public class MusicPlayer {
@@ -28,22 +25,24 @@ public class MusicPlayer {
public static void playMusic(final Context ctx, final int id, final boolean loop) {
if (isPlaying()) {
- DebugLog.debug("freeing up MusicPlayer instance to play new song");
+ Logger.debug("freeing up MusicPlayer instance to play new song");
stopMusic();
}
- DebugLog.debug("starting music (loop: " + loop + ")");
+ Logger.debug("starting music (loop: " + loop + ")");
mplayer = new MediaPlayer();
mplayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+ @Override
public void onPrepared(final MediaPlayer mp) {
- DebugLog.debug("starting music");
+ Logger.debug("starting music");
// FIXME: not working
//mplayer.setLooping(loop);
mplayer.start();
}
});
mplayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+ @Override
public void onCompletion(final MediaPlayer mp) {
// free up resources & reset player to null
stopMusic();
@@ -59,7 +58,7 @@ public class MusicPlayer {
mplayer.setDataSource(ctx, parseResourceUri(id));
mplayer.prepareAsync();
} catch (final IOException e) {
- DebugLog.error("failed to load resource " + id + ":\n" + e.getStackTrace());
+ Logger.error("failed to load resource " + id + ":\n" + e.getStackTrace());
}
}
@@ -67,10 +66,46 @@ public class MusicPlayer {
playMusic(MainActivity.get(), id, loop);
}
+ /**
+ * Plays selected music.
+ *
+ * @param musicId
+ * String identifier of music to play or `null` to play music configured in preferences.
+ */
+ public static void playTitleMusic(String musicId) {
+ if (musicId == null) {
+ musicId = PreferencesActivity.getString("song_list");
+ }
+ int id = R.raw.title_01;
+ switch (musicId) {
+ case "title_02":
+ id = R.raw.title_02;
+ break;
+ case "title_03":
+ id = R.raw.title_03;
+ break;
+ case "title_04":
+ id = R.raw.title_04;
+ break;
+ case "title_05":
+ id = R.raw.title_05;
+ break;
+ }
+ Logger.debug("playing music: " + musicId);
+ MusicPlayer.playMusic(id, true);
+ }
+
+ /**
+ * Plays music configured in preferences.
+ */
+ public static void playTitleMusic() {
+ playTitleMusic(null);
+ }
+
public static void stopMusic() {
if (mplayer != null) {
if (mplayer.isPlaying()) {
- DebugLog.debug("stopping music");
+ Logger.debug("stopping music");
mplayer.stop();
}
mplayer.release();
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/Notifier.java b/app/android/client/src/main/java/org/stendhalgame/client/Notifier.java
similarity index 84%
rename from android/app/src/main/java/org/arianne/stendhal/client/Notifier.java
rename to app/android/client/src/main/java/org/stendhalgame/client/Notifier.java
index 2ed1488349..c0bf473ef5 100644
--- a/android/app/src/main/java/org/arianne/stendhal/client/Notifier.java
+++ b/app/android/client/src/main/java/org/stendhalgame/client/Notifier.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright © 2022 - Arianne *
+ * Copyright © 2022-2024 - Faiumoni e. V. *
***************************************************************************
***************************************************************************
* *
@@ -9,7 +9,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
-package org.arianne.stendhal.client;
+package org.stendhalgame.client;
import android.app.AlertDialog;
import android.content.Context;
@@ -19,38 +19,32 @@ import android.widget.Toast;
public class Notifier {
- private AlertDialog.Builder builder;
-
- private static Notifier instance;
+ private static AlertDialog.Builder builder;
- public static Notifier get() {
- if (instance == null) {
- instance = new Notifier();
- }
-
- return instance;
+ /**
+ * Static methods only.
+ */
+ private Notifier() {
+ // do nothing
}
- private Notifier() {}
-
- private void showDialog() {
+ private static void showDialog() {
if (builder != null) {
builder.create().show();
}
-
builder = null;
}
- private void createDialog(final Context ctx) {
+ private static void createDialog(final Context ctx) {
builder = new AlertDialog.Builder(ctx);
}
- private void createDialog() {
+ private static void createDialog() {
createDialog(MainActivity.get());
}
- public void showMessage(final String msg, final boolean cancelable, final String title) {
+ public static void showMessage(final String msg, final boolean cancelable, final String title) {
createDialog();
builder.setCancelable(cancelable);
@@ -59,6 +53,7 @@ public class Notifier {
builder.setTitle(title);
}
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+ @Override
public void onClick(final DialogInterface dialog, final int id) {
dialog.cancel();
}
@@ -67,19 +62,19 @@ public class Notifier {
showDialog();
}
- public void showMessage(final String msg, final boolean cancelable) {
+ public static void showMessage(final String msg, final boolean cancelable) {
showMessage(msg, cancelable, null);
}
- public void showMessage(final String msg) {
+ public static void showMessage(final String msg) {
showMessage(msg, true, null);
}
- public void showError(final String msg) {
+ public static void showError(final String msg) {
showMessage(msg, false, "Error");
}
- public void showPrompt(final Context ctx, final String msg, final Action... actions) {
+ public static void showPrompt(final Context ctx, final String msg, final Action... actions) {
createDialog(ctx);
builder.setCancelable(false);
@@ -98,6 +93,7 @@ public class Notifier {
}
builder.setPositiveButton(labelY, new DialogInterface.OnClickListener() {
+ @Override
public void onClick(final DialogInterface dialog, final int id) {
dialog.cancel();
@@ -117,6 +113,7 @@ public class Notifier {
}
builder.setNegativeButton(labelN, new DialogInterface.OnClickListener() {
+ @Override
public void onClick(final DialogInterface dialog, final int id) {
dialog.cancel();
@@ -137,6 +134,7 @@ public class Notifier {
}
builder.setNeutralButton(labelO, new DialogInterface.OnClickListener() {
+ @Override
public void onClick(final DialogInterface dialog, final int id) {
dialog.cancel();
@@ -150,7 +148,7 @@ public class Notifier {
showDialog();
}
- public void showPrompt(final String msg, final Action... actions) {
+ public static void showPrompt(final String msg, final Action... actions) {
showPrompt(MainActivity.get(), msg, actions);
}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/OpenAppByUrl.java b/app/android/client/src/main/java/org/stendhalgame/client/OpenAppByUrl.java
new file mode 100644
index 0000000000..9b0c4c03e1
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/OpenAppByUrl.java
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright © 2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+
+public class OpenAppByUrl extends Activity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ Intent intent = getIntent();
+ // String action = intent.getAction();
+ Uri data = intent.getData();
+ Logger.debug("URL: " + data);
+ MainActivity.get().getActiveClientView().checkLoginIntent(intent);
+ finish();
+ }
+
+}
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/PageId.java b/app/android/client/src/main/java/org/stendhalgame/client/PageId.java
similarity index 89%
rename from android/app/src/main/java/org/arianne/stendhal/client/PageId.java
rename to app/android/client/src/main/java/org/stendhalgame/client/PageId.java
index 8551caddea..32b4677f53 100644
--- a/android/app/src/main/java/org/arianne/stendhal/client/PageId.java
+++ b/app/android/client/src/main/java/org/stendhalgame/client/PageId.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright © 2022 - Arianne *
+ * Copyright © 2022-2024 - Faiumoni e. V. *
***************************************************************************
***************************************************************************
* *
@@ -9,7 +9,7 @@
* (at your option) any later version. *
* *
***************************************************************************/
-package org.arianne.stendhal.client;
+package org.stendhalgame.client;
public enum PageId {
diff --git a/android/app/src/main/java/org/arianne/stendhal/client/PreferencesActivity.java b/app/android/client/src/main/java/org/stendhalgame/client/PreferencesActivity.java
similarity index 67%
rename from android/app/src/main/java/org/arianne/stendhal/client/PreferencesActivity.java
rename to app/android/client/src/main/java/org/stendhalgame/client/PreferencesActivity.java
index 8d7eb07fcd..f5e40a92a6 100644
--- a/android/app/src/main/java/org/arianne/stendhal/client/PreferencesActivity.java
+++ b/app/android/client/src/main/java/org/stendhalgame/client/PreferencesActivity.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright © 2022 - Arianne *
+ * Copyright © 2022-2024 - Faiumoni e. V. *
***************************************************************************
***************************************************************************
* *
@@ -9,38 +9,47 @@
* (at your option) any later version. *
* *
***************************************************************************/
-package org.arianne.stendhal.client;
+package org.stendhalgame.client;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
-import android.preference.CheckBoxPreference;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.PreferenceFragment;
-import android.preference.PreferenceManager;
import androidx.appcompat.app.AppCompatActivity;
-
-import org.arianne.stendhal.client.input.DPad;
-import org.arianne.stendhal.client.input.DPadArrows;
-import org.arianne.stendhal.client.input.DPadJoy;
-import org.arianne.stendhal.client.sound.MusicPlayer;
+import androidx.preference.CheckBoxPreference;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+import androidx.preference.PreferenceManager;
+/**
+ * Interface for configuring app preferences.
+ */
public class PreferencesActivity extends AppCompatActivity {
+ /** Preferences activity instance. */
private static PreferencesActivity instance;
+ /**
+ * Retrieves preferences activity instance.
+ */
public static PreferencesActivity get() {
return instance;
}
+ /**
+ * Called when the activity is created.
+ */
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ // FIXME: may be considered unsafe as this is not technically a singleton
instance = this;
+ // use same orientation as main activity
+ setRequestedOrientation(MainActivity.get().getRequestedOrientation());
+
setContentView(R.layout.activity_preferences);
if (findViewById(R.id.preferencesFrame) != null) {
@@ -48,8 +57,8 @@ public class PreferencesActivity extends AppCompatActivity {
return;
}
- getFragmentManager().beginTransaction().add(R.id.preferencesFrame,
- new PFragment()).commit();
+ getSupportFragmentManager().beginTransaction().add(R.id.preferencesFrame,
+ new PFragment()).commit();
}
}
@@ -119,63 +128,62 @@ public class PreferencesActivity extends AppCompatActivity {
// SharedPreferences.getInt is returning string
final Object obj = getSharedPreferences().getString(key, String.valueOf(defVal));
if (obj instanceof String) {
- DebugLog.debug("PreferencesActivity.getInt: casting string return value to integer");
+ Logger.debug("PreferencesActivity.getInt: casting string return value to integer");
return Integer.parseInt((String) obj);
} else {
- DebugLog.debug("PreferencesActivity.getInt return value is integer");
+ Logger.debug("PreferencesActivity.getInt return value is integer");
return (Integer) obj;
}
} catch (final NumberFormatException e) {
final String errMsg = "An error occurred: " + e.getMessage();
- DebugLog.error(errMsg + "\n" + e.getStackTrace());
- Notifier.get().showError(errMsg + "\n\nSee " + DebugLog.getLogsDir()
+ Logger.error(errMsg + "\n" + e.getStackTrace());
+ Notifier.showError(errMsg + "\n\nSee " + Logger.getLogsDir()
+ " for more information.");
}
-
return null;
}
@Override
public void finish() {
- DebugLog.debug(PreferencesActivity.class.getName() + ".finish() called");
-
+ Logger.debug(PreferencesActivity.class.getName() + ".finish() called");
super.finish();
}
@Override
protected void onDestroy() {
- DebugLog.debug(PreferencesActivity.class.getName() + ".onDestroy() called");
-
+ Logger.debug(PreferencesActivity.class.getName() + ".onDestroy() called");
super.onDestroy();
}
- public static class PFragment extends PreferenceFragment
+ public static class PFragment extends PreferenceFragmentCompat
implements OnSharedPreferenceChangeListener {
@Override
- public void onCreate(final Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
addPreferencesFromResource(R.xml.preferences);
-
initListeners();
}
private void initListeners() {
final PreferenceManager pm = getPreferenceManager();
+ // FIXME: should update playing music
final Preference reset = pm.findPreference("reset");
if (reset != null) {
reset.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
public boolean onPreferenceClick(final Preference pref) {
- Notifier.get().showPrompt(getActivity(), "Restore prefrences defaults?",
+ Notifier.showPrompt(getActivity(), "Restore prefrences defaults?",
new Notifier.Action() {
+ @Override
protected void onCall() {
- DebugLog.debug("restoring preferences default values");
+ Logger.debug("restoring preferences default values");
restoreDefaults();
}
},
new Notifier.Action() {
+ @Override
protected void onCall() {
// do nothing
}
@@ -185,19 +193,20 @@ public class PreferencesActivity extends AppCompatActivity {
}
});
} else {
- DebugLog.warn("preference \"reset\" not found");
+ Logger.warn("preference \"reset\" not found");
}
final CheckBoxPreference title_music = (CheckBoxPreference) pm.findPreference("title_music");
if (title_music != null) {
title_music.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
public boolean onPreferenceChange(final Preference pref, final Object obj) {
// set music state as soon as preference is changed
- if (ClientView.onTitleScreen()) {
+ if (MainActivity.get().getActiveClientView().onTitleScreen()) {
if (!((Boolean) obj)) {
MusicPlayer.stopMusic();
} else if (!MusicPlayer.isPlaying()) {
- ClientView.playTitleMusic();
+ MusicPlayer.playTitleMusic();
}
}
@@ -217,13 +226,14 @@ public class PreferencesActivity extends AppCompatActivity {
}
song_list.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+ @Override
public boolean onPreferenceChange(final Preference pref, final Object obj) {
// set music state as soon as preference is changed
- if (ClientView.onTitleScreen()) {
- DebugLog.debug("changing title music preference: " + (String) obj);
+ if (MainActivity.get().getActiveClientView().onTitleScreen()) {
+ Logger.debug("changing title music preference: " + (String) obj);
if (title_music.isChecked()) {
- ClientView.playTitleMusic((String) obj);
+ MusicPlayer.playTitleMusic((String) obj);
}
}
@@ -231,6 +241,35 @@ public class PreferencesActivity extends AppCompatActivity {
}
});
}
+
+ final Preference clear_cache = pm.findPreference("clear_cache");
+ if (clear_cache != null) {
+ clear_cache.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(final Preference pref) {
+ Notifier.showPrompt(getActivity(), "Delete cached data?",
+ new Notifier.Action() {
+ @Override
+ protected void onCall() {
+ Logger.debug("clearing cache");
+ for (final ClientView clientView: MainActivity.get().getClientViewList()) {
+ clientView.clearCache(true);
+ }
+ }
+ },
+ new Notifier.Action() {
+ @Override
+ protected void onCall() {
+ // do nothing
+ }
+ });
+
+ return true;
+ }
+ });
+ } else {
+ Logger.warn("preference \"clear_cache\" not found");
+ }
}
private void restoreDefaults() {
@@ -246,25 +285,9 @@ public class PreferencesActivity extends AppCompatActivity {
@Override
public void onSharedPreferenceChanged(final SharedPreferences sp, final String key) {
- if (key.equals("show_dpad") || key.equals("dpad_joy")) {
- // reset all d-pads states to hidden
- DPadArrows.get().hide();
- DPadJoy.get().hide();
-
- if (getBoolean("dpad_joy", true)) {
- DPad.setCurrentPad(DPadJoy.get());
- } else {
- DPad.setCurrentPad(DPadArrows.get());
- }
-
- // restore visible state
- final DPad currentPad = DPad.getCurrentPad();
- if (currentPad != null && ClientView.isGameActive() && getBoolean("show_dpad", false)) {
- currentPad.show();
- currentPad.onRefreshView();
- }
- } else if (key.equals("joypad_sensitivity")) {
- DPadJoy.get().setSensitivity(getInt("joypad_sensitivity", 25));
+ if ("orientation".equals(key)) {
+ Logger.debug("orientation set to \"" + PreferencesActivity.getString(key) + "\"");
+ MainActivity.get().updateOrientation();
}
}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/SplashUtil.java b/app/android/client/src/main/java/org/stendhalgame/client/SplashUtil.java
new file mode 100644
index 0000000000..56efcb2316
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/SplashUtil.java
@@ -0,0 +1,90 @@
+/***************************************************************************
+ * Copyright © 2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import android.content.res.Configuration;
+import android.widget.ImageView;
+
+
+public class SplashUtil {
+
+ /** Image used as title page background. */
+ private final ImageView splash;
+
+ /** Singleton instance. */
+ private static SplashUtil instance;
+
+
+ /**
+ * Retrieves singleton instance.
+ */
+ public static SplashUtil get() {
+ if (SplashUtil.instance == null) {
+ SplashUtil.instance = new SplashUtil();
+ }
+ return SplashUtil.instance;
+ }
+
+ /**
+ * Hidden singleton constructor.
+ */
+ private SplashUtil() {
+ splash = (ImageView) MainActivity.get().findViewById(R.id.splash);
+ setVisible(false);
+ }
+
+ /**
+ * Sets the background splash image.
+ *
+ * @param resId
+ * Resource ID.
+ * @param bgColor
+ * Coloring to fill behind splash image.
+ */
+ private void setImage(final int resId, final int bgColor) {
+ splash.setBackgroundColor(bgColor);
+ splash.setImageResource(resId);
+ }
+
+ /**
+ * Sets splash image dependent on device orientation.
+ */
+ public void update() {
+ if (!isVisible()) {
+ return;
+ }
+ int resId = R.drawable.splash;
+ if (MainActivity.get().getOrientation() == Configuration.ORIENTATION_PORTRAIT) {
+ resId = R.drawable.splash_portrait;
+ }
+ // light blue background color
+ setImage(resId, 0xff6c9ed1);
+ }
+
+ /**
+ * Shows or hides background splash image.
+ *
+ * @param visible
+ * `true` if image should visible, `false` if not.
+ */
+ public void setVisible(final boolean visible) {
+ splash.setVisibility(visible ? ImageView.VISIBLE : ImageView.GONE);
+ update();
+ }
+
+ /**
+ * Checks if splash is visible.
+ */
+ public boolean isVisible() {
+ return ImageView.VISIBLE == splash.getVisibility();
+ }
+}
diff --git a/app/android/client/src/main/java/org/stendhalgame/client/UrlHelper.java b/app/android/client/src/main/java/org/stendhalgame/client/UrlHelper.java
new file mode 100644
index 0000000000..f0d872b387
--- /dev/null
+++ b/app/android/client/src/main/java/org/stendhalgame/client/UrlHelper.java
@@ -0,0 +1,280 @@
+/***************************************************************************
+ * Copyright © 2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import android.net.Uri;
+
+
+class UrlHelper {
+
+ private static final String defaultServer = "https://stendhalgame.org/";
+
+
+ private UrlHelper() {
+ // static methods only
+ }
+
+ /**
+ * Creates a URI from a string HTTP URL.
+ *
+ * @return
+ * `android.net.Uri`.
+ */
+ public static Uri toUri(String url) {
+ if (!url.startsWith("https://") && !url.startsWith("http://") && !url.startsWith("about:")) {
+ // Uri.getHost returns `null` if localhost not prefixed with protocol
+ url = "http://" + url;
+ }
+ return Uri.parse(url);
+ }
+
+ /**
+ * Retrieves the HTTP URL of the default server (stendhalgame.org).
+ *
+ * @return
+ * String URL.
+ */
+ public static String getDefaultServer() {
+ return UrlHelper.defaultServer;
+ }
+
+ /**
+ * Retrieves the URI of the default server (stendhalgame.org).
+ *
+ * @return
+ * `android.net.Uri` of default server.
+ */
+ public static Uri getDefaultServerUri() {
+ return UrlHelper.toUri(UrlHelper.defaultServer);
+ }
+
+ /**
+ * Retrieves the default host.
+ *
+ * @return
+ * Host portion of the default URI.
+ */
+ public static String getDefaultHost() {
+ return UrlHelper.getDefaultServerUri().getHost();
+ }
+
+ /**
+ * Removes protocol & "www" prefixes from a URL.
+ *
+ * FIXME: rename to "trimProtocol"
+ *
+ * @return
+ * Trimmed URL string.
+ */
+ public static String stripHost(final String url) {
+ if (url == null) {
+ return "";
+ }
+ return url.replaceAll("^https://", "").replaceAll("^http://", "")
+ .replaceAll("^www\\.", "");
+ }
+
+ /**
+ * Extracts character name from URL fragment identifier & converts to query string.
+ *
+ * Deprecated. Should use `UrlHelper.formatCharName(Uri, Uri.Builder).
+ *
+ * @param url
+ * HTTP string to be formatted.
+ * @return
+ * Formatted URL.
+ */
+ @Deprecated
+ public static String formatCharName(String url) {
+ final int idx = url.indexOf("#");
+ if (idx > -1) {
+ url = url.substring(0, idx) + "?char=" + url.substring(idx+1);
+ }
+ return url;
+ }
+
+ /**
+ * Converts URL fragment identifier to character name query string parameter.
+ *
+ * @param uri
+ * URI being checked for fragment identifier.
+ * @param builder
+ * URI builder to update.
+ */
+ public static void formatCharName(final Uri uri, final Uri.Builder builder) {
+ final String name = uri.getFragment();
+ if (name != null) {
+ builder.appendQueryParameter("char", name);
+ }
+ }
+
+ /**
+ * Formats client URL for currently selected server.
+ *
+ * @param url
+ * URL to be checked.
+ * @return
+ * URL to be loaded.
+ */
+ public static String checkClientUrl(String url) {
+ final Uri uri = UrlHelper.toUri(url);
+ final Uri.Builder builder = uri.buildUpon();
+ if (UrlHelper.isClientUrl(url)) {
+ final ClientView client = MainActivity.get().getActiveClientView();
+ final boolean testClient = client.isTestClient();
+ String replaceSuffix = "/testclient/";
+ if (testClient) {
+ replaceSuffix = "/client/";
+ }
+ // ensure website directs to configured client
+ builder.path(uri.getPath().replace(replaceSuffix, "/" + client.getClientUrlSuffix() + "/"));
+ UrlHelper.formatCharName(uri, builder);
+ if (testClient && !client.isTestServer() && uri.getQueryParameter("server") == null) {
+ // connect test client to main server
+ builder.appendQueryParameter("server", "main");
+ }
+ }
+ return builder.toString();
+ }
+
+ /**
+ * Checks if a URL is a link to one of the web clients.
+ *
+ * @param url
+ * HTTP URL to be checked.
+ * @return
+ * `true` if `url` links to "client" or "testclient".
+ */
+ public static boolean isClientUrl(final String url) {
+ final String custom_client = PreferencesActivity.getString("client_url").trim();
+ if (!custom_client.equals("")) {
+ return url.contains(custom_client);
+ }
+ final String defaultHost = UrlHelper.stripHost(UrlHelper.getDefaultServerUri().getHost());
+ return url.contains(defaultHost + "/client/") || url.contains(defaultHost + "/testclient/");
+ }
+
+ /**
+ * Retrieves client URL.
+ *
+ * @return
+ * Client URL string.
+ */
+ public static String getClientUrl() {
+ final String custom_client = PreferencesActivity.getString("client_url").trim();
+ if (!custom_client.equals("")) {
+ return custom_client;
+ }
+ return UrlHelper.defaultServer + "client/stendhal.html";
+ }
+
+ /**
+ * Retrieves URL string for initial page to be loaded from server.
+ *
+ * If custom client URL is used then client URL is returned.
+ *
+ * @return
+ * HTTP URL string.
+ */
+ public static String getInitialPageUrl() {
+ final String custom_client = PreferencesActivity.getString("client_url").trim();
+ if (!custom_client.equals("")) {
+ return custom_client;
+ }
+ return UrlHelper.defaultServer + "account/mycharacters.html";
+ }
+
+ /**
+ * Checks if requested URL is whitelisted to be opened within WebView client.
+ *
+ * @param uri
+ * `android.net.Uri` to be checked.
+ * @return
+ * `true` if URI is under default domain (stendhalgame.org) or localhost.
+ */
+ public static boolean isInternalUri(final Uri uri) {
+ if (UrlHelper.isLoginUri(uri)) {
+ // open login page in external browser
+ return false;
+ }
+ final String defaultHost = UrlHelper.stripHost(UrlHelper.getDefaultHost());
+ final String host = UrlHelper.stripHost(uri.getHost());
+ if (defaultHost.equals(host)) {
+ // allow pages from stendhalgame.org
+ return true;
+ }
+ final String cs = MainActivity.get().getActiveClientView().checkCustomServer();
+ if (cs != null) {
+ return UrlHelper.stripHost(cs).equals(host);
+ }
+ return "localhost".equals(host);
+ }
+
+ /**
+ * Checks if requested URL is whitelisted to be opened within WebView client.
+ *
+ * @param url
+ * HTTP URL string to be checked.
+ * @return
+ * `true` if URL is under default domain (stendhalgame.org) or localhost.
+ */
+ public static boolean isInternal(final String url) {
+ return UrlHelper.isInternalUri(UrlHelper.toUri(url));
+ }
+
+ /**
+ * Checks if a URI matches the intent URL scheme.
+ *
+ * @param uri
+ * URI to be check.
+ * @return
+ * `true` if URI's host is the intent scheme.
+ */
+ public static boolean isIntentUri(final Uri uri) {
+ return AppInfo.getIntentUrlScheme().equals(UrlHelper.stripHost(uri.getHost()));
+ }
+
+ /**
+ * Checks if a URL matches the intent URL scheme.
+ *
+ * @param url
+ * HTTP URL string to be check.
+ * @return
+ * `true` if URI's host is the intent scheme.
+ */
+ public static boolean isIntentUrl(final String url) {
+ return UrlHelper.isIntentUri(UrlHelper.toUri(url));
+ }
+
+ /**
+ * Checks if a URI represents a login page.
+ *
+ * @param uri
+ * Page URI to check.
+ * @return
+ * `true` if URI path equals "/account/login.html" or `id` parameter of query string equals
+ * "content/account/login".
+ */
+ public static boolean isLoginUri(final Uri uri) {
+ if ("/account/login.html".equals(uri.getPath())) {
+ return true;
+ }
+ if (!uri.isHierarchical()) {
+ return false;
+ }
+ final String id = uri.getQueryParameter("id");
+ if (id == null) {
+ return false;
+ }
+ return "content/account/login".equals(id);
+ }
+}
diff --git a/app/android/client/src/main/play/contact-email.txt b/app/android/client/src/main/play/contact-email.txt
new file mode 100644
index 0000000000..3cc2a3b503
--- /dev/null
+++ b/app/android/client/src/main/play/contact-email.txt
@@ -0,0 +1 @@
+https://sourceforge.net/projects/arianne/support
diff --git a/app/android/client/src/main/play/contact-website.txt b/app/android/client/src/main/play/contact-website.txt
new file mode 100644
index 0000000000..f095b1935d
--- /dev/null
+++ b/app/android/client/src/main/play/contact-website.txt
@@ -0,0 +1 @@
+https://stendhalgame.org/
diff --git a/app/android/client/src/main/play/default-language.txt b/app/android/client/src/main/play/default-language.txt
new file mode 100644
index 0000000000..beb9970be0
--- /dev/null
+++ b/app/android/client/src/main/play/default-language.txt
@@ -0,0 +1 @@
+en-US
diff --git a/app/android/client/src/main/play/listings/de/full-description.txt b/app/android/client/src/main/play/listings/de/full-description.txt
new file mode 100644
index 0000000000..8de217eefe
--- /dev/null
+++ b/app/android/client/src/main/play/listings/de/full-description.txt
@@ -0,0 +1,9 @@
+Stendhal has a huge and rich world. You can explore cities, forest, mountains, plains and dungeons.
+You can fight monsters and become a hero.
+
+You will meet a wide variety of characters. Many will give you tasks and quests for valuable
+experience. You may be asked to help protect land, feed the hungry, heal the sick, make someone
+happy, solve a puzzle or simply lend a hand.
+
+So what are you waiting for? A whole new world awaits... And if you like, get the source code, and
+add your own ideas!
diff --git a/app/android/client/src/main/play/listings/de/short-description.txt b/app/android/client/src/main/play/listings/de/short-description.txt
new file mode 100644
index 0000000000..b94e5d92e0
--- /dev/null
+++ b/app/android/client/src/main/play/listings/de/short-description.txt
@@ -0,0 +1 @@
+Ein Multiplayer-Adventure mit klassischer 2D-Grafik
diff --git a/app/android/client/src/main/play/listings/en-US/full-description.txt b/app/android/client/src/main/play/listings/en-US/full-description.txt
new file mode 100644
index 0000000000..8de217eefe
--- /dev/null
+++ b/app/android/client/src/main/play/listings/en-US/full-description.txt
@@ -0,0 +1,9 @@
+Stendhal has a huge and rich world. You can explore cities, forest, mountains, plains and dungeons.
+You can fight monsters and become a hero.
+
+You will meet a wide variety of characters. Many will give you tasks and quests for valuable
+experience. You may be asked to help protect land, feed the hungry, heal the sick, make someone
+happy, solve a puzzle or simply lend a hand.
+
+So what are you waiting for? A whole new world awaits... And if you like, get the source code, and
+add your own ideas!
diff --git a/app/android/client/src/main/play/listings/en-US/graphics/feature-graphic/1.jpg b/app/android/client/src/main/play/listings/en-US/graphics/feature-graphic/1.jpg
new file mode 100644
index 0000000000..015bfbb45c
Binary files /dev/null and b/app/android/client/src/main/play/listings/en-US/graphics/feature-graphic/1.jpg differ
diff --git a/app/android/client/src/main/play/listings/en-US/graphics/icon/1.png b/app/android/client/src/main/play/listings/en-US/graphics/icon/1.png
new file mode 100644
index 0000000000..d90dc19ed7
Binary files /dev/null and b/app/android/client/src/main/play/listings/en-US/graphics/icon/1.png differ
diff --git a/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/01-start.jpg b/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/01-start.jpg
new file mode 100644
index 0000000000..3dbef90e03
Binary files /dev/null and b/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/01-start.jpg differ
diff --git a/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/02-npc_interaction.jpg b/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/02-npc_interaction.jpg
new file mode 100644
index 0000000000..5cb65ec5e9
Binary files /dev/null and b/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/02-npc_interaction.jpg differ
diff --git a/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/03-melee_combat.jpg b/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/03-melee_combat.jpg
new file mode 100644
index 0000000000..86fe43ded9
Binary files /dev/null and b/app/android/client/src/main/play/listings/en-US/graphics/phone-screenshots/03-melee_combat.jpg differ
diff --git a/app/android/client/src/main/play/listings/en-US/short-description.txt b/app/android/client/src/main/play/listings/en-US/short-description.txt
new file mode 100644
index 0000000000..d369a731e0
--- /dev/null
+++ b/app/android/client/src/main/play/listings/en-US/short-description.txt
@@ -0,0 +1 @@
+A multiplayer adventure with classic 2D graphics
diff --git a/app/android/client/src/main/play/listings/en-US/title.txt b/app/android/client/src/main/play/listings/en-US/title.txt
new file mode 100644
index 0000000000..7d865b2b4a
--- /dev/null
+++ b/app/android/client/src/main/play/listings/en-US/title.txt
@@ -0,0 +1 @@
+Stendhal Game
diff --git a/app/android/client/src/main/play/listings/es/full-description.txt b/app/android/client/src/main/play/listings/es/full-description.txt
new file mode 100644
index 0000000000..d77ea1ace1
--- /dev/null
+++ b/app/android/client/src/main/play/listings/es/full-description.txt
@@ -0,0 +1,9 @@
+Stendhal tiene un mundo enorme y rico. Puedes explorar ciudades, bosques, montañas, llanos y
+mazmorras. Puedes combatir monstruos y llegar a ser un héroe.
+
+Te encontrarás con una amplia variedad de personajes. Muchos te darán tareas y misiones para obtener
+experiencia valiosa. Es posible que se te pida proteger terrenos, alimentar a los hambrientos, curar
+a los enfermos, hacer feliz a alguien, resolver un rompecabezas, o simplemente echar una mano.
+
+Entonces, ¿a qué estás esperando? Un mundo completamente nuevo te espera... ¡Y si deseas, consigue
+el código fuente y añade tus propias ideas!
diff --git a/app/android/client/src/main/play/listings/es/short-description.txt b/app/android/client/src/main/play/listings/es/short-description.txt
new file mode 100644
index 0000000000..6edf6e08a8
--- /dev/null
+++ b/app/android/client/src/main/play/listings/es/short-description.txt
@@ -0,0 +1 @@
+Una aventura multijugador con gráficos 2D clásicos
diff --git a/app/android/client/src/main/play/listings/fr/full-description.temp.txt b/app/android/client/src/main/play/listings/fr/full-description.temp.txt
new file mode 100644
index 0000000000..557f7ef23f
--- /dev/null
+++ b/app/android/client/src/main/play/listings/fr/full-description.temp.txt
@@ -0,0 +1,10 @@
+Stendhal a un monde immense et riche. Vous pouvez explorer des villes, des forêts, des montagnes,
+des plaines et des donjons. Vous pouvez combattre des monstres et devenir un héros.
+
+Vous rencontrerez une grande variété de personnages. Beaucoup vous donneront des tâches et des
+quêtes pour l'expérience précieuse. On vous demandera peut-être d'aider à protéger des terres,
+nourrir les affamés, soigner les malades, rendre quelqu'un heureux, résoudre une énigme ou
+simplement donner un coup de main.
+
+Alors, qu'attendez-tu? Un tout nouveau monde vous attend... Et si vous le souhaitez, récupérez le
+code source et ajoutez vos propres idées!
diff --git a/app/android/client/src/main/play/listings/fr/short-description.txt b/app/android/client/src/main/play/listings/fr/short-description.txt
new file mode 100644
index 0000000000..a5bf716bbc
--- /dev/null
+++ b/app/android/client/src/main/play/listings/fr/short-description.txt
@@ -0,0 +1 @@
+Une aventure multijoueur avec des graphismes 2D classiques
diff --git a/app/android/client/src/main/play/listings/it/full-description.temp.txt b/app/android/client/src/main/play/listings/it/full-description.temp.txt
new file mode 100644
index 0000000000..46b0c947ec
--- /dev/null
+++ b/app/android/client/src/main/play/listings/it/full-description.temp.txt
@@ -0,0 +1,9 @@
+Stendhal ha un mondo enorme e ricco. Puoi esplorare città, foreste, montagne, pianure e dungeon.
+Puoi combattere mostri e diventare un eroe.
+
+Incontrerai una vasta varietà di personaggi. Molti ti daranno compiti e missioni per preziosa
+esperienza. Potresti essere chiesto di aiutare a proteggere terra, nutrire gli affamati, curare i
+malati, rendere felice qualcuno, risolvere un puzzle o semplicemente dare una mano.
+
+Allora, cosa stai aspettando? Un mondo completamente nuovo aspetta... E se vuoi, ottieni il codice
+sorgente e aggiungi le tue idee!
diff --git a/app/android/client/src/main/play/listings/it/short-description.txt b/app/android/client/src/main/play/listings/it/short-description.txt
new file mode 100644
index 0000000000..b287c4c60d
--- /dev/null
+++ b/app/android/client/src/main/play/listings/it/short-description.txt
@@ -0,0 +1 @@
+Un'avventura multiplayer con la classica grafica 2D
diff --git a/app/android/client/src/main/play/listings/pl/full-description.txt b/app/android/client/src/main/play/listings/pl/full-description.txt
new file mode 100644
index 0000000000..794e0867c9
--- /dev/null
+++ b/app/android/client/src/main/play/listings/pl/full-description.txt
@@ -0,0 +1,9 @@
+Stendhal to niezwykły, pełen możliwości świat. Odkryjesz w nim miasta, lasy, góry, równiny i lochy.
+Stawić możesz czoło potworom oraz stać się bohaterem.
+
+W drodze napotkasz rozmaite postacie. Wielu z nich zleci ci misje, które zapewnią cenne
+doświadczenie. Zdarzy się, że będziesz musiał ochraniać ziemie, nakarmić głodnych, pomóc wyleczyć chorych,
+uprzyjemnić czyjeś życie, rozwiązać zagadki lub po prostu wesprzeć pomocną dłonią.
+
+A więc na co jeszcze czekasz? Cały nowy świat wyczekuje ciebie... Jeśli chcesz, pobierz kod
+źródłowy oraz dodaj własne pomysły!
diff --git a/app/android/client/src/main/play/listings/pl/short-description.txt b/app/android/client/src/main/play/listings/pl/short-description.txt
new file mode 100644
index 0000000000..4d90c174a4
--- /dev/null
+++ b/app/android/client/src/main/play/listings/pl/short-description.txt
@@ -0,0 +1 @@
+Wieloosobowa gra przygodowa z klasyczną grafiką 2D
diff --git a/app/android/client/src/main/play/listings/pt/full-description.temp.txt b/app/android/client/src/main/play/listings/pt/full-description.temp.txt
new file mode 100644
index 0000000000..23583d044c
--- /dev/null
+++ b/app/android/client/src/main/play/listings/pt/full-description.temp.txt
@@ -0,0 +1,9 @@
+Stendhal tem um mundo enorme e rico. Podes explorar cidades, florestas, montanhas, planícies e
+masmorras. Podes lutar contra monstros e tornar-te um herói.
+
+Vais encontrar uma grande variedade de personagens. Muitos vão dar-te tarefas e missões para
+experiência valiosa. Podes ser solicitado(a) a proteger a terra, alimentar os famintos, curar os
+doentes, fazer alguém feliz, resolver um quebra-cabeça, ou simplesmente dar uma mão.
+
+Então, do que estás à espera? Um mundo completamente novo aguarda... E se quiseres, obtém o
+código-fonte e adiciona as tuas próprias ideias!
diff --git a/app/android/client/src/main/play/listings/pt/short-description.txt b/app/android/client/src/main/play/listings/pt/short-description.txt
new file mode 100644
index 0000000000..538ec567f0
--- /dev/null
+++ b/app/android/client/src/main/play/listings/pt/short-description.txt
@@ -0,0 +1 @@
+Uma aventura multijogador com gráficos 2D clássicos
diff --git a/app/android/client/src/main/play/listings/ro/full-description.txt b/app/android/client/src/main/play/listings/ro/full-description.txt
new file mode 100644
index 0000000000..0bf7b76dcc
--- /dev/null
+++ b/app/android/client/src/main/play/listings/ro/full-description.txt
@@ -0,0 +1,9 @@
+Stendhal are o lume imensă și bogată. Poți explora orașe, păduri, munți, câmpii și temnițe. Poți să
+lupți cu monștri și să devii erou.
+
+Vei întâlni o gamă largă de personaje. Multe îți vor da sarcini și misiuni în schimbul valoroasei
+experiențe. Ți s-ar putea cere să protejezi pământuri, să-i hrănești pe cei flămânzi, să-i vindeci
+pe cei bolnavi, să faci pe cineva fericit, să dezlegi un puzzle sau doar să dai o mână de ajutor.
+
+Ce mai aștepți? O întreagă nouă lume te așteaptă... Și dacă vrei, ia codul sursă și adaugă-ți
+propriile idei!
diff --git a/app/android/client/src/main/play/listings/ro/short-description.txt b/app/android/client/src/main/play/listings/ro/short-description.txt
new file mode 100644
index 0000000000..fabfed557d
--- /dev/null
+++ b/app/android/client/src/main/play/listings/ro/short-description.txt
@@ -0,0 +1 @@
+O aventură multijucător cu grafică 2D clasică
diff --git a/app/android/client/src/main/play/release-notes/en-US/default.txt b/app/android/client/src/main/play/release-notes/en-US/default.txt
new file mode 100644
index 0000000000..70b8142595
--- /dev/null
+++ b/app/android/client/src/main/play/release-notes/en-US/default.txt
@@ -0,0 +1,3 @@
+PUT RELEASE ANNOUNCEMENT LINES HERE
+
+Please see the complete change log for further details: https://arianne-project.org/game/stendhal.html#changes
diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/android/client/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from android/app/src/main/res/drawable/ic_launcher_foreground.xml
rename to app/android/client/src/main/res/drawable/ic_launcher_foreground.xml
diff --git a/android/app/src/main/res/drawable/splash.jpg b/app/android/client/src/main/res/drawable/splash.jpg
similarity index 100%
rename from android/app/src/main/res/drawable/splash.jpg
rename to app/android/client/src/main/res/drawable/splash.jpg
diff --git a/app/android/client/src/main/res/drawable/splash_portrait.jpg b/app/android/client/src/main/res/drawable/splash_portrait.jpg
new file mode 100644
index 0000000000..20e604dac8
Binary files /dev/null and b/app/android/client/src/main/res/drawable/splash_portrait.jpg differ
diff --git a/app/android/client/src/main/res/layout/activity_main.xml b/app/android/client/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000000..4e2ff2e1e9
--- /dev/null
+++ b/app/android/client/src/main/res/layout/activity_main.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/android/client/src/main/res/layout/activity_preferences.xml b/app/android/client/src/main/res/layout/activity_preferences.xml
new file mode 100644
index 0000000000..e00998f298
--- /dev/null
+++ b/app/android/client/src/main/res/layout/activity_preferences.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/android/client/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
similarity index 100%
rename from android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
rename to app/android/client/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/android/client/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
similarity index 100%
rename from android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
rename to app/android/client/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/android/client/src/main/res/mipmap-hdpi/ic_launcher.png
similarity index 100%
rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.png
rename to app/android/client/src/main/res/mipmap-hdpi/ic_launcher.png
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/android/client/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
similarity index 100%
rename from android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
rename to app/android/client/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/android/client/src/main/res/mipmap-hdpi/ic_launcher_round.png
similarity index 100%
rename from android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
rename to app/android/client/src/main/res/mipmap-hdpi/ic_launcher_round.png
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/android/client/src/main/res/mipmap-mdpi/ic_launcher.png
similarity index 100%
rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.png
rename to app/android/client/src/main/res/mipmap-mdpi/ic_launcher.png
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/android/client/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
similarity index 100%
rename from android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
rename to app/android/client/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/android/client/src/main/res/mipmap-mdpi/ic_launcher_round.png
similarity index 100%
rename from android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
rename to app/android/client/src/main/res/mipmap-mdpi/ic_launcher_round.png
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/android/client/src/main/res/mipmap-xhdpi/ic_launcher.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
rename to app/android/client/src/main/res/mipmap-xhdpi/ic_launcher.png
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/android/client/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
rename to app/android/client/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/android/client/src/main/res/mipmap-xhdpi/ic_launcher_round.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
rename to app/android/client/src/main/res/mipmap-xhdpi/ic_launcher_round.png
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/android/client/src/main/res/mipmap-xxhdpi/ic_launcher.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
rename to app/android/client/src/main/res/mipmap-xxhdpi/ic_launcher.png
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/android/client/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
rename to app/android/client/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/android/client/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
rename to app/android/client/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/android/client/src/main/res/mipmap-xxxhdpi/ic_launcher.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
rename to app/android/client/src/main/res/mipmap-xxxhdpi/ic_launcher.png
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/android/client/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
rename to app/android/client/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/android/client/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
similarity index 100%
rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
rename to app/android/client/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
diff --git a/android/app/src/main/res/raw/title_01.ogg b/app/android/client/src/main/res/raw/title_01.ogg
similarity index 100%
rename from android/app/src/main/res/raw/title_01.ogg
rename to app/android/client/src/main/res/raw/title_01.ogg
diff --git a/android/app/src/main/res/raw/title_02.ogg b/app/android/client/src/main/res/raw/title_02.ogg
similarity index 100%
rename from android/app/src/main/res/raw/title_02.ogg
rename to app/android/client/src/main/res/raw/title_02.ogg
diff --git a/android/app/src/main/res/raw/title_03.ogg b/app/android/client/src/main/res/raw/title_03.ogg
similarity index 100%
rename from android/app/src/main/res/raw/title_03.ogg
rename to app/android/client/src/main/res/raw/title_03.ogg
diff --git a/android/app/src/main/res/raw/title_04.ogg b/app/android/client/src/main/res/raw/title_04.ogg
similarity index 100%
rename from android/app/src/main/res/raw/title_04.ogg
rename to app/android/client/src/main/res/raw/title_04.ogg
diff --git a/android/app/src/main/res/raw/title_05.ogg b/app/android/client/src/main/res/raw/title_05.ogg
similarity index 100%
rename from android/app/src/main/res/raw/title_05.ogg
rename to app/android/client/src/main/res/raw/title_05.ogg
diff --git a/android/app/src/main/res/values-night/themes.xml b/app/android/client/src/main/res/values-night/themes.xml
similarity index 100%
rename from android/app/src/main/res/values-night/themes.xml
rename to app/android/client/src/main/res/values-night/themes.xml
diff --git a/app/android/client/src/main/res/values/array.xml b/app/android/client/src/main/res/values/array.xml
new file mode 100644
index 0000000000..8c0cafcb03
--- /dev/null
+++ b/app/android/client/src/main/res/values/array.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ - Use current user\'s setting
+ - Landscape
+ - Portrait
+
+
+
+ - user
+ - landscape
+ - portrait
+
+
+
+ - Treasure Hunter
+ - Woodland Fantasy
+ - Land of Fearless
+ - Rejoicing
+ - The Old Tower Inn
+
+
+
+ - title_01
+ - title_02
+ - title_03
+ - title_04
+ - title_05
+
+
+
diff --git a/android/app/src/main/res/values/colors.xml b/app/android/client/src/main/res/values/colors.xml
similarity index 100%
rename from android/app/src/main/res/values/colors.xml
rename to app/android/client/src/main/res/values/colors.xml
diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/app/android/client/src/main/res/values/ic_launcher_background.xml
similarity index 100%
rename from android/app/src/main/res/values/ic_launcher_background.xml
rename to app/android/client/src/main/res/values/ic_launcher_background.xml
diff --git a/app/android/client/src/main/res/values/strings.xml b/app/android/client/src/main/res/values/strings.xml
new file mode 100644
index 0000000000..f60bf90f42
--- /dev/null
+++ b/app/android/client/src/main/res/values/strings.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Stendhal
+ stendhalprod8gps5y99pu
+ prod
+ 1.49.5
+
+
diff --git a/android/app/src/main/res/values/themes.xml b/app/android/client/src/main/res/values/themes.xml
similarity index 100%
rename from android/app/src/main/res/values/themes.xml
rename to app/android/client/src/main/res/values/themes.xml
diff --git a/app/android/client/src/main/res/xml/preferences.xml b/app/android/client/src/main/res/xml/preferences.xml
new file mode 100644
index 0000000000..264377f7d4
--- /dev/null
+++ b/app/android/client/src/main/res/xml/preferences.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/android/client/src/shared/java/org/stendhalgame/client/Logger.java b/app/android/client/src/shared/java/org/stendhalgame/client/Logger.java
new file mode 100644
index 0000000000..cb14799ca6
--- /dev/null
+++ b/app/android/client/src/shared/java/org/stendhalgame/client/Logger.java
@@ -0,0 +1,214 @@
+/***************************************************************************
+ * Copyright © 2022-2024 - Faiumoni e. V. *
+ ***************************************************************************
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+package org.stendhalgame.client;
+
+import java.io.File;
+
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+
+
+/**
+ * Semi-functional logger for release builds.
+ *
+ * Displays notification dialogs but does not write to logs directory.
+ */
+public class Logger {
+
+ /** Attribute denoting state of initialization. */
+ private static boolean initialized = false;
+ /** Logs directory. */
+ private static File logsDir;
+
+ /** Singleton instance. */
+ private static Logger instance;
+
+
+ /**
+ * Retrieves singleton instance.
+ */
+ public static Logger get() {
+ if (Logger.instance == null) {
+ Logger.instance = new Logger();
+ }
+ return Logger.instance;
+ }
+
+ /**
+ * Hidden singleton constructor.
+ */
+ private Logger() {
+ // do nothing
+ }
+
+ /**
+ * Initializes logs directory.
+ */
+ public static void init(final File dir) {
+ if (Logger.initialized) {
+ Logger.warn("tried to re-initialize logger");
+ return;
+ }
+ Logger.initialized = true;
+ logsDir = new File(dir.getPath() + "/logs");
+ }
+
+ /**
+ * Dummy method for release builds.
+ */
+ public static void writeLine(final String text) {
+ // do nothing
+ }
+
+ /**
+ * Dummy method for release builds.
+ */
+ public static void writeLine(final String text, final LogLevel level) {
+ // do nothing
+ }
+
+ /**
+ * Dummy method for release builds.
+ */
+ public static void info(final String text) {
+ // do nothing
+ }
+
+ /**
+ * Shows an information dialog.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be displayed.
+ */
+ public static void info(final boolean notify, final String text) {
+ if (notify) {
+ Logger.notify(text, LogLevel.INFO);
+ }
+ }
+
+ /**
+ * Dummy method for release builds.
+ */
+ public static void warn(final String text) {
+ // do nothing
+ }
+
+ /**
+ * Shows a warning dialog.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be displayed.
+ */
+ public static void warn(final boolean notify, final String text) {
+ if (notify) {
+ Logger.notify(text, LogLevel.WARN);
+ }
+ }
+
+ /**
+ * Dummy method for release builds.
+ */
+ public static void error(final String text) {
+ // do nothing
+ }
+
+ /**
+ * Shows an error message dialog.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be displayed.
+ */
+ public static void error(final boolean notify, final String text) {
+ if (notify) {
+ Logger.notify(text, LogLevel.ERROR);
+ }
+ }
+
+ /**
+ * Dummy method for release builds.
+ */
+ public static void debug(final String text) {
+ // do nothing
+ }
+
+ /**
+ * Shows a debug message dialog.
+ *
+ * @param notify
+ * If `true` a toast notification is displayed to user.
+ * @param text
+ * Text to be displayed.
+ */
+ public static void debug(final boolean notify, final String text) {
+ if (notify) {
+ Logger.notify(text, LogLevel.DEBUG);
+ }
+ }
+
+ /**
+ * Displays a toast notification to user.
+ *
+ * @param text
+ * Text to display in notification.
+ */
+ public static void notify(final String text) {
+ notify(text, LogLevel.INFO);
+ }
+
+ /**
+ * Displays a toast notification to user.
+ *
+ * @param text
+ * Text to display in notification.
+ * @param level
+ * Logging verbosity level.
+ */
+ public static void notify(final String text, LogLevel level) {
+ if (!Logger.initialized) {
+ System.err.println("ERROR: Logger not initialized. Call Logger.init.");
+ return;
+ }
+
+ if (level == null) {
+ level = LogLevel.INFO;
+ }
+
+ final AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.get());
+ builder.setTitle(level.label);
+ builder.setMessage(text);
+
+ builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(final DialogInterface dialog, final int id) {
+ dialog.cancel();
+ }
+ });
+
+ builder.create().show();
+ }
+
+ /**
+ * Retrieves logs directory.
+ *
+ * @return
+ * Directory path to outpu logs.
+ */
+ public static String getLogsDir() {
+ return logsDir.getPath();
+ }
+}
diff --git a/android/gradle.properties b/app/android/gradle.properties
similarity index 88%
rename from android/gradle.properties
rename to app/android/gradle.properties
index 52f5917cb0..bf8f5aaf47 100644
--- a/android/gradle.properties
+++ b/app/android/gradle.properties
@@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+org.gradle.jvmargs=-Xmx512m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -16,4 +16,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
-android.enableJetifier=true
\ No newline at end of file
+android.enableJetifier=true
+# Stop daemon after build
+org.gradle.daemon=false
diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/app/android/gradle/wrapper/gradle-wrapper.jar
similarity index 59%
rename from android/gradle/wrapper/gradle-wrapper.jar
rename to app/android/gradle/wrapper/gradle-wrapper.jar
index e708b1c023..249e5832f0 100644
Binary files a/android/gradle/wrapper/gradle-wrapper.jar and b/app/android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/app/android/gradle/wrapper/gradle-wrapper.properties
similarity index 64%
rename from android/gradle/wrapper/gradle-wrapper.properties
rename to app/android/gradle/wrapper/gradle-wrapper.properties
index 2e6e5897b5..b916c04dbb 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/app/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/app/android/gradlew b/app/android/gradlew
new file mode 100755
index 0000000000..a69d9cb6c2
--- /dev/null
+++ b/app/android/gradlew
@@ -0,0 +1,240 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/android/gradlew.bat b/app/android/gradlew.bat
similarity index 87%
rename from android/gradlew.bat
rename to app/android/gradlew.bat
index ac1b06f938..53a6b238d4 100644
--- a/android/gradlew.bat
+++ b/app/android/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
+if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/android/launcher_icon.xcf b/app/android/launcher_icon.xcf
similarity index 100%
rename from android/launcher_icon.xcf
rename to app/android/launcher_icon.xcf
diff --git a/android/settings.gradle b/app/android/settings.gradle
similarity index 90%
rename from android/settings.gradle
rename to app/android/settings.gradle
index 15c65c6422..c18738c292 100644
--- a/android/settings.gradle
+++ b/app/android/settings.gradle
@@ -6,4 +6,4 @@ dependencyResolutionManagement {
}
}
rootProject.name = "Stendhal"
-include ':app'
+include ':client'
diff --git a/app/nativehelper/.gitignore b/app/nativehelper/.gitignore
new file mode 100644
index 0000000000..f516acf914
--- /dev/null
+++ b/app/nativehelper/.gitignore
@@ -0,0 +1,3 @@
+/target
+steam_appid.txt
+/Cargo.lock
diff --git a/app/nativehelper/Cargo.toml b/app/nativehelper/Cargo.toml
new file mode 100644
index 0000000000..4df05921bc
--- /dev/null
+++ b/app/nativehelper/Cargo.toml
@@ -0,0 +1,25 @@
+[package]
+authors = ["Arianne Project"]
+name = "nativehelper"
+documentation = "https://arianne-project.org/game/stendhal.html"
+edition = "2021"
+license = "LGPL-3"
+repository = "https://github.com/arianne/stendhal"
+version = "0.3.1"
+
+
+[profile.release]
+codegen-units = 1
+debug = false
+debug-assertions = false
+lto = true
+opt-level = "z"
+panic = 'abort'
+strip = true
+
+[dependencies]
+lazy_static = "1.5.0"
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
+steamworks = "0.10.0"
+websocket = "0.27.0"
diff --git a/app/nativehelper/src/main.rs b/app/nativehelper/src/main.rs
new file mode 100644
index 0000000000..75186ee688
--- /dev/null
+++ b/app/nativehelper/src/main.rs
@@ -0,0 +1,209 @@
+use lazy_static::lazy_static;
+use serde_json::Value;
+use std::io;
+use std::io::Read;
+use std::process;
+use std::sync::Arc;
+use std::sync::atomic::AtomicBool;
+use std::sync::atomic::Ordering;
+use std::sync::Mutex;
+use std::sync::mpsc::Sender;
+use std::sync::mpsc::channel;
+use std::thread;
+use std::thread::JoinHandle;
+
+use steamworks::AuthSessionTicketResponse;
+use steamworks::Client;
+
+use websocket::client::ClientBuilder;
+use websocket::{Message, OwnedMessage};
+
+
+lazy_static! {
+ static ref AUTHENTICATED: Mutex = Mutex::new(false);
+}
+
+fn connect() -> (Sender, JoinHandle<()>) {
+ println!("Read connection parameters");
+ let mut json = String::new();
+ io::stdin().read_to_string(&mut json).expect("Read from stdin");
+ let connection_params: Value = serde_json::from_str(&json).expect("Parse json from stdin");
+
+ let nl_token = connection_params["nlToken"].as_str().expect("nlToken").to_string();
+ let nl_port = connection_params["nlPort"].as_str().expect("nlPort").to_string();
+ let nl_connect_token = connection_params["nlConnectToken"].as_str().expect("nlConnectToken").to_string();
+
+ let connection = "ws://127.0.0.1:".to_owned() + &nl_port + "?extensionId=nativehelper&connectToken=" + &nl_connect_token;
+ println!("Connecting");
+
+ let client = ClientBuilder::new(&connection)
+ .unwrap()
+ .connect_insecure()
+ .unwrap();
+
+ println!("Successfully connected");
+
+ let (mut receiver, mut sender) = client.split().unwrap();
+ let (tx, rx) = channel();
+ let tx_1 = tx.clone();
+ let _send_loop = thread::spawn(move || {
+ loop {
+ // Send loop
+ let message = match rx.recv() {
+ Ok(m) => m,
+ Err(e) => {
+ println!("Send Loop: {:?}", e);
+ return;
+ }
+ };
+ match message {
+ OwnedMessage::Close(_) => {
+ let _ = sender.send_message(&message);
+ // If it's a close message, just send it and then return.
+ println!("Send Loop Close");
+ return;
+ }
+ _ => (),
+ }
+ // Send the message
+ match sender.send_message(&message) {
+ Ok(()) => (),
+ Err(e) => {
+ println!("Send Loop: {:?}", e);
+ let _ = sender.send_message(&Message::close());
+ return;
+ }
+ }
+ }
+ });
+
+ let receive_loop = thread::spawn(move || {
+ for message in receiver.incoming_messages() {
+ let message = match message {
+ Ok(m) => m,
+ Err(e) => {
+ println!("Receive Loop: {:?}", e);
+ let _ = tx_1.send(OwnedMessage::Close(None));
+ return;
+ }
+ };
+ match message {
+ OwnedMessage::Close(_) => {
+ // Got a close message, so send a close message and return
+ println!("Receive Loop Close");
+ let _ = tx_1.send(OwnedMessage::Close(None));
+ return;
+ }
+ OwnedMessage::Ping(data) => {
+ println!("Receive Loop Ping");
+ match tx_1.send(OwnedMessage::Pong(data)) {
+ // Send a pong in response
+ Ok(()) => (),
+ Err(e) => {
+ println!("Receive Loop: {:?}", e);
+ return;
+ }
+ }
+ }
+ OwnedMessage::Binary(data) =>{
+ println!("Receive Loop Binary: {:?}", data);
+ }
+
+ // Say what we received
+ OwnedMessage::Text(data) => {
+ println!("Receive Loop Text: {:?}", data);
+ let tx_2 = tx_1.clone();
+ handle_message(&nl_token, tx_2, data);
+ }
+ _ => println!("Receive Loop: {:?}", message)
+ }
+ }
+ });
+
+ return (tx, receive_loop);
+}
+
+fn handle_message(nl_token: &String, tx: Sender, message: String) {
+ if message.contains("event\":\"request_authentication\"") {
+ authenticate(tx, nl_token.clone());
+ } else if message.contains("event\":\"clientDisconnect\"") {
+ let authenticated = AUTHENTICATED.lock().unwrap();
+ if *authenticated {
+ println!("Authenticated, exiting extension ...");
+ } else {
+ println!("Unauthenticated, exiting extension ...");
+ }
+ process::exit(0);
+ }
+}
+
+fn authenticate(tx: Sender, nl_token: String) {
+ match Client::init() {
+ Ok((client, single)) => {
+ let called = Arc::new(AtomicBool::new(false));
+ let callback_called = called.clone();
+
+ let (_ticket_handle, session_ticket): (steamworks::AuthTicket, Vec) = client.user().authentication_session_ticket();
+ let _callback =
+ client.register_callback(move |session_ticket_response: AuthSessionTicketResponse| {
+ //if session_ticket_response.ticket == ticket_handle {
+ if session_ticket_response.result.is_ok() {
+ let mut authenticated = AUTHENTICATED.lock().unwrap();
+ *authenticated = true;
+ }
+ println!("Ticket Response Result: {:?}", session_ticket_response.result);
+ callback_called.store(true, Ordering::Relaxed);
+ // println!("Ticket : {:?}", session_ticket_response.ticket);
+ // println!("Ticket Response: {:?}", session_ticket);
+
+ let message = OwnedMessage::Text(format!("\
+ {{\
+ \"id\": \"15fb0ffb-7b18-48d2-89a3-39b1ce4b2645\",\
+ \"method\": \"app.broadcast\",\
+ \"accessToken\": {:?},\
+ \"data\": {{\
+ \"event\": \"steamAuthToken\",\
+ \"data\": {:?}\
+ }}\
+ }}", nl_token, &session_ticket));
+ match tx.send(message) {
+ Ok(()) => (),
+ Err(e) => {
+ println!("Websocket send error: {:?}", e);
+ }
+ }
+
+ });
+ for _ in 0..100 {
+ single.run_callbacks();
+ if called.load(Ordering::Relaxed) {
+ return;
+ }
+ ::std::thread::sleep(::std::time::Duration::from_millis(50));
+ }
+ },
+ Err(_) => {
+ println!("Steam not available");
+ let message = OwnedMessage::Text(format!("\
+ {{\
+ \"id\": \"15fb0ffb-7b18-48d2-89a3-39b1ce4b2645\",\
+ \"method\": \"app.broadcast\",\
+ \"accessToken\": {:?},\
+ \"data\": {{\
+ \"event\": \"noAuthToken\"\
+ }}\
+ }}", &nl_token));
+ match tx.send(message) {
+ Ok(()) => (),
+ Err(e) => {
+ println!("Websocket send error: {:?}", e);
+ }
+ }
+ }
+ }
+}
+
+fn main() {
+ let (_tx, receive_loop) = connect();
+ let _ = receive_loop.join();
+}
diff --git a/app/neutralinojs/.gitignore b/app/neutralinojs/.gitignore
new file mode 100644
index 0000000000..3bdc203be2
--- /dev/null
+++ b/app/neutralinojs/.gitignore
@@ -0,0 +1,19 @@
+# Developer tools' files
+.lite_workspace.lua
+
+# Neutralinojs binaries and builds
+/bin
+/dist
+
+# Neutralinojs client (minified)
+neutralino.js
+
+# Neutralinojs related files
+.storage
+*.log
+extensions/binary/steam_appid.txt
+extensions/binary/*.so
+extensions/binary/*.dll
+extensions/binary/nativehelper*
+extensions/binary/LICENSE.txt
+resources/js/neutralino.d.ts
diff --git a/app/neutralinojs/LICENSE.txt b/app/neutralinojs/LICENSE.txt
new file mode 100644
index 0000000000..3977f9dcd0
--- /dev/null
+++ b/app/neutralinojs/LICENSE.txt
@@ -0,0 +1,697 @@
+Stendhal
+========
+
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
+
+
+
+Neutralinojs
+============
+
+MIT License
+
+Copyright (c) 2021 Neutralinojs and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+
+Cargo Dependencies
+==================
+
diff --git a/app/neutralinojs/neutralino.config.json b/app/neutralinojs/neutralino.config.json
new file mode 100644
index 0000000000..7d4ac4d423
--- /dev/null
+++ b/app/neutralinojs/neutralino.config.json
@@ -0,0 +1,61 @@
+{
+ "$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
+ "applicationId": "org.stendhalgame.client",
+ "version": "1.49.5",
+ "defaultMode": "window",
+ "port": 0,
+ "documentRoot": "/resources/",
+ "url": "/",
+ "enableServer": true,
+ "enableNativeAPI": true,
+ "enableExtensions": true,
+ "extensions": [
+ {
+ "id": "nativehelper",
+ "commandLinux": "${NL_PATH}/extensions/binary/nativehelper",
+ "commandWindows": "${NL_PATH}/extensions/binary/nativehelper.exe"
+ }
+ ],
+ "tokenSecurity": "one-time",
+ "logging": {
+ "enabled": true
+ },
+ "nativeAllowList": [
+ "app.*",
+ "extensions.*"
+ ],
+ "modes": {
+ "window": {
+ "exitProcessOnClose": true,
+ "extendUserAgentWith": "Stendhal",
+ "title": "Stendhal",
+ "width": 930,
+ "height": 700,
+ "minWidth": 400,
+ "minHeight": 200,
+ "icon": "resources/StendhalIcon.png",
+ "resizable": true
+ },
+ "chrome": {
+ "exitProcessOnClose": true,
+ "width": 930,
+ "height": 700,
+ "minWidth": 400,
+ "minHeight": 200,
+ "icon": "resources/StendhalIcon.png",
+ "args": "--user-agent=\"Stendhal\"",
+ "nativeBlockList": [
+ "filesystem.*",
+ "os.*"
+ ]
+ }
+ },
+ "cli": {
+ "binaryName": "stendhal-client",
+ "resourcesPath": "/resources/",
+ "extensionsPath": "/extensions/",
+ "clientLibrary": "/resources/js/neutralino.js",
+ "binaryVersion": "6.2.0",
+ "clientVersion": "6.2.0"
+ }
+}
diff --git a/app/neutralinojs/package-lock.json b/app/neutralinojs/package-lock.json
new file mode 100644
index 0000000000..bb868dea3b
--- /dev/null
+++ b/app/neutralinojs/package-lock.json
@@ -0,0 +1,6 @@
+{
+ "name": "stendhal_client",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {}
+}
diff --git a/app/neutralinojs/resources/StendhalIcon.png b/app/neutralinojs/resources/StendhalIcon.png
new file mode 100644
index 0000000000..1ecdb2407a
Binary files /dev/null and b/app/neutralinojs/resources/StendhalIcon.png differ
diff --git a/app/neutralinojs/resources/index.html b/app/neutralinojs/resources/index.html
new file mode 100644
index 0000000000..56efb4cc70
--- /dev/null
+++ b/app/neutralinojs/resources/index.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Loading...
+
+
+
+ Loading...
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/neutralinojs/resources/js/main.js b/app/neutralinojs/resources/js/main.js
new file mode 100644
index 0000000000..ce926d9a10
--- /dev/null
+++ b/app/neutralinojs/resources/js/main.js
@@ -0,0 +1,88 @@
+const SERVER_ORIGIN = "https://stendhalgame.org";
+// const SERVER_ORIGIN = "http://localhost";
+const SERVER_PATH = "/account/login.html";
+
+const UPDATE_URL = "https://arianne-project.org/stendhal/updates/manifest.json";
+
+
+let authenticated = false;
+
+const byteToHex = [];
+for (let n = 0; n <= 0xff; ++n) {
+ const hexOctet = n.toString(16).padStart(2, "0");
+ byteToHex.push(hexOctet);
+}
+
+function hex(arrayBuffer) {
+ const buff = new Uint8Array(arrayBuffer);
+ const hexOctets = [];
+ for (let i = 0; i < buff.length; ++i) {
+ hexOctets.push(byteToHex[buff[i]]);
+ }
+ return hexOctets.join("");
+}
+
+function onSteamAuthToken(event) {
+ console.log("onSteamAuthToken");
+ authenticated = true;
+ let ticketString = hex(event.detail);
+ document.querySelector("form").action = SERVER_ORIGIN + SERVER_PATH + "?" + Date.now();
+ document.querySelector("#steam_auth_ticket").value = ticketString;
+ document.querySelector("form").submit();
+}
+
+async function update() {
+ try {
+ let manifest = await Neutralino.updater.checkForUpdates(UPDATE_URL);
+
+ if(manifest.version > NL_APPVERSION) {
+ console.log("Updating...");
+ await Neutralino.updater.install();
+ } else {
+ console.log('Stendhal is up to date.');
+ }
+ } catch (e) {
+ console.log("Update check failed", e);
+ }
+}
+
+function onNoAuthToken(_event) {
+ console.log("onNoAuthToken");
+ update();
+ window.location = SERVER_ORIGIN + SERVER_PATH + "?" + Date.now();
+}
+
+async function timeoutExtensionConnection() {
+ if (authenticated) {
+ return;
+ }
+ let stats = await Neutralino.extensions.getStats();
+ let connected = stats.connected.includes("nativehelper");
+ if (!connected) {
+ console.log("timeoutExtensionConnection");
+ onNoAuthToken();
+ return;
+ }
+ setTimeout(() => timeoutExtensionAuthentication(), 10000);
+}
+
+async function timeoutExtensionAuthentication() {
+ if (authenticated) {
+ return;
+ }
+ console.log("timeoutExtensionAuthentication");
+ onNoAuthToken();
+}
+
+Neutralino.init();
+
+// https://github.com/neutralinojs/neutralinojs/issues/678
+Neutralino.events.on("windowClose", () => {
+ Neutralino.app.exit();
+});
+
+setTimeout(() => timeoutExtensionConnection(), 2000);
+
+Neutralino.events.on("steamAuthToken", onSteamAuthToken);
+Neutralino.events.on("noAuthToken", onNoAuthToken);
+Neutralino.extensions.dispatch("nativehelper", "request_authentication");
diff --git a/bin/check-boilerplates.sh b/bin/check-boilerplates.sh
new file mode 100755
index 0000000000..2a6d1fce15
--- /dev/null
+++ b/bin/check-boilerplates.sh
@@ -0,0 +1,146 @@
+#!/usr/bin/env bash
+
+# This script is licensed under Creative Commons Zero (CC0 / Public Domain).
+
+# source root should be directory above script location
+cd "$(dirname $0)/../"
+root=$(pwd)
+
+script="$(basename $0)";
+cur_year=$(date +"%Y")
+
+args=("$@")
+write=0
+if [ "${args[0]}" == "-w" ] || [ "${args[0]}" == "--write" ]; then
+ write=1
+ unset args[0]
+ # shift so args[0] isn't undefined
+ args=("${args[@]}")
+fi
+
+if [ ! -z ${args[0]} ]; then
+ src_dirs=("${args[@]}")
+else
+ src_dirs=(
+ "src/games/stendhal/client"
+ "src/games/stendhal/common"
+ "src/games/stendhal/server"
+ "src/games/stendhal/tools"
+ "src/js/stendhal"
+ "data/script"
+ )
+fi
+
+if [ ${write} -eq 0 ]; then
+ echo -e "\nScan only mode, to update files use '${script} --write'"
+fi
+
+warnings=0
+# logs a warning message
+warn() {
+ w="WARNING: ${1}"
+ if [[ ${warnings} -eq 0 ]]; then
+ # no previous output from this so erase contents
+ echo -e "Issues reported by ${script}:\n${w}" > "issues.txt"
+ else
+ # append
+ echo -e "${w}" >> "issues.txt"
+ fi
+ echo "${w}"
+ warnings=$(expr ${warnings} + 1)
+}
+
+# logs an error message & exits
+err() {
+ c=${1}
+ e="ERROR: ${2} (error code: ${c}), exiting ..."
+ if [[ ${warnings} -eq 0 ]]; then
+ # no previous output from this run so erase contents
+ echo -e "Issues reported by ${script}:\n${e}" > "issues.txt"
+ else
+ # append
+ echo -e "${e}" >> "issues.txt"
+ fi
+ echo -e "${e}\nDetails saved to issues.txt"
+ exit ${c}
+}
+
+start_time=$(date +"%s")
+
+file_types=(-name "*.java" -o -name "*.js" -o -name "*.ts" -o -name "*.lua")
+checked=0
+updated=0
+for rel_path in "${src_dirs[@]}"; do
+ if [[ "${rel_path}" == /* ]]; then
+ abs_path="${rel_path}"
+ else
+ abs_path="${root}/${rel_path}"
+ fi
+ if [ ! -d "${abs_path}" ]; then
+ warn "Skipped missing directory: ${rel_path}"
+ continue
+ fi
+ if [ ${write} -eq 0 ]; then
+ echo -e "\nChecking copyrights in ${rel_path} ..."
+ else
+ echo -e "\nChecking and updating copyright year (${cur_year}) in ${rel_path} ..."
+ fi
+
+ sources=$(find "${rel_path}" -type f \( "${file_types[@]}" \))
+ for src in ${sources}; do
+ pattern="Copyright\( ©\)\? "
+ instances=$(grep "^ \*.*${pattern}" "${src}")
+ icount=$(echo "${instances}" | wc -l)
+
+ if [ ${icount} -gt 1 ]; then
+ warn "Multiple copyrights: ${src}"
+ # use first instance
+ instances=$(echo "${instances}" | head -n1)
+ fi
+
+ year=$(echo "${instances}" | sed -e "s/^ \*.*${pattern}//" | cut -b1-4)
+ if [ "${year}" == "" ]; then
+ warn "Copyright not detected: ${src}"
+ continue
+ elif [ "${year}" == "${cur_year}" ]; then
+ years="${cur_year}"
+ else
+ years="${year}-${cur_year}"
+ fi
+
+ if [ ${#year} -lt 4 ]; then
+ warn "Invalid year ${year}: ${src}"
+ fi
+
+ if [ ${write} -gt 0 ]; then
+ # add updated year(s) to file (replace only first instance)
+ sed -i -e "0,/${pattern}${year}[^ ]* \([^*]*\)\*/s//Copyright\1 ${years} \2\*/" "${src}"
+ # update pattern for perl regex
+ #pattern=$(echo ${pattern} | perl -pe 's/\\//g')
+ #perl -i -pe "!\${i} && s/${pattern} ${year}.*? (.*)\*/Copyright\$1 ${years} \$2\*/ && (\${i}=1)" "${src}"
+
+ ret=$?
+ if [ ${ret} -ne 0 ]; then
+ err ${ret} "An unhandled exception occurred"
+ fi
+
+ updated=$(expr ${updated} + 1)
+ fi
+
+ checked=$(expr ${checked} + 1)
+ done
+done
+
+s=$(expr $(date +"%s") - ${start_time})
+m=$(expr ${s} / 60)
+s=$(expr ${s} - ${m} \* 60)
+h=$(expr ${m} / 60)
+m=$(expr ${m} - ${h} \* 60)
+
+echo -e "\nDone (elapsed time: ${h}h ${m}m ${s}s)"
+echo "Files checked: ${checked}"
+echo "Files updated: ${updated}"
+echo "Warnings: ${warnings}"
+if [ ${warnings} -gt 0 ]; then
+ echo "Details saved to issues.txt"
+fi
diff --git a/bin/check-file-size.py b/bin/check-file-size.py
new file mode 100755
index 0000000000..8ea91e307e
--- /dev/null
+++ b/bin/check-file-size.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+
+'''
+***************************************************************************
+* Copyright © 2025 - Faiumoni e. V. *
+***************************************************************************
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+'''
+
+import errno
+import os
+import sys
+
+from pathlib import Path
+
+
+dir_root = Path(__file__).parent
+if "bin" == dir_root.name:
+ dir_root = Path(dir_root.parent)
+dir_music = Path(dir_root, "data/music")
+dir_sounds = Path(dir_root, "data/sounds")
+
+
+## Checks if a file is larger than 2MB.
+#
+# On systems with low resources, the Java client struggles to load large audio files.
+#
+# @param path
+# File path.
+# @return
+# `EFBIG` if file is larger than 2MB, 0 otherwise.
+def checkAudioFileSize(path):
+ if not path.is_file():
+ # ignore if audio file doesn't exist
+ print("WARNING: Ignoring file not found: {}".format(path))
+ return 0
+
+ if path.stat().st_size > 1048576 * 2:
+ # warn if file size > 2MB
+ return errno.EFBIG
+ return 0
+
+## Checks directory for large audio files.
+#
+# @param path
+# Directory path to be walked.
+# @return
+# `EFBIG` if any file larger than 2MB found, 0 otherwise.
+def checkAudioDir(path):
+ if not path.is_dir():
+ # ignore if audio directory doesn't exist
+ print("WARNING: Ignoring directory not found: {}".format(path))
+ return 0
+
+ res = 0
+ for ROOT, DIRS, FILES in path.walk():
+ for filename in FILES:
+ filepath = Path(ROOT, filename)
+ if filepath.suffix.lower().lstrip(".") not in ("ogg", "oga", "mid", "midi"):
+ # only check supported file types
+ continue
+
+ code = checkAudioFileSize(filepath)
+ if code == errno.EFBIG:
+ res = code
+ sys.stderr.write("WARNING: Audio file size larger than 2MB: {}\n".format(str(filepath)[len(str(dir_root)):].lstrip("/\\")))
+
+ return res
+
+def main():
+ res = 0
+ for audio_dir in dir_music, dir_sounds:
+ code = checkAudioDir(audio_dir)
+ if code != 0:
+ res = code
+ if res == 0:
+ print("No large audio data files detected")
+ return res
+
+if __name__ == "__main__":
+ # work from source tree root
+ os.chdir(dir_root)
+ sys.exit(main())
diff --git a/comtest.sh b/bin/comtest.sh
similarity index 100%
rename from comtest.sh
rename to bin/comtest.sh
diff --git a/bin/locale-template.py b/bin/locale-template.py
new file mode 100755
index 0000000000..b3c6f34ba9
--- /dev/null
+++ b/bin/locale-template.py
@@ -0,0 +1,308 @@
+#!/usr/bin/env python
+
+# ***************************************************************************
+# * Copyright © 2023-2024 - Stendhal *
+# ***************************************************************************
+# * *
+# * This program is free software; you can redistribute it and/or modify *
+# * it under the terms of the GNU General Public License as published by *
+# * the Free Software Foundation; either version 2 of the License, or *
+# * (at your option) any later version. *
+# * *
+# ***************************************************************************
+
+
+# script for generating data/language/template.txt
+
+import codecs
+import errno
+import os
+import re
+import sys
+
+
+dir_root = os.path.dirname(os.path.dirname(__file__))
+dir_config = os.path.normpath(os.path.join(dir_root, "data/conf"))
+dir_locale = os.path.normpath(os.path.join(dir_root, "data/languages"))
+file_template = os.path.join(dir_locale, "template.txt")
+
+
+# Helper functions.
+
+def printWarning(msg):
+ sys.stdout.write("WARNING: {}\n".format(msg))
+
+def printError(msg):
+ sys.stderr.write("ERROR: {}\n".format(msg))
+
+def exitWithError(err, msg):
+ printError(msg)
+ sys.exit(err)
+
+def escapeRegex(st):
+ return st.replace("*", "\\*")\
+ .replace("?", "\\?")\
+ .replace("+", "\\+")\
+ .replace("(", "\\(")\
+ .replace(")", "\\)")\
+ .replace("[", "\\[")\
+ .replace("]", "\\]")\
+ .replace("|", "\\|")
+
+
+# categories, names, & descriptions cache
+__cache = {
+ "items": {},
+ "creatures": {}
+}
+
+
+## Parses configuration file for names & descriptions.
+def parseConfig(_type, category):
+ print("parsing {} names and descriptions from category '{}'".format(_type, category))
+
+ dir_type = os.path.join(dir_config, _type)
+ if not os.path.isdir(dir_type):
+ printWarning("'{}' directory not found, excluding from translations template".format(dir_type))
+ return
+
+ file_xml = os.path.join(dir_type, category + ".xml")
+ if not os.path.isfile(file_xml):
+ printWarning("'{}' file not found, excluding from translation template".format(file_xml))
+ return
+
+ if category not in __cache[_type]:
+ __cache[_type][category] = {}
+ tmp = __cache[_type][category]
+
+ try:
+ fin = codecs.open(file_xml, "r", "utf-8")
+ # ensure working with LF line endings
+ content = fin.read().replace("\r\n", "\n").replace("\r", "\n")
+ fin.close()
+ except PermissionError:
+ exitWithError(errno.EACCES, "cannot open '{}' for reading, permission denied".format(file_xml))
+
+ # tag to parse from xml
+ tag = _type
+ if tag.endswith("s"):
+ tag = tag[:-1]
+
+ item_name = None
+ item_desc = None
+ in_comment = False
+ for line in content.split("\n"):
+ line = line.strip()
+
+ # ignore commented sections
+ # NOTE: only ignores lines starting with a comment and ignores content on same line after comment
+ if in_comment and "-->" in line:
+ in_comment = False
+ continue
+ if not in_comment:
+ in_comment = line.startswith("" not in line
+ if in_comment:
+ continue
+
+ if line.startswith("<{} name=\"".format(tag)):
+ item_name = re.sub("^<{} name=\"".format(tag), "", line)
+ item_name = re.sub("\".*$", "", item_name).strip()
+ elif item_name and line.startswith(""):
+ item_desc = re.sub("^", "", line)
+ item_desc = re.sub("$", "", item_desc).strip()
+ elif item_name and line == "{}>".format(tag):
+ # there may be multiple versions of an entity/item with different descriptions
+ if item_name in tmp and item_desc:
+ desc_new = item_desc
+ # preserve previous description(s)
+ item_desc = tmp[item_name]
+ # convert to a list for multiple descriptions
+ if type(item_desc) == str:
+ item_desc = [item_desc]
+ elif not item_desc:
+ item_desc = []
+ # add new description
+ item_desc.append(desc_new)
+
+ tmp[item_name] = item_desc
+
+ # reset
+ item_name = None
+ item_desc = None
+
+ __cache[_type][category] = tmp
+
+
+## Exports parsed data to template text file.
+def exportTemplate():
+ if not os.path.isdir(dir_locale):
+ exitWithError(errno.ENOENT, "'{}' directory not found, cannot create translation template".format(dir_locale))
+
+ try:
+ fout = codecs.open(file_template, "w", "utf-8")
+ except PermissionError:
+ exitWithError(errno.EACCES, "cannot open '{}' for writing, permission denied".format(file_template))
+
+ # main header
+ header = ("", "##", "## Language: ()", "## Translators: [, ...]", "##")
+ fout.write("\n".join(header) + "\n")
+
+ for _type in __cache:
+ # type header
+ fout.write("\n\n# {} names and descriptions".format(_type))
+
+ contents = __cache[_type]
+ for category in tuple(sorted(contents)):
+ if not contents[category]:
+ printWarning("'{}' category '{}' is empty, skipping".format(_type, category))
+ continue
+
+ # category header
+ fout.write("\n\n## " + category + "\n")
+
+ cat_list = contents[category]
+ for item_name in cat_list:
+ fout.write("\n" + item_name + "=\n")
+ item_desc = cat_list[item_name]
+ if item_desc:
+ if type(item_desc) == str:
+ item_desc = [item_desc]
+ for desc in item_desc:
+ fout.write(desc + "=\n")
+
+ fout.close()
+
+ print("template exported to '{}'".format(file_template))
+
+
+## Builds a localization template for translating.
+def buildTemplate():
+ # categores not translated
+ cat_excludes = {
+ "items": ("dummy_weapons", "meta")
+ }
+
+ for _type in __cache:
+ print("parsing type: {}".format(_type))
+
+ category_names = []
+
+ dir_type = os.path.join(dir_config, _type)
+ for basename in sorted(os.listdir(dir_type)):
+ # include xml configuration files only
+ if not os.path.isfile(os.path.join(dir_type, basename)) or not basename.endswith(".xml"):
+ continue
+
+ # remove .xml filename suffix
+ category = basename[:-4]
+ if _type in cat_excludes and category in cat_excludes[_type]:
+ continue
+ category_names.append(category)
+
+ if len(category_names) == 0:
+ printWarning("no '{}' categories found, excluding from translation template".format(_type))
+
+ for category in category_names:
+ parseConfig(_type, category)
+
+ exportTemplate()
+
+
+## Updates existing translations found in data/languages.
+def updateExisting():
+ if not os.path.isdir(dir_locale):
+ printWarning("directory '{}' not found, no translations available for updating".format(dir_locale))
+ return
+ if not os.path.isfile(file_template):
+ exitWithError(errno.ENOENT, "template '{}' not found, cannot update translations".format(file_template))
+
+ try:
+ fin = codecs.open(file_template, "r", "utf-8")
+ template = fin.read().replace("\r\n", "\n").replace("\r", "\n")
+ fin.close()
+ except PermissionError:
+ exitWithError(errno.EACCES, "cannot open '{}' for reading, permission denied".format(file_template))
+
+ locale_codes = []
+ for basename in os.listdir(dir_locale):
+ if not basename.endswith(".txt") or basename == "template.txt":
+ continue
+ locale_codes.append(basename[:-4])
+
+ if not locale_codes:
+ printWarning("no translations available for updating")
+ return
+
+ for code in locale_codes:
+ print("updating locale '{}'".format(code))
+
+ filepath = os.path.join(dir_locale, code + ".txt")
+ try:
+ fin = codecs.open(filepath, "r", "utf-8")
+ contents_old = fin.read().replace("\r\n", "\n").replace("\r", "\n")
+ fin.close()
+ except PermissionError:
+ exitWithError(errno.EACCES, "cannot open '{}' for reading, permission denied".format(filepath))
+
+ # make a copy of template
+ contents = template
+
+ header_language = None
+ header_translators = None
+ unused = []
+ lidx = 0
+ for line in contents_old.split("\n"):
+ lidx += 1
+
+ # check for headers
+ if not header_language and line.startswith("## Language:"):
+ header_language = re.sub("^## Language:", "", line).strip()
+ continue
+ if not header_translators and line.startswith("## Translators:"):
+ header_translators = re.sub("^## Translators:", "", line).strip()
+ continue
+
+ # ignore comments & empty lines
+ if not line.strip() or line.startswith("#"):
+ continue
+ if "=" not in line:
+ printWarning("malformed line ({}) in '{}'".format(lidx, filepath))
+ continue
+
+ key = escapeRegex(line.split("=", 1)[0]) + "="
+ if not re.search("^" + key, contents, re.M):
+ unused.append(line)
+ continue
+ contents = re.sub("^" + key + ".*$", line, contents, flags=re.M)
+
+ if header_language:
+ contents = re.sub("^## Language:.*$", "## Language: {}".format(header_language), contents, 1, re.M)
+ if header_translators:
+ contents = re.sub("^## Translators:.*$", "## Translators: {}".format(header_translators), contents, 1, re.M)
+
+ contents = contents.rstrip()
+
+ if unused:
+ contents += "\n\n\n# strings not found in template\n"
+ for line in unused:
+ contents += "\n" + line
+
+ try:
+ fout = codecs.open(filepath, "w", "utf-8")
+ fout.write(contents + "\n")
+ fout.close()
+ except PermissionError:
+ exitWithError(errno.EACCES, "cannot open '{}' for writing, permission denied".format(filepath))
+
+ print("exported to '{}'".format(filepath))
+
+
+if __name__ == "__main__":
+ # work from source root
+ os.chdir(dir_root)
+
+ args = sys.argv[1:]
+ if "--update" in args:
+ updateExisting()
+ else:
+ buildTemplate()
diff --git a/runBalanceRPGame.sh b/bin/runBalanceRPGame.sh
similarity index 100%
rename from runBalanceRPGame.sh
rename to bin/runBalanceRPGame.sh
diff --git a/runpte.bat b/bin/runpte.bat
similarity index 100%
rename from runpte.bat
rename to bin/runpte.bat
diff --git a/runpte.sh b/bin/runpte.sh
similarity index 100%
rename from runpte.sh
rename to bin/runpte.sh
diff --git a/bin/runserver.bat b/bin/runserver.bat
new file mode 100644
index 0000000000..91d06c7e74
--- /dev/null
+++ b/bin/runserver.bat
@@ -0,0 +1,40 @@
+@echo off
+
+set STENDHAL_VERSION=1.49.5
+set SERVER_JAR=stendhal-server-%STENDHAL_VERSION%.jar
+
+:: change to server directory
+::for %%F in ("%0") do set server_root=%%~dpF
+::cd "%server_root%"
+
+:: parse arguments
+set vm_args=
+set app_args=
+setlocal EnableDelayedExpansion
+for %%A in (%*) do (
+ set arg=%%A
+ if ["-D"] == ["!arg:~0,2!"] (
+ if [] == [!vm_args!] (
+ set vm_args=!arg!
+ ) else (
+ set vm_args=!vm_args! !arg!
+ )
+ ) else (
+ if [] == [!app_args!] (
+ set app_args=!arg!
+ ) else (
+ set app_args=!app_args! !arg!
+ )
+ )
+)
+
+if exist "%SERVER_JAR%" (
+ set LOCALCLASSPATH=.\%SERVER_JAR%;.\libs\*
+) else (
+ set LOCALCLASSPATH=.;.\build\build_server;.\build\build_server_maps;.\build\build_server_script;.\build\build_server_xmlconf;.\libs\*;
+)
+
+java -Xmx400m -cp "%LOCALCLASSPATH%" %vm_args% games.stendhal.server.StendhalServer %app_args%
+
+:end
+@pause
diff --git a/bin/runserver.sh b/bin/runserver.sh
new file mode 100755
index 0000000000..6dbe08452d
--- /dev/null
+++ b/bin/runserver.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+STENDHAL_VERSION="1.49.5"
+SERVER_JAR="stendhal-server-${STENDHAL_VERSION}.jar"
+
+# change to server directory
+#cd "$(dirname "$0")" || exit
+
+# parse arguments
+vm_args=()
+app_args=()
+for arg in "$@"; do
+ if [[ "${arg}" =~ ^-D ]]; then
+ vm_args+=("${arg}")
+ else
+ app_args+=("${arg}")
+ fi
+done
+
+if [ -f "${SERVER_JAR}" ]; then
+ LOCALCLASSPATH="./${SERVER_JAR}:./libs/*"
+else
+ LOCALCLASSPATH=".:./build/build_server:./build/build_server_maps:./build/build_server_script:./build/build_server_xmlconf:./libs/*"
+fi
+
+java -Xmx400m -cp "${LOCALCLASSPATH}" "${vm_args[@]}" games.stendhal.server.StendhalServer "${app_args[@]}"
diff --git a/runtest.sh b/bin/runtest.sh
similarity index 100%
rename from runtest.sh
rename to bin/runtest.sh
diff --git a/tiled/vampire_maplabel.py b/bin/vampire_maplabel.py
similarity index 51%
rename from tiled/vampire_maplabel.py
rename to bin/vampire_maplabel.py
index c46e147b40..80ebe83c39 100644
--- a/tiled/vampire_maplabel.py
+++ b/bin/vampire_maplabel.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
-#Tue Sep 10 23:32:58 CEST 2019, slightly tweaked -- omero
"""
This script is used to create the world map with labeled zone names.
@@ -10,20 +9,19 @@ To create the labeled world map:
* Open a command line
* Change to your stendhal directory
* Run
- ant rendermaps
+ ant rendermaps
* Change to the tiled directory
* Run
- python vampire_maplabel.py -world
+ python vampire_maplabel.py -world
* Open tiled/world/world.tmx in tiled
* Set the floor layer to opaque (no transparency)
* Set the zoom to 1:1 (CTRL-0)
* From the file menu, select "Save as Image"
* Crop the black border (e.g. use "Crop Automatically" in The GIMP)
* Upload the image, e.g. at http://imageshack.us
- * Replace your labeled image files from the tiled/world directory with
- the clean (unlabeled) ones from CVS.
- * Edit http://stendhalgame.org/wiki/Template:SmallWorldMap
- and add a link to your uploaded image.
+ * Replace your labeled image files from the tiled/world directory with the clean (unlabeled) ones
+ from CVS.
+ * Edit http://stendhalgame.org/wiki/Template:SmallWorldMap and add a link to your uploaded image.
"""
import sys
@@ -33,29 +31,38 @@ import os
from PIL import Image, ImageFont, ImageDraw
-# get absolute path where script is located
-dir_root = os.path.dirname(__file__)
-if dir_root:
- os.chdir(dir_root)
-dir_root = os.getcwd()
-dir_world = os.path.join(dir_root, 'world')
+
script_name = os.path.basename(__file__)
+# directory from where script was executed
+dir_start = os.getcwd()
+# path to root directory
+os.chdir(os.path.join(os.path.dirname(__file__), '../'))
+dir_root = os.getcwd()
+# directory relative to root where images are located
+subdir_world = os.path.normpath('data/maps/world')
+# absolute path to directory where images are located
+dir_world = os.path.join(dir_root, subdir_world)
+
protected = ('world', 'logo', 'reserved', 'empty', 'empty-white')
def showUsage():
- print ('Usage: {} [image-filenames...]'.format(script_name))
- print (' This will label each PNG file passed as argument.')
- print (' E.g: ./world/int_*.png will label all interiors, etc. etc.')
- print
- print ('Alternatively, you can run: {} -world'.format(script_name))
- print (' This will label each PNG file in the world subdirectory.')
+ print('Usage: {} [image-filenames...]'.format(script_name))
+ print(' This will label each PNG file passed as argument.')
+ print(' E.g: data/maps/world/int_*.png will label all\n interiors, etc.')
+ print(' Note: If filename parameters aren\'t found they\n are assumed to be nested within the\n {} directory.'.format(subdir_world))
+ print()
+ print('Alternatively, you can run: {} -world'.format(script_name))
+ print(' This will label each PNG file in the world subdirectory.')
+processed = 0
def do_label(fname):
- print ('Processing {}'.format(fname))
+ global processed
+
+ print('Processing {}'.format(fname))
# remove directory and file extension
label = os.path.basename(fname).split('/')[-1].replace('.png', '')
- print ('Processing LABEL: {}'.format(label))
+ print('Processing LABEL: {}'.format(label))
img = Image.open(fname)
img = img.convert('RGBA')
@@ -64,7 +71,7 @@ def do_label(fname):
# label
draw = ImageDraw.Draw(img, 'RGBA')
draw.fontmode = "0" # set to "1" to disable anti-aliasing (not documented in PIL module)
- font = ImageFont.truetype('../data/font/Carlito-Bold.ttf', 12)
+ font = ImageFont.truetype('../font/Carlito-Bold.ttf', 12)
draw.text((6, 6), label, ( 0, 0, 0, 255),font=font)
draw.text((5, 5), label, (255, 255, 255, 255),font=font)
@@ -75,12 +82,43 @@ def do_label(fname):
img.paste(img2, img2)
img.save(fname)
+ processed += 1
+
+
+## Checks file path & converts to absolute.
+#
+# @param imagepath
+# Path to image file.
+def checkAbsPath(imagepath):
+ if not imagepath.lower().endswith('.png'):
+ # only PNG images supported
+ imagepath += '.png'
+ imagepath = os.path.normpath(imagepath)
+
+ # check from root directory
+ if os.path.isfile(imagepath):
+ return os.path.abspath(imagepath)
+
+ # check from directory where script was executed
+ os.chdir(dir_start)
+ if os.path.isfile(imagepath):
+ imagepath = os.path.abspath(imagepath)
+ else:
+ # assume file is nested in `subdir_world`
+ imagepath = os.path.join(dir_world, imagepath)
+ # change back to root dir remaining execution
+ os.chdir(dir_root)
+
+ return imagepath
+
if len(sys.argv) < 2:
print('\nERROR: Not enough arguments\n')
showUsage()
sys.exit(1)
-elif len(sys.argv) == 2 and sys.argv[1] == '-world':
+
+
+if len(sys.argv) == 2 and sys.argv[1] == '-world':
for fname in os.listdir(dir_world):
if fname.endswith('.png'):
absolute_fname = os.path.join(dir_world, fname)
@@ -89,14 +127,8 @@ elif len(sys.argv) == 2 and sys.argv[1] == '-world':
continue
do_label(absolute_fname)
else:
- # This doesn't work for me. --mort
- #for fname in reduce(operator.add, map(glob.glob, sys.argv[1:])):
-
- # This works for me. --omero
for fname in list(sys.argv[1:]):
- if not fname.endswith('.png'):
- fname = '{}.png'.format(fname)
- absolute_fname = os.path.join(dir_world, fname)
+ absolute_fname = checkAbsPath(fname)
if fname.rstrip('.png') in protected:
print('NOTE: skipping protected file: {}'.format(absolute_fname))
continue
@@ -104,7 +136,10 @@ else:
if not os.path.isfile(absolute_fname):
print('\nERROR: Cannot process {}\n File does not exist.'.format(absolute_fname))
sys.exit(1)
- print ( 'Labeling {}...'.format(fname ))
+ print('Labeling {}...'.format(fname ))
do_label(absolute_fname)
-print ('All Done.')
+if processed == 0:
+ print('\nWARNING: no images were processed')
+else:
+ print('\nprocessed {} {}'.format(processed, 'image' if processed == 1 else 'images'))
diff --git a/bin/wordlist.bat b/bin/wordlist.bat
new file mode 100644
index 0000000000..861187f7d8
--- /dev/null
+++ b/bin/wordlist.bat
@@ -0,0 +1,5 @@
+@echo off
+call ant compile_stendhaltools server_build
+
+set LOCALCLASSPATH=libs\*;build\build_stendhaltools;build\build_server
+javaw -cp "%LOCALCLASSPATH%" games.stendhal.tools.npcparser.WordListUpdate
diff --git a/bin/wordlist.sh b/bin/wordlist.sh
new file mode 100755
index 0000000000..ea4a47a1cd
--- /dev/null
+++ b/bin/wordlist.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+ant compile_stendhaltools server_build
+
+LOCALCLASSPATH=:./libs/*:./build/build_stendhaltools:./build/build_server
+java -cp "${LOCALCLASSPATH}" games.stendhal.tools.npcparser.WordListUpdate
diff --git a/build-archive/.cvsignore b/build-archive/.cvsignore
deleted file mode 100644
index 33c8fad814..0000000000
--- a/build-archive/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.jar
-*.zip
-AUTHORS
-BUGS
-COPYING
-LICENSE
-README
diff --git a/build.ant.properties b/build.ant.properties
index 900a15fb2a..fb5e66018b 100644
--- a/build.ant.properties
+++ b/build.ant.properties
@@ -1,5 +1,6 @@
+
# this is the directory of the *.jar files
-libdir = libs
+libdir = libs
#
# Dear friend,
@@ -7,65 +8,73 @@ libdir = libs
#
# Do no despair, it can be done.
#
-# Just use google, common sense and patiente. Remember that we offered you
+# Just use Google, common sense, and patience. Remember that we offer you
# an already compiled version :)
#
# Download and copy the .jar files to stendhal/libs folder.
-# Marauroa. Arianne framework.
+# Marauroa (Arianne framework)
marauroa_jar = ${libdir}/marauroa.jar
# Apache commons
-guava_jar = ${libdir}/guava.jar
+guava_jar = ${libdir}/guava.jar
# Apache log4j
-log4j_jar = ${libdir}/log4j.jar
+log4j_jar = ${libdir}/log4j.jar
-#hamcrest Matchers
-hamcrest_jar =${libdir}/java-hamcrest-2.0.0.0.jar
+# Hamcrest matchers
+hamcrest_jar = ${libdir}/java-hamcrest-2.0.0.0.jar
-# Junit 4.
-junit_jar = ${libdir}/junit-4.12.jar
+# Junit 4.x
+junit_jar = ${libdir}/junit-4.12.jar
-# Groovy. You perhaps can save this one.
-# It was used on the past but we agreed to remove support for groovy.
+# Groovy
+# You perhaps can save this one. It was used on the past but we agreed to remove support for groovy.
groovy_jarname = groovy-3.0.9.jar
-groovy_jar = ${libdir}/${groovy_jarname}
+groovy_jar = ${libdir}/${groovy_jarname}
-# Simple HTTP.
-simple_jar = ${libdir}/simple.jar
+# Simple HTTP
+simple_jar = ${libdir}/simple.jar
-# SKIP. You can find this one inside Netbeans.
-# It is just used to build tools like creature editor.
+# SKIP
+# You can find this one inside Netbeans. It is just used to build tools like creature editor.
swinglayout_jar = ${libdir}/swing-layout.jar
-# MySQL Connector for Java.
+# MySQL Connector for Java
mysqldriver_jarname = mysql-connector-java-8.0.13.jar
-mysqldriver_jar = ${libdir}/${mysqldriver_jarname}
+mysqldriver_jar = ${libdir}/${mysqldriver_jarname}
-#tiled
-tiled_jar= ${libdir}/libtiled.jar
+# Tiled
+tiled_jar = ${libdir}/libtiled.jar
-#JOrbis ogg vorbis decoder
-jorbis_jar=${libdir}/jorbis.jar
+# JOrbis ogg vorbis decoder
+jorbis_jar = ${libdir}/jorbis.jar
# h2
-h2_jar = ${libdir}/h2.jar
+h2_jar = ${libdir}/h2.jar
# Luaj
luaj_jarname = luaj-jse-3.0.1.jar
-luaj_jar = ${libdir}/${luaj_jarname}
+luaj_jar = ${libdir}/${luaj_jarname}
# json-simple
jsonsimple_jarname = json-simple-1.1.1.jar
-jsonsimple_jar = ${libdir}/${jsonsimple_jarname}
+jsonsimple_jar = ${libdir}/${jsonsimple_jarname}
+
+# Apache Tomcat
+tomcatcore_jar = ${libdir}/tomcat-embed-core-10.1.13.jar
+tomcatwebsocket_jar = ${libdir}/tomcat-embed-websocket-10.1.13.jar
+
+# Jakarta Annotations API
+jakartaannotation_jar = ${libdir}/jakarta.annotation-api-2.1.1.jar
# You can ignore the rest unless you plan to run test on Stendhal.
-easymock_jar = ${libdir}/easymock.jar
+easymock_jar = ${libdir}/easymock.jar
easymockclassextension_jar = ${libdir}/easymockclassextension.jar
-cglib_jar = ${libdir}/cglib-nodep-2.2_beta1.jar
-cobertura_jar = ${libdir}/cobertura/cobertura.jar
+cglib_jar = ${libdir}/cglib-nodep-2.2_beta1.jar
+cobertura_jar = ${libdir}/cobertura/cobertura.jar
+
#
# OK.
# You are done. Congrats.
@@ -74,37 +83,39 @@ cobertura_jar = ${libdir}/cobertura/cobertura.jar
# updates of stendhal instead of one big single file.
#
-#Updates locations
-game_name = Stendhal
-default_server = stendhalgame.org
-updates_server = https://arianne-project.org/stendhal/updates
+# updates locations
+game_name = Stendhal
+default_server = stendhalgame.org
+updates_server = https://arianne-project.org/stendhal/updates
updates_server_fallback = http://arianne.sourceforge.net/stendhal/updates
-version_server = http://arianne.sourceforge.net/stendhal.version
+version_server = http://arianne.sourceforge.net/stendhal.version
# current version of stendhal
-version.old = 1.43
-version = 1.43.5
+version.old = 1.49
+version = 1.49.5
+# FIXME: dynamic method to set this property?
+version.android = 1049005
# javac options
-javac.deprecation = true
-javac.debug = true
-javac.debuglevel = source,lines
+javac.deprecation = true
+javac.debug = true
+javac.debuglevel = source,lines
# change these only if you know what you are doing
-buildroot = build
+build = build
+buildroot = ${build}
build-archive = build-archive
-src = src
-testsrc = tests
-srcjs = srcjs
-docu = data/docu
-maps = data/maps
-data = data/gui
-sprites = data/sprites
-layers = data/layers
-tiled = tiled
-build = build
-lib = ${buildroot}/lib
-docs = ${buildroot}/javadocs
+src = src
+testsrc = tests
+srcjs = ${src}/js
+docs = doc
+data = data
+gui = ${data}/gui
+maps = ${data}/maps
+sprites = ${data}/sprites
+lib = ${buildroot}/lib
marauroa_root = ../marauroa
marauroa_src = ${marauroa_root}/src
marauroa_libs = ${marauroa_root}/libs
+buildtools = buildtools
+ant_modules = ${buildtools}/ant_modules
diff --git a/build.xml b/build.xml
index 838b569fe7..f438a3c6ea 100644
--- a/build.xml
+++ b/build.xml
@@ -1,1722 +1,42 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Built client and server for NetBeans.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- package games.stendhal.client;
- public class StendhalBuild {
- private static final String BUILD_NUMBER = "${timestamp}";
- public static String getBuildNumber() {return BUILD_NUMBER;}
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var stendhal = window.stendhal = window.stendhal || {};
- stendhal.data = stendhal.data || {};
-
- stendhal.data.build = {
- version: "${version}",
- build: "${timestamp}",
- dist: "webclient"
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-//# sourceMappingURL=stendhal-compiled.js.map
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Creating update from ${version.old} to ${version}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-database_implementation=games.stendhal.server.core.engine.StendhalPlayerDatabase
-factory_implementation=games.stendhal.server.core.engine.StendhalRPObjectFactory
-database_adapter=marauroa.server.db.adapter.H2DatabaseAdapter
-jdbc_url=jdbc:h2:~/stendhal/database/h2db;AUTO_RECONNECT=TRUE;DB_CLOSE_ON_EXIT=FALSE
-jdbc_class=org.h2.Driver
-tcp_port=32160
-world=games.stendhal.server.core.engine.StendhalRPWorld
-ruleprocessor=games.stendhal.server.core.engine.StendhalRPRuleProcessor
-turn_length=300
-server_typeGame=stendhal
-server_name=stendhal Marauroa server
-server_version=1.17.5
-server_contact=https://sourceforge.net/tracker/?atid=514826&group_id=66537&func=browse
-n = 966117159215070350422008719727400433209081371975507132437556194069529307432746058120899703845731090424709994853484674454738958575201865208533043689325553646377
-e = 15
-d = 901709348600732327060541471745573737661809280510473323608385781131560686937229596225645929798090122419343070307904183075525081589946196209839163758401803422679
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+Project:
+ Name: .......... ${game_name}
+ Version: ....... ${version}
+ Root: .......... ${basedir}
+
+Build system:
+ Ant version: ... ${ant.version.number}
+ Ant home: ...... ${ant.location}
+ Java version: .. ${java.version}
+ Java home: ..... ${java.home}
+
+Execute `ant help` for more information.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/apps.xml b/buildtools/ant_modules/apps.xml
new file mode 100644
index 0000000000..632566cf60
--- /dev/null
+++ b/buildtools/ant_modules/apps.xml
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${steam-appid}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/clean.xml b/buildtools/ant_modules/clean.xml
new file mode 100644
index 0000000000..eb73fe81aa
--- /dev/null
+++ b/buildtools/ant_modules/clean.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/dist.xml b/buildtools/ant_modules/dist.xml
new file mode 100644
index 0000000000..69e17d1822
--- /dev/null
+++ b/buildtools/ant_modules/dist.xml
@@ -0,0 +1,858 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Built client and server for NetBeans.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ package games.stendhal.client;
+ public class StendhalBuild {
+ private static final String BUILD_NUMBER = "${datetime}";
+ public static String getBuildNumber() {return BUILD_NUMBER;}
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+export function version(marauroa, stendhal) {
+ stendhal.data = stendhal.data || {};
+
+ stendhal.data.build = {
+ version: "${version}",
+ build: "${datetime}",
+ dist: "webclient"
+ }
+
+ //CI
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/docs.xml b/buildtools/ant_modules/docs.xml
new file mode 100644
index 0000000000..4e6cd05dfb
--- /dev/null
+++ b/buildtools/ant_modules/docs.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/info.xml b/buildtools/ant_modules/info.xml
new file mode 100644
index 0000000000..68c7ef2400
--- /dev/null
+++ b/buildtools/ant_modules/info.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/locale.xml b/buildtools/ant_modules/locale.xml
new file mode 100644
index 0000000000..66f25bb768
--- /dev/null
+++ b/buildtools/ant_modules/locale.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/main.xml b/buildtools/ant_modules/main.xml
new file mode 100644
index 0000000000..9891b0664c
--- /dev/null
+++ b/buildtools/ant_modules/main.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/maps.xml b/buildtools/ant_modules/maps.xml
new file mode 100644
index 0000000000..1f12acb6fa
--- /dev/null
+++ b/buildtools/ant_modules/maps.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/package.xml b/buildtools/ant_modules/package.xml
new file mode 100644
index 0000000000..1d260be037
--- /dev/null
+++ b/buildtools/ant_modules/package.xml
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/properties.xml b/buildtools/ant_modules/properties.xml
new file mode 100644
index 0000000000..76fdfc3ae4
--- /dev/null
+++ b/buildtools/ant_modules/properties.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/system.xml b/buildtools/ant_modules/system.xml
new file mode 100644
index 0000000000..dfef2434cd
--- /dev/null
+++ b/buildtools/ant_modules/system.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/testing.xml b/buildtools/ant_modules/testing.xml
new file mode 100644
index 0000000000..a0bfbea6cd
--- /dev/null
+++ b/buildtools/ant_modules/testing.xml
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+database_implementation=games.stendhal.server.core.engine.StendhalPlayerDatabase
+factory_implementation=games.stendhal.server.core.engine.StendhalRPObjectFactory
+database_adapter=marauroa.server.db.adapter.H2DatabaseAdapter
+jdbc_url=jdbc:h2:~/stendhal/database/h2db;AUTO_RECONNECT=TRUE
+jdbc_class=org.h2.Driver
+tcp_port=32160
+world=games.stendhal.server.core.engine.StendhalRPWorld
+ruleprocessor=games.stendhal.server.core.engine.StendhalRPRuleProcessor
+turn_length=300
+server_typeGame=stendhal
+server_name=stendhal Marauroa server
+server_version=1.17.5
+server_contact=https://sourceforge.net/tracker/?atid=514826&group_id=66537&func=browse
+n = 966117159215070350422008719727400433209081371975507132437556194069529307432746058120899703845731090424709994853484674454738958575201865208533043689325553646377
+e = 15
+d = 901709348600732327060541471745573737661809280510473323608385781131560686937229596225645929798090122419343070307904183075525081589946196209839163758401803422679
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/ant_modules/tools.xml b/buildtools/ant_modules/tools.xml
new file mode 100644
index 0000000000..67bf2c0136
--- /dev/null
+++ b/buildtools/ant_modules/tools.xml
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Creating update from ${version.old} to ${version}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildtools/doxygen/Doxyfile b/buildtools/doxygen/Doxyfile
deleted file mode 100644
index 0f95436ef4..0000000000
--- a/buildtools/doxygen/Doxyfile
+++ /dev/null
@@ -1,2666 +0,0 @@
-# Doxyfile 1.9.3
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the configuration
-# file that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME = Stendhal
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER = 1.43.5
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF = "A fun, friendly, & free multiplayer online adventure game."
-
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
-
-PROJECT_LOGO = ./data/gui/StendhalIcon.png
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = ./build/doxygen
-
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS = YES
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
-# such as
-# /***************
-# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
-# Javadoc-style will behave just like regular comments and it will not be
-# interpreted by doxygen.
-# The default value is: NO.
-
-JAVADOC_BANNER = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# By default Python docstrings are displayed as preformatted text and doxygen's
-# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
-# doxygen's special commands can be used and the contents of the docstring
-# documentation blocks is shown as doxygen documentation.
-# The default value is: YES.
-
-PYTHON_DOCSTRING = YES
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:^^"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". Note that you cannot put \n's in the value part of an alias
-# to insert newlines (in the resulting output). You can put ^^ in the value part
-# of an alias to insert a newline as if a physical newline was in the original
-# file. When you need a literal { or } or , in the value part of an alias you
-# have to escape them by means of a backslash (\), this can lead to conflicts
-# with the commands \{ and \} for these it is advised to use the version @{ and
-# @} or use a double escape (\\{ and \\})
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA = YES
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
-# sources only. Doxygen will then generate output that is more tailored for that
-# language. For instance, namespaces will be presented as modules, types will be
-# separated into more groups, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_SLICE = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
-# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
-# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
-# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
-# tries to guess whether the code is fixed or free formatted code, this is the
-# default for Fortran type files). For instance to make doxygen treat .inc files
-# as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen. When specifying no_extension you should add
-# * to the FILE_PATTERNS.
-#
-# Note see also the list of default file extension mappings.
-
-EXTENSION_MAPPING =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See https://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT = YES
-
-# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
-# to that level are automatically included in the table of contents, even if
-# they do not have an id attribute.
-# Note: This feature currently applies only to Markdown headings.
-# Minimum value: 0, maximum value: 99, default value: 5.
-# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
-
-TOC_INCLUDE_HEADINGS = 5
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# If one adds a struct or class to a group and this option is enabled, then also
-# any nested class or struct is added to the same group. By default this option
-# is disabled and one has to add nested compounds explicitly via \ingroup.
-# The default value is: NO.
-
-GROUP_NESTED_COMPOUNDS = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE = 0
-
-# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
-# during processing. When set to 0 doxygen will based this on the number of
-# cores available in the system. You can set it explicitly to a value larger
-# than 0 to get more control over the balance between CPU load and processing
-# speed. At this moment only the input processing can be done using multiple
-# threads. Since this is still an experimental feature the default is set to 1,
-# which effectively disables parallel processing. Please report any issues you
-# encounter. Generating dot graphs in parallel is controlled by the
-# DOT_NUM_THREADS setting.
-# Minimum value: 0, maximum value: 32, default value: 1.
-
-NUM_PROC_THREADS = 1
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE = YES
-
-# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
-# methods of a class will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIV_VIRTUAL = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE = YES
-
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. If set to YES, local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If this flag is set to YES, the name of an unnamed parameter in a declaration
-# will be determined by the corresponding definition. By default unnamed
-# parameters remain unnamed in the output.
-# The default value is: YES.
-
-RESOLVE_UNNAMED_PARAMS = YES
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# declarations. If set to NO, these declarations will be included in the
-# documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS = NO
-
-# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
-# able to match the capabilities of the underlying filesystem. In case the
-# filesystem is case sensitive (i.e. it supports files in the same directory
-# whose names only differ in casing), the option must be set to YES to properly
-# deal with such files in case they appear in the input. For filesystems that
-# are not case sensitive the option should be be set to NO to properly deal with
-# output files written for symbols that only differ in casing, such as for two
-# classes, one named CLASS and the other named Class, and to also support
-# references to files without having to specify the exact matching casing. On
-# Windows (including Cygwin) and MacOS, users should typically set this option
-# to NO, whereas on Linux or other Unix flavors it should typically be set to
-# YES.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
-# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
-# will show which file needs to be included to use the class.
-# The default value is: YES.
-
-SHOW_HEADERFILE = YES
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if ... \endif and \cond
-# ... \endcond blocks.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
-# list will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file. See also section "Changing the
-# layout of pages" for information.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE = ./buildtools/doxygen/layout.xml
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED = NO
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as documenting some parameters in
-# a documented function twice, or documenting parameters that don't exist or
-# using markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR = NO
-
-# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
-# function parameter documentation. If set to NO, doxygen will accept that some
-# parameters have no documentation without warning.
-# The default value is: YES.
-
-WARN_IF_INCOMPLETE_DOC = NO
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong parameter
-# documentation, but not about the absence of documentation. If EXTRACT_ALL is
-# set to YES then this flag will automatically be disabled. See also
-# WARN_IF_INCOMPLETE_DOC
-# The default value is: NO.
-
-WARN_NO_PARAMDOC = NO
-
-# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
-# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
-# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
-# at the end of the doxygen process doxygen will return with a non-zero status.
-# Possible values are: NO, YES and FAIL_ON_WARNINGS.
-# The default value is: NO.
-
-WARN_AS_ERROR = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr). In case the file specified cannot be opened for writing the
-# warning and error messages are written to standard error. When as file - is
-# specified the warning and error messages are written to standard output
-# (stdout).
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
-# Note: If this tag is empty the current directory is searched.
-
-INPUT = ./README.md \
- ./src/ \
- ./android/app/src/ \
- ../marauroa/src/ \
- ./doc/scripting/
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see:
-# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# read by doxygen.
-#
-# Note the list of default checked file patterns might differ from the list of
-# default file extension mappings.
-#
-# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
-# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
-# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
-# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
-# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
-# *.vhdl, *.ucf, *.qsf and *.ice.
-
-FILE_PATTERNS = *.java \
- *.md
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# ANamespace::AClass, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-#
-#
-# where is the value of the INPUT_FILTER tag, and is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE = ./README.md
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# entity all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see https://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS = YES
-
-# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
-# clang parser (see:
-# http://clang.llvm.org/) for more accurate parsing at the cost of reduced
-# performance. This can be particularly helpful with template rich C++ code for
-# which doxygen's built-in parser lacks the necessary type information.
-# Note: The availability of this option depends on whether or not doxygen was
-# generated with the -Duse_libclang=ON option for CMake.
-# The default value is: NO.
-
-CLANG_ASSISTED_PARSING = NO
-
-# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS
-# tag is set to YES then doxygen will add the directory of each input to the
-# include path.
-# The default value is: YES.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-CLANG_ADD_INC_PATHS = YES
-
-# If clang assisted parsing is enabled you can provide the compiler with command
-# line options that you would normally use when invoking the compiler. Note that
-# the include paths will already be set by doxygen for the files and directories
-# specified with INPUT and INCLUDE_PATH.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-CLANG_OPTIONS =
-
-# If clang assisted parsing is enabled you can provide the clang parser with the
-# path to the directory containing a file called compile_commands.json. This
-# file is the compilation database (see:
-# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
-# options used when the source files were built. This is equivalent to
-# specifying the -p option to a clang tool, such as clang-check. These options
-# will then be passed to the parser. Any options specified with CLANG_OPTIONS
-# will be added as well.
-# Note: The availability of this option depends on whether or not doxygen was
-# generated with the -Duse_libclang=ON option for CMake.
-
-CLANG_DATABASE_PATH =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX = YES
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER = ./buildtools/doxygen/header.xml
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER = ./buildtools/doxygen/footer.xml
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET = ./buildtools/doxygen/styles.css
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES = ./LICENSE.txt \
- ./buildtools/doxygen/favicon.ico
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a color-wheel, see
-# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use gray-scales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = NO
-
-# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
-# documentation will contain a main index with vertical navigation menus that
-# are dynamically created via JavaScript. If disabled, the navigation index will
-# consists of multiple levels of tabs that are statically embedded in every HTML
-# page. Disable this option to support browsers that do not have JavaScript,
-# like the Qt help browser.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_MENUS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see:
-# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
-# create a documentation set, doxygen will generate a Makefile in the HTML
-# output directory. Running make will produce the docset in that directory and
-# running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
-# genXcode/_index.html for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# This tag determines the URL of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDURL =
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# on Windows. In the beginning of 2021 Microsoft took the original page, with
-# a.o. the download links, offline the HTML help workshop was already many years
-# in maintenance mode). You can download the HTML help workshop from the web
-# archives at Installation executable (see:
-# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
-# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the main .chm file (NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS =
-
-# The QHG_LOCATION tag can be used to specify the location (absolute path
-# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
-# run qhelpgenerator on the generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine tune the look of the index (see "Fine-tuning the output"). As an
-# example, the default style sheet generated by doxygen has an example that
-# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
-# Since the tree basically has the same information as the tab index, you could
-# consider setting DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW = NO
-
-# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
-# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
-# area (value NO) or if it should extend to the full height of the window (value
-# YES). Setting this to YES gives a layout similar to
-# https://docs.readthedocs.io with more room for contents, but less room for the
-# project logo, title, and description. If either GENERATE_TREEVIEW or
-# DISABLE_INDEX is set to NO, this option has no effect.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FULL_SIDEBAR = NO
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH = 250
-
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email
-# addresses.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-OBFUSCATE_EMAILS = YES
-
-# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
-# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
-# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
-# the HTML output. These images will generally look nicer at scaled resolutions.
-# Possible values are: png (the default) and svg (looks nicer but requires the
-# pdf2svg or inkscape tool).
-# The default value is: png.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FORMULA_FORMAT = png
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
-# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
-# to create new LaTeX commands to be used in formulas as building blocks. See
-# the section "Including formulas" for details.
-
-FORMULA_MACROFILE =
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# https://www.mathjax.org) which uses client side JavaScript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX = NO
-
-# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
-# Note that the different versions of MathJax have different requirements with
-# regards to the different settings, so it is possible that also other MathJax
-# settings have to be changed when switching between the different MathJax
-# versions.
-# Possible values are: MathJax_2 and MathJax_3.
-# The default value is: MathJax_2.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_VERSION = MathJax_2
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. For more details about the output format see MathJax
-# version 2 (see:
-# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
-# (see:
-# http://docs.mathjax.org/en/latest/web/components/output.html).
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility. This is the name for Mathjax version 2, for MathJax version 3
-# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
-# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
-# is the name for Mathjax version 3, for MathJax version 2 this will be
-# translated into HTML-CSS) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from https://www.mathjax.org before deployment. The default value is:
-# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
-# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH =
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# for MathJax version 2 (see
-# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# For example for MathJax version 3 (see
-# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
-# MATHJAX_EXTENSIONS = ams
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see:
-# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use + S
-# (what the is depends on the OS and browser, but it is typically
-# , /