2 /////////////////////////////////////////////////////////////////
3 // WARNING : this is a generated file, don't change it !
4 /////////////////////////////////////////////////////////////////
6 #ifndef WELCOME_SERVICE_ITF
7 #define WELCOME_SERVICE_ITF
8 #include "nel/misc/types_nl.h"
12 #include "nel/misc/hierarchical_timer.h"
13 #include "nel/misc/string_conversion.h"
14 #include "nel/net/message.h"
15 #include "nel/net/module.h"
16 #include "nel/net/module_builder_parts.h"
17 #include "nel/net/module_message.h"
18 #include "nel/net/module_gateway.h"
20 #include "nel/net/login_cookie.h"
34 /// the highest valid value in the enum
35 last_enum_item
= ur_animator
,
36 /// a value equal to the last enum item +1
41 /// Number of enumerated values
45 /// Index table to convert enum value to linear index table
46 const std::map
<TValues
, uint32
> &getIndexTable() const
48 static std::map
<TValues
, uint32
> indexTable
;
49 static bool init
= false;
52 // fill the index table
53 indexTable
.insert(std::make_pair(ur_player
, 0));
54 indexTable
.insert(std::make_pair(ur_editor
, 1));
55 indexTable
.insert(std::make_pair(ur_animator
, 2));
64 static const NLMISC::CStringConversion
<TValues
> &getConversionTable()
66 NL_BEGIN_STRING_CONVERSION_TABLE(TValues
)
67 NL_STRING_CONVERSION_TABLE_ENTRY(ur_player
)
68 NL_STRING_CONVERSION_TABLE_ENTRY(ur_editor
)
69 NL_STRING_CONVERSION_TABLE_ENTRY(ur_animator
)
70 NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val
)
72 static NLMISC::CStringConversion
<TValues
>
73 conversionTable(TValues_nl_string_conversion_table
, sizeof(TValues_nl_string_conversion_table
)
74 / sizeof(TValues_nl_string_conversion_table
[0]), invalid_val
);
76 return conversionTable
;
86 TUserRole(TValues value
)
91 TUserRole(const std::string
&str
)
93 _Value
= getConversionTable().fromString(str
);
96 void serial(NLMISC::IStream
&s
)
101 bool operator == (const TUserRole
&other
) const
103 return _Value
== other
._Value
;
105 bool operator != (const TUserRole
&other
) const
107 return ! (_Value
== other
._Value
);
109 bool operator < (const TUserRole
&other
) const
111 return _Value
< other
._Value
;
114 bool operator <= (const TUserRole
&other
) const
116 return _Value
<= other
._Value
;
119 bool operator > (const TUserRole
&other
) const
121 return !(_Value
<= other
._Value
);
123 bool operator >= (const TUserRole
&other
) const
125 return !(_Value
< other
._Value
);
128 const std::string
&toString() const
130 return getConversionTable().toString(_Value
);
132 static const std::string
&toString(TValues value
)
134 return getConversionTable().toString(value
);
137 TValues
getValue() const
142 // return true if the actual value of the enum is valid, otherwise false
145 if (_Value
== invalid_val
)
148 // not invalid, check other enum value
149 return getConversionTable().isValid(_Value
);
155 std::map
<TValues
, uint32
>::const_iterator
it(getIndexTable().find(_Value
));
156 nlassert(it
!= getIndexTable().end());
162 /////////////////////////////////////////////////////////////////
163 // WARNING : this is a generated file, don't change it !
164 /////////////////////////////////////////////////////////////////
165 class CWelcomeServiceSkel
168 /// the interceptor type
169 typedef NLNET::CInterceptorForwarder
< CWelcomeServiceSkel
> TInterceptor
;
171 CWelcomeServiceSkel()
173 // do early run time check for message table
174 getMessageHandlers();
176 virtual ~CWelcomeServiceSkel()
180 void init(NLNET::IModule
*module
)
182 _Interceptor
.init(this, module
);
185 // unused interceptors
186 std::string
fwdBuildModuleManifest() const { return std::string(); }
187 void fwdOnModuleUp(NLNET::IModuleProxy
* /* moduleProxy */) {}
188 void fwdOnModuleDown(NLNET::IModuleProxy
* /* moduleProxy */) {}
189 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
* /* moduleProxy */) {}
191 // process module message interceptor
192 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
195 typedef void (CWelcomeServiceSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
196 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
198 const TMessageHandlerMap
&getMessageHandlers() const;
201 void welcomeUser_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
203 void disconnectUser_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
205 // declare one interceptor member of the skeleton
206 TInterceptor _Interceptor
;
208 // declare the interceptor forwarder as friend of this class
209 friend class NLNET::CInterceptorForwarder
< CWelcomeServiceSkel
>;
211 /////////////////////////////////////////////////////////////////
212 // WARNING : this is a generated file, don't change it !
213 /////////////////////////////////////////////////////////////////
215 // ask the welcome service to welcome a character
216 virtual void welcomeUser(NLNET::IModuleProxy
*sender
, uint32 charId
, const std::string
&userName
, const NLNET::CLoginCookie
&cookie
, const std::string
&priviledge
, const std::string
&exPriviledge
, WS::TUserRole mode
, uint32 instanceId
) =0;
217 // ask the welcome service to disconnect a user
218 virtual void disconnectUser(NLNET::IModuleProxy
*sender
, uint32 userId
) =0;
223 /////////////////////////////////////////////////////////////////
224 // WARNING : this is a generated file, don't change it !
225 /////////////////////////////////////////////////////////////////
226 class CWelcomeServiceProxy
228 /// Smart pointer on the module proxy
229 NLNET::TModuleProxyPtr _ModuleProxy
;
231 // Pointer on the local module that implement the interface (if the proxy is for a local module)
232 NLNET::TModulePtr _LocalModule
;
233 // Direct pointer on the server implementation interface for collocated module
234 CWelcomeServiceSkel
*_LocalModuleSkel
;
238 CWelcomeServiceProxy(NLNET::IModuleProxy
*proxy
)
240 nlassert(proxy
->getModuleClassName() == "WelcomeService");
241 _ModuleProxy
= proxy
;
243 // initialize collocated servant interface
244 if (proxy
->getModuleDistance() == 0)
246 _LocalModule
= proxy
->getLocalModule();
247 nlassert(_LocalModule
!= NULL
);
248 CWelcomeServiceSkel::TInterceptor
*interceptor
= NULL
;
249 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
250 nlassert(interceptor
!= NULL
);
252 _LocalModuleSkel
= interceptor
->getParent();
253 nlassert(_LocalModuleSkel
!= NULL
);
256 _LocalModuleSkel
= 0;
259 virtual ~CWelcomeServiceProxy()
263 NLNET::IModuleProxy
*getModuleProxy()
268 // ask the welcome service to welcome a character
269 void 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
);
270 // ask the welcome service to disconnect a user
271 void disconnectUser(NLNET::IModule
*sender
, uint32 userId
);
273 // Message serializer. Return the message received in reference for easier integration
274 static const NLNET::CMessage
&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
);
276 // Message serializer. Return the message received in reference for easier integration
277 static const NLNET::CMessage
&buildMessageFor_disconnectUser(NLNET::CMessage
&__message
, uint32 userId
);
284 /////////////////////////////////////////////////////////////////
285 // WARNING : this is a generated file, don't change it !
286 /////////////////////////////////////////////////////////////////
287 class CLoginServiceSkel
290 /// the interceptor type
291 typedef NLNET::CInterceptorForwarder
< CLoginServiceSkel
> TInterceptor
;
295 // do early run time check for message table
296 getMessageHandlers();
298 virtual ~CLoginServiceSkel()
302 void init(NLNET::IModule
*module
)
304 _Interceptor
.init(this, module
);
307 // unused interceptors
308 std::string
fwdBuildModuleManifest() const { return std::string(); }
309 void fwdOnModuleUp(NLNET::IModuleProxy
* /* moduleProxy */) {}
310 void fwdOnModuleDown(NLNET::IModuleProxy
* /* moduleProxy */) {}
311 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
* /* moduleProxy */) {}
313 // process module message interceptor
314 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
317 typedef void (CLoginServiceSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
318 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
320 const TMessageHandlerMap
&getMessageHandlers() const;
323 void pendingUserLost_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
325 // declare one interceptor member of the skeleton
326 TInterceptor _Interceptor
;
328 // declare the interceptor forwarder as friend of this class
329 friend class NLNET::CInterceptorForwarder
< CLoginServiceSkel
>;
331 /////////////////////////////////////////////////////////////////
332 // WARNING : this is a generated file, don't change it !
333 /////////////////////////////////////////////////////////////////
335 // An awaited user did not connect before the allowed timeout expire
336 virtual void pendingUserLost(NLNET::IModuleProxy
*sender
, const NLNET::CLoginCookie
&cookie
) =0;
341 /////////////////////////////////////////////////////////////////
342 // WARNING : this is a generated file, don't change it !
343 /////////////////////////////////////////////////////////////////
344 class CLoginServiceProxy
346 /// Smart pointer on the module proxy
347 NLNET::TModuleProxyPtr _ModuleProxy
;
349 // Pointer on the local module that implement the interface (if the proxy is for a local module)
350 NLNET::TModulePtr _LocalModule
;
351 // Direct pointer on the server implementation interface for collocated module
352 CLoginServiceSkel
*_LocalModuleSkel
;
356 CLoginServiceProxy(NLNET::IModuleProxy
*proxy
)
359 _ModuleProxy
= proxy
;
361 // initialize collocated servant interface
362 if (proxy
->getModuleDistance() == 0)
364 _LocalModule
= proxy
->getLocalModule();
365 nlassert(_LocalModule
!= NULL
);
366 CLoginServiceSkel::TInterceptor
*interceptor
= NULL
;
367 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
368 nlassert(interceptor
!= NULL
);
370 _LocalModuleSkel
= interceptor
->getParent();
371 nlassert(_LocalModuleSkel
!= NULL
);
374 _LocalModuleSkel
= 0;
377 virtual ~CLoginServiceProxy()
381 NLNET::IModuleProxy
*getModuleProxy()
386 // An awaited user did not connect before the allowed timeout expire
387 void pendingUserLost(NLNET::IModule
*sender
, const NLNET::CLoginCookie
&cookie
);
389 // Message serializer. Return the message received in reference for easier integration
390 static const NLNET::CMessage
&buildMessageFor_pendingUserLost(NLNET::CMessage
&__message
, const NLNET::CLoginCookie
&cookie
);
397 /////////////////////////////////////////////////////////////////
398 // WARNING : this is a generated file, don't change it !
399 /////////////////////////////////////////////////////////////////
400 class CWelcomeServiceClientSkel
403 /// the interceptor type
404 typedef NLNET::CInterceptorForwarder
< CWelcomeServiceClientSkel
> TInterceptor
;
406 CWelcomeServiceClientSkel()
408 // do early run time check for message table
409 getMessageHandlers();
411 virtual ~CWelcomeServiceClientSkel()
415 void init(NLNET::IModule
*module
)
417 _Interceptor
.init(this, module
);
420 // unused interceptors
421 std::string
fwdBuildModuleManifest() const { return std::string(); }
422 void fwdOnModuleUp(NLNET::IModuleProxy
* /* moduleProxy */) {}
423 void fwdOnModuleDown(NLNET::IModuleProxy
* /* moduleProxy */) {}
424 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
* /* moduleProxy */) {}
426 // process module message interceptor
427 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
430 typedef void (CWelcomeServiceClientSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
431 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
433 const TMessageHandlerMap
&getMessageHandlers() const;
436 void registerWS_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
438 void reportWSOpenState_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
440 void welcomeUserResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
442 void updateConnectedPlayerCount_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
444 // declare one interceptor member of the skeleton
445 TInterceptor _Interceptor
;
447 // declare the interceptor forwarder as friend of this class
448 friend class NLNET::CInterceptorForwarder
< CWelcomeServiceClientSkel
>;
450 /////////////////////////////////////////////////////////////////
451 // WARNING : this is a generated file, don't change it !
452 /////////////////////////////////////////////////////////////////
454 // Register the welcome service in the ring session manager
455 // The provided sessionId will be non-zero only for a shard with a fixed sessionId
456 virtual void registerWS(NLNET::IModuleProxy
*sender
, uint32 shardId
, uint32 fixedSessionId
, bool isOnline
) =0;
457 // WS report it's current open state
458 virtual void reportWSOpenState(NLNET::IModuleProxy
*sender
, bool isOnline
) =0;
459 // return for welcome user
460 virtual void welcomeUserResult(NLNET::IModuleProxy
*sender
, uint32 userId
, bool ok
, const std::string
&shardAddr
, const std::string
&errorMsg
) =0;
461 // transmits the current player counts
462 virtual void updateConnectedPlayerCount(NLNET::IModuleProxy
*sender
, uint32 nbOnlinePlayers
, uint32 nbPendingPlayers
) =0;
467 /////////////////////////////////////////////////////////////////
468 // WARNING : this is a generated file, don't change it !
469 /////////////////////////////////////////////////////////////////
470 class CWelcomeServiceClientProxy
472 /// Smart pointer on the module proxy
473 NLNET::TModuleProxyPtr _ModuleProxy
;
475 // Pointer on the local module that implement the interface (if the proxy is for a local module)
476 NLNET::TModulePtr _LocalModule
;
477 // Direct pointer on the server implementation interface for collocated module
478 CWelcomeServiceClientSkel
*_LocalModuleSkel
;
482 CWelcomeServiceClientProxy(NLNET::IModuleProxy
*proxy
)
485 _ModuleProxy
= proxy
;
487 // initialize collocated servant interface
488 if (proxy
->getModuleDistance() == 0)
490 _LocalModule
= proxy
->getLocalModule();
491 nlassert(_LocalModule
!= NULL
);
492 CWelcomeServiceClientSkel::TInterceptor
*interceptor
= NULL
;
493 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
494 nlassert(interceptor
!= NULL
);
496 _LocalModuleSkel
= interceptor
->getParent();
497 nlassert(_LocalModuleSkel
!= NULL
);
500 _LocalModuleSkel
= 0;
503 virtual ~CWelcomeServiceClientProxy()
507 NLNET::IModuleProxy
*getModuleProxy()
512 // Register the welcome service in the ring session manager
513 // The provided sessionId will be non-zero only for a shard with a fixed sessionId
514 void registerWS(NLNET::IModule
*sender
, uint32 shardId
, uint32 fixedSessionId
, bool isOnline
);
515 // WS report it's current open state
516 void reportWSOpenState(NLNET::IModule
*sender
, bool isOnline
);
517 // return for welcome user
518 void welcomeUserResult(NLNET::IModule
*sender
, uint32 userId
, bool ok
, const std::string
&shardAddr
, const std::string
&errorMsg
);
519 // transmits the current player counts
520 void updateConnectedPlayerCount(NLNET::IModule
*sender
, uint32 nbOnlinePlayers
, uint32 nbPendingPlayers
);
522 // Message serializer. Return the message received in reference for easier integration
523 static const NLNET::CMessage
&buildMessageFor_registerWS(NLNET::CMessage
&__message
, uint32 shardId
, uint32 fixedSessionId
, bool isOnline
);
525 // Message serializer. Return the message received in reference for easier integration
526 static const NLNET::CMessage
&buildMessageFor_reportWSOpenState(NLNET::CMessage
&__message
, bool isOnline
);
528 // Message serializer. Return the message received in reference for easier integration
529 static const NLNET::CMessage
&buildMessageFor_welcomeUserResult(NLNET::CMessage
&__message
, uint32 userId
, bool ok
, const std::string
&shardAddr
, const std::string
&errorMsg
);
531 // Message serializer. Return the message received in reference for easier integration
532 static const NLNET::CMessage
&buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage
&__message
, uint32 nbOnlinePlayers
, uint32 nbPendingPlayers
);