The final solution to all RS communication: RSBuffer
I decided that I'd write up for you guys a legal, more safe, and easy-to-use way of communicating via the RuneScape protocol.
It's called the RSBuffer, and it's beautiful. It takes care of encryption for you, and provides a "getDecryption()" (and encryption should you need it) method that allows you to call "nextInt()" to get the next key to decrypt incoming packet opcodes. It starts out with a very low memory footprint (128 bytes) and will increase it's own size automatically when necessary. Unlike the current "stream.java", it is legal - it isn't ripped from a deob, I wrote this from scratch. It also uses more familiar naming conventions, like "int" instead of "dword". It also returns it's own instance for every "put" method so you can have method chaining, like so:
Code:
rsBuffer.createOpcode(10).putShort(5).put(14);
Naming Convention Changes
Here are the data-type naming convention changes so you guys know how to put this into your server.
Quote:
byte -> byte
word -> short
dword -> int
qword -> long
BigEndian -> LE
Frame -> Packet
So, "writeWordBigEndianA" would be, in RSBuffer, "putLEShortA".
This took me a few hours to write up for you guys (it's 1,409 lines - 30kb - of code), so I'd appreciate some thanks of course, but I'd appreciate it more if I saw it being used in your servers. It's legal, it's safer (wont crash your server unexpectedly), it's more familiar with the data-type naming conventions, and it's faster.
It also contains way more put/get methods than the wL stream has, or even ones that the client deobs have - just in-case you guys would ever need the extra methods (adding your own packets, etc). On top of all of that, it's 100% javadoc documented.
(note 12-16-2009 I had to fix some bugs, here is revision 2)
RSBuffer Source: http://pastebin.com/f324e8e6f
RSBuffer Documentation (zip): http://**********/v/QUCYPGVZ and http://www.megaupload.com/?d=RFNQ4ZSI
Good luck developing!
-Blake