Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / server / ai_build_wmap / main.cpp
blob80183c9c4a280fb81b86b53e5f045c98dc6a9d90
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
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"
30 using namespace std;
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)
40 createDebug();
42 CConfigFile cf;
43 CConfigFile::CVar *var;
45 cf.load(string("ai_build_wmap.cfg"));
48 var = cf.getVarPtr("Paths");
49 if (var != NULL)
51 for (uint i=0; i < var->size(); ++i)
52 LookupPath.push_back(var->asString(i));
55 var = cf.getVarPtr("NoRecursePaths");
56 if (var != NULL)
58 for (uint i=0; i < var->size(); ++i)
59 LookupNoRecursePath.push_back(var->asString(i));
62 var = cf.getVarPtr("PacsPrimPaths");
63 if (var != NULL)
65 for (uint i=0; i < var->size(); ++i)
66 PacsPrimPath.push_back(var->asString(i));
69 var = cf.getVarPtr("OutputPath");
70 if (var != NULL)
72 OutputPath = CPath::standardizePath(var->asString());
76 vector<string> commands;
77 var = cf.getVarPtr("Commands");
78 if (var != NULL)
80 for (uint i=0; i < var->size(); ++i)
81 commands.push_back(var->asString(i));
84 string cmd;
85 for (sint i=1; i < argc; ++i)
87 if (string(argv[i]) == string("-"))
89 if (!cmd.empty())
91 commands.push_back(cmd);
92 cmd.clear();
95 else
97 if (!cmd.empty())
98 cmd += ' ';
99 cmd += argv[i];
103 if (!cmd.empty())
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);
112 return 0;