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

quest_parser unboosted

This commit is contained in:
NotAdam 2018-10-27 22:47:58 +11:00
parent cf723d7630
commit af0ac23e46
3 changed files with 15 additions and 9 deletions

View file

@ -42,7 +42,7 @@ add_subdirectory( "src/servers" )
#add_subdirectory( "src/tools/exd_common_gen" )
add_subdirectory( "src/tools/exd_struct_gen" )
add_subdirectory( "src/tools/exd_struct_test" )
#add_subdirectory( "src/tools/quest_parser" )
add_subdirectory( "src/tools/quest_parser" )
#add_subdirectory( "src/tools/discovery_parser" )
#add_subdirectory( "src/tools/mob_parse" )
#add_subdirectory("src/tools/pcb_reader")

View file

@ -30,10 +30,8 @@ set_target_properties(quest_parse PROPERTIES
)
if (UNIX)
target_link_libraries (quest_parse common xivdat pthread mysqlclient dl z)
target_link_libraries (quest_parse common xivdat pthread mysqlclient dl z stdc++fs)
else()
target_link_libraries (quest_parse common xivdat libmysql zlib1)
endif()
target_link_libraries(quest_parse ${Boost_LIBRARIES} ${Boost_LIBRARIES})

View file

@ -4,8 +4,8 @@
#include <locale>
#include <set>
#include <string>
#include <cstring>
#include <boost/algorithm/string.hpp>
#include <experimental/filesystem>
#include <Exd.h>
@ -15,10 +15,11 @@
#include <GameData.h>
#include <DatCat.h>
#include <Exd/ExdData.h>
#include <Exd/ExdDataGenerated.h>
#include <Logging/Logger.h>
#include <algorithm>
Core::Logger g_log;
Core::Data::ExdDataGenerated g_exdDataGen;
@ -62,7 +63,7 @@ std::string titleCase( const std::string& str )
}
void
createScript( boost::shared_ptr< Core::Data::Quest >& pQuestData, std::set< std::string >& additionalList, int questId )
createScript( std::shared_ptr< Core::Data::Quest >& pQuestData, std::set< std::string >& additionalList, int questId )
{
std::string header(
"// This is an automatically generated C++ script template\n"
@ -125,7 +126,10 @@ createScript( boost::shared_ptr< Core::Data::Quest >& pQuestData, std::set< std:
else
{
std::string seqName = titleCase( entry );
boost::replace_all( seqName, "_", "" );
seqName.erase( std::remove_if( seqName.begin(), seqName.end(), []( const char c ) {
return c == '_';
}), seqName.end());
std::string seqId = entry.substr( 4 );
seqStr += " " + seqName + " = " + seqId + ",\n";
@ -252,7 +256,11 @@ createScript( boost::shared_ptr< Core::Data::Quest >& pQuestData, std::set< std:
for( auto& entity : script_entities )
{
auto name = titleCase( entity );
boost::replace_all( name, "_", "" );
name.erase( std::remove_if( name.begin(), name.end(), []( const char c ) {
return c == '_';
}), name.end());
sentities += " static constexpr auto " + name + ";\n";
}