This project provides a basic TCP client implementation in C++. It does not include predefined packets but allows for easy packet handling.
- Create a new file inside
Packets/Client
. - Define a function that takes a pointer to
CallingInstance
as an argument. - Register it in
createMessage
by adding it to the appropriateswitch
case.
- Create a new file inside
Packets/Server
. - Define a function that takes
vector<uint8_t>
andCallingInstance
as arguments. - Register it in
handlePacket
by adding it to the appropriateswitch
case.
- Modify
Classes/CallingInstance.h
to define a new struct for packet-specific data. - Add the struct to
CallingInstance
and set values inside the client packet. - The server packet can then utilize this data.
- Use
Messaging::createMessage(packetID, callingInstance)
to send a packet to the server.
This setup allows for easy expansion and customization of packet handling within the client-server architecture.