mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
commit
d6111ebc3c
12 changed files with 119 additions and 220 deletions
|
@ -5,7 +5,7 @@ configuration:
|
|||
- Debug
|
||||
|
||||
platform:
|
||||
- Win32
|
||||
- Win64
|
||||
|
||||
environment:
|
||||
MSVC_DEFAULT_OPTIONS: ON
|
||||
|
@ -20,7 +20,7 @@ before_build:
|
|||
- git submodule update --init
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake .. -G "Visual Studio 15 2017"
|
||||
- cmake .. -G "Visual Studio 15 2017 Win64"
|
||||
- cmake --build . --target ALL_BUILD --config Debug
|
||||
|
||||
build_script:
|
||||
|
|
|
@ -40,9 +40,9 @@ add_subdirectory( "src/servers" )
|
|||
#add_subdirectory( "src/dbm" )
|
||||
|
||||
#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/exd_struct_gen" )
|
||||
add_subdirectory( "src/tools/exd_struct_test" )
|
||||
add_subdirectory( "src/tools/quest_parser" )
|
||||
#add_subdirectory( "src/tools/discovery_parser" )
|
||||
#add_subdirectory( "src/tools/mob_parse" )
|
||||
#add_subdirectory("src/tools/pcb_reader")
|
||||
|
|
|
@ -1,75 +1,13 @@
|
|||
{
|
||||
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file.
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x86-Debug",
|
||||
"generator": "Visual Studio 14 2015",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "-DCMAKE_BUILD_TYPE=\"Debug\"",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc140"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x86-Release",
|
||||
"generator": "Visual Studio 14 2015",
|
||||
"configurationType": "Release",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc140"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Visual Studio 14 2015 Win64",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "-DCMAKE_BUILD_TYPE=\"Debug\"",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc140"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Visual Studio 14 2015 Win64",
|
||||
"configurationType": "Release",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc140"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x86-Debug",
|
||||
"generator": "Visual Studio 15 2017",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "-DCMAKE_BUILD_TYPE=\"Debug\"",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc141"
|
||||
}
|
||||
]
|
||||
"buildCommandArgs": "-m -v:minimal"
|
||||
},
|
||||
{
|
||||
"name": "x86-Release",
|
||||
|
@ -77,13 +15,7 @@
|
|||
"configurationType": "Release",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc141"
|
||||
}
|
||||
]
|
||||
"buildCommandArgs": "-m -v:minimal"
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
|
@ -91,13 +23,7 @@
|
|||
"configurationType": "Debug",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "-DCMAKE_BUILD_TYPE=\"Debug\"",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc141"
|
||||
}
|
||||
]
|
||||
"buildCommandArgs": "-m -v:minimal"
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
|
@ -105,13 +31,7 @@
|
|||
"configurationType": "Release",
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "-m -v:minimal",
|
||||
"variables": [
|
||||
{
|
||||
"name": "Boost_COMPILER",
|
||||
"value": "-vc141"
|
||||
}
|
||||
]
|
||||
"buildCommandArgs": "-m -v:minimal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
10
README.md
10
README.md
|
@ -1,8 +1,13 @@
|
|||
# Sapphire - FINAL FANTASY XIV Server Emulator
|
||||
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/I4bj1tR.png" alt="FFXIV Sapphire"/>
|
||||
</p>
|
||||
|
||||
[](https://discord.gg/xxcdCER)
|
||||
[](https://travis-ci.org/SapphireMordred/Sapphire)
|
||||
[](https://ci.appveyor.com/project/SapphireMordred/Sapphire)
|
||||

|
||||
|
||||
|
||||
Sapphire is a FINAL FANTASY XIV 4.0+ Server Emulator currently in development.
|
||||
|
||||
|
@ -13,8 +18,7 @@ Sapphire requires the following software:
|
|||
|
||||
| *Name* | *Windows* | *Linux* |
|
||||
| ------ | --------- | ------- |
|
||||
| CMake 3.0.2+ and C++14 capable compiler | [Visual Studio 2017](https://www.visualstudio.com/) | `gcc 4.9` and `g++ 4.9` or newer |
|
||||
| Boost 1.63.0 | [Win32 precompiled binaries](https://sourceforge.net/projects/boost/files/boost-binaries/1.63.0/boost_1_63_0-msvc-14.0-32.exe/download) | Boost libraries from your distribution's package manager |
|
||||
| CMake 3.0.2+ and C++17 capable compiler | [Visual Studio 2017](https://www.visualstudio.com/) | `gcc 7` and `g++ 7` or newer |
|
||||
| MySQL Server 5.7 | [Official Site](https://dev.mysql.com/downloads/mysql/) | MySQL server from your distribution's package manager |
|
||||
|
||||
Please check the [wiki](https://github.com/SapphireMordred/Sapphire/wiki) for detailed installation/build instructions for your OS.
|
||||
|
|
|
@ -86,16 +86,16 @@ find_path(MYSQL_INCLUDE_DIR
|
|||
/usr/local/include
|
||||
/usr/local/include/mysql
|
||||
/usr/local/mysql/include
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/include"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.7/include"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.6/include"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.5/include"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.1/include"
|
||||
"${PROGRAM_FILES_32}/MySQL/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/include"
|
||||
"${PROGRAM_FILES_64}/MySQL/include"
|
||||
"C:/MySQL/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/include"
|
||||
|
@ -142,15 +142,6 @@ if( WIN32 )
|
|||
libmysql
|
||||
PATHS
|
||||
${MYSQL_ADD_LIBRARIES_PATH}
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/lib"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.7/lib"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.6/lib"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.5/lib"
|
||||
|
@ -160,6 +151,15 @@ if( WIN32 )
|
|||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.5/lib/opt"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.1/lib/opt"
|
||||
"${PROGRAM_FILES_32}/MySQL/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/lib"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/lib/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/lib"
|
||||
"C:/MySQL/lib/debug"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib"
|
||||
|
@ -223,15 +223,6 @@ endif( UNIX )
|
|||
if( WIN32 )
|
||||
find_program(MYSQL_EXECUTABLE mysql
|
||||
PATHS
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/bin"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.7/bin"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.6/bin"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.5/bin"
|
||||
|
@ -241,6 +232,15 @@ if( WIN32 )
|
|||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.5/bin/opt"
|
||||
"${PROGRAM_FILES_32}/MySQL/MySQL Server 5.1/bin/opt"
|
||||
"${PROGRAM_FILES_32}/MySQL/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.6/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.5/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.1/bin/opt"
|
||||
"${PROGRAM_FILES_64}/MySQL/bin"
|
||||
"C:/MySQL/bin/debug"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/bin"
|
||||
|
|
|
@ -17,7 +17,7 @@ else()
|
|||
|
||||
# edit and continue
|
||||
message(STATUS "Enabling Edit and Continue..")
|
||||
add_definitions(/ZI)
|
||||
add_definitions(/Zi)
|
||||
|
||||
# incremental linking
|
||||
message(STATUS "Enabling Incremental Linking..")
|
||||
|
|
|
@ -26,7 +26,7 @@ set_target_properties(exd_common_gen PROPERTIES
|
|||
if (UNIX)
|
||||
target_link_libraries (exd_common_gen common xivdat pthread mysqlclient dl z)
|
||||
else()
|
||||
target_link_libraries (exd_common_gen common xivdat libmysql zlib1)
|
||||
target_link_libraries (exd_common_gen common xivdat libmysql zlib)
|
||||
|
||||
# ignore unchecked iterators warnings from msvc
|
||||
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
||||
|
|
|
@ -24,10 +24,8 @@ set_target_properties(exd_struct_gen PROPERTIES
|
|||
)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries (exd_struct_gen common xivdat pthread mysqlclient dl z)
|
||||
target_link_libraries (exd_struct_gen common xivdat pthread mysqlclient dl z stdc++fs)
|
||||
else()
|
||||
target_link_libraries (exd_struct_gen common xivdat libmysql zlib1)
|
||||
target_link_libraries (exd_struct_gen common xivdat mysql zlib)
|
||||
endif()
|
||||
|
||||
target_link_libraries(exd_struct_gen ${Boost_LIBRARIES} ${Boost_LIBRARIES})
|
||||
|
||||
|
|
|
@ -9,27 +9,20 @@
|
|||
#include <iostream>
|
||||
#include <cctype>
|
||||
#include <set>
|
||||
#include <Exd/ExdData.h>
|
||||
#include <Exd/ExdDataGenerated.h>
|
||||
#include <Logging/Logger.h>
|
||||
#include <boost/range/algorithm/remove_if.hpp>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
#include <boost/property_tree/xml_parser.hpp>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <streambuf>
|
||||
#include <regex>
|
||||
#include <boost/archive/iterators/ostream_iterator.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
|
||||
Core::Logger g_log;
|
||||
Core::Data::ExdData g_exdData;
|
||||
Core::Data::ExdDataGenerated g_exdData;
|
||||
bool skipUnmapped = true;
|
||||
|
||||
std::map< char, std::string > numberToStringMap
|
||||
|
@ -69,7 +62,7 @@ std::string generateIdListDecl( const std::string& exd )
|
|||
|
||||
std::string generateDirectGetters( const std::string& exd )
|
||||
{
|
||||
return " using " + exd + "Ptr = boost::shared_ptr< " + exd + " >;\n";
|
||||
return " using " + exd + "Ptr = std::shared_ptr< " + exd + " >;\n";
|
||||
}
|
||||
|
||||
std::string generateIdListGetter( const std::string& exd )
|
||||
|
@ -119,64 +112,37 @@ std::string generateStruct( const std::string& exd )
|
|||
|
||||
int count = 0;
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
ptree m_propTree;
|
||||
boost::property_tree::read_json( "ex.json", m_propTree );
|
||||
auto json = nlohmann::json();
|
||||
|
||||
BOOST_FOREACH( boost::property_tree::ptree::value_type& sheet, m_propTree.get_child( "sheets" ) )
|
||||
{
|
||||
std::string name = sheet.second.get< std::string >( "sheet" );
|
||||
if( name != exd )
|
||||
continue;
|
||||
std::ifstream exJson( "ex.json" );
|
||||
exJson >> json;
|
||||
|
||||
BOOST_FOREACH( boost::property_tree::ptree::value_type& show, sheet.second.get_child( "definitions" ) )
|
||||
for( auto& definition : json["sheets"][exd] )
|
||||
{
|
||||
uint32_t index;
|
||||
std::string converterTarget = "";
|
||||
bool isRepeat = false;
|
||||
int num = 0;
|
||||
try
|
||||
{
|
||||
index = show.second.get< uint32_t >( "index" );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
try
|
||||
{
|
||||
std::string fieldName = show.second.get< std::string >( "name" );
|
||||
indexToNameMap[ index ] = fieldName;
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
converterTarget = show.second.get< std::string >( "converter.target" );
|
||||
index = definition["index"].get< uint32_t >();
|
||||
indexToNameMap[ index ] = std::string( definition["name"] );
|
||||
|
||||
converterTarget = std::string( definition["converter"]["target"] );
|
||||
if( nameTaken.find( converterTarget ) != nameTaken.end() )
|
||||
indexToTarget[ index ] = converterTarget;
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
|
||||
try
|
||||
if( auto count = definition["count"] )
|
||||
{
|
||||
show.second.get< std::string >( "type" );
|
||||
num = show.second.get< uint8_t >( "count" );
|
||||
num = std::stoi( std::string( count ) );
|
||||
isRepeat = true;
|
||||
indexIsArrayMap[ index ] = true;
|
||||
indexCountMap[ index ] = num;
|
||||
std::string fName = show.second.get< std::string >( "definition.name" );
|
||||
|
||||
std::string fName = definition["definition"]["name"];
|
||||
indexToNameMap[ index ] = fName;
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string result = "struct " + exd + "\n{\n";
|
||||
|
@ -208,8 +174,12 @@ std::string generateStruct( const std::string& exd )
|
|||
fieldName = indexToNameMap[ count ];
|
||||
}
|
||||
fieldName[ 0 ] = std::tolower( fieldName[ 0 ] );
|
||||
fieldName.erase( boost::remove_if( fieldName, boost::is_any_of( ",-':![](){}<>% \x02\x1f\x01\x03" ) ),
|
||||
fieldName.end() );
|
||||
|
||||
std::string badChars = ",-':![](){}<>% \x02\x1f\x01\x03";
|
||||
std::for_each( badChars.begin(), badChars.end(), [ &fieldName ]( const char c )
|
||||
{
|
||||
fieldName.erase( std::remove( fieldName.begin(), fieldName.end(), c ), fieldName.end() );
|
||||
});
|
||||
|
||||
for( auto entry : numberToStringMap )
|
||||
{
|
||||
|
@ -229,7 +199,7 @@ std::string generateStruct( const std::string& exd )
|
|||
indexToNameMap[ count ] = fieldName;
|
||||
indexToTypeMap[ count ] = type;
|
||||
if( indexToTarget.find( count ) != indexToTarget.end() )
|
||||
result += " boost::shared_ptr< " + indexToTarget[ count ] + "> " + fieldName + ";\n";
|
||||
result += " std::shared_ptr< " + indexToTarget[ count ] + "> " + fieldName + ";\n";
|
||||
else
|
||||
{
|
||||
if( indexIsArrayMap.find( count ) != indexIsArrayMap.end() )
|
||||
|
@ -272,7 +242,7 @@ std::string generateConstructorsDecl( const std::string& exd )
|
|||
continue;
|
||||
}
|
||||
if( indexToTarget.find( count ) != indexToTarget.end() )
|
||||
result += indent + indexToNameMap[ count ] + " = boost::make_shared< " + indexToTarget[ count ] +
|
||||
result += indent + indexToNameMap[ count ] + " = std::make_shared< " + indexToTarget[ count ] +
|
||||
">( exdData->getField< " +
|
||||
indexToTypeMap[ count ] + " >( row, " + std::to_string( count ) + " ), exdData );\n";
|
||||
else
|
||||
|
@ -337,9 +307,10 @@ int main( int argc, char** argv )
|
|||
std::istreambuf_iterator< char >() );
|
||||
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
ptree m_propTree;
|
||||
boost::property_tree::read_json( "ex.json", m_propTree );
|
||||
std::ifstream exJson( "ex.json" );
|
||||
|
||||
auto json = nlohmann::json();
|
||||
exJson >> json;
|
||||
|
||||
g_log.info( "Setting up EXD data" );
|
||||
if( !g_exdData.init( datLocation ) )
|
||||
|
@ -366,9 +337,9 @@ int main( int argc, char** argv )
|
|||
//nameTaken[name] = "1";
|
||||
//}
|
||||
|
||||
BOOST_FOREACH( boost::property_tree::ptree::value_type& sheet, m_propTree.get_child( "sheets" ) )
|
||||
for( auto& sheet : json["sheets"] )
|
||||
{
|
||||
std::string name = sheet.second.get< std::string >( "sheet" );
|
||||
std::string name = json["sheet"];
|
||||
|
||||
forwards += "struct " + name + ";\n";
|
||||
structDefs += generateStruct( name );
|
||||
|
@ -382,11 +353,11 @@ int main( int argc, char** argv )
|
|||
|
||||
getterDecl +=
|
||||
"\n template< class T >\n"
|
||||
" boost::shared_ptr< T > get( uint32_t id )\n"
|
||||
" std::shared_ptr< T > get( uint32_t id )\n"
|
||||
" {\n"
|
||||
" try\n"
|
||||
" {\n"
|
||||
" auto info = boost::make_shared< T >( id, this );\n"
|
||||
" auto info = std::make_shared< T >( id, this );\n"
|
||||
" return info;\n"
|
||||
" }\n"
|
||||
" catch( ... )\n"
|
||||
|
|
|
@ -24,6 +24,6 @@ set_target_properties(exd_struct_test PROPERTIES
|
|||
if (UNIX)
|
||||
target_link_libraries (exd_struct_test common xivdat pthread mysqlclient dl z stdc++fs )
|
||||
else()
|
||||
target_link_libraries (exd_struct_test common xivdat libmysql zlib1)
|
||||
target_link_libraries (exd_struct_test common xivdat mysql zlib)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -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)
|
||||
target_link_libraries (quest_parse common xivdat mysql zlib)
|
||||
endif()
|
||||
|
||||
target_link_libraries(quest_parse ${Boost_LIBRARIES} ${Boost_LIBRARIES})
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue