Types of packet


We have concluded that we need to do something about determining the type of packet sent. There will be a number of communications between each client and the server, so I have made a Packet class that contains a pointer to another type of packet, and an enum int to specify what time of message it is. Currently this is not being sent over the server correctly yet, but we are working on it.

It would be simpler if the Packet class was the parent of each individual class, but instead it needs to be separate. A BasePacket class was made to be the parent of each packet, so that the actual Packet class could have a generic pointer that points to any of them. Working with virtual functions to handle this inheritance is irritating.

Leave a comment

Log in with itch.io to leave a comment.