GithubHelp home page GithubHelp logo

tomm0017 / rsmod Goto Github PK

View Code? Open in Web Editor NEW
124.0 13.0 101.0 4.12 MB

New repository: https://github.com/rsmod/rsmod

Home Page: https://github.com/rsmod/rsmod

License: Apache License 2.0

Kotlin 99.96% Dockerfile 0.04%
rs-mod rsps osrs runescape

rsmod's Introduction

RS Mod V1

RS Mod is a server that is highly flexible and user-friendly. We allow the developer to make and create any sort of plugin they wish without having to modify the core game module. People without developing experience can have others make plugins for them and simply drop them into the Plugins module and it'll automatically load on the next server startup!

Getting Started

You can learn how to get started here: RS Mod Wiki

Installation

There's two ways to launch RS Mod. One is for users who want to look into the code and possibly create their own content. The other is for users who simply want to run the server as fast as possible and log in quick.

I want to run the server quickly

  • Go to the repository's release page: Releases
  • Download the latest release (note: not the source code package)
  • Extract the archive on your desktop (or anywhere of your preference)
  • Open the extracted folder and open the following directory: game-${version-number}/bin
  • If you are running Windows, run the game.bat file. If you are running Linux or Mac, run the game file
  • The first time you launch it, you will receive a prompt stating that you do not have an RSA private key. Enter y on your terminal/command prompt and wait for a message stating that your key was created. Do not close the terminal/command prompt
  • Once your key is created, you will have to follow the instructions on the terminal/command prompt
    • You need to copy the public keys you are given and replace them in your client
    • In your client, you can find the text BigInteger("10001 which will usually be the place where you need to replace both the public keys (the "10001" key is usually the same)
    • Once you have replaced the keys in the client, you can restart the server and launch your client
  • The server release comes with a cache and XTEA keys you can use. Current revision: 180

I want to run the server and begin making my own content

1) Clone/Download the Repository

  • Go to the repository page: RS Mod
  • Clone or download the repository
  • Extract the repository in your desktop (or anywhere else you prefer)
    • Note: make sure you use Extract here and not Extract to rs-mod-master\, unless you know what you're doing (it can lead to silly mistakes when setting up your project)

2) Open the project in IntelliJ

  • If you do not have IntelliJ, you can download it from here: https://www.jetbrains.com/idea/download/
  • In your IntelliJ window, go to the top-left menu bar and navigate to File -> New -> Project from Existing Sources...
  • Select the RSMod repository which you downloaded on the previous step
  • In the Import Project window, select Import project from external model -> Gradle
  • In the next window you want to select the following and unselect anything else:
    • Select Create separate module per source set
    • Select Use default gradle wrapper (recommended)
    • In the Global Gradle settings section:
      • If Offline work is selected, unselect it
  • Give the project a bit of time to create and index its files

3) Install RSMod

  • On the top-right there should be a box Add Configuration..., click on the box
  • On the top-left of the Run/Debug Configurations window, click on the + button
  • Select Gradle from the drop-down menu
  • In the Unnamed Gradle task, you should now fill in the Configuration
    • Gradle project click the folder button on its right side and select the :game option
    • Tasks set value to install
    • Arguments set value to -x test
  • Now hit the Ok button
  • Next to the new button that should appear where the Add Configuration... was previously, there should be a green run button, click on that and let the installation begin.

4) RSA key setup

RSA is a method to stop man-in-the-middle (MITM) attacks on packets. RS Mod has this method enabled by default, no two servers should use the same private key so you must create your own:

  • After the install task completes, it will print out a message on the IntelliJ console
  • Once your key is created, you will have to follow the instructions on the terminal/command prompt
    • You need to copy the public keys you are given and replace them in your client
    • In your client, you can find the text BigInteger("10001 which will usually be the place where you need to replace both the public keys (the "10001" key is usually the same)
    • Once you have replaced the keys in the client, you can restart the server and launch your client

5) Choose your revision

Now you're ready to start choosing the direction of your server!

  • Go to the archives page and select a revision you want your server to run on: https://archive.runestats.com/osrs/
  • Download whichever archive you want
  • Open the archive that you downloaded
  • Copy the files in its "cache" folder and place them in your RS Mod folder ${rsmod-project}/data/cache
  • Create the folder ${rsmod-project}/data/xteas/
  • Copy the file xteas.json and place it in the xteas folder you just created

6) Run the Server

This step is similar to step 3) Install RSMod

  • On the top-right there should be a box Add Configuration..., click on the box
  • On the top-left of the Run/Debug Configurations window, click on the + button
  • Select Gradle from the drop-down menu
  • In the Unnamed Gradle task, you should now fill in the Configuration
    • Gradle project click the folder button on its right side and select the :game option
    • Tasks set value to run
  • Now hit the Ok button
  • Next to the new button that should appear where the other configuration was previously, there should be a green run button, click on that and the server should begin to run.

Troubleshooting

  • Where can I get a client?
  • I receive a Bad session id message on the log-in screen
    • This means the RSA keys on the client do not match the ones created on the server. You should try to follow the steps in 4) RSA key setup again.
  • I receive a Revision mismatch for channel console message when trying to log in
    • Find the revision of your client (not cache)
    • Open ${rsmod-project}/game.yml
    • Edit the value for revision: 180 to match your client's revision
  • I receive a error_game_js5connect error on the client console
    • You need to launch the server first and then the client
  • When following 2) Open the project in IntelliJ my IntelliJ throws the error Build model 'org.jetbrains.plugins.gradle.model.ExternalProject' for root project 'gg.rsmod'
    • This appears to be an issue that can be solved by upgrading your IntelliJ
  • I receive a java.lang.NoClassDefFoundError: Could not initialize class class_name_here when trying to log into the client
    • The RSA key you copied to the client should not include \n at the end - remove it.

FAQ

One or more of my plugins stopped working

  • When you buy, or create, and use a Plugin JAR - the plugin uses code it assumes you have on the core game module when it was written. If for some reason you move, rename, or completely delete the code that the plugin is using - the plugin will stop working.
  • Notes:
    • You can add new code to the game module without this being an issue, this includes adding code to existing methods and files. However, it's best to avoid writing code to the game module and you should always opt to write a suggestion for the RS Mod creators to add specific features to the official game module.

I have done some modifications to the game module. How can I tell if one of my plugins is no longer compatible?

  • The only way to check is to download the plugin's source files and run it on your server and see if it compiles correctly!
  • Notes:
    • You only have to worry about JAR plugins suddenly becoming incompatible when you edit the game module code
    • Delete or move the JAR plugin when you add the source plugin, otherwise the plugins will conflict when trying to bind them on server start-up
    • In the future, we will add a tool to check if any of your JAR plugins are no longer compatible with your game module

I would like a feature added to the core game module

  • If you would like a feature added, you can create a Pull Request on GitHub or contact [email protected]

I found a bug, where can I report it?

Acknowledgments

    • Using Cache module from RuneLite
  • Graham Edgecombe
    • Using project structure based on Apollo
    • Using StatefulFrameDecoder, AccessMode, DataConstants, DataOrder, DataTransformation, DataType, GamePacket & GamePacketBuilder from Apollo
  • Major
    • Using Collision Detection from Apollo
    • Basic idea behind the Region system (known as Chunk on RS Mod)
  • Polar
  • Sini
    • Advice on improving RS Mod's infrastructure
  • Kris
    • Always willing to lend a hand and share some code
  • Bart and Scu11
    • Helped solve an issue with setting up KotlinScript
  • Bart (from original OSS team)
    • The basic idea behind certain features such as TimerSystem, AttributeSystem and Services
    • The basic idea behind user-friendly plugin binding
  • Rune-Status
    • Discord members lending a hand and being helpful

rsmod's People

Contributors

dennissnijder avatar jeztc avatar joshua-f avatar tomm0017 avatar tristonplummer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rsmod's Issues

Mocking

Add support for mocking in tests

Use Alpine Docker image and multi-stage building

https://github.com/Tomm0017/rsmod/blob/master/Dockerfile#L11

The distributor of the zenika/kotlin:1.3-jdk8 image also provides Alpine images which will reduce the size down by roughly 500mb:

Screenshot from 2019-03-26 23-10-40

Though a better solution would be to make use of multi-stage building using either one of those images presented above for just building a fat JAR:

# Start with the Alpine image for building (You can also use the larger one as this image will be discarded eventually)
FROM zenika/kotlin:1.3-eap-jdk8-alpine AS builder

# Imagine Gradle commands here building our fat JAR

# Restart using probably the smallest JRE image available
FROM openjdk:8-jre-alpine

# Copy over the fat JAR
COPY --from=builder /my_fat_jar.jar /app/

This fat JAR would include everything RS MOD needs. The JAR can then be copied over to an OpenJDK based JRE image as this image is even smaller than the Kotlin Alpine one.

Non-combat NPCs can be attacked

Expected Behavior

Non-combat NPCs such as Bankers, Shop keepers shouldn't be able to be attacked with magic.

Actual Behavior

If you cast a magic spell to any NPC, it hits them and they won't respawn.

when you die for npc

Expected Behavior

if player dies to an npc and u back to fight the same npc , both will fight

Actual Behavior

if the player dies to an npc and that player back to fight the same npc , the npc will not fight just the player

Steps to Reproduce the Problem

1.fight npc
2.die to that npc
3.fight the same npc again

Add method to stun player

There should be a method to stun the player as in freeze them to a location and set a flag on the player that can be checked to see if they are stunned before doing an action. Useful for thieving, and weapon special attacks amongst other things.

NPC Path Finding

Redo SimplePathFindingStrategy. Current one is awful and doesn't even support diagonal movement.

Support for dynamic object options?

Some objects only have objects when a specific varbit is set - can we add support for this somehow? The example I'll give is the Mysterious Ruins for Runecrafting. When varbit 607 is set to 1, the 'enter' option on the Mysterious Ruins for the Air Altar is shown, however this throws an exception when starting the server as 'enter' is not a valid option for the object.

package gg.rsmod.plugins.content.objs.runecraftruins

import com.google.common.collect.ImmutableSet

data class RunecraftRuinsType(val id : Int, val talisman : Int, val tiara : Int, val varbit : Int, val destination: Tile)

val ruins = ImmutableSet.of(
        RunecraftRuinsType(id = Objs.MYSTERIOUS_RUINS, talisman = Items.AIR_TALISMAN, tiara = Items.AIR_TIARA, varbit = 607, destination = Tile(2841, 4830))
)!!

ruins.forEach { ruin ->

    on_item_equip(ruin.tiara) {
        player.setVarbit(ruin.varbit, 1)
    }

    on_item_unequip(ruin.tiara) {
        player.setVarbit(ruin.varbit, 0)
    }

    on_obj_option(obj = ruin.id, option = "enter") {
        if (player.getVarbit(ruin.varbit) == 1) {
            player.teleport(ruin.destination)
        }
    }
}

NPC Respawn

Expected Behavior

Npcs should become invisible on death if they respawn

Actual Behavior

Npcs are de-spawned from the world and a new npc is constructed after death delay

follow / trade / report

Expected Behavior

when u follow or trade other player , your player must follow or trade the player u have clicked on

Actual Behavior

if u talk to npc first and then tried to follow or trade or report other player , your player will talk with npc

Steps to Reproduce the Problem

1.talk to npc first
2.try to follow or trade or report other player
3.

Player Death

Implement player death
Don't forget to call World.instanceAllocator.death

Serving JS5 client archives

Expected Behavior

Serve back archives to clients independently from the Netty thread, either through its own thread pool or an independent app.

Actual Behavior

Serves back archives to clients on Netty thread, which can cause delay on other Netty operations

A player.hasItem function

There should be a function that you can use to see if a player has a specified item on their person (equipped, in inventory, or in looting bag) or in their bank and should return the number of that item. This would be used for items that a player should only have 1 or a certain amount of. Such as clue scrolls, quest items, etc.

kill an npc with ranged weapon

Expected Behavior

when you kill any npc it should die and respawn normally without any problems

Actual Behavior

when you kill the npc with range , the npc will not die and u cant attack it again

Steps to Reproduce the Problem

1.wear ranged weapon with arrows
2.kill any npc
3.

here is the error when u kill npc with range
https://pastebin.com/AJNvadmM

on_area plugins

Add support for plugins that are executed when players enter certain areas

NPC Combat Def

Move the values in NpcCombatDef to NpcDef to keep everything in one place and make it easier when we pack these values into the cache and decode them on startup

bank deposit box with placeholder

Expected Behavior

if u have placeholder for any item in ur bank and u deposit ur items , the item should go to their place.

Actual Behavior

when u have placeholder for any item in the bank , and u deposit the item it takes new place

Steps to Reproduce the Problem

1.make place holder for any item
2.deposit that item by bank deposit box
3.go check ur bank

Lunar Teleport GFX

Expected Behavior

Lunar teleports should play a gfx when being cast

Actual Behavior

Lunar teleports do not play a gfx

Steps to Reproduce the Problem

  1. Switch to lunar spellbook (set varbit 4070 to 2)
  2. Use a teleport spell

Client force-logout on chat message

Expected Behavior

When a player sends a chat message, the message goes to the people in the general area.

Actual Behavior

When a player with privilege id 0 sends a chat message their client, as well as ones in the area, will crash. My only guess is the icon id for the privilege being -1 in game.yml

Steps to Reproduce the Problem

  1. Log into an account with privilege 0
  2. Send a chat message
  3. Observe the crash.

Error in client is as follows:
Error: class242:278 client:1420 client:2913 client:2523 class52:381 class52:613 Thread:844 | java.lang.NullPointerException | 79,60,67,778,3084,3499,-110,-64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

ItemOnItem handling

Need support for ItemOnItem actions for things such as combining items/skills(firemaking, herblore)

Combat XP greater than damage hit granted.

If you roll a higher hit than an NPC (and presumably player, though not tested) has, it grants xp for the damage that was rolled, and not the damage that was hit.

Example:
an NPC has 8 hp left and you roll a 10, you get xp for the 10 damage even though you only hit an 8

Regional Music System

Implement a music system which plays tracks based on which region the player is standing in. I'll write all the data.

After doing ::max command you can't attack

Expected Behavior

When you do ::max it should just say your max hit and accuracy and be able to continue combat.

Actual Behavior

After doing ::max (at least with level 1 stats) it spams in chat "Your magic level is not high enough for this spell" and even clicking to change combat styles, it still gives the same message. Also, there may be a logic issue with the ::max command as I'm not sure how a character with all level 1 stats can hit a 21.

Steps to Reproduce the Problem

  1. Create a character and log into the server
  2. Initiate combat with an npc
  3. do ::max

Levels still continue up past 99

Levels will continue to level up past level 99 until ~190m xp. The highest level I was able to see is level 125/99 then as I approached 200m xp it went to level 99/99

NPC Collision Flag

Add support for npc collision flags as npcs shouldn't be able to walk on top of one another

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.