diff --git a/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp b/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp index 334f9484b..64263b89b 100644 --- a/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp +++ b/ryzom/server/src/patchman_service/spt_server_patch_terminal.cpp @@ -801,6 +801,7 @@ NLMISC_CLASS_COMMAND_IMPL(CServerPatchTerminal, depDevCfg) #if 1 std::map batches; + std::map inis; #endif for (uint i=0; i&>(cmdParams), true); + string launchCmd; for (uint i=0; i::iterator it = exeMap.find(toLowerAscii(p)); if (it != exeMap.end()) p = it->second; - p += exeSuffix; + launchCmd = p; + p = ""; } else { @@ -888,9 +891,29 @@ NLMISC_CLASS_COMMAND_IMPL(CServerPatchTerminal, depDevCfg) batchIt = batches.insert(pair(appDesc.ShardName, stringstream())).first; stringstream &batch = batchIt->second; batch << "cd \"" << DevWorkingDirectory.get() << "\\" << appDesc.AppName << "\"\n"; - batch << DevExePrefix.get() << cmdLine << "\n"; + batch << DevExePrefix.get() << launchCmd << exeSuffix << " " << cmdLine << "\n"; batch << DevSleepCmd.get() << "\n"; batch << "\n"; + map::iterator iniIt = inis.find(appDesc.ShardName); + if (iniIt == inis.end()) + { + iniIt = inis.insert(pair(appDesc.ShardName, stringstream())).first; + string shardTitle; + ptrdiff_t ti = 0; + NLMISC::appendToTitle(shardTitle, appDesc.ShardName, ti); + stringstream &ini = iniIt->second; + ini << "[]\n"; + ini << "Title=" << shardTitle << appDesc.ShardName.substr(ti) << "\n"; + ini << "\n"; + } + stringstream &ini = iniIt->second; + ini << "[" << appDesc.AppName << "]\n"; + ini << "Title=" << appDesc.AppName << "\n"; + ini << "ReadyPattern=^[^*].+Service Console\n"; + ini << "WorkingDirectory=.\\" << appDesc.AppName << "\n"; + ini << "LaunchCmd=" << launchCmd << "\n"; + ini << "LaunchArgs=" << cmdLine << "\n"; + ini << "\n"; #endif } @@ -904,6 +927,16 @@ NLMISC_CLASS_COMMAND_IMPL(CServerPatchTerminal, depDevCfg) fclose(fp); } + for (map::iterator it = inis.begin(), end = inis.end(); it != end; ++it) + { + fileName = DevConfigDirectory.get() + "/start_" + it->first + ".ini"; + FILE *fp = nlfopen(fileName, "wt"); + nlassert(fp != NULL); + string s = it->second.str(); + fwrite(s.c_str(), s.size(), 1, fp); + fclose(fp); + } + // TODO: Development AES configuration return true;