Hyperion or Apollo, I guess.
I have been learning from it for RuneSpire.
You can convert Hyperion's code for Netty, that shouldn't be too hard.
|
|
Anyone know of a framework that has been released or example that's similar to RS. I like the way rs handles their packets & am curious if there is anything similar using netty 4+. I'm to the point in my game where i'm ready to add multiplayer. I need to be able to send specific packets (ping, login, etc..) I'm only looking for a skeleton because I'll be using it a lot for a learning experience.
Hyperion or Apollo, I guess.
I have been learning from it for RuneSpire.
You can convert Hyperion's code for Netty, that shouldn't be too hard.
Really you should be creating your own packet system. The networking is specific to the application. Java In/outputstreams have the option to send objects, all you have to do is send two 4 byte ints (object byte size) (packet ID)
then on the other end you .read() for the size (byte[4] i = inputstream.read()), assign a new byte array to the size of the size: new byte[i], then read for the packet (byte[4] packetID = inputstream.read()), then read for the object and assign it to the byte array you created with the size of the object using
object u = inputstream.readObject(arrayName);
then do a case switch on the packetID
case 1: //walking packet ect
//cast object to class
(WalkingClass) a = (WalkingClass) u;
break;
Walking class will be serializable and visible to both the client and server (two copies or global scope (same project)).
and because .read() on the input/outputstreams are blocking methods they act as interrupts meaning optimal efficiency.
If you need more of an explanation add me on skype: KieranDevvs
| « Recreating a Social Media site like Twitter | IPB HELP [ Group icon image ] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |