mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-02 16:24:47 +00:00
Changed: Expand environment variables in paths read from cfg files
This commit is contained in:
parent
854d4dd624
commit
b82f133585
9 changed files with 17 additions and 17 deletions
|
@ -1169,7 +1169,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName,
|
|||
{
|
||||
for (uint i = 0; i < var->size(); i++)
|
||||
{
|
||||
CPath::addSearchPath (var->asString(i), true, false);
|
||||
CPath::addSearchPath (NLMISC::expandEnvironmentVariables(var->asString(i)), true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1177,7 +1177,7 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName,
|
|||
{
|
||||
for (uint i = 0; i < var->size(); i++)
|
||||
{
|
||||
CPath::addSearchPath (var->asString(i), false, false);
|
||||
CPath::addSearchPath (NLMISC::expandEnvironmentVariables(var->asString(i)), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -906,7 +906,7 @@ void AISHEETS::CSheets::packSheets(const std::string &writeFilesDirectoryName)
|
|||
{
|
||||
addSearchPath=true;
|
||||
for (uint32 i=0;i<varPtr->size();++i)
|
||||
CPath::addSearchPath(varPtr->asString(i).c_str(), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(varPtr->asString(i)), true, false);
|
||||
}
|
||||
loadForm2("aiaction", writeFilesDirectoryName+AISPackedActionSheetsFilename, _ActionSheets, true);
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ void AISHEETS::CSheets::packSheets(const std::string &writeFilesDirectoryName)
|
|||
{
|
||||
addSearchPath=true;
|
||||
for (uint32 i=0;i<varPtr->size();++i)
|
||||
CPath::addSearchPath(varPtr->asString(i).c_str(), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(varPtr->asString(i)), true, false);
|
||||
}
|
||||
loadForm("actionlist", writeFilesDirectoryName+AISPackedFightConfigSheetsFilename, _ActionListSheets, true);
|
||||
}
|
||||
|
@ -931,7 +931,7 @@ void AISHEETS::CSheets::packSheets(const std::string &writeFilesDirectoryName)
|
|||
{
|
||||
addSearchPath=true;
|
||||
for (uint32 i=0;i<varPtr->size();++i)
|
||||
CPath::addSearchPath(varPtr->asString(i).c_str(), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(varPtr->asString(i)), true, false);
|
||||
}
|
||||
loadForm2("creature", writeFilesDirectoryName+AISPackedSheetsFilename, _Sheets, true);
|
||||
}
|
||||
|
@ -943,7 +943,7 @@ void AISHEETS::CSheets::packSheets(const std::string &writeFilesDirectoryName)
|
|||
{
|
||||
addSearchPath=true;
|
||||
for (uint32 i=0;i<varPtr->size();++i)
|
||||
CPath::addSearchPath(varPtr->asString(i).c_str(), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(varPtr->asString(i)), true, false);
|
||||
}
|
||||
loadForm2("race_stats", writeFilesDirectoryName+AISPackedRaceStatsSheetsFilename, _RaceStatsSheets, true);
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
for(uint i = 0; i < ClientCfg.PreDataPath.size(); ++i)
|
||||
{
|
||||
CPath::addSearchPath(ClientCfg.PreDataPath[i], true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(ClientCfg.PreDataPath[i]), true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ int main()
|
|||
// add the search paths
|
||||
for (uint i=0; i<paths.size(); ++i)
|
||||
{
|
||||
CPath::addSearchPath(paths.asString(i), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(paths.asString(i)), true, false);
|
||||
}
|
||||
|
||||
// init ligo
|
||||
|
|
|
@ -179,7 +179,7 @@ int main( int argc, char ** argv )
|
|||
sint i;
|
||||
for( i = 0; i< (sint)cvSheetPaths.size(); ++i)
|
||||
{
|
||||
sheetPaths.push_back( cvSheetPaths.asString(i) );
|
||||
sheetPaths.push_back(NLMISC::expandEnvironmentVariables(cvSheetPaths.asString(i)));
|
||||
}
|
||||
}
|
||||
catch(const EUnknownVar &)
|
||||
|
|
|
@ -108,7 +108,7 @@ int main(int argc, char* argv[])
|
|||
//
|
||||
for(uint k = 0; k < builderConfig.SearchPaths.size(); ++k)
|
||||
{
|
||||
CPath::addSearchPath(builderConfig.SearchPaths[k], true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(builderConfig.SearchPaths[k]), true, false);
|
||||
}
|
||||
CPath::remapExtension("dds", "tga", true);
|
||||
CPath::remapExtension("dds", "png", true);
|
||||
|
|
|
@ -83,7 +83,7 @@ bool init()
|
|||
// Define the root path that contains all data needed for the application.
|
||||
nlinfo("Adding search paths...");
|
||||
for(uint i = 0; i < AppCfg.DataPath.size(); i++)
|
||||
CPath::addSearchPath(AppCfg.DataPath[i], true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(AppCfg.DataPath[i]), true, false);
|
||||
|
||||
// Initialize Sheet IDs.
|
||||
nlinfo("Init SheetId...");
|
||||
|
|
|
@ -256,11 +256,11 @@ int extractBotNames(int argc, char *argv[])
|
|||
|
||||
for (uint i=0; i<paths.size(); ++i)
|
||||
{
|
||||
CPath::addSearchPath(paths.asString(i), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(paths.asString(i)), true, false);
|
||||
}
|
||||
for (uint i=0; i<pathNoRecurse.size(); ++i)
|
||||
{
|
||||
CPath::addSearchPath(pathNoRecurse.asString(i), false, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(pathNoRecurse.asString(i)), false, false);
|
||||
}
|
||||
|
||||
for (uint i=0; i<filtersVar.size(); ++i)
|
||||
|
@ -278,7 +278,7 @@ int extractBotNames(int argc, char *argv[])
|
|||
if (Creatures.empty())
|
||||
{
|
||||
for (uint i=0;i<georgesPaths.size();++i)
|
||||
CPath::addSearchPath(georgesPaths.asString(i).c_str(), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(georgesPaths.asString(i)), true, false);
|
||||
|
||||
loadForm("creature", PACKED_SHEETS_NAME, Creatures, true);
|
||||
}
|
||||
|
|
|
@ -360,15 +360,15 @@ int extractNewSheetNames(int argc, char *argv[])
|
|||
// parse path
|
||||
for (uint i=0; i<paths.size(); ++i)
|
||||
{
|
||||
CPath::addSearchPath(paths.asString(i), true, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(paths.asString(i)), true, false);
|
||||
}
|
||||
for (uint i=0; i<pathNoRecurse.size(); ++i)
|
||||
{
|
||||
CPath::addSearchPath(pathNoRecurse.asString(i), false, false);
|
||||
CPath::addSearchPath(NLMISC::expandEnvironmentVariables(pathNoRecurse.asString(i)), false, false);
|
||||
}
|
||||
|
||||
// init ligo config once
|
||||
string ligoPath = CPath::lookup(ligoClassFile.asString(), true, true);
|
||||
string ligoPath = CPath::lookup(NLMISC::expandEnvironmentVariables(ligoClassFile.asString()), true, true);
|
||||
LigoConfig.readPrimitiveClass(ligoPath.c_str(), false);
|
||||
NLLIGO::Register();
|
||||
CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig;
|
||||
|
|
Loading…
Reference in a new issue