![]() |
|
Kotlin MMO Game LibGDX Ktor beta - Wersja do druku +- decodesoft.pl (https://decodesoft.pl/forum) +-- Dział: GreenVale (https://decodesoft.pl/forum/forumdisplay.php?fid=27) +--- Dział: Download (https://decodesoft.pl/forum/forumdisplay.php?fid=30) +--- Wątek: Kotlin MMO Game LibGDX Ktor beta (/showthread.php?tid=75) |
Kotlin MMO Game LibGDX Ktor beta - platefobrain - 05-06-2025 Kotlin MMO Game (LibGDX + Ktor)
Gracze mogą się logować, tworzyć postacie, poruszać, rozmawiać i walczyć w czasie rzeczywistym za pomocą komunikacji WebSocket.
Funkcje
Stos technologiczny Client: Kotlin + LibGDX Server: Kotlin + Ktor WebSockets Networking: WebSocket build.gradle.kts (client) plugins { kotlin("jvm") version "2.1.10" kotlin("plugin.serialization") version "2.1.20" application // <<< dodajemy plugin application } group = "pl.decodesoft" version = "1.0-SNAPSHOT" repositories { mavenCentral() } val gdxVersion = "1.12.1" val ktorVersion = "2.3.4" dependencies { implementation("io.ktor:ktor-client-core:$ktorVersion") implementation("io.ktor:ktor-client-websockets:$ktorVersion") implementation("io.ktor:ktor-client-cio:$ktorVersion") implementation("ch.qos.logback:logback-classic:1.4.12") implementation("com.badlogicgames.gdx:gdx-freetype:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop") implementation("com.badlogicgames.gdx:gdx:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop") // Logowanie, Rejestracja implementation("at.favre.lib:bcrypt:0.9.0") implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion") implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion") // Zależności LibGDX implementation("com.badlogicgames.gdx:gdx:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop") } // Konfiguracja zadań do uruchamiania klienta i serwera tasks.register<JavaExec>("runClient") { group = "application" mainClass.set("pl.decodesoft.DesktopLauncher") classpath = sourceSets["main"].runtimeClasspath standardInput = System.`in` workingDir = file("assets") // Jeśli masz zasoby aplikacji, stworzy katalog assets jeśli nie istnieje doFirst { file("assets").mkdirs() }} tasks.register<JavaExec>("runServer") { group = "application" mainClass.set("pl.decodesoft.ServerKt") classpath = sourceSets["main"].runtimeClasspath standardInput = System.`in` } tasks.test { useJUnitPlatform() } tasks.withType<Jar> { manifest { attributes["Main-Class"] = "pl.decodesoft.MMOGame.Launcher" }} kotlin { jvmToolchain(21) } build.gradle.kts (server) plugins { kotlin("jvm") version "2.1.10" kotlin("plugin.serialization") version "2.1.20" } group = "pl.decodesoft" version = "1.0-SNAPSHOT" repositories { mavenCentral() } val gdxVersion = "1.12.1" val ktorVersion = "2.3.4" dependencies { // Twoje istniejące zależności implementation("io.ktor:ktor-client-core:$ktorVersion") implementation("io.ktor:ktor-client-websockets:$ktorVersion") implementation("io.ktor:ktor-client-cio:$ktorVersion") implementation("ch.qos.logback:logback-classic:1.4.12") // Zależności do serwera (jeśli są potrzebne w tym samym projekcie) implementation("io.ktor:ktor-server-core:$ktorVersion") implementation("io.ktor:ktor-server-netty:$ktorVersion") implementation("io.ktor:ktor-server-websockets:$ktorVersion") // Logowanie, Rejestracja implementation("at.favre.lib:bcrypt:0.9.0") implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion") implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion") // Zależności LibGDX implementation("com.badlogicgames.gdx:gdx:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion") implementation("com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop") } tasks.test { useJUnitPlatform() } tasks.withType<Jar> { manifest { attributes["Main-Class"] = "pl.decodesoft.Main" } duplicatesStrategy = DuplicatesStrategy.EXCLUDE from({ configurations.runtimeClasspath.get() .filter { it.name.endsWith("jar") } .map { zipTree(it) } }) } kotlin { jvmToolchain(21) } Licencja Cytat:Copyright [2025] [Platefobrain] Cytat:Licencja: Wszelkie prawa zastrzeżone. Download Kod: https://decodesoft.pl/download/server-mmo.zipKod: https://decodesoft.pl/download/client-mmo.zipKod: https://github.com/Platefobrain/Simple-MMO-Game-greenvaleScreeny ![]()
|