Add multi update message

This commit is contained in:
Yousef Khadadeh 2025-12-23 14:10:33 +03:00
parent 023b17818e
commit cd4d2572f8
8 changed files with 140 additions and 61 deletions

View file

@ -20,7 +20,7 @@ class NetClient : public std::enable_shared_from_this<NetClient> {
template <typename... Args> void send_items_to_server(const std::string& channel, Args&&... items) {
if(isDisconnected)
return;
auto ss(std::make_shared<std::stringstream>());
auto ss(std::make_shared<std::stringstream>(std::ios::binary | std::ios::out));
{
cereal::PortableBinaryOutputArchive m(*ss);
(m(items), ...);

View file

@ -67,7 +67,7 @@ class NetServer : public std::enable_shared_from_this<NetServer> {
send_string_stream_to_client_if(clientChecker, channel, get_string_stream_from_items(items...));
}
template <typename... Args> std::shared_ptr<std::stringstream> get_string_stream_from_items(Args&&... items) {
auto ss(std::make_shared<std::stringstream>());
auto ss(std::make_shared<std::stringstream>(std::ios::binary | std::ios::out));
{
cereal::PortableBinaryOutputArchive m(*ss);
(m(items), ...);