mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 16:17:46 +00:00
Fix pcb_reader, quest_parser
This commit is contained in:
parent
e018914eb9
commit
7d3a3b8c66
2 changed files with 13 additions and 17 deletions
|
@ -26,7 +26,7 @@
|
||||||
// garbage to ignore models
|
// garbage to ignore models
|
||||||
bool ignoreModels = false;
|
bool ignoreModels = false;
|
||||||
|
|
||||||
std::string gamePath( "C:\\Program Files (x86)\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
|
std::string gamePath( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack" );
|
||||||
std::unordered_map< uint32_t, std::string > eobjNameMap;
|
std::unordered_map< uint32_t, std::string > eobjNameMap;
|
||||||
std::unordered_map< uint16_t, std::string > zoneNameMap;
|
std::unordered_map< uint16_t, std::string > zoneNameMap;
|
||||||
std::unordered_map< uint16_t, std::vector< std::pair< uint16_t, std::string > > > zoneInstanceMap;
|
std::unordered_map< uint16_t, std::vector< std::pair< uint16_t, std::string > > > zoneInstanceMap;
|
||||||
|
@ -335,7 +335,7 @@ int main( int argc, char* argv[] )
|
||||||
|
|
||||||
std::vector< std::string > argVec( argv + 1, argv + argc );
|
std::vector< std::string > argVec( argv + 1, argv + argc );
|
||||||
// todo: support expansions
|
// todo: support expansions
|
||||||
std::string zoneName = "r1f1";
|
std::string zoneName = "r2t2";
|
||||||
bool dumpInstances = ignoreModels = std::remove_if( argVec.begin(), argVec.end(), []( auto arg ){ return arg == "--instance-dump"; } ) != argVec.end();
|
bool dumpInstances = ignoreModels = std::remove_if( argVec.begin(), argVec.end(), []( auto arg ){ return arg == "--instance-dump"; } ) != argVec.end();
|
||||||
|
|
||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
|
@ -366,12 +366,6 @@ LABEL_DUMP:
|
||||||
{
|
{
|
||||||
const auto& zonePath = zoneNameToPath( zoneName );
|
const auto& zonePath = zoneNameToPath( zoneName );
|
||||||
|
|
||||||
if( zonePath.find( "ex1/" ) != std::string::npos || zonePath.find( "ex2" ) != std::string::npos )
|
|
||||||
{
|
|
||||||
std::cout << "[Error] Expansions are currently not supported " << zonePath << "\n";
|
|
||||||
goto LABEL_NEXT_ZONE_ENTRY;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string listPcbPath( zonePath + "/collision/list.pcb" );
|
std::string listPcbPath( zonePath + "/collision/list.pcb" );
|
||||||
std::string bgLgbPath( zonePath + "/level/bg.lgb" );
|
std::string bgLgbPath( zonePath + "/level/bg.lgb" );
|
||||||
std::string planmapLgbPath( zonePath + "/level/planmap.lgb" );
|
std::string planmapLgbPath( zonePath + "/level/planmap.lgb" );
|
||||||
|
@ -381,15 +375,15 @@ LABEL_DUMP:
|
||||||
std::vector< char > section2;
|
std::vector< char > section2;
|
||||||
|
|
||||||
#ifndef STANDALONE
|
#ifndef STANDALONE
|
||||||
const xiv::dat::Cat& test = data1->get_category( "bg" );
|
const xiv::dat::Cat& test = data1->getCategory( "bg" );
|
||||||
|
|
||||||
auto test_file = data1->get_file( bgLgbPath );
|
auto test_file = data1->getFile( bgLgbPath );
|
||||||
section = test_file->access_data_sections().at( 0 );
|
section = test_file->access_data_sections().at( 0 );
|
||||||
|
|
||||||
auto planmap_file = data1->get_file( planmapLgbPath );
|
auto planmap_file = data1->getFile( planmapLgbPath );
|
||||||
section2 = planmap_file->access_data_sections().at( 0 );
|
section2 = planmap_file->access_data_sections().at( 0 );
|
||||||
|
|
||||||
auto test_file1 = data1->get_file( listPcbPath );
|
auto test_file1 = data1->getFile( listPcbPath );
|
||||||
section1 = test_file1->access_data_sections().at( 0 );
|
section1 = test_file1->access_data_sections().at( 0 );
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
|
@ -475,7 +469,7 @@ LABEL_DUMP:
|
||||||
char* dataSection = nullptr;
|
char* dataSection = nullptr;
|
||||||
//std::cout << fileName << " ";
|
//std::cout << fileName << " ";
|
||||||
#ifndef STANDALONE
|
#ifndef STANDALONE
|
||||||
auto file = data1->get_file( fileName );
|
auto file = data1->getFile( fileName );
|
||||||
auto sections = file->get_data_sections();
|
auto sections = file->get_data_sections();
|
||||||
dataSection = §ions.at( 0 )[0];
|
dataSection = §ions.at( 0 )[0];
|
||||||
#else
|
#else
|
||||||
|
@ -527,7 +521,7 @@ LABEL_DUMP:
|
||||||
char* dataSection = nullptr;
|
char* dataSection = nullptr;
|
||||||
//std::cout << fileName << " ";
|
//std::cout << fileName << " ";
|
||||||
#ifndef STANDALONE
|
#ifndef STANDALONE
|
||||||
auto file = data1->get_file( fileName );
|
auto file = data1->getFile( fileName );
|
||||||
auto sections = file->get_data_sections();
|
auto sections = file->get_data_sections();
|
||||||
dataSection = §ions.at( 0 )[0];
|
dataSection = §ions.at( 0 )[0];
|
||||||
#else
|
#else
|
||||||
|
@ -743,6 +737,8 @@ LABEL_DUMP:
|
||||||
std::cout << "\n\n\n[Success] Finished all tasks in " <<
|
std::cout << "\n\n\n[Success] Finished all tasks in " <<
|
||||||
std::chrono::duration_cast< std::chrono::seconds >( std::chrono::system_clock::now() - startTime ).count() << " seconds\n";
|
std::chrono::duration_cast< std::chrono::seconds >( std::chrono::system_clock::now() - startTime ).count() << " seconds\n";
|
||||||
|
|
||||||
|
getchar();
|
||||||
|
|
||||||
if( eData )
|
if( eData )
|
||||||
delete eData;
|
delete eData;
|
||||||
if( data1 )
|
if( data1 )
|
||||||
|
|
|
@ -299,7 +299,7 @@ int main( int argc, char** argv )
|
||||||
|
|
||||||
bool unluac = false;
|
bool unluac = false;
|
||||||
// std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
// std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
||||||
std::string datLocation( "C:/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn/game/sqpack/ffxiv" );
|
std::string datLocation( "C:/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn/game/sqpack" );
|
||||||
if ( argc > 1 )
|
if ( argc > 1 )
|
||||||
datLocation = std::string( argv[1] );
|
datLocation = std::string( argv[1] );
|
||||||
if ( argc > 2 )
|
if ( argc > 2 )
|
||||||
|
@ -350,11 +350,11 @@ int main( int argc, char** argv )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const xiv::dat::Cat& test = data.get_category( "game_script" );
|
const xiv::dat::Cat& test = data.getCategory( "game_script" );
|
||||||
|
|
||||||
const std::string questPath = "game_script/quest/" + folder + "/" + questInfo->name_intern + ".luab";
|
const std::string questPath = "game_script/quest/" + folder + "/" + questInfo->name_intern + ".luab";
|
||||||
|
|
||||||
const auto &test_file = data.get_file( questPath );
|
const auto &test_file = data.getFile( questPath );
|
||||||
auto §ion = test_file->access_data_sections().at( 0 );
|
auto §ion = test_file->access_data_sections().at( 0 );
|
||||||
int32_t size = *( uint32_t* ) §ion[4];
|
int32_t size = *( uint32_t* ) §ion[4];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue