mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
commit
db55a576b7
5 changed files with 21 additions and 13 deletions
|
@ -56,6 +56,11 @@ namespace Sapphire::Common::Config
|
|||
bool hotSwap;
|
||||
} scripts;
|
||||
|
||||
struct Navigation
|
||||
{
|
||||
std::string meshPath;
|
||||
} navigation;
|
||||
|
||||
std::string motd;
|
||||
};
|
||||
|
||||
|
|
|
@ -173,8 +173,8 @@ bool Sapphire::World::Manager::TerritoryMgr::createDefaultTerritories()
|
|||
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();
|
||||
|
@ -199,7 +199,7 @@ bool Sapphire::World::Manager::TerritoryMgr::createHousingTerritories()
|
|||
auto territoryTypeId = territory.first;
|
||||
auto territoryInfo = territory.second;
|
||||
uint32_t wardNum;
|
||||
uint32_t wardMaxNum = 1;
|
||||
uint32_t wardMaxNum = 18;
|
||||
|
||||
if( territoryInfo->name.empty() )
|
||||
continue;
|
||||
|
@ -213,7 +213,7 @@ bool Sapphire::World::Manager::TerritoryMgr::createHousingTerritories()
|
|||
{
|
||||
uint32_t guid = getNextInstanceId();
|
||||
|
||||
Logger::info( "{0}\t{1}\t{2}\t{3:<10}\tHOUSING\t{4}#{5}",
|
||||
Logger::info( "{0}\t{1}\t{2}\t{3:<10}\tHOUSING\t\t{4}#{5}",
|
||||
territoryTypeId,
|
||||
guid,
|
||||
territoryInfo->territoryIntendedUse,
|
||||
|
@ -224,7 +224,6 @@ bool Sapphire::World::Manager::TerritoryMgr::createHousingTerritories()
|
|||
auto pHousingZone = make_HousingZone( wardNum, territoryTypeId, guid, territoryInfo->name,
|
||||
pPlaceName->name, framework() );
|
||||
pHousingZone->init();
|
||||
wardMaxNum = 18;
|
||||
|
||||
InstanceIdToZonePtrMap instanceMap;
|
||||
instanceMap[ guid ] = pHousingZone;
|
||||
|
|
|
@ -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 );
|
||||
|
@ -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;
|
||||
|
|
|
@ -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