Commit Graph
100 Commits
Author SHA1 Message Date
Gary Tierney 14f53531c3 Merge remote-tracking branch 'origin/master' into kotlin-experiments 2018-08-23 00:22:16 +01:00
Gary Tierney ba5ff2b765 Fix inclusion of ktlint for check tasks 2018-08-22 23:16:53 +01:00
Gary Tierney 96e11dfe27 Remove empty allprojects block 2018-08-22 23:00:17 +01:00
Gary Tierney eaa6ff6f2f Add ktlint Gradle plugin 2018-08-22 22:59:25 +01:00
Gary Tierney d97b6274c6 Include default configuratio in app distribution 2018-08-22 22:13:16 +01:00
Gary Tierney 51cfe1cd36 Add WalkingQueue tests 2018-08-22 22:00:39 +01:00
Gary Tierney 6198e30520 Remove Gradle wrapper hack from Travis config 2018-08-22 21:28:56 +01:00
Gary Tierney c3cdbdf75e Create zip file distributions for each AppVeyor build 2018-08-22 21:26:37 +01:00
Gary Tierney d8c7cdff61 Add Appyveyor configuration 2018-08-22 21:22:39 +01:00
Gary Tierney c2724236a2 Add Gradle wrapper 2018-08-22 21:21:58 +01:00
Gary Tierney 50d7e86302 Produce XML coverage report for codecov.io 2018-08-20 01:38:43 +01:00
Gary Tierney 5d84cdf40f Fix recording of code coverage 2018-08-20 01:29:52 +01:00
Gary Tierney 37547ee3aa Produce coverage report with JaCoCo during CI 2018-08-20 00:14:08 +01:00
Gary Tierney 5307a62f8d Put plugins with the same name in unique packages 2018-08-20 00:13:25 +01:00
Gary Tierney ab64a099ba Add missing wrapper task in Travis config 2018-08-20 00:03:12 +01:00
Gary Tierney 88b0305cc8 Update test runner and coverage for CI 2018-08-20 00:00:55 +01:00
Gary Tierney ebeaa7cd92 Use Gradles built-in JUnit 5 support 2018-08-19 23:43:42 +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 82b79ba60c Remove Kotlin scripting Gradle plugin 2018-08-19 19:59:05 +01:00
Gary Tierney bd6db246dc Remove Detekt configuration 2018-08-19 19:52:51 +01:00
Gary Tierney 09346134fa Make buildscripts backwards compatible with Gradle 4.0 2018-08-19 19:50:27 +01:00
Gary Tierney c687f549da Add core plugins to the servers runtime classpath 2018-08-19 19:37:36 +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
Gary Tierney 2b7a62d997 Use a map for bone and prayer lookups 2018-03-31 22:24:10 +01:00
Gary Tierney 7c59c2c3a5 Clean up remaining issues on prayer plugin 2018-03-31 22:12:34 +01:00
Gary Tierney 59a651a1eb Fix code-style in prayer plugin
Adds named arguments to enum declarations along with lookup functions, fixes
continuation indent, and replaces Map<Player, ArrayList<Prayer>> with a
SetMultimap<Player, Prayer>.
2018-03-31 21:58:53 +01:00
Gary Tierney 28c85d1ecc Remove now invalid packageName from prayer plugin 2018-03-31 21:57:28 +01:00
Gary Tierney 5d77ed5e4b Remove plugin script stub 2018-03-27 22:35:12 +01:00
Gary Tierney 179c35fc2d Add IntelliJ kotlinc configuration
This removes the need for the plugin 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
Gary Tierney 2f71097380 Add Acknowledgements section to the README
Also add list of services we're using via open source licensing models (YourKit
and Travis-CI).
2018-01-28 18:15:20 +00:00
Gary Tierney 53521e7e0d Update varrock plugin package name 2017-09-23 13:30:23 +01:00
Gary Tierney 2cd160feb3 Refactor woodcutting to use coroutines 2017-09-19 19:02:29 +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 8a3decfc54 Enable experimental coroutines for all kotlin projects 2017-09-17 19:37:14 +01:00
Gary Tierney 1f33619ac6 Add source information to remapped scripts 2017-09-17 19:36:58 +01:00
Gary Tierney 89516dab63 Rewrite package names in compiled script files 2017-09-17 18:42:19 +01:00
Gary Tierney 112b8aab57 Add basic detekt configuration 2017-09-17 04:28:10 +01:00
Gary Tierney 40095d65e5 Add explicit stop() to async actions 2017-09-17 03:24:59 +01:00
Gary Tierney 0dc6879bdc Refactor mining to use async actions 2017-09-17 03:13: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 68710cae47 Use File.separator in settings.gradle 2017-09-16 22:13:12 +01:00
Gary Tierney a60cc82650 Use main sourcset output dir for scripts 2017-09-16 21:54:57 +01:00
Gary Tierney b4d951c7cc Fix incremental script compilation 2017-09-16 21:49:45 +01:00
Gary Tierney edcb72b474 Fix plugin test running with new gradle modules 2017-09-16 20:40:17 +01:00
Gary Tierney 36282cf81e Remove plugins.gradle and factor into common extension 2017-09-16 18:49:06 +01:00
Gary Tierney d323bcd69c Fix plugin test runner 2017-09-16 13:19:55 +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 b17ad487ab Add Jenkinsfile 2017-06-20 08:00:06 +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
Gary Tierney f40a3a3a5d Update travis-ci configuration to cache build deps 2017-06-18 21:39:55 +01:00
Gary Tierney 1019cc8e6a Check for conflicting plugin names at build-time 2017-06-18 21:37:44 +01:00
Gary Tierney 3f714831c7 Make plugin classes dependant on scripts 2017-06-18 21:25:04 +01:00
Gary Tierney adaaae2129 Refactor the plugin compile task for performance
Integrates the plugin script compilation task with Gradle so we no
longer need to start a new instance of the JVM for each set of plugin
scripts that we want to compile.
2017-06-18 21:13:30 +01:00
Gary Tierney df305bd775 Merge pull request #340 from cubeee/kotlin-port/commands
Convert commands to Kotlin
2017-06-18 19:09:08 +01:00
Gary Tierney ce3150082d Fix builds on other platforms (non-Unix) 2017-06-02 22:30:39 +01:00
Gary Tierney 7ecc2e3158 Clean up plugin script compilation 2017-06-01 23:09:24 +01:00
Gary Tierney 42fdaee8b8 Make run task depend on plugin scripts 2017-06-01 22:47:50 +01:00
Gary Tierney eed32efcf9 Move stub.kt to main game module 2017-05-31 21:05:35 +01:00
Gary Tierney 258fc6c97b Add stub to plugin compile-time classpath 2017-05-31 10:55:12 +01:00
Gary Tierney 9353daabc3 Add plugin tests to the game build 2017-05-30 21:11:40 +01:00
Gary Tierney 3fb6d3f792 Treat each plugin as an individual source set
Adds separate build tasks for each plugin by auto-discovering plugin meta
files in the build script.  Each plugin will automatically have its
main sources and tests compiled, and then it's output added to the game
modules classpath.

This enables support for incremental compilation of scripts, as well as
unit testing using Gradle's test framework.
2017-05-30 21:06:37 +01:00
Gary Tierney 4ee123a59d Add private messaging plugin 2017-05-28 23:20:07 +01:00
Gary Tierney ad72036853 Add port of the 'dummys' plugin from Ruby 2017-05-28 23:09:36 +01:00
Gary Tierney 48e1726bc0 Remove 'world' object from global script scope 2017-05-28 23:07:05 +01:00
Gary Tierney 05e20d9d51 Reorganize project sources from src/main to src/main/java 2017-05-28 22:04:34 +01:00
Gary Tierney 7ffef28117 Compile plugins at build-time instead of runtime
Adds gradle tasks to build all plugin scripts under data/plugins with
the KotlinPluginCompiler implementation previously used for runtime code
generation.  In addition to .plugin.kts files, scripts can also declare
API code in .kt files which will also be included on the classpath and
made available to other plugins.
2017-05-28 01:43:35 +01:00
Gary Tierney 79f79cd15c Add a 'plugins' source set to the game module
Creates a new sourceset for server plugins to support IDE integration
with plugin code.  Additionally moves plugins to game/data/plugins and
contains some gradle related fixes (remove java plugin from root project
and fix exec task dependency).
2017-05-27 18:58:05 +01:00
Gary Tierney 3403c0a2d1 First draft of KotlinPluginEnvironment 2017-05-27 18:57:39 +01:00
Gary Tierney 93df5c8546 Merge pull request #333 from Major-/hit-bug
Fix 317 HitUpdateBlock encoding
2017-05-25 15:32:27 +01:00
Gary Tierney 7456a43e4f Merge pull request #332 from Major-/report
Add support for decoding Report Abuse messages
2017-05-25 15:23:15 +01:00
Gary Tierney 85587bd9d1 Merge pull request #331 from Major-/npc-item
Add support for decoding Item on Npc messages
2017-05-25 15:15:17 +01:00
Gary Tierney 358594a91b Merge pull request #327 from Major-/unignore-fs
Ensure /data/fs exists in fresh clones
2017-05-25 11:50:30 +01:00
Gary Tierney ffa5a39a17 Merge pull request #326 from Major-/getting-started
Add 'getting started' section to README
2017-05-25 11:50:17 +01:00
Gary Tierney d4219320a1 Merge pull request #318 from apollo-rsps/bug/fix-grounditem-message
Fix argument order of tile item message ctor call
2017-05-23 01:46:49 +01:00
Gary Tierney 0559c4093c Fix argument order of tile item message ctor call
Rearrange the arguments passed to the SendTileItemUpdateMessage
constructor when recording a ground item RegionUpdate.  Fixes #316.
2017-05-23 01:40:31 +01:00
Gary Tierney 30a1aebb56 Remove Maven POM files 2017-01-02 04:59:41 +00:00
Gary Tierney 4d79052199 Convert to the gradle build system
Ports the Maven build POMs to Gradle build scripts, which are a bit
friendlier to use.  Instead of using the exec:java Maven goal to run the
server now, the gradle run task should be used.
2017-01-02 04:44:04 +00:00
Gary Tierney e5a6638e2f Add support for player / npc following
Implements a new MobExtension plugin which adds 'follow', and 'chase'
mixins that allow the mob to follow behind another mob, and chase them
while keeping at a safe distance to fire projectiles.  Also adds a new
public method 'raycast' to CollisionManager, for drawing a line through
the world using bresenham's line algorithm whille checking for any impenetrable
objects.
2017-01-02 04:11:13 +00:00
Gary Tierney baa12ca446 Add a mob extension plugin for walking to entities
Adds a new mob extension plugin which creates a walk_to() method on
Mobs to allow walking to another entity (accounting for the size of the
entity) with an optional facing position.
2017-01-02 03:39:02 +00:00
Gary Tierney b047d0197a Add a plugin which allows creating mixins for Mobs
Adds a mob-extension plugin, which allows creating modules as mixins to
be monkey-patched into the Mob class.  Having a standard method of doing
this prevents confusing problems with mixin name conflicts, by allowing
the plugin to raise an error that 2 mixins with the same name exist.
2017-01-01 08:13:09 +00:00
Gary Tierney 916f6c547d Add tests around CollisionManager functionality
Adds tests for the CollisionManager which makes sure that collision
matrices are correctly built for the following object types:

* Interactables
* Walls
* Corners

Missing from these tests are tests for blocked / bridged tiles, and
large corner walls, which can be added later.  Additionally, the test
cases include ASCII illustrations of the collision grid and how it is
built / checked for a particular object or movement.
2016-12-31 05:19:49 +00:00
Gary Tierney 6188c2e751 Add support for dynamic collision detection
This commit implements collision detection using the map files loaded
from the cache, and adds support for modifying the collision matrices at
runtime when the game world is updated.

All checks to see if a tile is reachable should now be done via.
World#traversable, instead of Region#traversable, as the World object
can handle checking tiles across multiple regions.  These are done for
the WalkingQueue and Pathfinder implementations.
2016-12-31 05:14:19 +00:00
Gary Tierney 0672fa2ea0 Fix bitwise negation in CollisionMatrix#clear()
Adds the missing bitwise AND to the clear() method in CollisionMatrix,
so any flags besides the one given are retained.
2016-12-31 02:09:42 +00:00
Gary Tierney 376d36871a Allow registering region listeners globally
Adds the ability to register region listeners with the
RegionRepository, which will register the listener with any existing
regions and cache it for any newly created regions later.
2016-12-31 02:09:42 +00:00
Gary Tierney 6a4625cb32 Refactor map loading code
Refactors the map file loading code by importing existing code from the
Vicis cache editor project.  Adds classes for decoding objects and tiles
for a given map file index. Only the new MapIndex decoder code is used
when loading GameObjects at the moment , which will later be updated.
2016-12-31 02:08:58 +00:00
Gary Tierney 43e522b1ba Update contributors guidelines 2016-03-12 13:39:47 +00:00
Gary Tierney f2aced1bca Add support for projectiles
* Adds support for short-lived entities, which are never added to the
  entity sets of the region they belong in.

* Adds support for checking the number of tiles a Mob occupies.

* Adds a ProjectileBuilder class to simplify creating projectiles.
2016-03-11 20:03:33 +00:00