1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "nel/misc/types_nl.h"
23 #include "nel/misc/common.h"
24 #include "nel/misc/debug.h"
25 #include "nel/misc/command.h"
26 #include "nel/misc/config_file.h"
28 #include "nel/misc/path.h"
31 using namespace NLMISC
;
33 extern string OutputPath
;
34 extern vector
<string
> PacsPrimPath
;
35 extern vector
<string
> LookupPath
;
36 extern vector
<string
> LookupNoRecursePath
;
38 sint
main(sint argc
, char **argv
)
43 CConfigFile::CVar
*var
;
45 cf
.load(string("ai_build_wmap.cfg"));
48 var
= cf
.getVarPtr("Paths");
51 for (uint i
=0; i
< var
->size(); ++i
)
52 LookupPath
.push_back(var
->asString(i
));
55 var
= cf
.getVarPtr("NoRecursePaths");
58 for (uint i
=0; i
< var
->size(); ++i
)
59 LookupNoRecursePath
.push_back(var
->asString(i
));
62 var
= cf
.getVarPtr("PacsPrimPaths");
65 for (uint i
=0; i
< var
->size(); ++i
)
66 PacsPrimPath
.push_back(var
->asString(i
));
69 var
= cf
.getVarPtr("OutputPath");
72 OutputPath
= CPath::standardizePath(var
->asString());
76 vector
<string
> commands
;
77 var
= cf
.getVarPtr("Commands");
80 for (uint i
=0; i
< var
->size(); ++i
)
81 commands
.push_back(var
->asString(i
));
85 for (sint i
=1; i
< argc
; ++i
)
87 if (string(argv
[i
]) == string("-"))
91 commands
.push_back(cmd
);
104 commands
.push_back(cmd
);
106 NLMISC::createDebug ();
107 nlinfo("Running commands:");
109 for (uint i
=0; i
<commands
.size(); ++i
)
110 ICommand::execute(commands
[i
], *InfoLog
);