Skip to content

Commit

Permalink
I've had it... new option added to skip opening cutscenes
Browse files Browse the repository at this point in the history
  • Loading branch information
SapphireMordred committed Dec 2, 2021
1 parent 6326991 commit c84cfba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/world.ini.default
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/common/Config/ConfigDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ namespace Sapphire::Common::Config
} navigation;

std::string motd;
bool skipOpening;
};

struct LobbyConfig
Expand Down
8 changes: 8 additions & 0 deletions src/world/Actor/PlayerSql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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" );
Expand Down
1 change: 1 addition & 0 deletions src/world/WorldServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 #{}" );

Expand Down

0 comments on commit c84cfba

Please sign in to comment.