1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Style fixes

This commit is contained in:
goaaats 2018-01-08 23:23:09 +01:00
parent a25ee827a5
commit a543a149cc
2 changed files with 17 additions and 16 deletions

View file

@ -126,12 +126,12 @@ void Core::Session::startReplay( const std::string& folderpath )
for( auto it = boost::filesystem::directory_iterator( boost::filesystem::path( folderpath ) ); it != boost::filesystem::directory_iterator(); ++it )
{
// Get the filename of the current element
auto filename = it->path().filename().string();
auto unixtime = atoi( filename.substr( 0, 10 ).c_str() );
auto fileName = it->path().filename().string();
auto unixTime = atoi( fileName.substr( 0, 10 ).c_str() );
if( unixtime > 1000000000)
if( unixTime > 1000000000)
{
loadedSets.push_back( std::tuple<uint64_t, std::string>( unixtime, it->path().string() ) );
loadedSets.push_back( std::tuple< uint64_t, std::string >( unixTime, it->path().string() ) );
}
}
@ -142,10 +142,10 @@ void Core::Session::startReplay( const std::string& folderpath )
int startTime = std::get< 0 >( loadedSets.at( 0 ) );
for( auto thing : loadedSets )
for( auto set : loadedSets )
{
m_replayCache.push_back( std::tuple<uint64_t, std::string>( Util::getTimeSeconds() + ( std::get<0>( thing ) - startTime ), std::get<1>( thing ) ) );
g_log.info( "Registering " + std::get<1>( thing ) + " for " + std::to_string( std::get<0>( thing ) - startTime ) );
m_replayCache.push_back( std::tuple<uint64_t, std::string>( Util::getTimeSeconds() + ( std::get< 0 >( set ) - startTime ), std::get< 1 >( set ) ) );
g_log.info( "Registering " + std::get< 1 >( set ) + " for " + std::to_string( std::get< 0 >( set ) - startTime ) );
}
getPlayer()->sendDebug( "Registered " + std::to_string( m_replayCache.size() ) + " sets for replay" );
@ -163,7 +163,8 @@ void Core::Session::update()
if( m_isReplaying )
{
int at = 0;
for( auto const& set : m_replayCache ) {
for( const auto& set : m_replayCache )
{
if( std::get< 0 >( set ) == Util::getTimeSeconds() )
{
m_pZoneConnection->injectPacket( std::get< 1 >( set ), *getPlayer().get() );