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

Method updateDamage

source/game/StarWorldServer.cpp:2010–2030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2008}
2009
2010void WorldServer::updateDamage(float dt) {
2011 m_damageManager->update(dt);
2012
2013 // Do nothing with damage notifications at the moment.
2014 m_damageManager->pullPendingNotifications();
2015
2016 for (auto const& remoteHitRequest : m_damageManager->pullRemoteHitRequests())
2017 m_clientInfo.get(remoteHitRequest.destinationConnection())
2018 ->outgoingPackets.append(make_shared<HitRequestPacket>(remoteHitRequest));
2019
2020 for (auto const& remoteDamageRequest : m_damageManager->pullRemoteDamageRequests())
2021 m_clientInfo.get(remoteDamageRequest.destinationConnection())
2022 ->outgoingPackets.append(make_shared<DamageRequestPacket>(remoteDamageRequest));
2023
2024 for (auto const& remoteDamageNotification : m_damageManager->pullRemoteDamageNotifications()) {
2025 for (auto const& pair : m_clientInfo) {
2026 if (pair.second->needsDamageNotification(remoteDamageNotification))
2027 pair.second->outgoingPackets.append(make_shared<DamageNotificationPacket>(remoteDamageNotification));
2028 }
2029 }
2030}
2031
2032void WorldServer::sync() {
2033 writeMetadata();

Callers

nothing calls this directly

Calls 9

pullRemoteHitRequestsMethod · 0.80
destinationConnectionMethod · 0.80
updateMethod · 0.45
appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected