Пересмотр асинхронностей

This commit is contained in:
2025-03-11 14:55:43 +06:00
parent e99ae2f6ba
commit e190c79d00
12 changed files with 482 additions and 194 deletions

View File

@@ -20,8 +20,10 @@ namespace LV::Server {
GameServer::~GameServer() {
shutdown("on ~GameServer");
RunThread.join();
WorkDeadline.cancel();
UseLock.wait_no_use();
LOG.info() << "Сервер уничтожен";
}
@@ -448,7 +450,7 @@ void GameServer::stepPlayers() {
auto lock = External.NewConnectedPlayers.lock_write();
for(std::unique_ptr<RemoteClient> &client : *lock) {
co_spawn(client->run());
asio::co_spawn(IOC, client->run(), asio::detached);
Game.CECs.push_back(std::make_unique<ContentEventController>(std::move(client)));
}