The server now uses the RewindManager to receive network events

and takes the kart input from this queue of events.
This commit is contained in:
hiker
2016-12-15 08:12:04 +11:00
parent 95ca3fcac1
commit 77c14152c2
10 changed files with 131 additions and 53 deletions

View File

@@ -39,6 +39,7 @@
#include "modes/world.hpp"
#include "network/network_config.hpp"
#include "network/protocols/game_protocol.hpp"
#include "network/rewind_manager.hpp"
#include "race/history.hpp"
#include "states_screens/race_gui_base.hpp"
#include "tracks/track.hpp"
@@ -143,9 +144,10 @@ void LocalPlayerController::action(PlayerAction action, int value)
{
PlayerController::action(action, value);
// If this is a client, send the action to the server
// If this is a client, send the action to networking layer
if (World::getWorld()->isNetworkWorld() &&
NetworkConfig::get()->isClient() )
NetworkConfig::get()->isClient() &&
!RewindManager::get()->isRewinding() )
{
GameProtocol::getInstance()->controllerAction(m_kart->getWorldKartId(),
action, value);