Thread: Setup RSMod v2 + OpenOSRS/RuneLite or just OpenOSRS/RuneLite

Results 1 to 4 of 4
  1. #1 Setup RSMod v2 + OpenOSRS/RuneLite or just OpenOSRS/RuneLite 
    Contributor


    Join Date
    Jul 2010
    Posts
    450
    Thanks given
    256
    Thanks received
    268
    Rep Power
    1305
    RSMod v2 + RuneLite Setup Tutorial

    If you've seen either original RSMod v2 repo or my (partial) rev upgrades, you might also wonder how to set them up.
    This tutorial will cover getting that done. Tutorial will be aimed at around intermediate level, although if you're a beginner,
    you might still be able to follow the tutorial just fine.


    If you only want to setup OpenOSRS/RuneLite, you can do that as well. You just skip the sections related to RSMod.



    DISCLAIMER! @Tomm0017 does not intend for this to be used yet, especially not for production.

    NOTE! Do not private message me or anyone else about help with setting this up.
    If you need help, ask in this thread or in #free-help in the Discord server. I will not provide any help through direct messages,
    and I'm sure most or all of the people mentioned here also appreciates not being bombarded with help requests.


    DISCLAIMER! Not all of the steps are necessarily the best ways to get things done, and certainly often not the only way.
    If you have additions/improvements/corrections for the tutorial, please don't hesitate to reply to the thread with your input!

    Also side note! I'm sorry if you use bright forum theme and this tutorial is terrible to read. I personally use a dark theme.



    Important
    - Please make sure to read and respect the disclaimers above!
    - Please do not use the plugin hub that is configured by default. If you need to download plugins, please set up your own plugin hub.
    I've made a tutorial on how to do that as well, which can be found here: https://www.rune-server.ee/runescape...lugin-hub.html
    - Before asking for help anywhere at all, please make sure to also read the FAQ at the bottom of this post.



    Prerequisites
    So before we get started, I assume you have the following things.
    All though not all of them are equally necessary, but will help you along the way.

    - Installation of IntelliJ (or other preferred IDE preferably with Git integration)
    - [Optional] SSH Key added to your GitHub account.
    - Basic Git Knowledge
    - Basic IntelliJ Knowledge + Using it With Git
    - OSRS Cache Matching Target OSRS Revision
    - Finding Revision Matching OpenOSRS/RuneLite Version
    - [Optional] Programming Knowledge
    - [Optional] Some Kotlin knowledge
    - [Optional] Basic Gradle Knowledge
    - [Optional] Basic Maven Knowledge

    Little Disclaimer! I will not cover Eclipse or official RuneLite repository. I will only cover IntelliJ and OpenOSRS.
    However you should be fine to follow this tutorial even with Eclipse and/or offical RuneLite repository.

    Although I recommend having an SSH key configured and added to your GitHub account, it's not necessary.
    However, you'll have to know how to download the required version yourself.
    You'll still be able to follow this tutorial to figure out which is the required version.

    Depending on which OpenOSRS/RuneLite version you target, you may encounter Maven and/or Gradle. Some versions have both.


    Skip this section if you don't care and want to get to the good stuff. Otherwise, let's talk about the optional prerequisites;
    you may be able to setup and mess around with this project just fine without them, but it'll be significantly worse.
    If your intention is to write code/content for the server, you will find that very difficult without knowing either Kotlin or other programming languages.
    If you know other programming languages, you will probably have an easier time however.

    Where do you get a cache for the respective OSRS revision?
    I personally use https://archive.runestats.com/osrs/, which is maintained by @Polar.
    Although there is also https://archive.openrs2.org/ which is maintained by @Graham.
    So thanks a lot to both of them who continue to maintain these archives, enabling us to easily get our hands on previous and current (OS)RS caches and clients.

    Where to get RSMod v2 and which OSRS rev does it support?
    - 194 - https://github.com/rsmod/rsmod (official repository)
    - 199 - Refer to my thread about it.
    - 200 - There is a partial rev upgrade for this in my fork (forked repository)
    - 201 - Refer to my thread about it.
    - 202 - I haven't yet done the rev upgrade to 202, but planning to, so stay tuned!

    How do I find the correct OpenOSRS (or RuneLite) version?
    Head over to their repository (https://github.com/open-osrs/runelite), and find the first commit for following revision.
    1. Press CTRL+K (COMMAND+K on Mac presumably).
    2. Type "Update <TARGET REVISION + 1>" so for 201, you'll do "Update 202", then hit Enter.
    3. Press "Commits" in the left tab, and you should (hopefully see one commit). Click it.
    4. In the URL you have a hash reference for that commit, copy that (example: f5e16493b2d633976b167c600cd1e2517eeab5b2)
    5. Go to the overall commit history of the repository and hit "Older" at the bottom.
    6. Replace the hash in the URL with the one from step 4, and change it to before instead of after. Also change from +34 to +35.
    Example: https://github.com/open-osrs/runelit...&branch=master
    7. You should (hopefully) now see the commit with the updated revision support at the top, you pick the first commit under that.
    8. Which for 201 would be https://github.com/open-osrs/runelit...fa017980b7769b
    9. From here you can either download the repository as ZIP file from this particular version (I assume you will know how to do that).
    Alternatively you can carry on, and do it the way I personally prefer.

    Here is my list:
    - 201 - Latest commit for OSRS #201 support: https://github.com/open-osrs/runelit...861b4b24ae7d46
    - 199 - Latest commit for OSRS #199 support: https://github.com/open-osrs/runelit...72b7ad4e7ff897

    Now we're ready to get into IntelliJ. Assuming you use SSH key, otherwise you'll want to skip this and figure out how to get this done yourself.
    1. Pick appropriate option:
    Welcome Screen: Get from VCS
    Already Open Project: Click File -> New -> Project from Version Control...
    2. Go to the front page of the repository, and click the green "Code"-button.
    3. Copy the SSH URL (at this time, and probably any time in the future) being:
    Code:
    [email protected]:open-osrs/runelite.git
    4. Paste it in the dialogue in IntelliJ asking for URL and click "Clone".
    5. Wait for IntelliJ to do it's job...
    6. When project is open, IntelliJ still wants to do some work, indexing, download dependencies etc. However we don't need to wait for that.
    7. Click Git in the bottom of IntelliJ
    8. Click the "Log" tab, and you'll see the commit history of this repository.
    9. Now with the commit we found in the step by step list above, you'll search the history.
    10. You simply take the commit hash and paste it into the search field (the little one right above the commit history).
    11. You should get one result, right click it click "New Branch" and name it whatever you want (for example "rev-201")
    12. Now you wait for IntelliJ to index and download necessary dependencies.

    Note! Some versions still have a Maven pom file as well, you'll have to import that as a Maven project.

    That concludes it for how to find and get the targeted version of RuneLite/OpenOSRS.



    Getting Server Online
    I assume by now, you've checked out the appropriate server for your target revision.
    So let's get this server running for you, so we can connect the RuneLite client.
    1. Add the cache into <PROJECT ROOT>/all/data/cache/packed (which is where the .idx files and .dat2 file goes)
    2. Add the XTEA keys json in the folder above.
    3. Run the "createRsa" Gradle-task from command line or from the Gradle task browser to the right in IntelliJ.
    4. Make sure to take note of the client key because you'll need that in order to connect to the server.
    I personally just create a client.txt in the RSA folder for convenience. Don't add it to the tracked files and push it though.
    5. Create a "config.yml" file in root of the "all"-module, look at "config.example.yml" for reference.
    6. Now run the Gradle task "run" from either command line or IntelliJ's Gradle task browser.
    7. Let the server start up.

    About 5., there are more config options, I won't however be going through that in this tutorial.
    You can however look at RSMod v2s config system and figure it out on your own.

    Also 7., you'll probably get an error about "banker_1618", this can be regarded as a warning.
    I won't go over how to fix it for this tutorial, but it should be a simple fix, so perhaps that's something to initially as a way to familiarize yourself with RSMod v2.



    Getting Client Connected
    Assuming you've followed the sections above and started up your server, you probably want to connect to it to play.

    First of all; RuneLite and OpenOSRS are catering around official OSRS, not RSPS.
    What this means for you is that you need to change the RSA keys (we already made them in the section above).

    Now there are two ways to apply the new RSA keys, I will only cover one of them. I'm not comfortable enough writing a tutorial for the other one.
    Kyle Escobar was kind enough to share this RuneLite plugin which makes this a breeze: https://cdn.discordapp.com/attachmen..._rev-199.patch
    So all you need to do is download that patch file, go into OpenOSRS project in Intellij, then follow the steps:
    1. Top of IntelliJ, click Git -> Patch -> Apply Patch...
    2. Locate your downloaded patch file, click it, click Ok.
    3. You'll get a window showing which files are changed and what changed in each.
    4. You can look at the changes, or just press "Ok".
    5. After pressing "Ok", a new window might appear, asking you to approve some changes. This should be fine.
    6. Now you should be able to use this plugin.

    Preparation steps are now taken, there are however a couple steps more we need to take.
    This is especially if you're running a target revision older than official OSRS.

    1. You need to create your own jav_config.ws, as the one OpenOSRS/RuneLite will get by default fool
    2. Go here and copy this file: https://oldschool.runescape.com/jav_config.ws
    3. You'll want to change:
    - codebase=http://127.0.0.1/
    - initial_jar=gamepack.jar
    4. You'll now want to change the "runelite.properties" file, found in "runelite-client/src/main/resources/net/runelite/client/runelite.properties"
    - runelite.jav_config=<YOUR JAV CONFIG URL>
    - runelite.jav_config_backup=<A JAV CONFIG BACKUP URL (can be same as above)>



    Follow steps below if you're using a version that is older than official OSRS' revision (at the time of writing older than #202).

    You'll now have to make a little modification to the RSMod v2 server, so it can serve the gamepack jar (the OSRS client it injects).
    Disclaimer! Changes/additions below is a workaround/cheap fix, and would need to be improved for a production server!
    Note that you also will need to have port 80 available for this to work. So if anything else on your PC is occupying port 80, you need to find a solution on your own. (example XAMPP will occupy port 80)


    You can also use this to serve the jav_config.ws, otherwise I personally just used GitHub's gist and gave the properties file the raw URL to it.

    1. Update "all/build.gradle.kts"
    Add following dependencies:
    Code:
    implementation("io.ktor:ktor-server-core:1.4.0")
    implementation("io.ktor:ktor-server-netty:1.4.0")
    implementation("ch.qos.logback:logback-classic:1.2.5")
    2. Create new file "all/src/main/kotlin/org/rsmod/HttpServer.kt" (so you have Serer.kt and HttpServer.kt in the same package)
    Code:
    package org.rsmod
    
    import io.ktor.application.*
    import io.ktor.response.*
    import io.ktor.routing.*
    import io.ktor.server.engine.*
    import io.ktor.server.netty.*
    import java.io.File
    
    fun main() {
    
        embeddedServer(Netty, port = 80) {
            routing {
                get("/") {
                    call.respondFile(File("./all/data/gamepack.jar"))
                }
                get("/gamepack.jar") {
                    call.respondFile(File("./all/data/gamepack.jar"))
                }
            }
        }.start(wait = true)
    }
    3. Reload the Gralde project to import the new dependencies, that will remove the red lines in the new file.
    4. Get the gamepack.jar from the downloaded archive and put it in the data folder root, and name it "gamepack.jar".
    5. Run the main method of this HttpServer file (since this is not a Gradle task, it'll assume it starts from project's root, hence why you have to specify ./all/data/gamepack.jar for path)


    Now that all of the above should be done, you should be ready to start your OpenOSRS/RuneLite client.
    1. Run the Gradle task "RuneLite.main()" either from command line or from IntelliJ's Gradle task browser. (ditch the parantheses when running through command line)
    2. When at the login screen, you open the RuneLite settings and search for "Private Server".
    3. Now you want to make sure it's activated and you need to click the cog wheel and add your RSA public modulus (the one generated while setting up the server)
    4. Then make sure codebase is Welcome to nginx!.
    5. Now you can login to the server.

    That concludes it for the tutorial! Happy coding!



    "FAQ" - Guessing of common questions

    Q: RuneLite says it's not updated for this version, what do I do?
    A: This means RuneLite isn't injecting the appropriate gamepack.jar. You need to revisit the steps to take for revisions older than official OSRS.

    Q: How do I host this for my friends?
    A: If you can't figure that out from this provided tutorial, you likely shouldn't bother. This tutorial is only intended for you to personally mess around and explore RSMod v2.

    Q: I want to host the server for everyone to play! How do I do that?
    A: You don't! This is not ready for production, and should not be used for production. If you needed this answer, you should throw away this question and look at alternatives:
    Kronos, OS-Scape, RSMod v1 or Alter (based off of RSMod v1)
    All of these should be possible to add OpenOSRS/RuneLite for in a similar fashion too. Aside from Kronos that already comes with RuneLite.

    Q: RuneLite shares config with actual OSRS RuneLite, how to fix?
    A: This is because I haven't bothered to include how to change the config directory. Should be a simple fix for you to get that done.

    Q: How do I push my RuneLite repo to my own on GitHub?
    A: You need to create a new repository on GitHub and add it's URL to the remote origin in your local RuneLite project.
    If this isn't understandable for you; I suggest looking into and learning some Git basics.
    Reply With Quote  
     


  2. #2  
    HEAD GFX DESIGNER

    Rusko's Avatar
    Join Date
    Aug 2010
    Posts
    3,316
    Thanks given
    645
    Thanks received
    1,199
    Rep Power
    5000
    excellent work noz
    Attached image
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Contributor


    Join Date
    Jul 2010
    Posts
    450
    Thanks given
    256
    Thanks received
    268
    Rep Power
    1305
    Quote Originally Posted by Rusko View Post
    excellent work noz
    Thanks, made sure to put some effort in while at it. Fine thing with this, it can also be used to setup RuneLite for any other server tbh.
    Reply With Quote  
     

  5. #4  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Posts
    2,622
    Thanks given
    201
    Thanks received
    813
    Rep Power
    1462
    Very informative and useful post. Thanks.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Dreamscape Client V2!
    By excloona3 in forum Downloads
    Replies: 23
    Last Post: 06-24-2015, 05:38 AM
  2. [Final Release] Project blue V2...
    By Sam Server in forum Downloads
    Replies: 73
    Last Post: 05-02-2013, 04:14 PM
  3. GangScape v2
    By Ric914` in forum Downloads
    Replies: 22
    Last Post: 11-03-2008, 05:57 PM
  4. Replies: 16
    Last Post: 01-16-2008, 12:36 AM
  5. Replies: 29
    Last Post: 10-31-2007, 03:56 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •