Closed dbechrd closed 2 months ago
It's a public interface to allow higher level libraries to directly inject packets from memory into the protocol, to support some higher level functionality in Yojimbo. It's not used directly by netcode, but by other libraries that use netcode -- for example, when somebody wants to replace the netcode socket implementation with their own.
I don't understand why the function
netcode_server_process_packet
exists. It's nearly identical tonetcode_server_read_and_process_packet
, with the exception of setting anallowed_packets
filter, butnetcode_server_read_and_process_packet
is always called from inside ofnetcode_server_receive_packets
, which sets the same filter.It is not used in any of the tests or examples, neither in this repository, nor in yojimbo, but it is exposed in the header as part of netcode's public interface.
Does this function have a use-case? Why would the user ever want to receive one packet at a time?
\
netcode_server_process_packet
, whose purpose I do not understand: https://github.com/mas-bandwidth/netcode/blob/efd0c6d64e21dc501be3d589f25b3a54e2e66e95/netcode.c#L4578\
netcode_server_process_packet
, exposed in the header: https://github.com/mas-bandwidth/netcode/blob/efd0c6d64e21dc501be3d589f25b3a54e2e66e95/netcode.h#L247\
netcode_server_read_and_process_packet
which is part of the internal implementation ofnetcode_server_receive_packets
: https://github.com/mas-bandwidth/netcode/blob/efd0c6d64e21dc501be3d589f25b3a54e2e66e95/netcode.c#L4632\
netcode_server_receive_packets
: https://github.com/mas-bandwidth/netcode/blob/efd0c6d64e21dc501be3d589f25b3a54e2e66e95/netcode.c#L4687