├── .gitignore ├── README.md ├── client ├── android │ ├── AndroidManifest.xml │ ├── assets │ │ └── badlogic.jpg │ ├── build.gradle.kts │ ├── ic_launcher-web.png │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── mrlem │ │ └── sample │ │ └── android │ │ └── AndroidLauncher.kt ├── build.gradle.kts ├── buildSrc │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ ├── App.kt │ │ └── Versions.kt ├── core │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── mrlem │ │ └── sample │ │ ├── SampleActor.kt │ │ ├── SampleGame.kt │ │ └── SampleScreen.kt ├── desktop │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── org │ │ └── mrlem │ │ └── sample │ │ └── desktop │ │ └── DesktopLauncher.kt ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle.kts └── engine ├── build.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── protocol ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── Protocol.kt ├── server ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── Server.kt └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | ## Java 2 | 3 | *.class 4 | *.war 5 | *.ear 6 | hs_err_pid* 7 | 8 | ## GWT 9 | war/ 10 | html/war/gwt_bree/ 11 | html/gwt-unitCache/ 12 | .apt_generated/ 13 | html/war/WEB-INF/deploy/ 14 | html/war/WEB-INF/classes/ 15 | .gwt/ 16 | gwt-unitCache/ 17 | www-test/ 18 | .gwt-tmp/ 19 | 20 | ## Android Studio and Intellij and Android in general 21 | android/libs/armeabi/ 22 | android/libs/armeabi-v7a/ 23 | android/libs/x86/ 24 | android/gen/ 25 | .idea/ 26 | *.ipr 27 | *.iws 28 | *.iml 29 | out/ 30 | com_crashlytics_export_strings.xml 31 | 32 | ## Eclipse 33 | .classpath 34 | .project 35 | .metadata 36 | **/bin/ 37 | tmp/ 38 | *.tmp 39 | *.bak 40 | *.swp 41 | *~.nib 42 | local.properties 43 | .settings/ 44 | .loadpath 45 | .externalToolBuilders/ 46 | *.launch 47 | 48 | ## NetBeans 49 | **/nbproject/private/ 50 | build/ 51 | nbbuild/ 52 | dist/ 53 | nbdist/ 54 | nbactions.xml 55 | nb-configuration.xml 56 | 57 | ## Gradle 58 | 59 | .gradle 60 | gradle-app.setting 61 | build/ 62 | 63 | ## OS Specific 64 | .DS_Store 65 | build 66 | client/android/libs/ 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kotlin Sample Game Template 2 | Sample game project using: 3 | * kotlin 4 | * gradle 5 | * libgdx for client 6 | * spring-boot for server 7 | * and a common protocol project 8 | 9 | ## Purpose 10 | I like to develop small game prototypes, more specifically networked games. As a language, I like Java, and lately I like [Kotlin](https://kotlinlang.org) even more. 11 | * game client: [LibGDX](https://libgdx.badlogicgames.com) is a fantastic framework 12 | * game server: for rapid prototyping, I really like [SpringBoot](https://projects.spring.io/spring-boot) 13 | 14 | Combining these the way I like takes time and can turn into a gradle nightmare, especially: 15 | * if you want to work separately on client & server projects 16 | * want those projects to share some common code, like say classes for a network protocol 17 | 18 | Hope this saves you time to get started: because when an idea comes into your mind, you just don't want to waste your precious time, energy and enthousiasm for these infrastructure stuff. You just just to code the damn thing :) 19 | 20 | ## What I provide 21 | 22 | I provide a set of empty projects combining all these containing the bare minimum to get started, for a game named **sample** (change this name to suite your needs). You'll find: 23 | * **sample**: the game client project (using LibGDX), wth a simple scene2d stage 24 | * **sample-engine**: including a **server** module (using SpringBoot) and a **protocol** module (shared with the client) 25 | 26 | Tested all this with IDEA IntelliJ and from the command line. 27 | 28 | ## How do I run things? 29 | 30 | The desktop client: 31 | ```shell 32 | cd client/desktop 33 | ../gradlew run 34 | ``` 35 | 36 | The server: 37 | ```shell 38 | cd engine/server 39 | ../gradlew bootRun 40 | ``` 41 | 42 | ## What I don't provide 43 | 44 | I don't provide any kind of classes / architecture to guide the way you code the game, this is not my point. Use LibGDX & SpringBoot docs for this! I also chose those libraries because of their excellent documentations. 45 | 46 | ## Credits 47 | 48 | A huge thanks for those who provide those marvellous tools to the community: 49 | * https://kotlinlang.org 50 | * https://gradle.org/ 51 | * https://projects.spring.io/spring-boot/ 52 | * https://libgdx.badlogicgames.com 53 | * https://libktx.github.io/ 54 | -------------------------------------------------------------------------------- /client/android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /client/android/assets/badlogic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/android/assets/badlogic.jpg -------------------------------------------------------------------------------- /client/android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | id("kotlin-android") 4 | } 5 | 6 | android { 7 | sourceSets { 8 | getByName("main") { 9 | manifest.srcFile("AndroidManifest.xml") 10 | aidl.srcDirs("src") 11 | renderscript.srcDirs("src") 12 | res.srcDirs("res") 13 | assets.srcDirs("assets") 14 | jniLibs.srcDirs("libs") 15 | } 16 | } 17 | packagingOptions { 18 | resources.excludes += "META-INF/robovm/ios/robovm.xml" 19 | } 20 | defaultConfig { 21 | applicationId = App.id 22 | buildToolsVersion = "31.0.0" 23 | compileSdk = Versions.Sdk.compile 24 | minSdk = Versions.Sdk.min 25 | targetSdk = Versions.Sdk.target 26 | versionCode = 1 27 | versionName = "1.0" 28 | } 29 | buildTypes { 30 | release { 31 | isMinifyEnabled = true 32 | proguardFiles( 33 | getDefaultProguardFile("proguard-android.txt"), 34 | "proguard-rules.pro", 35 | ) 36 | } 37 | } 38 | } 39 | 40 | val natives: Configuration by configurations.creating 41 | 42 | // Called every time gradle gets executed, takes the native dependencies of 43 | // the natives configuration, and extracts them to the proper libs/ folders 44 | // so they get packed with the APK. 45 | tasks.register("copyAndroidNatives") { 46 | doFirst { 47 | natives.files.forEach { jar -> 48 | val outputDir = file("libs/" + jar.nameWithoutExtension.substringAfterLast("natives-")) 49 | outputDir.mkdirs() 50 | copy { 51 | from(zipTree(jar)) 52 | into(outputDir) 53 | include("*.so") 54 | } 55 | } 56 | } 57 | } 58 | 59 | tasks.whenTaskAdded { 60 | if ("package" in name) { 61 | dependsOn("copyAndroidNatives") 62 | } 63 | } 64 | 65 | dependencies { 66 | implementation(project(":core")) 67 | api("com.badlogicgames.gdx:gdx-backend-android:${Versions.Gdx.gdx}") 68 | natives("com.badlogicgames.gdx:gdx-platform:${Versions.Gdx.gdx}:natives-armeabi-v7a") 69 | natives("com.badlogicgames.gdx:gdx-platform:${Versions.Gdx.gdx}:natives-arm64-v8a") 70 | natives("com.badlogicgames.gdx:gdx-platform:${Versions.Gdx.gdx}:natives-x86") 71 | natives("com.badlogicgames.gdx:gdx-platform:${Versions.Gdx.gdx}:natives-x86_64") 72 | } -------------------------------------------------------------------------------- /client/android/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/android/ic_launcher-web.png -------------------------------------------------------------------------------- /client/android/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | 22 | -verbose 23 | 24 | -dontwarn android.support.** 25 | -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication 26 | -dontwarn com.badlogic.gdx.utils.GdxBuild 27 | -dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild 28 | -dontwarn com.badlogic.gdx.jnigen.BuildTarget* 29 | 30 | -keep class com.badlogic.gdx.controllers.android.AndroidControllers 31 | 32 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* { 33 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration); 34 | } 35 | 36 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World { 37 | boolean contactFilter(long, long); 38 | void beginContact(long); 39 | void endContact(long); 40 | void preSolve(long, long); 41 | void postSolve(long, long); 42 | boolean reportFixture(long); 43 | float reportRayFixture(long, float, float, float, float, float); 44 | } 45 | -------------------------------------------------------------------------------- /client/android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | -------------------------------------------------------------------------------- /client/android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/android/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/android/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sample 5 | 6 | 7 | -------------------------------------------------------------------------------- /client/android/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /client/android/src/main/kotlin/org/mrlem/sample/android/AndroidLauncher.kt: -------------------------------------------------------------------------------- 1 | package org.mrlem.sample.android 2 | 3 | import android.os.Bundle 4 | import com.badlogic.gdx.backends.android.AndroidApplication 5 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration 6 | import org.mrlem.sample.SampleGame 7 | 8 | class AndroidLauncher : AndroidApplication() { 9 | 10 | override fun onCreate(savedInstanceState: Bundle?) { 11 | super.onCreate(savedInstanceState) 12 | val config = AndroidApplicationConfiguration() 13 | initialize(SampleGame(), config) 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /client/build.gradle.kts: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenLocal() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") 7 | google() 8 | } 9 | dependencies { 10 | classpath("com.android.tools.build:gradle:7.2.2") 11 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}") 12 | } 13 | } 14 | 15 | allprojects { 16 | version = "1.0" 17 | 18 | repositories { 19 | mavenLocal() 20 | mavenCentral() 21 | google() 22 | gradlePluginPortal() 23 | maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") 24 | maven(url = "https://oss.sonatype.org/content/repositories/releases/") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /client/buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | implementation("com.android.tools.build:gradle:7.2.2") 12 | implementation(kotlin("gradle-plugin","1.7.10")) 13 | } 14 | -------------------------------------------------------------------------------- /client/buildSrc/src/main/kotlin/App.kt: -------------------------------------------------------------------------------- 1 | object App { 2 | 3 | const val name = "Sample" 4 | const val id = "org.mrlem.sample" 5 | 6 | } -------------------------------------------------------------------------------- /client/buildSrc/src/main/kotlin/Versions.kt: -------------------------------------------------------------------------------- 1 | object Versions { 2 | 3 | object Sdk { 4 | const val compile = 33 5 | const val min = 14 6 | const val target = 33 7 | } 8 | 9 | object Gdx { 10 | const val gdx = "1.11.0" 11 | const val controllers = "2.2.2" 12 | const val ktx = "1.11.0-rc2" 13 | } 14 | 15 | const val kotlin = "1.7.10" 16 | 17 | } -------------------------------------------------------------------------------- /client/core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("kotlin") 3 | } 4 | 5 | sourceSets { 6 | getByName("main") { 7 | resources.srcDirs("../android/assets") 8 | } 9 | } 10 | 11 | dependencies { 12 | implementation(project(":protocol")) 13 | implementation("com.badlogicgames.gdx:gdx:${Versions.Gdx.gdx}") 14 | api("io.github.libktx:ktx-app:${Versions.Gdx.ktx}") 15 | } -------------------------------------------------------------------------------- /client/core/src/main/kotlin/org/mrlem/sample/SampleActor.kt: -------------------------------------------------------------------------------- 1 | package org.mrlem.sample 2 | 3 | import com.badlogic.gdx.Gdx 4 | import com.badlogic.gdx.graphics.Texture 5 | import com.badlogic.gdx.graphics.g2d.Batch 6 | import com.badlogic.gdx.graphics.g2d.TextureRegion 7 | import com.badlogic.gdx.scenes.scene2d.Actor 8 | 9 | class SampleActor: Actor() { 10 | 11 | val region: TextureRegion 12 | 13 | init { 14 | region = TextureRegion(Texture(Gdx.files.internal("badlogic.jpg"))) 15 | width = region.regionWidth.toFloat() 16 | height = region.regionHeight.toFloat() 17 | } 18 | 19 | override fun draw(batch: Batch?, parentAlpha: Float) { 20 | batch?.setColor(color.r, color.g, color.b, color.a * parentAlpha) 21 | batch?.draw(region, x, y, originX, originY, width, height, scaleX, scaleY, rotation) 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /client/core/src/main/kotlin/org/mrlem/sample/SampleGame.kt: -------------------------------------------------------------------------------- 1 | package org.mrlem.sample 2 | 3 | import com.badlogic.gdx.Gdx 4 | import com.badlogic.gdx.Screen 5 | import ktx.app.KtxGame 6 | 7 | class SampleGame : KtxGame() { 8 | 9 | override fun create() { 10 | Gdx.app.log("app", "launching client...") 11 | 12 | addScreen(SampleScreen()) 13 | setScreen() 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /client/core/src/main/kotlin/org/mrlem/sample/SampleScreen.kt: -------------------------------------------------------------------------------- 1 | package org.mrlem.sample 2 | 3 | import com.badlogic.gdx.Gdx 4 | import com.badlogic.gdx.graphics.GL20 5 | import com.badlogic.gdx.scenes.scene2d.Stage 6 | import com.badlogic.gdx.utils.viewport.ScreenViewport 7 | import ktx.app.KtxScreen 8 | 9 | class SampleScreen : KtxScreen { 10 | 11 | val actor = SampleActor() 12 | val stage = Stage(ScreenViewport()) 13 | 14 | init { 15 | stage.addActor(actor) 16 | Gdx.input.inputProcessor = stage 17 | 18 | actor.setPosition(60f, 60f) 19 | } 20 | 21 | override fun resize(width: Int, height: Int) { 22 | stage.viewport.update(width, height, true) 23 | } 24 | 25 | override fun render(delta: Float) { 26 | Gdx.gl.glClearColor(0f, 0f, 0.2f, 1f) 27 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT) 28 | stage.act(delta) 29 | stage.draw() 30 | } 31 | 32 | override fun dispose() { 33 | stage.dispose() 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /client/desktop/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("kotlin") 3 | } 4 | 5 | val assetsDir = file("../android/assets") 6 | val mainClassName = "org.mrlem.sample.desktop.DesktopLauncher" 7 | 8 | // Use this task to run the game if IntelliJ run application configuration doesn't work. 9 | tasks.register("run") { 10 | main = mainClassName 11 | classpath = sourceSets.main.get().runtimeClasspath 12 | standardInput = System.`in` 13 | workingDir = assetsDir 14 | isIgnoreExitValue = true 15 | 16 | if ("mac" in System.getProperty("os.name").toLowerCase()) { 17 | jvmArgs("-XstartOnFirstThread") 18 | } 19 | } 20 | 21 | // Use this task to create a fat jar. 22 | tasks.register("dist") { 23 | from(files(sourceSets.main.get().output.classesDirs)) 24 | from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) 25 | from(assetsDir) 26 | 27 | manifest { 28 | attributes["Main-Class"] = mainClassName 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation(project(":core")) 34 | implementation("com.badlogicgames.gdx:gdx-backend-lwjgl:${Versions.Gdx.gdx}") 35 | implementation("com.badlogicgames.gdx:gdx-platform:${Versions.Gdx.gdx}:natives-desktop") 36 | } -------------------------------------------------------------------------------- /client/desktop/src/main/kotlin/org/mrlem/sample/desktop/DesktopLauncher.kt: -------------------------------------------------------------------------------- 1 | package org.mrlem.sample.desktop 2 | 3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration 4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication 5 | import org.mrlem.sample.SampleGame 6 | 7 | object DesktopLauncher { 8 | 9 | @JvmStatic 10 | fun main(arg: Array) { 11 | val config = LwjglApplicationConfiguration() 12 | LwjglApplication(SampleGame(), config) 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /client/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | org.gradle.jvmargs=-Xms128m -Xmx512m 3 | org.gradle.configureondemand=true 4 | -------------------------------------------------------------------------------- /client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed May 31 17:56:58 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /client/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /client/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /client/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "sample" 2 | 3 | include("desktop", "android", "core") 4 | include("protocol") 5 | project(":protocol").projectDir = File(settingsDir, "../engine/protocol") 6 | -------------------------------------------------------------------------------- /engine/build.gradle.kts: -------------------------------------------------------------------------------- 1 | group = "org.mrlem.sample" 2 | version = "1.0-SNAPSHOT" 3 | 4 | buildscript { 5 | val kotlinVersion = "1.7.10" 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenCentral() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /engine/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrlem/sample-game-libgdx-springboot/dc7ce094713721c42d453f81b92fc977c824aed1/engine/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /engine/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 26 15:32:27 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME -------------------------------------------------------------------------------- /engine/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 165 | if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then 166 | cd "$(dirname "$0")" 167 | fi 168 | 169 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 170 | -------------------------------------------------------------------------------- /engine/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /engine/protocol/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("kotlin") 3 | } -------------------------------------------------------------------------------- /engine/protocol/src/main/kotlin/Protocol.kt: -------------------------------------------------------------------------------- 1 | class Protocol { 2 | 3 | // TODO 4 | 5 | } -------------------------------------------------------------------------------- /engine/server/build.gradle.kts: -------------------------------------------------------------------------------- 1 | buildscript { 2 | val springBootVersion = "2.7.2" 3 | 4 | repositories { 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 10 | } 11 | } 12 | 13 | plugins { 14 | val springBootVersion = "2.7.2" 15 | 16 | id("kotlin") 17 | id("org.springframework.boot") version springBootVersion 18 | id("io.spring.dependency-management") version "1.0.13.RELEASE" 19 | } 20 | 21 | repositories { mavenCentral() } 22 | 23 | dependencies { 24 | implementation(project(":protocol")) 25 | implementation("org.springframework.boot:spring-boot-starter-web") 26 | } 27 | -------------------------------------------------------------------------------- /engine/server/src/main/kotlin/Server.kt: -------------------------------------------------------------------------------- 1 | import org.springframework.boot.SpringApplication 2 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 3 | import org.springframework.web.bind.annotation.RestController 4 | 5 | @RestController 6 | @EnableAutoConfiguration 7 | class Server { 8 | 9 | // TODO 10 | 11 | } 12 | 13 | fun main(args: Array) { 14 | println("launching server...") 15 | SpringApplication.run(Server::class.java, *args) 16 | } -------------------------------------------------------------------------------- /engine/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'sample-engine' 2 | 3 | include ":server", ":protocol" 4 | --------------------------------------------------------------------------------