Merge branch 'fixes' into main/gingo-test
[ryzomcore.git] / nelns / welcome_service / welcome_service_itf.cpp
blob3ebd3ba81b0e14870743ceae6c8843fcac565118
2 /////////////////////////////////////////////////////////////////
3 // WARNING : this is a generated file, don't change it !
4 /////////////////////////////////////////////////////////////////
6 #include "welcome_service_itf.h"
8 namespace WS
11 /////////////////////////////////////////////////////////////////
12 // WARNING : this is a generated file, don't change it !
13 /////////////////////////////////////////////////////////////////
16 const CWelcomeServiceSkel::TMessageHandlerMap &CWelcomeServiceSkel::getMessageHandlers() const
18 static TMessageHandlerMap handlers;
19 static bool init = false;
21 if (!init)
23 std::pair < TMessageHandlerMap::iterator, bool > res;
25 res = handlers.insert(std::make_pair(std::string("WU"), &CWelcomeServiceSkel::welcomeUser_skel));
26 // if this assert, you have a doubly message name in your interface definition !
27 nlassert(res.second);
29 res = handlers.insert(std::make_pair(std::string("DU"), &CWelcomeServiceSkel::disconnectUser_skel));
30 // if this assert, you have a doubly message name in your interface definition !
31 nlassert(res.second);
33 init = true;
36 return handlers;
38 bool CWelcomeServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
40 const TMessageHandlerMap &mh = getMessageHandlers();
42 TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
44 if (it == mh.end())
46 return false;
49 TMessageHandler cmd = it->second;
50 (this->*cmd)(sender, message);
52 return true;
56 void CWelcomeServiceSkel::welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
58 H_AUTO(CWelcomeServiceSkel_welcomeUser_WU);
59 uint32 charId;
60 nlRead(__message, serial, charId);
61 std::string userName;
62 nlRead(__message, serial, userName);
63 NLNET::CLoginCookie cookie;
64 nlRead(__message, serial, cookie);
65 std::string priviledge;
66 nlRead(__message, serial, priviledge);
67 std::string exPriviledge;
68 nlRead(__message, serial, exPriviledge);
69 WS::TUserRole mode;
70 nlRead(__message, serial, mode);
71 uint32 instanceId;
72 nlRead(__message, serial, instanceId);
73 welcomeUser(sender, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
76 void CWelcomeServiceSkel::disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
78 H_AUTO(CWelcomeServiceSkel_disconnectUser_DU);
79 uint32 userId;
80 nlRead(__message, serial, userId);
81 disconnectUser(sender, userId);
83 // ask the welcome service to welcome a character
84 void CWelcomeServiceProxy::welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId)
86 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
88 // immediate local synchronous dispatching
89 _LocalModuleSkel->welcomeUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
91 else
93 // send the message for remote dispatching and execution or local queing
94 NLNET::CMessage __message;
96 buildMessageFor_welcomeUser(__message, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
98 _ModuleProxy->sendModuleMessage(sender, __message);
101 // ask the welcome service to disconnect a user
102 void CWelcomeServiceProxy::disconnectUser(NLNET::IModule *sender, uint32 userId)
104 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
106 // immediate local synchronous dispatching
107 _LocalModuleSkel->disconnectUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId);
109 else
111 // send the message for remote dispatching and execution or local queing
112 NLNET::CMessage __message;
114 buildMessageFor_disconnectUser(__message, userId);
116 _ModuleProxy->sendModuleMessage(sender, __message);
120 // Message serializer. Return the message received in reference for easier integration
121 const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId)
123 __message.setType("WU");
124 nlWrite(__message, serial, charId);
125 nlWrite(__message, serial, const_cast < std::string& > (userName));
126 nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie));
127 nlWrite(__message, serial, const_cast < std::string& > (priviledge));
128 nlWrite(__message, serial, const_cast < std::string& > (exPriviledge));
129 nlWrite(__message, serial, mode);
130 nlWrite(__message, serial, instanceId);
133 return __message;
136 // Message serializer. Return the message received in reference for easier integration
137 const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId)
139 __message.setType("DU");
140 nlWrite(__message, serial, userId);
143 return __message;
146 /////////////////////////////////////////////////////////////////
147 // WARNING : this is a generated file, don't change it !
148 /////////////////////////////////////////////////////////////////
151 const CLoginServiceSkel::TMessageHandlerMap &CLoginServiceSkel::getMessageHandlers() const
153 static TMessageHandlerMap handlers;
154 static bool init = false;
156 if (!init)
158 std::pair < TMessageHandlerMap::iterator, bool > res;
160 res = handlers.insert(std::make_pair(std::string("PUL"), &CLoginServiceSkel::pendingUserLost_skel));
161 // if this assert, you have a doubly message name in your interface definition !
162 nlassert(res.second);
164 init = true;
167 return handlers;
169 bool CLoginServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
171 const TMessageHandlerMap &mh = getMessageHandlers();
173 TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
175 if (it == mh.end())
177 return false;
180 TMessageHandler cmd = it->second;
181 (this->*cmd)(sender, message);
183 return true;
187 void CLoginServiceSkel::pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
189 H_AUTO(CLoginServiceSkel_pendingUserLost_PUL);
190 NLNET::CLoginCookie cookie;
191 nlRead(__message, serial, cookie);
192 pendingUserLost(sender, cookie);
194 // An awaited user did not connect before the allowed timeout expire
195 void CLoginServiceProxy::pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie)
197 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
199 // immediate local synchronous dispatching
200 _LocalModuleSkel->pendingUserLost(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), cookie);
202 else
204 // send the message for remote dispatching and execution or local queing
205 NLNET::CMessage __message;
207 buildMessageFor_pendingUserLost(__message, cookie);
209 _ModuleProxy->sendModuleMessage(sender, __message);
213 // Message serializer. Return the message received in reference for easier integration
214 const NLNET::CMessage &CLoginServiceProxy::buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie)
216 __message.setType("PUL");
217 nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie));
220 return __message;
223 /////////////////////////////////////////////////////////////////
224 // WARNING : this is a generated file, don't change it !
225 /////////////////////////////////////////////////////////////////
228 const CWelcomeServiceClientSkel::TMessageHandlerMap &CWelcomeServiceClientSkel::getMessageHandlers() const
230 static TMessageHandlerMap handlers;
231 static bool init = false;
233 if (!init)
235 std::pair < TMessageHandlerMap::iterator, bool > res;
237 res = handlers.insert(std::make_pair(std::string("RWS"), &CWelcomeServiceClientSkel::registerWS_skel));
238 // if this assert, you have a doubly message name in your interface definition !
239 nlassert(res.second);
241 res = handlers.insert(std::make_pair(std::string("RWSOS"), &CWelcomeServiceClientSkel::reportWSOpenState_skel));
242 // if this assert, you have a doubly message name in your interface definition !
243 nlassert(res.second);
245 res = handlers.insert(std::make_pair(std::string("WUR"), &CWelcomeServiceClientSkel::welcomeUserResult_skel));
246 // if this assert, you have a doubly message name in your interface definition !
247 nlassert(res.second);
249 res = handlers.insert(std::make_pair(std::string("UCP"), &CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel));
250 // if this assert, you have a doubly message name in your interface definition !
251 nlassert(res.second);
253 init = true;
256 return handlers;
258 bool CWelcomeServiceClientSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
260 const TMessageHandlerMap &mh = getMessageHandlers();
262 TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
264 if (it == mh.end())
266 return false;
269 TMessageHandler cmd = it->second;
270 (this->*cmd)(sender, message);
272 return true;
276 void CWelcomeServiceClientSkel::registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
278 H_AUTO(CWelcomeServiceClientSkel_registerWS_RWS);
279 uint32 shardId;
280 nlRead(__message, serial, shardId);
281 uint32 fixedSessionId;
282 nlRead(__message, serial, fixedSessionId);
283 bool isOnline;
284 nlRead(__message, serial, isOnline);
285 registerWS(sender, shardId, fixedSessionId, isOnline);
288 void CWelcomeServiceClientSkel::reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
290 H_AUTO(CWelcomeServiceClientSkel_reportWSOpenState_RWSOS);
291 bool isOnline;
292 nlRead(__message, serial, isOnline);
293 reportWSOpenState(sender, isOnline);
296 void CWelcomeServiceClientSkel::welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
298 H_AUTO(CWelcomeServiceClientSkel_welcomeUserResult_WUR);
299 uint32 userId;
300 nlRead(__message, serial, userId);
301 bool ok;
302 nlRead(__message, serial, ok);
303 std::string shardAddr;
304 nlRead(__message, serial, shardAddr);
305 std::string errorMsg;
306 nlRead(__message, serial, errorMsg);
307 welcomeUserResult(sender, userId, ok, shardAddr, errorMsg);
310 void CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
312 H_AUTO(CWelcomeServiceClientSkel_updateConnectedPlayerCount_UCP);
313 uint32 nbOnlinePlayers;
314 nlRead(__message, serial, nbOnlinePlayers);
315 uint32 nbPendingPlayers;
316 nlRead(__message, serial, nbPendingPlayers);
317 updateConnectedPlayerCount(sender, nbOnlinePlayers, nbPendingPlayers);
319 // Register the welcome service in the ring session manager
320 // The provided sessionId will be non-zero only for a shard with a fixed sessionId
321 void CWelcomeServiceClientProxy::registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline)
323 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
325 // immediate local synchronous dispatching
326 _LocalModuleSkel->registerWS(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), shardId, fixedSessionId, isOnline);
328 else
330 // send the message for remote dispatching and execution or local queing
331 NLNET::CMessage __message;
333 buildMessageFor_registerWS(__message, shardId, fixedSessionId, isOnline);
335 _ModuleProxy->sendModuleMessage(sender, __message);
338 // WS report it's current open state
339 void CWelcomeServiceClientProxy::reportWSOpenState(NLNET::IModule *sender, bool isOnline)
341 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
343 // immediate local synchronous dispatching
344 _LocalModuleSkel->reportWSOpenState(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), isOnline);
346 else
348 // send the message for remote dispatching and execution or local queing
349 NLNET::CMessage __message;
351 buildMessageFor_reportWSOpenState(__message, isOnline);
353 _ModuleProxy->sendModuleMessage(sender, __message);
356 // return for welcome user
357 void CWelcomeServiceClientProxy::welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg)
359 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
361 // immediate local synchronous dispatching
362 _LocalModuleSkel->welcomeUserResult(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId, ok, shardAddr, errorMsg);
364 else
366 // send the message for remote dispatching and execution or local queing
367 NLNET::CMessage __message;
369 buildMessageFor_welcomeUserResult(__message, userId, ok, shardAddr, errorMsg);
371 _ModuleProxy->sendModuleMessage(sender, __message);
374 // transmits the current player counts
375 void CWelcomeServiceClientProxy::updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
377 if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
379 // immediate local synchronous dispatching
380 _LocalModuleSkel->updateConnectedPlayerCount(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), nbOnlinePlayers, nbPendingPlayers);
382 else
384 // send the message for remote dispatching and execution or local queing
385 NLNET::CMessage __message;
387 buildMessageFor_updateConnectedPlayerCount(__message, nbOnlinePlayers, nbPendingPlayers);
389 _ModuleProxy->sendModuleMessage(sender, __message);
393 // Message serializer. Return the message received in reference for easier integration
394 const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline)
396 __message.setType("RWS");
397 nlWrite(__message, serial, shardId);
398 nlWrite(__message, serial, fixedSessionId);
399 nlWrite(__message, serial, isOnline);
402 return __message;
405 // Message serializer. Return the message received in reference for easier integration
406 const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline)
408 __message.setType("RWSOS");
409 nlWrite(__message, serial, isOnline);
412 return __message;
415 // Message serializer. Return the message received in reference for easier integration
416 const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg)
418 __message.setType("WUR");
419 nlWrite(__message, serial, userId);
420 nlWrite(__message, serial, ok);
421 nlWrite(__message, serial, const_cast < std::string& > (shardAddr));
422 nlWrite(__message, serial, const_cast < std::string& > (errorMsg));
425 return __message;
428 // Message serializer. Return the message received in reference for easier integration
429 const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
431 __message.setType("UCP");
432 nlWrite(__message, serial, nbOnlinePlayers);
433 nlWrite(__message, serial, nbPendingPlayers);
436 return __message;