Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've seen a lot of Runescape private servers lately. How do they work? Most of them are based on the old Runescape, but a few look exactly like the real Runescape.

How do they make the servers? Has the source code of the game been leaked on several occasions, and is that used to make Runescape servers? Or have some people just replicated Runescape, and tried to make the same game themselves (and "stolen" the 3D objects and texture from Jagex to make it look the same, and written the code to be able to replicate most functions of Runescape)?

share|improve this question
    
Not sure about Runescape, but both options are common. A lot of the early Ultima Online free servers were replication, and then the code was acquired and now all of them are based on the real production code. Often with heavy modification to add new features. I think WoW was always leaked code, harder to replicate it, UO leaked a lot of what needed to happen on the server through the client. –  DampeS8N May 9 '12 at 15:49
    
@DampeS8N Hmm, I'm a PHP-developer and I only understand Java, I can't write it. So I assume that replicating RuneScape and all it's features is a big job. I do not dear thinking about adding all the quests etc! –  Friend of Kim May 9 '12 at 15:51
    
I only remember playing on a few early UO clone servers, they didn't have all the features and made heavy use of ripped content. UO didn't have quests, so that wasn't much of a problem. I'd imagine that all modern free servers are based on leaked source or at the very least leaked software. (already compiled) –  DampeS8N May 9 '12 at 15:56
add comment

3 Answers

up vote 6 down vote accepted

Most Runescape Private Servers are coded in the Java language. For the most part, it's been a community effort. From the early days of Runescape classic, there was some leaked source, and from there it's been mostly the community reverse engineering updates as they come. Textures and images are found through URL-Manipulation, and some source code can be found to this day through such methods. Until late, a lot of the game could be analyzed through making a client, and then reading what gets sent to the client by the real Runescape server. Nowadays, you can get a lot of good source code for making your own, from large Runescape Private Server communities. You can get source ranging from a fully developed engine, all the way down to just a simple construct that needs to be fully scripted.

share|improve this answer
    
Actually, since its java, most of the code is downloaded then decompiled and hand edited from whatever the decompiler spits out. –  CobaltHex May 9 '12 at 17:17
    
@CobaltHex So, you are saying that you can get the .class files out of a real RS server?? –  Friend of Kim May 9 '12 at 18:38
    
@Bry6n How can you reverse engineer something you don't have? I mean, isn't the server just processing the input and giving the client an output? It doesn't give the client the code it has used to process the game? –  Friend of Kim May 9 '12 at 18:39
    
@50ndr33 The real server code and the private server code only need to perform the same actions, it doesn't need to be exactly the same. –  DampeS8N May 9 '12 at 18:51
    
@DampeS8N That's true. But if the PS developers have to make the code themselves, it would be a HUGE job! (By the way, is it actually legal to make private servers of Runescape?) –  Friend of Kim May 9 '12 at 19:04
show 1 more comment

What most people are saying here is entirely incorrect.

The process of developing a RuneScape private server is a bit complex.
Over the years, more and more RuneScape client revisions have been released. I believe the current revision is 724.
The RuneScape private server revision that you most commonly see is the 317 revision, possibly because the most work has been done on this revision. The RuneScape clients are obfuscated before they are released (ZKM obfuscator), but over the years several capable individuals from the RuneScape hacking scene have been able to "deobfuscate" these clients, in a sense. Once deobfuscated, the clients can be studied to understand how the game protocol works.

Let's take the 317 protocol for example. (Before you begin writing a private server/emulator, you need networking knowledge)
Firstly, you create the server. The server binds to port 43594 (the default).
After this, you'd need to set up a system to decode the incoming data being received from the client. The first part of data that is received from the client is the login protocol, which logs the user into the game (not going to describe how this works in detail). Basically, during this procedure, different data are exchanged between the client and the server, including the player's credentials.
Once the login procedure has been decoded, the server would perform player updating (in reality, the client updates the player, but the server would send packets to the client to tell it to begin the player updating procedure). The player updating procedure, well, updates the player (appearance, movement, etc.).
After these two have been completed, the player will be logged in game. Once logged in, the client and server send each other several different packets. These packets include sending interfaces and widgets, loading map regions, spawning items, and the like.
The opcode of a game packet is basically an identifier for the type of game action that the packet represents. The size of the packet is the amount of bytes that the payload of the packet carries, and the payload is an array of bytes that holds the actual data (information) of the packet (which is encrypted using the ISAAC cipher to prevent 3rd-party programs from tampering with the stream). A fixed-size packet is a packet whose payload size does never change, and the size for the specified opcode is already known between both client and server. A variable-sized packet is a packet whose payload size changes according to the situation of the game session.
Along with the standard data bytes that you can think of being sent to the client/server ([un]signed bytes, shorts, longs, the like), there are also special RuneScape data types. These have been named by the RuneScape hacking community but aren't JaGeX's official names for them. Here are a few:

  • JString - A C-Style string. The bytes of the string are written, followed by a terminating byte of 10.
  • "Special" bytes and shorts - Each special byte or short has a different read/write transformation. These are commonly known as special a, c, and s or add, invert, and subtract, respectively.
  • More come along in the later protocols...

A list of these packets can be found... places.

So, let's take a Netty server for example.

    class Server {
             // invoke serverhandler...
    }

Inside the server handler...

    class ServerHandler extends/implements? SimpleChannelHandler {
            @Override
            public void messageReceived(...) {
                    int handshake = buffer.readUnsignedByte();
                    if (handshake == 14)
                            // our cue to begin login protocol
                            channel.getPipeline().addLast("decoder", new LoginDecoder());
            }
    }

Inside the login decoder (a working implementation)

@Override
protected Object decode(ChannelHandlerContext context, Channel channel, ChannelBuffer buffer, State state)
        throws Exception {
            // Finish login and then replace the decoder with the packet decoder
        channel.getPipeline().replace("decoder", "decoder", new PacketDecoder(););
}

Then the packet decoder would handle the packets being received from the client. (handled using fancy event systems or packet managers)

There's more to it, but I don't feel like typing it all out now, so I'll finish later.

This is an example of a basic RuneScape emulator. (albeit a very bad one)

share|improve this answer
    
The link at the end is broken. –  Evan Teitelman Mar 3 '13 at 11:57
add comment

The way they work is based on creating private clients from decompiled (which has deobfuscated & renamed classes) source code of the the original client from Runescape's website. Those who made custom clients can read what kinds of signals are sent to the client and with the knowledge of knowing what is recieved, can replicate similar data from their own server.

Since this method is reverse-engineering the client in order to create a server the algorithms of Jagex's servers are not replicated exactly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.