440hz
This commit is contained in:
@@ -200,28 +200,14 @@ 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) {
|
||||
conn->getPacks(m_sock_udp);
|
||||
conn->Run(m_world);
|
||||
conn->sendPacks(m_sock_udp, m_players);
|
||||
if (conn->m_nsync) {
|
||||
conn->Run(m_world);
|
||||
conn->sendPacks(m_sock_udp, m_players);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user