Darkan Core Library

In the past Darkan was one big code source with all code in one place. However, certain parts of the code inflated the size and number of files. Server-sided learning became harder to manage with this huge file count.

Instead of keeping all files in one place, why not place the more immutable and advanced topics in a separate code source? This is what Darkan Core became. It is a library of code taken out of a monolithic code source with the file choices being that which likely does not need to be edited by the server-side developer.

Things to note, Darkan Core is mutable, anyone can contribute to it and when it is updated Gradle settings can be changed to include the new version of the library as a dependency. Here is an example of the dependency:

mainClassName = 'com.rs.Launcher'

repositories {
	mavenLocal()
	mavenCentral()
	maven githubPackage.invoke('DarkanRS/core')
}

group 'rs.darkan'
version '1.1.11'

dependencies {
	implementation group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.36'
	implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: '1.8.10'
	implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-common', version: '1.8.10'
	implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.6.4'
	implementation group: 'rs.darkan', name: 'core', version: '1.1.16'
	implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
	implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
	implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.4.0'
	implementation group: 'org.mongodb', name: 'mongodb-driver-core', version: '4.4.0'
	implementation group: 'io.netty', name: 'netty-all', version: '4.1.86.Final'
	implementation group: 'io.undertow', name: 'undertow-core', version: '2.2.22.Final'
	implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.5.8'
	implementation group: 'com.trivago', name: 'fastutil-concurrent-wrapper', version: '0.1.0'
  implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
}

On line 17 you can see there is a version of Darkan Core which is updated when the repository is updated. Lastly, here is a sample of what is in Darkan Core Library:

  • All networking packet structures
    • All packet protocols incoming and outgoing
    • Packet Encoders
    • Packet Decoders
    • Encryption
  • Cache reading tools and utilities used by the server and the developer
  • Json manipulation tools
  • Base classes and classes which should be rarely updated
    • SpotAnim.java
    • GroundItem.java
    • Projectile.java
    • WorldTile.java
    • WorldObject.java
    • VarBits
    • ...
  • Etc...