Network Code Notes

This commit is contained in:
2025-01-21 10:32:09 -06:00
parent c80b9482a4
commit 1f0cc1bbfc
2 changed files with 33 additions and 1 deletions

View File

@@ -8,6 +8,25 @@ A Redacted Software Product
## Build and Run
## Dependencies
Redacted Software Packages
JLog, JTest, JEvent
ReWindowLibrary
J3ML
JGL
JUI
Sockets
Fedora Linux Package Dependencies:
mesa-libGL-devel
freetype-devel
libX11-devel
libXrandr-devel
## Playtest
## Report Bugs

View File

@@ -4,6 +4,19 @@
#include <Sockets/UdpServer.hpp>
/* Networking Design Notes
*
* All packets are prefixed with `CaveGame`'s ascii representation. This functions as a header.
* After that, an 8-bit number indicates the message type of the packet.
*
* Default to swap "keepalive" packets every second.
* https://www.gafferongames.com/post/virtual_connection_over_udp/
* https://www.gafferongames.com/post/reading_and_writing_packets/
* https://www.gafferongames.com/post/serialization_strategies/
* https://www.gafferongames.com/post/packet_fragmentation_and_reassembly/
* https://www.gafferongames.com/post/sending_large_blocks_of_data/
*/
class ArgsParser
{
public:
@@ -29,7 +42,7 @@ int main(int argc, char** argv) {
if (message == "ping")
{
udpServer.SendTo("ping", ipv4, port);
udpServer.SendTo("pong", ipv4, port);
return;
}