Skip to content

New "buffer" parameter type to network protocol

Adam Kaminski requested to merge topic/default/protocolspec-changes into branch/default

SVC_PLAYERVOIPAUDIOPACKET is the only server command that requires reading from, or writing to, a buffer of data. It would've been nice to have defined this command in the network protocol in the first place, but it was missing this functionality. So, I made it possible now by defining a new "buffer" parameter type.

The network protocol generates a ServerCommands::Buffer struct, containing the buffer data itself and its size (always sent as a short since it's expected that sending the buffer's size will at least require a short a lot of the time). This is the object to be used for any buffer parameter, and it'll automatically allocate or deallocate memory when it's created or destroyed, or copy it when copying from one buffer to another.

Merge request reports

Loading