// NeL - MMORPG Framework // Copyright (C) 2014 by authors // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // // Author: Jan Boon #include // STL includes #include #include #include #include #include // NeL includes #include #include #include #include #include #include #include // Project includes // ... namespace { } /* anonymous namespace */ //////////////////////////////////////////////////////////////////////// // note: *.packed_sheets files are placed in // // and will need to be moved to the right location by // // your build script system. // //////////////////////////////////////////////////////////////////////// int main(int nNbArg, char **ppArgs) { // create debug stuff NLMISC::createDebug(); // verify all params if (nNbArg < 5) { nlinfo("ERROR : Wrong number of arguments\n"); nlinfo("USAGE : sheets_packer_shard \n"); return EXIT_FAILURE; } std::string leveldesignDir = std::string(ppArgs[1]); if (!NLMISC::CFile::isDirectory(leveldesignDir)) { nlerrornoex("Directory leveldesign '%s' does not exist", leveldesignDir.c_str()); return EXIT_FAILURE; } std::string dfnDir = std::string(ppArgs[2]); if (!NLMISC::CFile::isDirectory(dfnDir)) { nlerrornoex("Directory dfn '%s' does not exist", dfnDir.c_str()); return EXIT_FAILURE; } std::string datasetsDir = std::string(ppArgs[3]); if (!NLMISC::CFile::isDirectory(datasetsDir)) { nlerrornoex("Directory datasets '%s' does not exist", datasetsDir.c_str()); return EXIT_FAILURE; } std::string exportDir = std::string(ppArgs[4]); if (!NLMISC::CFile::isDirectory(exportDir)) { nlerrornoex("Directory build_packed_sheets '%s' does not exist", exportDir.c_str()); return EXIT_FAILURE; } // add search paths NLMISC::CPath::addSearchPath(leveldesignDir, true, false); NLMISC::CPath::addSearchPath(dfnDir, true, false); NLMISC::CPath::addSearchPath(datasetsDir, true, false); // this here does the magic // MS { // Used by mirror_service.cpp // Used by range_mirror_manager.cpp // Used by mirror.cpp TSDataSetSheets sDataSetSheets; loadForm("dataset", exportDir + "/datasets.packed_sheets", sDataSetSheets); } // IOS { // Used by string_manager_parcer.cpp std::map container; std::vector exts; exts.push_back("creature"); exts.push_back("race_stats"); loadForm(exts, exportDir + "/ios_sheets.packed_sheets", container); } // and that's all folks return EXIT_SUCCESS; } /* end of file */