[Only registered and activated users can see links. ]
Index_gl is NOT working as for now, don't know yet why. (probably .dat4 related.) Libs come only in windows x32. I'll be looking for x64/linux/mac in mitb/oldrs.
Currently missing player updating and packet decoders, will update after i manage to learn the base a bit better.
This is the ORIGINAL ScapeEmulator, with NO bugfixes, no new features, no new nothing. Original ScapeEmulator. Auto-login protocol (protocol id in 592: 24) is NOT converted. Rest are.
Login Region packet bit-block encoding is basic, and so incomplete that it only sends raw data. Player updating has NOT been started.
EDIT:
Spoiler for Auto World converted:
Code:
package net.scapeemulator.game.net.auto;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.MessageBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import net.scapeemulator.util.Base37Utils;
import net.scapeemulator.util.ByteBufUtils;
import net.scapeemulator.util.crypto.RsaKeySet;
import java.io.IOException;
public final class AutoLoginDecoder extends ByteToMessageDecoder {
public enum State {
READ_SIZE, READ_PAYLOAD;
}
private State state = State.READ_SIZE;
private int size;
private int version;
@Override
public void decode(ChannelHandlerContext ctx, ByteBuf buf, MessageBuf<Object> out) throws IOException {
if (state == State.READ_SIZE) {
if (!buf.isReadable() && buf.readableBytes() < 3)
return;
state = State.READ_PAYLOAD;
size = buf.readUnsignedByte() - 2;
version = buf.readUnsignedShort();
}
if (state == State.READ_PAYLOAD) {
if (buf.readableBytes() < size)
return;
int encryptedSize = buf.readUnsignedByte();
if (encryptedSize != size - 1)
throw new IOException("Encrypted size mismatch.");
ByteBuf secureBuffer = ByteBufUtils.rsa(buf.readBytes(encryptedSize), RsaKeySet.MODULUS,
RsaKeySet.PRIVATE_KEY);
int encryptedType = secureBuffer.readUnsignedByte();
if (encryptedType != 10)
throw new IOException("Invalid encrypted block type.");
secureBuffer.readUnsignedInt();
String username = Base37Utils.decodeBase37(secureBuffer.readLong());
secureBuffer.readInt();
String password = ByteBufUtils.readString(secureBuffer);
secureBuffer.readInt();
out.add(new AutoLoginRequest(version, username, password));
}
}
}
Also go to HandshakeMessage, and change SERVICE_AUTO_LOGIN to 24.
[Only registered and activated users can see links. ]
Spoiler for Set-up guide and original features by graham and Jonneh:
Originally Posted by Jonneh
Intro
ScapeEmulator is a RuneScape server emulator, created by myself and Graham, which targets build 530 of the game. It is written in Java 7, and can be built with Apache Maven.
It is released under the ISC license: [Only registered and activated users can see links. ]
The following third-party libraries are used:
JUnit
SLF4J
APIviz
ObjectWeb ASM
Netty 4
MySQL Connector/J
Download
Everything: [Only registered and activated users can see links. ]
Server code only (no cache/client etc.): [Only registered and activated users can see links. ]
Setup
A rough guide of how to get it working (on a UNIX-like system such as Linux)
Generate a keystore:
Code:
cd util/data
./mkkeystore
Compile, run unit tests and generate Javadoc:
Code:
mvn compile test javadoc:aggregate
Generate RSA key:
Code:
cd util
java -cp ... net.scapeemulator.util.crypto.RsaKeyGenerator
# then manually place the RSA key in src/main/java/net/scapeemulator/util/
# crypto/RsaKeySet.java
Recompile with the RSA key now in place:
Code:
mvn compile
Generate and sign client jar/pack200 files:
Code:
cd asm
java -cp ... net.scapeemulator.asm.ClientBundler
Copy example serializer configuration into place:
Code:
cd game/data
cp serializer.conf.example serializer.conf
Launch game server:
Code:
cd game
java -cp ... net.scapeemulator.game.GameServer
Point your Internet browser to [Only registered and activated users can see links. ] and login with a username and password of your choosing. If the OpenGL client does not work, you can also use index.html or index_unsigned.html.
The example serializer configuration as used above makes the server use a 'dummy' serializer. Any username/password works, and players are not saved. To provide proper persistence, the MySQL serializer must be used.
Setting up MySQL is beyond the scope of this README, but once it has been done, to set up persistence you should:
Import the database schema:
Code:
cd unpackaged
mysql -hHOST -uUSERNAME -pPASSWORD DATABASE < schema.sql
Update serializer.conf:
Code:
cd game/data
cat >serializer.conf <<EOF
type=jdbc
url=jdbc:mysql://HOST/DATABASE
username=USERNAME
password=PASSWORD
EOF
Manually create a user in the MySQL database. You'll also need to hash the password manually with bcrypt. There's no automated tool for doing this, sorry, and registration in the game is not functional.
Launch game server and web browser, as above. Login with the username and password you created in the previous step.
Originally Posted by Graham
An explanation of some of the cool stuff it's got:
Support for obscure parts of the protocol
As well as world list, ondemand, jaggrab and in-game support, it also has support for the auto login protocol (this is used in the signed clients where it has 'World: Auto', and the server sends back a world number for the client to connect to) and the registration protocol (although unfinished - the codecs are complete, but not the logic for dealing with them.)
Tools for creating a client using the original loader/client jars
The tool uses ASM to replace the parts of the bytecode (e.g. the hostname checking, the CRC checksums, the RSA key, the cache path) so that the original client/loader can be used to connect to the server. There's an in-built HTTP server to demonstrate this, just visit [Only registered and activated users can see links. ] when the game server is running.
Also I managed to find the native libraries corresponding to the version of JOGL jagex used at the time, so the client should work across Windows, Mac and Linux - 32 and 64 bit. Unfortunately I have no Mac to test it on though - but it has been tested on Windows and Linux. The unsigned client ofc works across all of them as it does not load the native libraries.
Benchmark
Tom asked for some benchmarks. There is a flooder module for you to test it on your own PC, but connecting 2k players on my PC (i5-2500k, 24g of RAM), the mean cycle time is ~92ms, with a standard deviation of ~14ms.
Some things ScapeEmulator lacks!
As it states in the README, you shouldn't just flock to this instead of using Apollo. Apollo is still your best choice for old engine servers, but it was never designed with the new engine in mind. So if you are making a new engine server, this may well be your best choice, but otherwise, I'd still recommend use of Apollo and carrying on with the development going on there (buroa, chris fletcher, etc. have released some really good stuff for Apollo.)
Some things Apollo has that this doesn't are: plugin system, multi-threaded updating, multi-protocol support, walkback support in the walking queue (although this would probably be reasonably easy to rip out of Apollo and add.) There are probably more.
I'm back.
ScapeEmulator #592 Convert [Only registered and activated users can see links. ]/[Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ]
For those who don't know: 592 is the last version before lobby and new hits.
I'm back.
ScapeEmulator #592 Convert [Only registered and activated users can see links. ]/[Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ]
New revision: 591 Released on 16 February 2010
Game Update On Date: 16 February 2010 Title: Familiarisation
New revision: 592 Released on 22 February 2010
Game Update On Date: 22 February 2010 Title: Impetuous Impulses Improvements
New revision: 593 Released on 3 March 2010
Game Update On Date: 3 March 2010 Title: RuneScape Lobby/Login Changes
New revision: 594 Released on 4 March 2010
Game Update On Date: 12 March 2010 Title: Bonus XP Weekend!
New revision: 595 Released on 15 March 2010
Game Update On Date: 15 March 2010 Title: The Blood Pact and Lumbridge Catacombs
New revision: 596 Released on 23 March 2010
Game Update On Date: 23 March 2010 Title: Fish Flingers
Revision Updated: 596 Released on 28 March 2010
New revision: 597 Released on 29 March 2010
Game Update On Date: 29 March 2010 Title: Egg-streme Management (Easter 2010)
New revision: 598 Released on 12 April 2010
Game Update On Date: 12 April 2010 Title: Dungeoneering Skill!
New revision: 599 Released on 13 April 2010
New revision: 600 Released on 14 April 2010
New revision: 601 Released on 16 April 2010
New revision: 602 Released on 21 April 2010
Game Update On Date: 21 April 2010 Title: Slayer Challenges
New revision: 603 Released on 28 April 2010
Game Update On Date: 28 April 2010 Title: Buyers and Cellars (and Thieves' Guild)
New revision: 604 Released on 3 May 2010
New revision: 606 Released on 13 May 2010
Game Update On Date: 13 May 2010 Title: DirectX Support and Graphics Options
New revision: 607 Released on 14 May 2010
New revision: 609 Released on 18 May 2010
New revision: 610 Released on 25 May 2010
Game Update On Date: 25 May 2010 Title: Free Player Friends List Expanded
Game Update On Date: 27 May 2010 Title: Castle Wars Improvements
Game Update On Date: 1 June 2010 Title: RuneScape Classic Temporarily Re-opened
New revision: 611 Released on 9 June 2010
Game Update On Date: 9 June 2010 Title: Court Cases
Revision Updated: 611 Released on 10 June 2010
Game Update On Date: 15 June 2010 Title: Ancient Effigies
New revision: 612 Released on 24 June 2010
Game Update On Date: 24 June 2010 Title: Free-to-play Quest Changes
Game Update On Date: 25 June 2010 Title: Miner Disturbance for iPhone, iPod and iPad
New revision: 613 Released on 5 July 2010
Game Update On Date: 5 July 2010 Title: Love Story
New revision: 614 Released on 14 July 2010
Game Update On Date: 19 July 2010 Title: Dungeoneering Update
Game Update On Date: 4 August 2010 Title: Extra Bank Space for F2P and Members
Game Update On Date: 10 August 2010 Title: A Void Dance
Game Update On Date: 19 August 2010 Title: Dungeoneering - The Occult Floors
Game Update On Date: 20 August 2010 Title: Cryptic Clue Fest II
Game Update On Date: 23 August 2010 Title: Bonus XP Weekend - 3rd to 6th 9
New revision: 616 Released on 25 August 2010
Very nice are you going to be working on it anymore?
Yes, earlier today I finished converting the original updating to the new format. I'll release an updated version later this weekend.
I'm back.
ScapeEmulator #592 Convert [Only registered and activated users can see links. ]/[Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ] [Only registered and activated users can see links. ]