From 388b59e9bf5a92f4d392e99a47e0ff1adaca91d2 Mon Sep 17 00:00:00 2001 From: DrSocalkwe3n Date: Wed, 27 Aug 2025 17:22:51 +0600 Subject: [PATCH] * --- Src/Server/GameServer.cpp | 11 +---------- Src/Server/RemoteClient.hpp | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Src/Server/GameServer.cpp b/Src/Server/GameServer.cpp index c5d7bca..c5646aa 100644 --- a/Src/Server/GameServer.cpp +++ b/Src/Server/GameServer.cpp @@ -1105,18 +1105,9 @@ coro<> GameServer::pushSocketGameProtocol(tcp::socket socket, const std::string lock.unlock(); co_await Net::AsyncSocket::write(socket, 0); - // Считываем ресурсы хранимые в кеше клиента - uint32_t count = co_await Net::AsyncSocket::read(socket); - if(count > 262144) - MAKE_ERROR("Не поддерживаемое количество ресурсов в кеше у клиента"); - - std::vector clientCache; - clientCache.resize(count); - co_await Net::AsyncSocket::read(socket, (std::byte*) clientCache.data(), count*32); - std::sort(clientCache.begin(), clientCache.end()); External.NewConnectedPlayers.lock_write() - ->push_back(std::make_unique(IOC, std::move(socket), username, std::move(clientCache))); + ->push_back(std::make_shared(IOC, std::move(socket), username)); } } } diff --git a/Src/Server/RemoteClient.hpp b/Src/Server/RemoteClient.hpp index 31a0b08..3c999b1 100644 --- a/Src/Server/RemoteClient.hpp +++ b/Src/Server/RemoteClient.hpp @@ -336,7 +336,7 @@ public: std::queue Build, Break; public: - RemoteClient(asio::io_context &ioc, tcp::socket socket, const std::string username, std::vector &&client_cache) + RemoteClient(asio::io_context &ioc, tcp::socket socket, const std::string username) : LOG("RemoteClient " + username), Socket(ioc, std::move(socket)), Username(username) {}