Originally Posted by
getBytes
So you may be wondering what a Packet is?
For starters a Packet is sent by the client to the server or vice versa depending what you want to do.
If you had a simple default case in your packetManager you would see that it prints out the packetId.
So what does this packet do? This packet allows communication between the client and server, the client sends the packet, the server accepts it, either defaults it or it goes into one of the cases there it is returned with the stream method.
For example, say we had just logged in, the client would send a packet to the server which should accept the connection and allow login to continue, but if you didnt have the packet, it would be classed as an unhandled packet and you would be waiting a short time at the login screen before it said error connecting time out.
What can we do to prevent these?
If you know what and how you made the packet they can be easily sorted by finding the right stream method to send back and adding it under your switch statement.
That is just the very basics of packets, packets can be used for hell loads more.
Thanks, any questions, just reply here.