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;
|
bool hotSwap;
|
||||||
} scripts;
|
} scripts;
|
||||||
|
|
||||||
|
struct Navigation
|
||||||
|
{
|
||||||
|
std::string meshPath;
|
||||||
|
} navigation;
|
||||||
|
|
||||||
std::string motd;
|
std::string motd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -167,14 +167,14 @@ bool Sapphire::World::Manager::TerritoryMgr::createDefaultTerritories()
|
||||||
auto pNaviMgr = framework()->get< Manager::NaviMgr >();
|
auto pNaviMgr = framework()->get< Manager::NaviMgr >();
|
||||||
bool hasNaviMesh = pNaviMgr->setupTerritory( territoryInfo->name );
|
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,
|
territoryTypeId,
|
||||||
guid,
|
guid,
|
||||||
territoryInfo->territoryIntendedUse,
|
territoryInfo->territoryIntendedUse,
|
||||||
territoryInfo->name,
|
territoryInfo->name,
|
||||||
( isPrivateTerritory( territoryTypeId ) ? "PRIVATE" : "PUBLIC" ),
|
( isPrivateTerritory( territoryTypeId ) ? "PRIVATE" : "PUBLIC" ),
|
||||||
pPlaceName->name,
|
hasNaviMesh ? "NAVI" : "",
|
||||||
hasNaviMesh ? "NAVI" : "");
|
pPlaceName->name );
|
||||||
|
|
||||||
auto pZone = make_Zone( territoryTypeId, guid, territoryInfo->name, pPlaceName->name, framework() );
|
auto pZone = make_Zone( territoryTypeId, guid, territoryInfo->name, pPlaceName->name, framework() );
|
||||||
pZone->init();
|
pZone->init();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <Framework.h>
|
#include <Framework.h>
|
||||||
#include <Territory/Zone.h>
|
#include <Territory/Zone.h>
|
||||||
#include <Logging/Logger.h>
|
#include <Logging/Logger.h>
|
||||||
#include <Config/ConfigMgr.h>
|
#include <ServerMgr.h>
|
||||||
|
|
||||||
|
|
||||||
#include "NaviProvider.h"
|
#include "NaviProvider.h"
|
||||||
|
@ -27,7 +27,9 @@ Sapphire::World::Navi::NaviProvider::NaviProvider( const std::string& internalNa
|
||||||
|
|
||||||
bool Sapphire::World::Navi::NaviProvider::init()
|
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 );
|
auto meshFolder = meshesFolder / std::experimental::filesystem::path( m_internalName );
|
||||||
|
|
||||||
if( std::experimental::filesystem::exists( meshFolder ) )
|
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.path = pConfig->getValue< std::string >( "Scripts", "Path", "./compiledscripts/" );
|
||||||
m_config.scripts.cachePath = pConfig->getValue< std::string >( "Scripts", "CachePath", "./cache/" );
|
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.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.listenIp = pConfig->getValue< std::string >( "Network", "ListenIp", "0.0.0.0" );
|
||||||
m_config.network.listenPort = pConfig->getValue< uint16_t >( "Network", "ListenPort", 54992 );
|
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 );
|
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();
|
res.reset();
|
||||||
|
@ -783,7 +783,7 @@ bool Sapphire::Zone::loadSpawnGroups()
|
||||||
|
|
||||||
group.getSpawnPointList().emplace_back( std::make_shared< Entity::SpawnPoint >( x, y, z, r, gimmickId ) );
|
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;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue