mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
fix config reading, alter territory loading output slightly
This commit is contained in:
parent
3e3f637be1
commit
dc520b730b
5 changed files with 20 additions and 11 deletions
|
@ -56,6 +56,11 @@ namespace Sapphire::Common::Config
|
|||
bool hotSwap;
|
||||
} scripts;
|
||||
|
||||
struct Navigation
|
||||
{
|
||||
std::string meshPath;
|
||||
} navigation;
|
||||
|
||||
std::string motd;
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 ) )
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue