mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
97e85868ff
Adds asynchronous implementations of the Action and DistancedAction classes, allowing plugins to make use of suspendable functions in Kotlin instead of creating mini state machines to keep track of state. The asynchronicity works by creating coroutine backed Channels for each asynchronous action and having them listen on "pulse" events from the action scheduler. The action can then suspend execution until a pulse is received or until some expensive operation has completed (i.e., pathfinding). If an asynchronous action is still busy when a pulse arrives then the number of missed pulses will be accumulated and sent to the action at the next possible time. The training dummy plugin has been updated to use asycnrhonous actions as an example.
52 lines
1.4 KiB
Groovy
52 lines
1.4 KiB
Groovy
description = 'Apollo Game'
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
classpath group: 'com.moandjiezana.toml', name: 'toml4j', version: '0.7.1'
|
|
}
|
|
}
|
|
|
|
ext.pluginsDir = "$projectDir/src/plugins"
|
|
|
|
apply plugin: 'kotlin'
|
|
apply from: 'plugins.gradle'
|
|
|
|
sourceSets {
|
|
main {
|
|
kotlin {
|
|
exclude 'stub.kt'
|
|
}
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
url { 'https://dl.bintray.com/kotlin/kotlinx/' }
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':cache')
|
|
compile project(':net')
|
|
compile project(':util')
|
|
|
|
compile group: 'io.github.lukehutch', name: 'fast-classpath-scanner', version: '2.0.21'
|
|
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jre8', version: "$kotlinVersion"
|
|
compile group: 'org.jetbrains.kotlin', name: 'kotlin-compiler-embeddable', version: "$kotlinVersion"
|
|
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-jdk8', version: '0.16'
|
|
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '0.16'
|
|
|
|
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0'
|
|
}
|
|
|
|
task run(type: JavaExec, dependsOn: classes) {
|
|
main = 'org.apollo.Server'
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
jvmArgs = ['-Xmx1750M']
|
|
workingDir = "$rootDir"
|
|
} |