Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


# Alter
[![revision: 228][rev-badge]][patch] [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.com/invite/sAzCuuwkpN) ![jdk-badge] ![](https://tokei.rs/b1/github/AlterRSPS/Alter)
[![revision: 231][rev-badge]][patch] [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.com/invite/sAzCuuwkpN) ![jdk-badge] ![](https://tokei.rs/b1/github/AlterRSPS/Alter)

**Alter** is a modified version of [RSMod](https://github.com/Tomm0017/rsmod) a highly flexible user-friendly game server for use with the OSRS client. Implemented in a modular way,
the framework allows developers to make and create any sort of plugin they wish without having to modify the core game module.
Expand All @@ -13,8 +13,8 @@ Due to the plugin capabilities, even owners without programming experience can j
* Youtube tutorial: https://www.youtube.com/watch?v=2Tu-NTzMbf0

* ### First of all Download:
* [Xteas](https://archive.openrs2.org/caches/runescape/2038/keys.json) Save as `xteas.json` inside `/data/` Directory.
* [cache-oldschool-live-en-b228-2025-02-05-11-45-05-openrs2](https://archive.openrs2.org/caches/runescape/2038/disk.zip) , And make sure you're using correct Java Version.
* [Xteas](https://archive.openrs2.org/caches/runescape/2206/keys.json) Save as `xteas.json` inside `/data/` Directory.
* [cache-oldschool-live-en-b231-2025-06-11-10-45-05-openrs2](https://archive.openrs2.org/caches/runescape/2206/disk.zip) , And make sure you're using correct Java Version.
* Also make sure you have [Intellij](https://www.jetbrains.com/idea/download/#section=windows) installed, how to install intellij: [Youtube](https://www.youtube.com/watch?v=t8T5Qwa5d_o)

* First open Intellij, (If you already have a project open, either do `File -> Close`, or `File -> New -> Project from Version Control`)
Expand All @@ -23,7 +23,7 @@ Due to the plugin capabilities, even owners without programming experience can j
* Second paste `https://github.com/AlterRSPS/Alter` in URL Field and hit Clone. </br>
![tutor2](https://raw.githubusercontent.com/AlterRSPS/Resources/main/docs/resources/ReadMe_Alter/tuor2.png)
* Hit `Clone` and Let the project fully load.
* Now open the `cache-oldschool-live-en-b228-2025-02-05-11-45-05-openrs2` file that you downloaded. and drag out Xteas.json and Cache folder and pull it to `/Data/` Folder.
* Now open the `cache-oldschool-live-en-b231-2025-06-11-10-45-05-openrs2` file that you downloaded. and drag out Xteas.json and Cache folder and pull it to `/Data/` Folder.
![tutor6](https://raw.githubusercontent.com/AlterRSPS/Resources/main/docs/resources/ReadMe_Alter/tutor6.png)
- `Xtea.json` has to be in same folder like: Data /`api.yml`, etc..
* Now click on `Gradle` button on right side. </br>
Expand Down Expand Up @@ -52,9 +52,9 @@ Due to the plugin capabilities, even owners without programming experience can j
> config:
> - id: 1
> name: Alter
> jav_config_url: https://client.blurite.io/jav_local_228.ws
> jav_config_url: https://client.blurite.io/jav_local_231.ws
> varp_count: 15000
> revision: 228.2
> revision: 231.1
> modulus: YOUR_MODULUS_KEY_HERE
> ```
> Modulus key will be found inside Alter Project root directory make sure to copy every character, And replace `YOUR_MODULUS_KEY_HERE` inside `proxy-targets.yaml` with your modulus key. For more information on it you can find at: [RSProx-Private-Server-Usage](https://github.com/blurite/rsprox?tab=readme-ov-file#private-server-usage)
Expand All @@ -71,6 +71,6 @@ Due to the plugin capabilities, even owners without programming experience can j
* Credits are given out to everyone who helped out with information or contributed in some form to the project. And can be found in: [Here](https://github.com/AlterRSPS)

[patch]: https://oldschool.runescape.wiki/w/Update:Leagues_V:_Raging_Echos_Rewards_Are_Here
[rev-badge]: https://img.shields.io/badge/Revision-228-blueviolet
[rev-badge]: https://img.shields.io/badge/Revision-231-blueviolet
[license-badge]: https://img.shields.io/badge/license-ISC-informational
[jdk-badge]: https://img.shields.io/badge/JDK-17-blue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ContainerExtTests {
val path = Paths.get("../data", "cache")
check(Files.exists(path)) { "Path does not exist: ${path.toAbsolutePath()}" }

CacheManager.init(path, 228)
CacheManager.init(path, 231)

assertNotEquals(itemSize(), 0)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import org.alter.game.model.entity.Client
import org.alter.game.service.login.LoginService

class RsModConnectionHandler(private val world: World) : GameConnectionHandler<Client> {
override fun onLogin(
responseHandler: GameLoginResponseHandler<Client>,
block: LoginBlock<AuthenticationType<*>>,
) {

override fun onLogin(responseHandler: GameLoginResponseHandler<Client>, block: LoginBlock<AuthenticationType>) {
if (loginService == null) {
loginService = world.getService(LoginService::class.java)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object PlayerSaving {

private fun validateAuthentication(previousXteas : IntArray, client: Client, block: LoginBlock<*>): PlayerLoadResult {
when (val auth = block.authentication) {
is AuthenticationType.PasswordAuthentication<*> -> {
is AuthenticationType.PasswordAuthentication -> {
if (!BCrypt.checkpw(auth.password.asString(), client.passwordHash)) {
return PlayerLoadResult.INVALID_CREDENTIALS
}
Expand Down Expand Up @@ -132,8 +132,8 @@ object PlayerSaving {
client.attr.put(NEW_ACCOUNT_ATTR, true)
client.attr.put(APPEARANCE_SET_ATTR, false)

if (block.authentication is AuthenticationType.PasswordAuthentication<*>) {
val passwordAuth = block.authentication as AuthenticationType.PasswordAuthentication<*>
if (block.authentication is AuthenticationType.PasswordAuthentication) {
val passwordAuth = block.authentication as AuthenticationType.PasswordAuthentication
client.passwordHash = BCrypt.hashpw(passwordAuth.password.asString(), BCrypt.gensalt(16))
}
client.tile = client.world.gameContext.home
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class decryptMap : Service {
val backupXteaLocation = xteaLocation.resolveSibling("xteas.json.backup")

val cacheTool = CacheTool(
Builder(type = TaskType.BUILD, revision = 228).apply {
Builder(type = TaskType.BUILD, revision = 231).apply {
extraTasks = arrayOf(
RemoveXteas(xteaLocation = xteaLocation.toFile())
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import net.rsprot.protocol.game.outgoing.info.util.BuildArea
import net.rsprot.protocol.game.outgoing.map.RebuildNormal
import net.rsprot.protocol.game.outgoing.map.RebuildRegion
import net.rsprot.protocol.game.outgoing.map.util.RebuildRegionZone
import net.rsprot.protocol.game.outgoing.worldentity.SetActiveWorld
import net.rsprot.protocol.game.outgoing.worldentity.SetActiveWorldV2
import org.alter.game.model.Coordinate
import org.alter.game.model.Tile
import org.alter.game.model.World
Expand Down Expand Up @@ -61,7 +61,7 @@ class SequentialSynchronizationTask : GameTask {
* not have one.
*/
if (it.entityType.isHumanControlled && it.initiated) {
it.write(SetActiveWorld(SetActiveWorld.RootWorldType(it.tile.height)))
it.write(SetActiveWorldV2(SetActiveWorldV2.RootWorldType(it.tile.height)))
it.write(it.playerInfo.toPacket()) // try-catch it, this _can_ throw exceptions during .toPacket()
it.write(
SetNpcUpdateOrigin(
Expand Down
2 changes: 1 addition & 1 deletion game.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# You want to edit these to fit your game.
name: "Alter"
game-port: 43594
revision: 228
revision: 231.1

# The coordinates for the home location.
home-x: 3218
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ csv = "0.7.3"
logback = "1.4.11"
ktlint = "12.1.0"
openrune-filestore = "1.3.6"
rsprot = "1.0.0-ALPHA-20250126"
rsprot = "1.0.0-ALPHA-20250610"
routefinder = "6.0.0"

[libraries]
Expand Down Expand Up @@ -66,7 +66,7 @@ netty-all = { group = "io.netty", name = "netty-all", version.ref = "nettyAll" }

logback-classic = { group ="ch.qos.logback", name = "logback-classic", version.ref = "logback"}
openrune-filestore = { group = "dev.openrune", name = "filestore", version.ref = "openrune-filestore"}
rsprot = { group = "net.rsprot", name = "osrs-228-api", version.ref = "rsprot"}
rsprot = { group = "net.rsprot", name = "osrs-231-api", version.ref = "rsprot"}
routefinder = { group = "org.rsmod", name = "rsmod-routefinder", version.ref = "routefinder"}

mongo-bson = { group = "org.mongodb", name = "bson", version.ref = "mongo"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.io.RandomAccessFile
/**
* [Cache] which efficiently stores information about its indexes, archives and files.
*/
abstract class ReadOnlyCache(indexCount: Int) : dev.openrune.cache.filestore.Cache {
abstract class ReadOnlyCache(indexCount: Int) : Cache {
val indices: IntArray = IntArray(indexCount) { it }
val archives: Array<IntArray?> = arrayOfNulls(indexCount)
val fileCounts: Array<IntArray?> = arrayOfNulls(indexCount)
Expand Down Expand Up @@ -144,10 +144,22 @@ abstract class ReadOnlyCache(indexCount: Int) : dev.openrune.cache.filestore.Cac
hashes[reader.readInt()] = archiveId
}
}
reader.skip(archiveCount * 4) // Crc
if (flags and 0x8 != 0) {
for (i in 0 until archiveCount) {
reader.readInt()
}
}
if (flags and WHIRLPOOL_FLAG != 0) {
reader.skip(archiveCount * WHIRLPOOL_SIZE)
}
reader.skip(archiveCount * 8) // Crc & revisions
if (flags and 0x4 != 0) {
for (i in 0 until archiveCount) {
reader.readInt()
reader.readInt()
}
}
reader.skip(archiveCount * 4) // Revision
val archiveSizes = IntArray(highest + 1)
for (i in 0 until archiveCount) {
val id = archiveIds[i]
Expand Down
2 changes: 1 addition & 1 deletion plugins/tools/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
implementation("me.tongfei:progressbar:0.9.2")
implementation("com.google.code.gson:gson:2.10.1")
implementation("commons-io:commons-io:2.15.1")
implementation("com.displee:rs-cache-library:7.1.0")
implementation("com.displee:rs-cache-library:7.3.0")
implementation("com.akuleshov7:ktoml-core:0.5.1")
implementation("com.akuleshov7:ktoml-file:0.5.1")
}
Expand Down