MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / setTemplate

Method setTemplate

source/game/StarWorldServer.cpp:2597–2610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2595}
2596
2597void 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}

Callers

nothing calls this directly

Calls 4

getMethod · 0.45
netCompatibilityRulesMethod · 0.45
positionMethod · 0.45
feetOffsetMethod · 0.45

Tested by

no test coverage detected