1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 07:07:45 +00:00

fix config reading, alter territory loading output slightly

This commit is contained in:
NotAdam 2019-01-25 12:23:38 +11:00
parent 3e3f637be1
commit dc520b730b
5 changed files with 20 additions and 11 deletions

View file

@ -56,6 +56,11 @@ namespace Sapphire::Common::Config
bool hotSwap;
} scripts;
struct Navigation
{
std::string meshPath;
} navigation;
std::string motd;
};

View file

@ -167,14 +167,14 @@ bool Sapphire::World::Manager::TerritoryMgr::createDefaultTerritories()
auto pNaviMgr = framework()->get< Manager::NaviMgr >();
bool hasNaviMesh = pNaviMgr->setupTerritory( territoryInfo->name );
Logger::info( "{0}\t{1}\t{2}\t{3:<10}\t{4}\t{5}\t{6}",
Logger::info( "{0}\t{1}\t{2}\t{3:<10}\t{4}\t{5:<6}{6}",
territoryTypeId,
guid,
territoryInfo->territoryIntendedUse,
territoryInfo->name,
( isPrivateTerritory( territoryTypeId ) ? "PRIVATE" : "PUBLIC" ),
pPlaceName->name,
hasNaviMesh ? "NAVI" : "");
hasNaviMesh ? "NAVI" : "",
pPlaceName->name );
auto pZone = make_Zone( territoryTypeId, guid, territoryInfo->name, pPlaceName->name, framework() );
pZone->init();

View file

@ -2,7 +2,7 @@
#include <Framework.h>
#include <Territory/Zone.h>
#include <Logging/Logger.h>
#include <Config/ConfigMgr.h>
#include <ServerMgr.h>
#include "NaviProvider.h"
@ -27,7 +27,9 @@ Sapphire::World::Navi::NaviProvider::NaviProvider( const std::string& internalNa
bool Sapphire::World::Navi::NaviProvider::init()
{
auto meshesFolder = std::experimental::filesystem::path( m_pFw->get< Sapphire::ConfigMgr >()->getValue< std::string >( "Navigation", "MeshPath", "navi" ) );
auto& cfg = m_pFw->get< Sapphire::World::ServerMgr >()->getConfig();
auto meshesFolder = std::experimental::filesystem::path( cfg.navigation.meshPath );
auto meshFolder = meshesFolder / std::experimental::filesystem::path( m_internalName );
if( std::experimental::filesystem::exists( meshFolder ) )

View file

@ -96,6 +96,8 @@ bool Sapphire::World::ServerMgr::loadSettings( int32_t argc, char* argv[] )
m_config.scripts.path = pConfig->getValue< std::string >( "Scripts", "Path", "./compiledscripts/" );
m_config.scripts.cachePath = pConfig->getValue< std::string >( "Scripts", "CachePath", "./cache/" );
m_config.navigation.meshPath = pConfig->getValue< std::string >( "Navigation", "MeshPath", "navi" );
m_config.network.disconnectTimeout = pConfig->getValue< uint16_t >( "Network", "DisconnectTimeout", 20 );
m_config.network.listenIp = pConfig->getValue< std::string >( "Network", "ListenIp", "0.0.0.0" );
m_config.network.listenPort = pConfig->getValue< uint16_t >( "Network", "ListenPort", 54992 );
@ -455,10 +457,10 @@ void Sapphire::World::ServerMgr::loadBNpcTemplates()
auto look = res->getBlobVector( 12 );
auto models = res->getBlobVector( 13 );
auto bnpcTemplate = std::make_shared< Entity::BNpcTemplate >(
id, bNPCBaseId, bNPCNameId, mainWeaponModel, secWeaponModel,
aggressionMode, enemyType, 0, pose, modelChara, displayFlags,
reinterpret_cast< uint32_t* >( &models[ 0 ] ),
auto bnpcTemplate = std::make_shared< Entity::BNpcTemplate >(
id, bNPCBaseId, bNPCNameId, mainWeaponModel, secWeaponModel,
aggressionMode, enemyType, 0, pose, modelChara, displayFlags,
reinterpret_cast< uint32_t* >( &models[ 0 ] ),
reinterpret_cast< uint8_t* >( &look[ 0 ] ) );
m_bNpcTemplateMap[ name ] = bnpcTemplate;

View file

@ -760,7 +760,7 @@ bool Sapphire::Zone::loadSpawnGroups()
m_spawnGroups.emplace_back( id, templateId, level, maxHp );
Logger::debug( "id: {0}, template: {1}, level: {2}, maxHp: {3}", id, m_spawnGroups.back().getTemplateId(), level, maxHp );
Logger::trace( "id: {0}, template: {1}, level: {2}, maxHp: {3}", id, m_spawnGroups.back().getTemplateId(), level, maxHp );
}
res.reset();
@ -783,7 +783,7 @@ bool Sapphire::Zone::loadSpawnGroups()
group.getSpawnPointList().emplace_back( std::make_shared< Entity::SpawnPoint >( x, y, z, r, gimmickId ) );
Logger::debug( "id: {0}, x: {1}, y: {2}, z: {3}, gimmickId: {4}", id, x, y, z, gimmickId );
Logger::trace( "id: {0}, x: {1}, y: {2}, z: {3}, gimmickId: {4}", id, x, y, z, gimmickId );
}
}
return false;