Threaded the barriers through the networking system

This commit is contained in:
2016-04-03 22:32:39 +10:00
parent 235f3b57e0
commit 7b9c016082
10 changed files with 181 additions and 2 deletions
+13
View File
@@ -115,6 +115,19 @@ void RoomData::RunFrame() {
pumpPacketProximity(reinterpret_cast<SerialPacket*>(&packet), roomIndex, it.second->GetOrigin(), INFLUENCE_RADIUS);
}
//a list of barriers that need to be updated client-side
std::list< std::pair<const int, BarrierData*>> barrierList;
barrierMgr.Update(&barrierList);
//send the updates
for (auto& it : barrierList) {
BarrierPacket packet;
copyBarrierToPacket(&packet, it.second, it.first);
packet.type = SerialPacketType::BARRIER_UPDATE;
packet.roomIndex = roomIndex;
pumpPacketProximity(reinterpret_cast<SerialPacket*>(&packet), roomIndex, it.second->GetOrigin(), INFLUENCE_RADIUS);
}
//TODO: creature/character collisions
}