This commit is contained in:
MarcEricMartel
2023-11-24 15:24:46 -05:00
parent bd3f677118
commit 981d66c730
3 changed files with 25 additions and 4 deletions

View File

@@ -200,6 +200,22 @@ void Server::Run() {
sync.timer = m_game.countdown;
sendPack<Sync>(conn->getSock(), &sync, &m_buf);
}
int clients_ready = 0;
while (clients_ready < players) {
Packet pck = getPack(&m_buf);
if (pck.type != PACKET_TYPE::SYNC) {
Log("Paquet invalide.", true, false);
if (pck.type != PACKET_TYPE::ERR)
netprot::emptyPack(pck);
continue;
}
Sync* sync = (Sync*)pck.ptr;
clients_ready++;
//m_players[sync->sid]
delete sync;
}
while (!endgame) {
for (auto& [key, conn] : m_players) {