RuneScape 2 Blitz by ~All-Go-Free~
Well, after seeing how horribly programmed WinterLove servers were, I decided to make my own server. I had already made a good packet reading/writing system that could be wrapped around standard IO, or could be powered by a NIO controlling class, which ran in its own thread doing all the actual IO. It allows a huge amount of incoming OR outgoing connects to be handled in one thread. The controlling class does all the underlying work, and the server only deals with streams of packets. This allows for improvements or more implementations of the underlying structure, without changing any code in the server. All that would be needed is a recompile.
I also wanted to use scripting and events to make things easier. And CFG files in my view are terrible. I used MySQL for storing data, as it allows for easy updating and a central database that all the Worlds can get information from, and you can edit scripts for something, such as commands, in MySQL, and then tell all the Worlds to reload the information into memory.
So it started off as 317, and I got this far then stopped:
Then, when 474 servers started to come out, I took a look at them and they were unstable pieces of crap. So I remembered that old project, and updated it to 474, and got this:
But 474 was slowly fading away because of the lack of 'MapData', and then 503 servers came along. Since I made it as upgradable as possible, up to 503 it went:
But, then came 508 servers. So once again, I updated it:
The server is also well programmed. Npcs and Players are both Entities, which own an object that implements Attackable. So, all code written for combat works on Npcs AND players. And all the data is loaded from MySQL into memory, even special attack code.
The server-side object system is also complete, and I now have the object packet! Both Woodcutting and Mining will just be scripts that pass themselves as an Event object to the player, so I could update either of them without even restarting the world. If you are interested, I used BeanShell as the scripting language, as it may be included with Java itself soon, plus it uses Java's syntax which makes scripting incredibly easy. Also, the login server is now complete!
Account loading and saving is done though the login server, which allows for very fast loading and saving over slow connections. Each piece of data implements a Data interface, with methods to convert the data to a byte array and create a Data class from a byte array. This makes it super easy to add player information to save.
More login server information:
Basically, the Login Server handles the loading/saving of Data objects attached to a Player. Even the Username is part of a Data object, which I named VitalData, that is automatically loaded for every user. The only information used in packets is the PID (unique Player ID). Everything that connects to the Login Server is a service that a user can connect too. For example. the RS2 Blitz worlds are services, and in the future if I make a game it will also be a service. A list of users on all the services is sent to every service and kept up to date, which ensures that one user is never on two services at once. This is also how the friends list will function, as the login server also forwards Private Messages. Data can be marked as global or non-global. Global data attached to a user is sent to every service, while non-global data is sent to only the service the user is on. And if you look at the JavaDoc, you will see that the login server is simple and lightweight, but VERY powerful. I think RSCD was planning to do something like this, but I guess I got to it first!
I've also uploaded the JavaDoc for the server, the Login Server, and my ~All-Go-Free~ APIs used in it. They aren't always up to date, but I do re-upload the JavaDocs every once and a while:https://www.worldscapeblitz.com/java/508javadoc/https://www.worldscapeblitz.com/java/agfjavadoc/https://www.worldscapeblitz.com/java/loginserverjavadoc/
Another great thing is that I can make large changes to the core NIO APIs, which I have done, and no changes to the server are needed.The server is now compatible with the HD client:
And thats the story of RuneScape 2 Blitz! I am working on it constantly, and I'm using it for my next server, WorldScape Blitz. I hope you enjoyed learning about the server!
Post as much as you want, I'm open to comments, suggestions, and criticism with appropriate reason.