Disable the unneeded time adjust
This commit is contained in:
parent
674faad226
commit
8c53296290
@ -161,7 +161,7 @@ void GameProtocol::handleControllerAction(Event *event)
|
|||||||
NetworkString &data = event->data();
|
NetworkString &data = event->data();
|
||||||
uint8_t count = data.getUInt8();
|
uint8_t count = data.getUInt8();
|
||||||
bool will_trigger_rewind = false;
|
bool will_trigger_rewind = false;
|
||||||
int rewind_delta = 0;
|
//int rewind_delta = 0;
|
||||||
int cur_ticks = 0;
|
int cur_ticks = 0;
|
||||||
const int not_rewound = RewindManager::get()->getNotRewoundWorldTicks();
|
const int not_rewound = RewindManager::get()->getNotRewoundWorldTicks();
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
@ -174,7 +174,7 @@ void GameProtocol::handleControllerAction(Event *event)
|
|||||||
if (cur_ticks < not_rewound && !will_trigger_rewind)
|
if (cur_ticks < not_rewound && !will_trigger_rewind)
|
||||||
{
|
{
|
||||||
will_trigger_rewind = true;
|
will_trigger_rewind = true;
|
||||||
rewind_delta = not_rewound - cur_ticks;
|
//rewind_delta = not_rewound - cur_ticks;
|
||||||
}
|
}
|
||||||
uint8_t kart_id = data.getUInt8();
|
uint8_t kart_id = data.getUInt8();
|
||||||
assert(kart_id < World::getWorld()->getNumKarts());
|
assert(kart_id < World::getWorld()->getNumKarts());
|
||||||
@ -201,7 +201,9 @@ void GameProtocol::handleControllerAction(Event *event)
|
|||||||
if (!will_trigger_rewind)
|
if (!will_trigger_rewind)
|
||||||
STKHost::get()->sendPacketExcept(event->getPeer(), &data, false);
|
STKHost::get()->sendPacketExcept(event->getPeer(), &data, false);
|
||||||
|
|
||||||
if (not_rewound == 0 ||
|
// FIXME unless there is a network jitter more than 100ms (more than
|
||||||
|
// server delay), time adjust is not necessary
|
||||||
|
/*if (not_rewound == 0 ||
|
||||||
m_initial_ticks.find(event->getPeer()) == m_initial_ticks.end())
|
m_initial_ticks.find(event->getPeer()) == m_initial_ticks.end())
|
||||||
return;
|
return;
|
||||||
int cur_diff = cur_ticks - not_rewound;
|
int cur_diff = cur_ticks - not_rewound;
|
||||||
@ -229,7 +231,7 @@ void GameProtocol::handleControllerAction(Event *event)
|
|||||||
World::getWorld()->getTimeTicks(), StkTime::getRealTime(),
|
World::getWorld()->getTimeTicks(), StkTime::getRealTime(),
|
||||||
not_rewound, adjustment, event->getPeer()->getHostId());
|
not_rewound, adjustment, event->getPeer()->getHostId());
|
||||||
adjustTimeForClient(event->getPeer(), adjustment);
|
adjustTimeForClient(event->getPeer(), adjustment);
|
||||||
}
|
}*/
|
||||||
} // if server
|
} // if server
|
||||||
|
|
||||||
} // handleControllerAction
|
} // handleControllerAction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user