| 2008 | } |
| 2009 | |
| 2010 | void 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 | |
| 2032 | void WorldServer::sync() { |
| 2033 | writeMetadata(); |
nothing calls this directly
no test coverage detected