diff --git a/config/world.ini.default b/config/world.ini.default index ec461c198..2a7da9536 100644 --- a/config/world.ini.default +++ b/config/world.ini.default @@ -14,6 +14,7 @@ DisconnectTimeout = 20 [General] ; Sent on login - each line must be shorter than 307 characters, split lines with ';' MotD = Welcome to Sapphire!;This is a very good server;You can change these messages by editing General.MotD in config/config.ini +SkipOpening = true [Navigation] MeshPath = navi diff --git a/src/common/Config/ConfigDef.h b/src/common/Config/ConfigDef.h index 0dc54de76..1f37b3d04 100644 --- a/src/common/Config/ConfigDef.h +++ b/src/common/Config/ConfigDef.h @@ -64,6 +64,7 @@ namespace Sapphire::Common::Config } navigation; std::string motd; + bool skipOpening; }; struct LobbyConfig diff --git a/src/world/Actor/PlayerSql.cpp b/src/world/Actor/PlayerSql.cpp index 37d439dfa..7bca241dc 100644 --- a/src/world/Actor/PlayerSql.cpp +++ b/src/world/Actor/PlayerSql.cpp @@ -16,6 +16,8 @@ #include "Manager/ItemMgr.h" #include "Quest/Quest.h" +#include "WorldServer.h" + using namespace Sapphire::Common; using namespace Sapphire::Network::Packets; using namespace Sapphire::Network::Packets::WorldPackets::Server; @@ -88,6 +90,12 @@ bool Sapphire::Entity::Player::loadFromDb( uint64_t characterId ) m_bNewAdventurer = res->getBoolean( "IsNewAdventurer" ); m_openingSequence = res->getUInt8( "OpeningSequence" ); + // check if opening sequence should be skipped + auto& server = Common::Service< World::WorldServer >::ref(); + auto skipOpening = server.getConfig().skipOpening; + if( m_openingSequence < 2 && skipOpening ) + m_openingSequence = 2; + m_gc = res->getUInt8( "GrandCompany" ); m_cfPenaltyUntil = res->getUInt( "CFPenaltyUntil" ); m_activeTitle = res->getUInt16( "ActiveTitle" ); diff --git a/src/world/WorldServer.cpp b/src/world/WorldServer.cpp index d46ef801d..1ceacf2fd 100644 --- a/src/world/WorldServer.cpp +++ b/src/world/WorldServer.cpp @@ -107,6 +107,7 @@ bool Sapphire::World::WorldServer::loadSettings( int32_t argc, char* argv[] ) m_config.network.inRangeDistance = configMgr.getValue< float >( "Network", "InRangeDistance", 80.f ); m_config.motd = configMgr.getValue< std::string >( "General", "MotD", "" ); + m_config.skipOpening = configMgr.getValue( "General", "SkipOpening", false ); m_config.housing.defaultEstateName = configMgr.getValue< std::string >( "Housing", "DefaultEstateName", "Estate #{}" );