diff --git a/code/nel/tools/pipeline/service/example_cfg/pipeline_service_master.cfg b/code/nel/tools/pipeline/service/example_cfg/pipeline_service_master.cfg index 5ece8f6c9..eadef870d 100644 --- a/code/nel/tools/pipeline/service/example_cfg/pipeline_service_master.cfg +++ b/code/nel/tools/pipeline/service/example_cfg/pipeline_service_master.cfg @@ -9,6 +9,7 @@ StartCommands += // Create a layer 3 server transport "gw.transportAdd L3Server l3s", + "gw.transportOptions l3s(PeerInvisible)", "gw.transportCmd l3s(open port="+MasterPort+")", // Create the master module (MASTER ONLY) diff --git a/code/nel/tools/pipeline/service/example_cfg/pipeline_service_slave.cfg b/code/nel/tools/pipeline/service/example_cfg/pipeline_service_slave.cfg index 1a9f077a7..280033b36 100644 --- a/code/nel/tools/pipeline/service/example_cfg/pipeline_service_slave.cfg +++ b/code/nel/tools/pipeline/service/example_cfg/pipeline_service_slave.cfg @@ -9,6 +9,7 @@ StartCommands += // Create a layer 3 client transport (SLAVE ONLY) "gw.transportAdd L3Client l3c", + "gw.transportOptions l3c(PeerInvisible)", "gw.transportCmd l3c(connect addr="+MasterAddress+":"+MasterPort+")", // Create the slave module diff --git a/code/nel/tools/pipeline/service/module_pipeline_master.cpp b/code/nel/tools/pipeline/service/module_pipeline_master.cpp index b2e73a205..4e9170b67 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_master.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_master.cpp @@ -62,16 +62,23 @@ class CModulePipelineMaster : CSlave(CModulePipelineMaster *master, IModuleProxy *moduleProxy) : Master(master), Proxy(moduleProxy), - ActiveTaskId(0) { } + ActiveTaskId(0), + SheetsOk(true) { } CModulePipelineMaster *Master; CModulePipelineSlaveProxy Proxy; std::vector Vector; uint32 ActiveTaskId; + bool SheetsOk; void cbUpdateDatabaseStatus() { Proxy.masterUpdatedDatabaseStatus(Master); } + + bool canAcceptTask() + { + return SheetsOk && (ActiveTaskId == 0); + } }; protected: @@ -162,6 +169,12 @@ public: // TODO } + virtual void slaveReloadedSheets(NLNET::IModuleProxy *sender) + { + CSlave *slave = m_Slaves[sender]; + slave->SheetsOk = true; + } + virtual void vectorPushString(NLNET::IModuleProxy *sender, const std::string &str) { CSlave *slave = m_Slaves[sender]; @@ -174,6 +187,29 @@ public: g_DatabaseStatus->updateDatabaseStatus(CCallback(slave, &CSlave::cbUpdateDatabaseStatus), slave->Vector, false, false); slave->Vector.clear(); } + +protected: + NLMISC_COMMAND_HANDLER_TABLE_EXTEND_BEGIN(CModulePipelineMaster, CModuleBase) + NLMISC_COMMAND_HANDLER_ADD(CModulePipelineMaster, reloadSheets, "Reload sheets across all services", "") + NLMISC_COMMAND_HANDLER_TABLE_END + + NLMISC_CLASS_COMMAND_DECL(reloadSheets) + { + if (args.size() != 0) return false; + + m_SlavesMutex.lock(); + + for (TSlaveMap::iterator it = m_Slaves.begin(), end = m_Slaves.end(); it != end; ++it) + { + CSlave *slave = it->second; + slave->SheetsOk = false; + slave->Proxy.reloadSheets(this); + } + + m_SlavesMutex.unlock(); + + return true; + } }; /* class CModulePipelineMaster */ diff --git a/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp b/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp index 9da26b338..3e59a5e44 100644 Binary files a/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp and b/code/nel/tools/pipeline/service/module_pipeline_master_itf.cpp differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_master_itf.h b/code/nel/tools/pipeline/service/module_pipeline_master_itf.h index 3f14d5c69..ddb7a4a38 100644 Binary files a/code/nel/tools/pipeline/service/module_pipeline_master_itf.h and b/code/nel/tools/pipeline/service/module_pipeline_master_itf.h differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml b/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml index 8f8126c64..e5a93eae7 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml +++ b/code/nel/tools/pipeline/service/module_pipeline_master_itf.xml @@ -16,6 +16,10 @@ + + + + diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp index be424159a..562960171 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp @@ -59,9 +59,10 @@ class CModulePipelineSlave : public: CModulePipelineMasterProxy *m_Master; bool m_TestCommand; + bool m_RequestedReloadSheets; public: - CModulePipelineSlave() : m_Master(NULL), m_TestCommand(false) + CModulePipelineSlave() : m_Master(NULL), m_TestCommand(false), m_RequestedReloadSheets(false) { } @@ -103,6 +104,12 @@ public: } } + virtual void onModuleUpdate() + { + if (m_RequestedReloadSheets) + m_RequestedReloadSheets = !PIPELINE::reloadSheets(); + } + virtual void startBuildTask(NLNET::IModuleProxy *sender, uint32 taskId, const std::string &projectName, const std::string &processHandler) { //this->queueModuleTask @@ -121,6 +128,12 @@ public: nlwarning("NOT_IMPLEMENTED"); } } + + virtual void reloadSheets(NLNET::IModuleProxy *sender) + { + if (!PIPELINE::reloadSheets()) + m_RequestedReloadSheets = true; + } protected: NLMISC_COMMAND_HANDLER_TABLE_EXTEND_BEGIN(CModulePipelineSlave, CModuleBase) diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp index 829328a04..4c768a123 100644 Binary files a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp and b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.cpp differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h index 05a534a5b..c8098b513 100644 Binary files a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h and b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.h differ diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml index 987196f8e..4ba679043 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml +++ b/code/nel/tools/pipeline/service/module_pipeline_slave_itf.xml @@ -16,6 +16,9 @@ + + + diff --git a/code/nel/tools/pipeline/service/pipeline_service.cpp b/code/nel/tools/pipeline/service/pipeline_service.cpp index c7470bca3..144658241 100644 --- a/code/nel/tools/pipeline/service/pipeline_service.cpp +++ b/code/nel/tools/pipeline/service/pipeline_service.cpp @@ -235,11 +235,15 @@ class CReloadSheets : public IRunnable }; CReloadSheets s_ReloadSheets; +} /* anonymous namespace */ + bool reloadSheets() { return tryStateTask(STATE_RELOAD_SHEETS, &s_ReloadSheets); } +namespace { + // ****************************************************************** class CUpdateDatabaseStatus : public IRunnable diff --git a/code/nel/tools/pipeline/service/pipeline_service.h b/code/nel/tools/pipeline/service/pipeline_service.h index 8e6f4e885..3f3812c45 100644 --- a/code/nel/tools/pipeline/service/pipeline_service.h +++ b/code/nel/tools/pipeline/service/pipeline_service.h @@ -70,6 +70,8 @@ std::string macroPath(const std::string &path); bool tryRunnableTask(std::string stateName, NLMISC::IRunnable *task); void endedRunnableTask(); +bool reloadSheets(); + extern NLGEORGES::UFormLoader *g_FormLoader; extern CPipelineWorkspace *g_PipelineWorkspace; extern CDatabaseStatus *g_DatabaseStatus;