Added a lot of packet handling, the server is about to go for a rewrite.