mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
Style fixes
This commit is contained in:
parent
a25ee827a5
commit
a543a149cc
2 changed files with 17 additions and 16 deletions
|
@ -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 )
|
for( auto it = boost::filesystem::directory_iterator( boost::filesystem::path( folderpath ) ); it != boost::filesystem::directory_iterator(); ++it )
|
||||||
{
|
{
|
||||||
// Get the filename of the current element
|
// Get the filename of the current element
|
||||||
auto filename = it->path().filename().string();
|
auto fileName = it->path().filename().string();
|
||||||
auto unixtime = atoi( filename.substr( 0, 10 ).c_str() );
|
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 ) );
|
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 ) ) );
|
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>( thing ) + " for " + std::to_string( std::get<0>( thing ) - startTime ) );
|
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" );
|
getPlayer()->sendDebug( "Registered " + std::to_string( m_replayCache.size() ) + " sets for replay" );
|
||||||
|
@ -163,7 +163,8 @@ void Core::Session::update()
|
||||||
if( m_isReplaying )
|
if( m_isReplaying )
|
||||||
{
|
{
|
||||||
int at = 0;
|
int at = 0;
|
||||||
for( auto const& set : m_replayCache ) {
|
for( const auto& set : m_replayCache )
|
||||||
|
{
|
||||||
if( std::get< 0 >( set ) == Util::getTimeSeconds() )
|
if( std::get< 0 >( set ) == Util::getTimeSeconds() )
|
||||||
{
|
{
|
||||||
m_pZoneConnection->injectPacket( std::get< 1 >( set ), *getPlayer().get() );
|
m_pZoneConnection->injectPacket( std::get< 1 >( set ), *getPlayer().get() );
|
||||||
|
|
Loading…
Add table
Reference in a new issue