Commit Graph

171 Commits

Author SHA1 Message Date
Gary Tierney 51cfe1cd36 Add WalkingQueue tests 2018-08-22 22:00:39 +01:00
Major- 2080e1e700 Add tests for player actions 2018-08-21 16:10:52 +01:00
Major 86fba62ab9 Support npc and object definitions in plugin tests 2018-08-21 16:09:16 +01:00
Gary Tierney 248a7d97d9 Update plugin test framework to junit5
Updates the testing infrastructure to use the latest relesae of junit and
leverages the new extension mechanism to create an easy to use testing
framework.  Also adds additional test coverage for several plugins.
2018-08-19 22:28:41 +01:00
Gary Tierney e255bd195e Replace fast-classpath-scanner with classgraph 2018-08-19 20:32:42 +01:00
Gary Tierney 0651d535fa Update to Kotlin 1.60 and Gradle 4.9
Removes the dependency on legacy script compilation and now relies on script
discovery.  In addition, the Gradle build scripts were refactored and updated
to be compatible with Gradle 5.0 and make use of the new java-library
configurations.
2018-08-19 19:26:51 +01:00
Steve Soltys 7fee8277ab Fix A* pathfinding when height is greater than zero 2018-07-30 21:09:03 -04:00
Steve Soltys 84f05ef51a Add support for checking the bounds of entities 2018-07-22 15:14:03 -04:00
Steve Soltys c44a942976 Optimize collision matrix building 2018-07-18 18:56:20 -04:00
Steve Soltys b74be81f05 Fix numerical attribute encoding 2018-07-14 12:16:49 -04:00
Gary Tierney 5d77ed5e4b Remove plugin script stub 2018-03-27 22:35:12 +01:00
Gary Tierney d8116478d4 Remove dependency on embedded kotlin compiler
This is a large change that significantly simplifies the plugin build system by
having the kotlinc handle everything related to script compilation.  Since we
no longer use package name rewriting, the "packageName" option has been dropped
from the gradle script API and has been removed from existing plugins.

In addition to simplifying the build system, it should also significantly speed
up build times.  Previously we ran 2 build processes for every plugin and
didn't have fully working incremental compilation for scripts compared to 1
build process with built-in incremental compilation.

There were also some random pieces of code that referenced kotlinc directly, so
those have either been removed or refactored out.
2018-03-27 22:35:05 +01:00
Trevor Flynn 97896a34a4 Add implementation of runecrafting skill 2018-01-17 22:25:21 +00:00
Major cb9e6f353d Let plugins intercept Events
Support for PlayerEvents already exists, but general event
support wasn't included in the original KotlinPluginScript.
2017-09-24 18:13:17 +01:00
Major 52c25946b9 Add shops plugin
Thanks to tlf30 for a lot of work on this.
2017-09-23 04:12:08 +01:00
Gary Tierney 76dd8ba192 Refactor asynchronous actions to avoid thread usage
Adds custom coroutines specifically for use within Actions.  This
implements all features of the previous system, however, does not rely
on a separate executor to wake up continuations.

Note: since Actions are still ran by an executor and a small chance of
overlap exists the ActionCoroutine implementation uses atomic counters
and references.
2017-09-19 01:52:10 +01:00
Gary Tierney 169d89ffc0 Clear static object REMOVE messages when re-adding 2017-09-17 20:27:50 +01:00
Gary Tierney 0dc6879bdc Refactor mining to use async actions 2017-09-17 03:13:03 +01:00
Trevor Flynn a54485e263 Finish up porting mining plugin to Kotlin 2017-09-17 03:12:43 +01:00
Trevor Flynn e61f4ef95a Adding support for mining skill 2017-09-17 03:11:03 +01:00
Gary Tierney cf0e3331e0 Add API plugin with common functionality 2017-09-17 03:11:02 +01:00
Gary Tierney 3a9e435189 Add an await function to the AsyncActionRunner trait 2017-09-17 03:11:02 +01:00
Gary Tierney 36282cf81e Remove plugins.gradle and factor into common extension 2017-09-16 18:49:06 +01:00
Gary Tierney b32b98eb86 Share kotlin version config between buildSrc and project (#353)
* Share kotlin version config between buildSrc and project
* Use built-in Kotlin MessageCollector
2017-09-16 02:39:34 +01:00
Gary Tierney cb14c32b71 Add kotlin port of the walk/run toggle plugin 2017-06-25 02:49:58 +01:00
Gary Tierney 8dc10e80bf Add kotlin port of the emote-tab plugin 2017-06-25 02:44:15 +01:00
Gary Tierney b2f0c7e4db Add Kotlin port of the logout plugin 2017-06-25 02:39:46 +01:00
Gary Tierney e605241893 Add on_button method to plugin scripts 2017-06-25 02:38:56 +01:00
Gary Tierney 9a8ed0d7a9 Port the walkto and following plugins to Kotlin 2017-06-24 18:24:13 +01:00
Gary Tierney c15f18c609 Add plugin for consumable food/drink 2017-06-22 22:23:55 +01:00
Gary Tierney 97e85868ff Add support for asynchronous Mob actions
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.
2017-06-20 07:31:07 +01:00
Gary Tierney 182de0330f Allow multiple players per test
Refactors the test helpers to use receiver functions so multiple players
can exist in the world per test case.  The AddFriendsTest is an example
of where this is needed.

Additionally, Hamcrest has been replaced with AssertJ for fluent
assertions.
2017-06-20 02:33:27 +01:00
Gary Tierney b532168551 Remove test context from plugin testing framework 2017-06-19 17:14:24 +01:00
Gary Tierney b536b2ed9d Add start of test framework for plugins
Adds a basic testing framework suitable for plugins that start simple
Actions for players, which can be expanded on in the future.  The
banking and training dummy tests have been updated to use this framework
and serve as samples.
2017-06-19 02:59:57 +01:00
Gary Tierney d0fec15a84 Add missing name normalization to lookup plugin 2017-06-18 21:45:52 +01:00
Cube c082f407ad Add input type checking to commands 2017-06-16 23:10:07 +03:00
Cube 4ca8978ff3 Convert lookup commands to Kotlin 2017-06-16 23:10:07 +03:00
Cube 3616753d7f Convert npc spawn commands to Kotlin 2017-06-16 23:10:07 +03:00
Cube 4f45f5f1ff Convert experience commands to Kotlin 2017-06-16 23:10:07 +03:00
Cube 9f67c30893 Convert teleport commands to Kotlin 2017-06-16 23:10:06 +03:00
Cube 72c0be8ac6 Convert punishment commands to Kotlin 2017-06-16 23:10:06 +03:00
Cube 6db98406d5 Overload valid_arg_length 2017-06-16 23:10:06 +03:00
Cube 5ea52e00f0 Convert messaging commands to Kotlin 2017-06-16 23:08:55 +03:00
Cube 7df948e12f Convert ::item command to Kotlin 2017-06-16 23:04:28 +03:00
Cube b99ee9ba31 Convert ::animate command to Kotlin 2017-06-03 18:55:40 +03:00
Cube 8e8e2d0991 Simplify on_command arguments 2017-06-03 15:23:03 +03:00
Cube 30fc810d61 Add base for Kotlin commands 2017-06-03 15:17:46 +03:00
Gary Tierney ce3150082d Fix builds on other platforms (non-Unix) 2017-06-02 22:30:39 +01:00
Jesse 35ab034f3d Port location NPC spawns from Ruby to Kotlin 2017-06-01 23:43:48 +01:00
Jesse 8d00dcc7c8 Add height and direction params to npc_spawn 2017-06-01 23:23:49 +01:00