Don't send events if it trigger a rewind in server

This commit is contained in:
Benau 2018-05-22 14:21:05 +08:00
parent 175b932b13
commit ff08a2ba16

View File

@ -196,9 +196,10 @@ void GameProtocol::handleControllerAction(Event *event)
}
if (NetworkConfig::get()->isServer())
{
// Send update to all clients except the original sender.
STKHost::get()->sendPacketExcept(event->getPeer(),
&data, false);
// Send update to all clients except the original sender if the event
// is after the server time
if (!will_trigger_rewind)
STKHost::get()->sendPacketExcept(event->getPeer(), &data, false);
if (not_rewound == 0 ||
m_initial_ticks.find(event->getPeer()) == m_initial_ticks.end())