| 2595 | } |
| 2596 | |
| 2597 | void WorldServer::setTemplate(WorldTemplatePtr newTemplate) { |
| 2598 | m_worldTemplate = std::move(newTemplate); |
| 2599 | for (auto& client : clientIds()) { |
| 2600 | auto& info = m_clientInfo.get(client); |
| 2601 | bool local = info->local; |
| 2602 | bool isAdmin = info->admin; |
| 2603 | auto netRules = info->clientState.netCompatibilityRules(); |
| 2604 | SpawnTarget spawnTarget; |
| 2605 | if (auto player = clientPlayer(client)) |
| 2606 | spawnTarget = SpawnTargetPosition(player->position() + player->feetOffset()); |
| 2607 | removeClient(client); |
| 2608 | addClient(client, spawnTarget, local, isAdmin, netRules); |
| 2609 | } |
| 2610 | } |
| 2611 | |
| 2612 | } |
nothing calls this directly
no test coverage detected