Network Code Notes
This commit is contained in:
19
README.md
19
README.md
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user