diff --git a/src/common/Util/SpawnIndexAllocator.h b/src/common/Util/SpawnIndexAllocator.h index 85875a67..732f652c 100644 --- a/src/common/Util/SpawnIndexAllocator.h +++ b/src/common/Util/SpawnIndexAllocator.h @@ -24,18 +24,16 @@ namespace Util void init( T maxSlotId, bool reserveFirstSlot = false ) { - setupQueue(); - m_maxSlotId = maxSlotId; m_reserveFirstSlot = reserveFirstSlot; + setupQueue(); + // todo: reserve max slot id in map to prevent any runtime reshashing } T freeUsedSpawnIndex( ActorIdType actorId ) { - assert( m_maxSlotId != 0 ); - auto it = m_actorIdToAllocatedMap.find( actorId ); if( it == m_actorIdToAllocatedMap.end() ) return 0; @@ -47,7 +45,7 @@ namespace Util return index; } - bool getNextFreeSpawnIndex( ActorIdType actorId ) + T getNextFreeSpawnIndex( ActorIdType actorId ) { assert( m_maxSlotId != 0 ); @@ -82,6 +80,8 @@ namespace Util protected: void setupQueue() { + assert( m_maxSlotId != 0 ); + while( !m_availableIds.empty() ) m_availableIds.pop(); diff --git a/src/servers/sapphire_zone/DebugCommand/DebugCommandHandler.cpp b/src/servers/sapphire_zone/DebugCommand/DebugCommandHandler.cpp index 35e711cd..9a68f69b 100644 --- a/src/servers/sapphire_zone/DebugCommand/DebugCommandHandler.cpp +++ b/src/servers/sapphire_zone/DebugCommand/DebugCommandHandler.cpp @@ -304,6 +304,14 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost: player.sendDebug( "MSQ Guide updated " ); } + else if( subCommand == "weatheroverride" || subCommand == "wo" ) + { + uint32_t weatherId; + + sscanf( params.c_str(), "%d", &weatherId ); + + player.getCurrentZone()->setWeatherOverride( static_cast< Common::Weather >( weatherId ) ); + } else { player.sendUrgent( subCommand + " is not a valid SET command." ); @@ -569,7 +577,7 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, boos void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { - player.sendDebug( "SapphireServer " + Version::VERSION + "\nRev: " + Version::GIT_HASH ); + player.sendDebug( "SapphireZone " + Version::VERSION + "\nRev: " + Version::GIT_HASH ); player.sendDebug( "Compiled: " __DATE__ " " __TIME__ ); player.sendDebug( "Sessions: " + std::to_string( g_serverZone.getSessionCount() ) ); }