Add infos into target window
[ryzomcore.git] / ryzom / server / src / patchman_service / spm_module_itf.cpp
blobf76da66182a2b749ec932762a5fe9d558dd487d6
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 /////////////////////////////////////////////////////////////////
18 // WARNING : this is a generated file, don't change it !
19 /////////////////////////////////////////////////////////////////
21 #include "spm_module_itf.h"
23 namespace PATCHMAN
26 /////////////////////////////////////////////////////////////////
27 // WARNING : this is a generated file, don't change it !
28 /////////////////////////////////////////////////////////////////
31 const CServerPatchManagerSkel::TMessageHandlerMap &CServerPatchManagerSkel::getMessageHandlers() const
33 static TMessageHandlerMap handlers;
34 static bool init = false;
36 if (!init)
38 std::pair < TMessageHandlerMap::iterator, bool > res;
40 res = handlers.insert(std::make_pair(std::string("SPM_REFRESH"), &CServerPatchManagerSkel::requestRefresh_skel));
41 // if this assert, you have a doubly message name in your interface definition !
42 nlassert(res.second);
44 res = handlers.insert(std::make_pair(std::string("SPM_SETNEXT"), &CServerPatchManagerSkel::setInstallVersion_skel));
45 // if this assert, you have a doubly message name in your interface definition !
46 nlassert(res.second);
48 res = handlers.insert(std::make_pair(std::string("SPM_SETLIVE"), &CServerPatchManagerSkel::setLaunchVersion_skel));
49 // if this assert, you have a doubly message name in your interface definition !
50 nlassert(res.second);
52 res = handlers.insert(std::make_pair(std::string("SPM_STATE"), &CServerPatchManagerSkel::declareState_skel));
53 // if this assert, you have a doubly message name in your interface definition !
54 nlassert(res.second);
56 res = handlers.insert(std::make_pair(std::string("SPM_VERSION_NAME"), &CServerPatchManagerSkel::declareVersionName_skel));
57 // if this assert, you have a doubly message name in your interface definition !
58 nlassert(res.second);
60 res = handlers.insert(std::make_pair(std::string("SPM_SPA_EXEC"), &CServerPatchManagerSkel::executeCommandOnSPA_skel));
61 // if this assert, you have a doubly message name in your interface definition !
62 nlassert(res.second);
64 res = handlers.insert(std::make_pair(std::string("SPM_SPA_EXEC_RESULT"), &CServerPatchManagerSkel::spaExecutedCommandResult_skel));
65 // if this assert, you have a doubly message name in your interface definition !
66 nlassert(res.second);
68 init = true;
71 return handlers;
73 bool CServerPatchManagerSkel::onDispatchMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
75 const TMessageHandlerMap &mh = getMessageHandlers();
77 TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
79 if (it == mh.end())
81 return false;
84 TMessageHandler cmd = it->second;
85 (this->*cmd)(sender, message);
87 return true;
91 void CServerPatchManagerSkel::requestRefresh_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
93 requestRefresh(sender);
96 void CServerPatchManagerSkel::setInstallVersion_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
98 NLMISC::CSString domain;
99 nlRead(__message, serial, domain);
100 uint32 version;
101 nlRead(__message, serial, version);
102 setInstallVersion(sender, domain, version);
105 void CServerPatchManagerSkel::setLaunchVersion_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
107 NLMISC::CSString domain;
108 nlRead(__message, serial, domain);
109 uint32 version;
110 nlRead(__message, serial, version);
111 setLaunchVersion(sender, domain, version);
114 void CServerPatchManagerSkel::declareState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
116 NLMISC::CSString state;
117 nlRead(__message, serial, state);
118 declareState(sender, state);
121 void CServerPatchManagerSkel::declareVersionName_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
123 NLMISC::CSString versionName;
124 nlRead(__message, serial, versionName);
125 uint32 clientVersion;
126 nlRead(__message, serial, clientVersion);
127 uint32 serverVersion;
128 nlRead(__message, serial, serverVersion);
129 declareVersionName(sender, versionName, clientVersion, serverVersion);
132 void CServerPatchManagerSkel::executeCommandOnSPA_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
134 NLMISC::CSString target;
135 nlRead(__message, serial, target);
136 NLMISC::CSString commandline;
137 nlRead(__message, serial, commandline);
138 executeCommandOnSPA(sender, target, commandline);
141 void CServerPatchManagerSkel::spaExecutedCommandResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
143 NLMISC::CSString originator;
144 nlRead(__message, serial, originator);
145 NLMISC::CSString commandline;
146 nlRead(__message, serial, commandline);
147 NLMISC::CSString result;
148 nlRead(__message, serial, result);
149 spaExecutedCommandResult(sender, originator, commandline, result);
152 // Message sent by SPT module to request a refresh of state info etc
153 void CServerPatchManagerProxy::requestRefresh(NLNET::IModule *sender)
155 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
157 // immediate local synchronous dispatching
158 _LocalModuleSkel->requestRefresh(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender));
160 else
162 // send the message for remote dispatching and execution or local queing
163 NLNET::CMessage __message;
165 buildMessageFor_requestRefresh(__message);
167 _ModuleProxy->sendModuleMessage(sender, __message);
171 // Message sent by SPT module to request a change of install version for a given domain
172 // This message is forwarded to all SPA modules of the given domain
173 void CServerPatchManagerProxy::setInstallVersion(NLNET::IModule *sender, const NLMISC::CSString &domain, uint32 version)
175 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
177 // immediate local synchronous dispatching
178 _LocalModuleSkel->setInstallVersion(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), domain, version);
180 else
182 // send the message for remote dispatching and execution or local queing
183 NLNET::CMessage __message;
185 buildMessageFor_setInstallVersion(__message, domain, version);
187 _ModuleProxy->sendModuleMessage(sender, __message);
191 // Message sent by SPT module to request a change of launch version for a given domain
192 // This message is forwarded to all SPA modules of the given domain
193 void CServerPatchManagerProxy::setLaunchVersion(NLNET::IModule *sender, const NLMISC::CSString &domain, uint32 version)
195 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
197 // immediate local synchronous dispatching
198 _LocalModuleSkel->setLaunchVersion(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), domain, version);
200 else
202 // send the message for remote dispatching and execution or local queing
203 NLNET::CMessage __message;
205 buildMessageFor_setLaunchVersion(__message, domain, version);
207 _ModuleProxy->sendModuleMessage(sender, __message);
211 // Message sent by RE / RR / SPA type modules to declare their states
212 // This message is forwarded to all connected SPT modules
213 void CServerPatchManagerProxy::declareState(NLNET::IModule *sender, const NLMISC::CSString &state)
215 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
217 // immediate local synchronous dispatching
218 _LocalModuleSkel->declareState(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), state);
220 else
222 // send the message for remote dispatching and execution or local queing
223 NLNET::CMessage __message;
225 buildMessageFor_declareState(__message, state);
227 _ModuleProxy->sendModuleMessage(sender, __message);
231 // Message sent by SPT module to define a new named version
232 void CServerPatchManagerProxy::declareVersionName(NLNET::IModule *sender, const NLMISC::CSString &versionName, uint32 clientVersion, uint32 serverVersion)
234 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
236 // immediate local synchronous dispatching
237 _LocalModuleSkel->declareVersionName(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), versionName, clientVersion, serverVersion);
239 else
241 // send the message for remote dispatching and execution or local queing
242 NLNET::CMessage __message;
244 buildMessageFor_declareVersionName(__message, versionName, clientVersion, serverVersion);
246 _ModuleProxy->sendModuleMessage(sender, __message);
250 // Message sent by SPT module to request execution of a command on one or more modules
251 // Note that the 'target' parameter may be a wildcard
252 void CServerPatchManagerProxy::executeCommandOnSPA(NLNET::IModule *sender, const NLMISC::CSString &target, const NLMISC::CSString &commandline)
254 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
256 // immediate local synchronous dispatching
257 _LocalModuleSkel->executeCommandOnSPA(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), target, commandline);
259 else
261 // send the message for remote dispatching and execution or local queing
262 NLNET::CMessage __message;
264 buildMessageFor_executeCommandOnSPA(__message, target, commandline);
266 _ModuleProxy->sendModuleMessage(sender, __message);
270 // Message sent by SPA with result of command issuued via executeCommandOnSPA()
271 void CServerPatchManagerProxy::spaExecutedCommandResult(NLNET::IModule *sender, const NLMISC::CSString &originator, const NLMISC::CSString &commandline, const NLMISC::CSString &result)
273 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
275 // immediate local synchronous dispatching
276 _LocalModuleSkel->spaExecutedCommandResult(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), originator, commandline, result);
278 else
280 // send the message for remote dispatching and execution or local queing
281 NLNET::CMessage __message;
283 buildMessageFor_spaExecutedCommandResult(__message, originator, commandline, result);
285 _ModuleProxy->sendModuleMessage(sender, __message);
289 // Message serializer. Return the message received in reference for easier integration
290 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_requestRefresh(NLNET::CMessage &__message)
292 __message.setType("SPM_REFRESH");
295 return __message;
298 // Message serializer. Return the message received in reference for easier integration
299 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_setInstallVersion(NLNET::CMessage &__message, const NLMISC::CSString &domain, uint32 version)
301 __message.setType("SPM_SETNEXT");
302 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (domain));
303 nlWrite(__message, serial, version);
306 return __message;
309 // Message serializer. Return the message received in reference for easier integration
310 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_setLaunchVersion(NLNET::CMessage &__message, const NLMISC::CSString &domain, uint32 version)
312 __message.setType("SPM_SETLIVE");
313 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (domain));
314 nlWrite(__message, serial, version);
317 return __message;
320 // Message serializer. Return the message received in reference for easier integration
321 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_declareState(NLNET::CMessage &__message, const NLMISC::CSString &state)
323 __message.setType("SPM_STATE");
324 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (state));
327 return __message;
330 // Message serializer. Return the message received in reference for easier integration
331 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_declareVersionName(NLNET::CMessage &__message, const NLMISC::CSString &versionName, uint32 clientVersion, uint32 serverVersion)
333 __message.setType("SPM_VERSION_NAME");
334 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (versionName));
335 nlWrite(__message, serial, clientVersion);
336 nlWrite(__message, serial, serverVersion);
339 return __message;
342 // Message serializer. Return the message received in reference for easier integration
343 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_executeCommandOnSPA(NLNET::CMessage &__message, const NLMISC::CSString &target, const NLMISC::CSString &commandline)
345 __message.setType("SPM_SPA_EXEC");
346 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (target));
347 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (commandline));
350 return __message;
353 // Message serializer. Return the message received in reference for easier integration
354 const NLNET::CMessage &CServerPatchManagerProxy::buildMessageFor_spaExecutedCommandResult(NLNET::CMessage &__message, const NLMISC::CSString &originator, const NLMISC::CSString &commandline, const NLMISC::CSString &result)
356 __message.setType("SPM_SPA_EXEC_RESULT");
357 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (originator));
358 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (commandline));
359 nlWrite(__message, serial, const_cast < NLMISC::CSString& > (result));
362 return __message;
365 /////////////////////////////////////////////////////////////////
366 // WARNING : this is a generated file, don't change it !
367 /////////////////////////////////////////////////////////////////
370 const CDeploymentConfigurationSynchroniserSkel::TMessageHandlerMap &CDeploymentConfigurationSynchroniserSkel::getMessageHandlers() const
372 static TMessageHandlerMap handlers;
373 static bool init = false;
375 if (!init)
377 std::pair < TMessageHandlerMap::iterator, bool > res;
379 res = handlers.insert(std::make_pair(std::string("DEPCFG_REQUEST"), &CDeploymentConfigurationSynchroniserSkel::requestSync_skel));
380 // if this assert, you have a doubly message name in your interface definition !
381 nlassert(res.second);
383 res = handlers.insert(std::make_pair(std::string("DEPCFG_SYNC"), &CDeploymentConfigurationSynchroniserSkel::sync_skel));
384 // if this assert, you have a doubly message name in your interface definition !
385 nlassert(res.second);
387 init = true;
390 return handlers;
392 bool CDeploymentConfigurationSynchroniserSkel::onDispatchMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
394 const TMessageHandlerMap &mh = getMessageHandlers();
396 TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
398 if (it == mh.end())
400 return false;
403 TMessageHandler cmd = it->second;
404 (this->*cmd)(sender, message);
406 return true;
410 void CDeploymentConfigurationSynchroniserSkel::requestSync_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
412 requestSync(sender);
415 void CDeploymentConfigurationSynchroniserSkel::sync_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
417 NLNET::TBinBuffer dataBlob;
418 nlRead(__message, serial, dataBlob);
419 sync(sender, dataBlob);
422 // Request for a copy of another module's CDeploymentConfiguration singleton
423 void CDeploymentConfigurationSynchroniserProxy::requestSync(NLNET::IModule *sender)
425 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
427 // immediate local synchronous dispatching
428 _LocalModuleSkel->requestSync(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender));
430 else
432 // send the message for remote dispatching and execution or local queing
433 NLNET::CMessage __message;
435 buildMessageFor_requestSync(__message);
437 _ModuleProxy->sendModuleMessage(sender, __message);
441 // A copy of the data from the CDeploymentConfiguration singleton
442 void CDeploymentConfigurationSynchroniserProxy::sync(NLNET::IModule *sender, const NLNET::TBinBuffer &dataBlob)
444 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
446 // immediate local synchronous dispatching
447 _LocalModuleSkel->sync(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), dataBlob);
449 else
451 // send the message for remote dispatching and execution or local queing
452 NLNET::CMessage __message;
454 buildMessageFor_sync(__message, dataBlob);
456 _ModuleProxy->sendModuleMessage(sender, __message);
460 // Message serializer. Return the message received in reference for easier integration
461 const NLNET::CMessage &CDeploymentConfigurationSynchroniserProxy::buildMessageFor_requestSync(NLNET::CMessage &__message)
463 __message.setType("DEPCFG_REQUEST");
466 return __message;
469 // Message serializer. Return the message received in reference for easier integration
470 const NLNET::CMessage &CDeploymentConfigurationSynchroniserProxy::buildMessageFor_sync(NLNET::CMessage &__message, const NLNET::TBinBuffer &dataBlob)
472 __message.setType("DEPCFG_SYNC");
473 nlWrite(__message, serial, const_cast < NLNET::TBinBuffer& > (dataBlob));
476 return __message;