1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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 "spt_module_itf.h"
26 /////////////////////////////////////////////////////////////////
27 // WARNING : this is a generated file, don't change it !
28 /////////////////////////////////////////////////////////////////
31 const CServerPatchTerminalSkel::TMessageHandlerMap
&CServerPatchTerminalSkel::getMessageHandlers() const
33 static TMessageHandlerMap handlers
;
34 static bool init
= false;
38 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
40 res
= handlers
.insert(std::make_pair(std::string("SPT_STATE"), &CServerPatchTerminalSkel::declareState_skel
));
41 // if this assert, you have a doubly message name in your interface definition !
44 res
= handlers
.insert(std::make_pair(std::string("SPT_MODULEDOWN"), &CServerPatchTerminalSkel::declareModuleDown_skel
));
45 // if this assert, you have a doubly message name in your interface definition !
48 res
= handlers
.insert(std::make_pair(std::string("SPT_VERSION_NAME"), &CServerPatchTerminalSkel::declareVersionName_skel
));
49 // if this assert, you have a doubly message name in your interface definition !
52 res
= handlers
.insert(std::make_pair(std::string("SPT_DOMAIN_INFO"), &CServerPatchTerminalSkel::declareDomainInfo_skel
));
53 // if this assert, you have a doubly message name in your interface definition !
56 res
= handlers
.insert(std::make_pair(std::string("SPT_VERSION_ACK"), &CServerPatchTerminalSkel::ackVersionChange_skel
));
57 // if this assert, you have a doubly message name in your interface definition !
60 res
= handlers
.insert(std::make_pair(std::string("SPT_SPA_EXEC_ACK"), &CServerPatchTerminalSkel::onSPAExecutedCommandAck_skel
));
61 // if this assert, you have a doubly message name in your interface definition !
64 res
= handlers
.insert(std::make_pair(std::string("SPT_SPA_EXEC_RESULT"), &CServerPatchTerminalSkel::onSPAExecutedCommandResult_skel
));
65 // if this assert, you have a doubly message name in your interface definition !
73 bool CServerPatchTerminalSkel::onDispatchMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
75 const TMessageHandlerMap
&mh
= getMessageHandlers();
77 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
84 TMessageHandler cmd
= it
->second
;
85 (this->*cmd
)(sender
, message
);
91 void CServerPatchTerminalSkel::declareState_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
93 NLMISC::CSString moduleName
;
94 nlRead(__message
, serial
, moduleName
);
95 NLMISC::CSString state
;
96 nlRead(__message
, serial
, state
);
97 declareState(sender
, moduleName
, state
);
100 void CServerPatchTerminalSkel::declareModuleDown_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
102 NLMISC::CSString moduleName
;
103 nlRead(__message
, serial
, moduleName
);
104 declareModuleDown(sender
, moduleName
);
107 void CServerPatchTerminalSkel::declareVersionName_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
109 NLMISC::CSString versionName
;
110 nlRead(__message
, serial
, versionName
);
111 uint32 clientVersion
;
112 nlRead(__message
, serial
, clientVersion
);
113 uint32 serverVersion
;
114 nlRead(__message
, serial
, serverVersion
);
115 declareVersionName(sender
, versionName
, clientVersion
, serverVersion
);
118 void CServerPatchTerminalSkel::declareDomainInfo_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
120 NLMISC::CSString domainName
;
121 nlRead(__message
, serial
, domainName
);
122 uint32 installVersion
;
123 nlRead(__message
, serial
, installVersion
);
124 uint32 launchVersion
;
125 nlRead(__message
, serial
, launchVersion
);
126 declareDomainInfo(sender
, domainName
, installVersion
, launchVersion
);
129 void CServerPatchTerminalSkel::ackVersionChange_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
131 NLMISC::CSString domainName
;
132 nlRead(__message
, serial
, domainName
);
134 nlRead(__message
, serial
, success
);
135 NLMISC::CSString comment
;
136 nlRead(__message
, serial
, comment
);
137 ackVersionChange(sender
, domainName
, success
, comment
);
140 void CServerPatchTerminalSkel::onSPAExecutedCommandAck_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
142 NLMISC::CSString result
;
143 nlRead(__message
, serial
, result
);
144 onSPAExecutedCommandAck(sender
, result
);
147 void CServerPatchTerminalSkel::onSPAExecutedCommandResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
149 NLMISC::CSString originator
;
150 nlRead(__message
, serial
, originator
);
151 NLMISC::CSString commandline
;
152 nlRead(__message
, serial
, commandline
);
153 NLMISC::CSString result
;
154 nlRead(__message
, serial
, result
);
155 onSPAExecutedCommandResult(sender
, originator
, commandline
, result
);
158 // Message sent by SPM module to declare the state of a named module
159 // This message is sent by the SPM for each connected SP / RE / RR type module on connection of SPT to SPM
160 // This message is also sent by the SPM for each type the SPM receives a state update from a SP / RE / RR type module
161 void CServerPatchTerminalProxy::declareState(NLNET::IModule
*sender
, const NLMISC::CSString
&moduleName
, const NLMISC::CSString
&state
)
163 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
165 // immediate local synchronous dispatching
166 _LocalModuleSkel
->declareState(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), moduleName
, state
);
170 // send the message for remote dispatching and execution or local queing
171 NLNET::CMessage __message
;
173 buildMessageFor_declareState(__message
, moduleName
, state
);
175 _ModuleProxy
->sendModuleMessage(sender
, __message
);
179 // Message sent by SPM module to declare module down for a connected SPA / RE / RR type module
180 void CServerPatchTerminalProxy::declareModuleDown(NLNET::IModule
*sender
, const NLMISC::CSString
&moduleName
)
182 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
184 // immediate local synchronous dispatching
185 _LocalModuleSkel
->declareModuleDown(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), moduleName
);
189 // send the message for remote dispatching and execution or local queing
190 NLNET::CMessage __message
;
192 buildMessageFor_declareModuleDown(__message
, moduleName
);
194 _ModuleProxy
->sendModuleMessage(sender
, __message
);
198 // Message sent by SPM module to define a named version
199 void CServerPatchTerminalProxy::declareVersionName(NLNET::IModule
*sender
, const NLMISC::CSString
&versionName
, uint32 clientVersion
, uint32 serverVersion
)
201 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
203 // immediate local synchronous dispatching
204 _LocalModuleSkel
->declareVersionName(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), versionName
, clientVersion
, serverVersion
);
208 // send the message for remote dispatching and execution or local queing
209 NLNET::CMessage __message
;
211 buildMessageFor_declareVersionName(__message
, versionName
, clientVersion
, serverVersion
);
213 _ModuleProxy
->sendModuleMessage(sender
, __message
);
217 // Message sent by SPM module to give info on a named domain
218 void CServerPatchTerminalProxy::declareDomainInfo(NLNET::IModule
*sender
, const NLMISC::CSString
&domainName
, uint32 installVersion
, uint32 launchVersion
)
220 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
222 // immediate local synchronous dispatching
223 _LocalModuleSkel
->declareDomainInfo(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), domainName
, installVersion
, launchVersion
);
227 // send the message for remote dispatching and execution or local queing
228 NLNET::CMessage __message
;
230 buildMessageFor_declareDomainInfo(__message
, domainName
, installVersion
, launchVersion
);
232 _ModuleProxy
->sendModuleMessage(sender
, __message
);
236 // Message sent by SPM module to acknowledge a version change attempt
237 void CServerPatchTerminalProxy::ackVersionChange(NLNET::IModule
*sender
, const NLMISC::CSString
&domainName
, bool success
, const NLMISC::CSString
&comment
)
239 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
241 // immediate local synchronous dispatching
242 _LocalModuleSkel
->ackVersionChange(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), domainName
, success
, comment
);
246 // send the message for remote dispatching and execution or local queing
247 NLNET::CMessage __message
;
249 buildMessageFor_ackVersionChange(__message
, domainName
, success
, comment
);
251 _ModuleProxy
->sendModuleMessage(sender
, __message
);
255 // Message sent by SPA with result of command issuued via executeCommandOnSPA()
256 void CServerPatchTerminalProxy::onSPAExecutedCommandAck(NLNET::IModule
*sender
, const NLMISC::CSString
&result
)
258 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
260 // immediate local synchronous dispatching
261 _LocalModuleSkel
->onSPAExecutedCommandAck(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), result
);
265 // send the message for remote dispatching and execution or local queing
266 NLNET::CMessage __message
;
268 buildMessageFor_onSPAExecutedCommandAck(__message
, result
);
270 _ModuleProxy
->sendModuleMessage(sender
, __message
);
274 // Message sent by SPA with result of command issuued via executeCommandOnSPA()
275 void CServerPatchTerminalProxy::onSPAExecutedCommandResult(NLNET::IModule
*sender
, const NLMISC::CSString
&originator
, const NLMISC::CSString
&commandline
, const NLMISC::CSString
&result
)
277 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
279 // immediate local synchronous dispatching
280 _LocalModuleSkel
->onSPAExecutedCommandResult(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), originator
, commandline
, result
);
284 // send the message for remote dispatching and execution or local queing
285 NLNET::CMessage __message
;
287 buildMessageFor_onSPAExecutedCommandResult(__message
, originator
, commandline
, result
);
289 _ModuleProxy
->sendModuleMessage(sender
, __message
);
293 // Message serializer. Return the message received in reference for easier integration
294 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_declareState(NLNET::CMessage
&__message
, const NLMISC::CSString
&moduleName
, const NLMISC::CSString
&state
)
296 __message
.setType("SPT_STATE");
297 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (moduleName
));
298 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (state
));
304 // Message serializer. Return the message received in reference for easier integration
305 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_declareModuleDown(NLNET::CMessage
&__message
, const NLMISC::CSString
&moduleName
)
307 __message
.setType("SPT_MODULEDOWN");
308 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (moduleName
));
314 // Message serializer. Return the message received in reference for easier integration
315 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_declareVersionName(NLNET::CMessage
&__message
, const NLMISC::CSString
&versionName
, uint32 clientVersion
, uint32 serverVersion
)
317 __message
.setType("SPT_VERSION_NAME");
318 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (versionName
));
319 nlWrite(__message
, serial
, clientVersion
);
320 nlWrite(__message
, serial
, serverVersion
);
326 // Message serializer. Return the message received in reference for easier integration
327 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_declareDomainInfo(NLNET::CMessage
&__message
, const NLMISC::CSString
&domainName
, uint32 installVersion
, uint32 launchVersion
)
329 __message
.setType("SPT_DOMAIN_INFO");
330 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (domainName
));
331 nlWrite(__message
, serial
, installVersion
);
332 nlWrite(__message
, serial
, launchVersion
);
338 // Message serializer. Return the message received in reference for easier integration
339 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_ackVersionChange(NLNET::CMessage
&__message
, const NLMISC::CSString
&domainName
, bool success
, const NLMISC::CSString
&comment
)
341 __message
.setType("SPT_VERSION_ACK");
342 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (domainName
));
343 nlWrite(__message
, serial
, success
);
344 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (comment
));
350 // Message serializer. Return the message received in reference for easier integration
351 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_onSPAExecutedCommandAck(NLNET::CMessage
&__message
, const NLMISC::CSString
&result
)
353 __message
.setType("SPT_SPA_EXEC_ACK");
354 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (result
));
360 // Message serializer. Return the message received in reference for easier integration
361 const NLNET::CMessage
&CServerPatchTerminalProxy::buildMessageFor_onSPAExecutedCommandResult(NLNET::CMessage
&__message
, const NLMISC::CSString
&originator
, const NLMISC::CSString
&commandline
, const NLMISC::CSString
&result
)
363 __message
.setType("SPT_SPA_EXEC_RESULT");
364 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (originator
));
365 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (commandline
));
366 nlWrite(__message
, serial
, const_cast < NLMISC::CSString
& > (result
));