First of all, I think this is a very good idea, but for a few improvements (cba to look at github):
Code:
Packet.send(session.context(), "send-message", "Welcome to runescape.");
- Not OO
- Referring to outgoing packets via string is a bad idea, people cannot see an existing list unless they go into the source, possible misspellings, etc, use a class or something of the sort
- I'd definitely prefer to use
Code:
session.context().writeAndFlush(new SendMessage("Welcome to runescape."));
as if it's that much of a problem, you can use a helper method like
Code:
player.write(new SendMessage("Welcome to RuneScape"));
(What server had that usage? Looks sick) - Also instead of using object varargs as the end parameter, I would make it so the outgoing packet class constructor contains the elements, what if a person doesn't know what arguments an outgoing packet contains? What if they don't know the order it should be in? All of that is avoided with the constructor containing elements/data