mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 08:27:46 +00:00
Fixed 2 small issues in the generator code
This commit is contained in:
parent
b89d7f586d
commit
56610fb07c
4 changed files with 10062 additions and 77 deletions
|
@ -31,8 +31,8 @@ Core::Logger g_log;
|
||||||
Core::Data::ExdData g_exdData;
|
Core::Data::ExdData g_exdData;
|
||||||
bool skipUnmapped = true;
|
bool skipUnmapped = true;
|
||||||
|
|
||||||
const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
//const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
||||||
//const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
|
const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
|
||||||
std::map< uint8_t, std::string > g_typeMap;
|
std::map< uint8_t, std::string > g_typeMap;
|
||||||
|
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ std::string generateStruct( const std::string &exd )
|
||||||
fieldName = indexToNameMap[count];
|
fieldName = indexToNameMap[count];
|
||||||
}
|
}
|
||||||
fieldName[0] = std::tolower( fieldName[0] );
|
fieldName[0] = std::tolower( fieldName[0] );
|
||||||
fieldName.erase( boost::remove_if( fieldName, boost::is_any_of(",-':!(){}<> \x02\x1f\x01\x03") ), fieldName.end() );
|
fieldName.erase( boost::remove_if( fieldName, boost::is_any_of(",-':![](){}<>% \x02\x1f\x01\x03") ), fieldName.end() );
|
||||||
indexToNameMap[count] = fieldName;
|
indexToNameMap[count] = fieldName;
|
||||||
indexToTypeMap[count] = type;
|
indexToTypeMap[count] = type;
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ std::string generateStruct( const std::string &exd )
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
result += "\n " + exd + "( uint32_t id, Core::Data::ExdDataGenerated* exdData );\n";
|
result += "\n " + exd + "( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );\n";
|
||||||
result += "};\n\n";
|
result += "};\n\n";
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -181,10 +181,10 @@ std::string generateConstructorsDecl( const std::string& exd )
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
|
||||||
result += "\n Core::Data::" + exd + "::" + exd + "( uint32_t id, Core::Data::ExdDataGenerated* exdData )\n";
|
result += "\n Core::Data::" + exd + "::" + exd + "( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )\n";
|
||||||
result += " {\n";
|
result += " {\n";
|
||||||
std::string indent = " ";
|
std::string indent = " ";
|
||||||
result += indent + "auto row = exdData->m_" + exd + "Dat.get_row( id );\n";
|
result += indent + "auto row = exdData->m_" + exd + "Dat.get_row( row_id );\n";
|
||||||
for( auto member : exhMem )
|
for( auto member : exhMem )
|
||||||
{
|
{
|
||||||
if( indexToNameMap.find( count ) == indexToNameMap.end() )
|
if( indexToNameMap.find( count ) == indexToNameMap.end() )
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -25,8 +25,8 @@ Core::Logger g_log;
|
||||||
Core::Data::ExdDataGenerated g_exdData;
|
Core::Data::ExdDataGenerated g_exdData;
|
||||||
|
|
||||||
|
|
||||||
const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
//const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
|
||||||
//const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
|
const std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv" );
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
@ -43,8 +43,8 @@ int main()
|
||||||
|
|
||||||
auto teri = g_exdData.getTerritoryType( 132 );
|
auto teri = g_exdData.getTerritoryType( 132 );
|
||||||
|
|
||||||
g_log.info( teri->field0 );
|
g_log.info( teri->name );
|
||||||
g_log.info( teri->field1 );
|
g_log.info( teri->bg );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue