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 /////////////////////////////////////////////////////////////////
23 #include "character_sync_itf.h"
28 /////////////////////////////////////////////////////////////////
29 // WARNING : this is a generated file, don't change it !
30 /////////////////////////////////////////////////////////////////
33 const CCharacterSyncSkel::TMessageHandlerMap
&CCharacterSyncSkel::getMessageHandlers() const
35 static TMessageHandlerMap handlers
;
36 static bool init
= false;
40 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
42 res
= handlers
.insert(std::make_pair(std::string("CS_ACH"), &CCharacterSyncSkel::addCharacter_skel
));
43 // if this assert, you have a doubly message name in your interface definition !
46 res
= handlers
.insert(std::make_pair(std::string("CS_DCH"), &CCharacterSyncSkel::deleteCharacter_skel
));
47 // if this assert, you have a doubly message name in your interface definition !
50 res
= handlers
.insert(std::make_pair(std::string("CS_UPDCG"), &CCharacterSyncSkel::updateCharGuild_skel
));
51 // if this assert, you have a doubly message name in your interface definition !
54 res
= handlers
.insert(std::make_pair(std::string("CS_UPDCR"), &CCharacterSyncSkel::updateCharRespawnPoints_skel
));
55 // if this assert, you have a doubly message name in your interface definition !
58 res
= handlers
.insert(std::make_pair(std::string("CS_UPDCL"), &CCharacterSyncSkel::updateCharsBestLevel_skel
));
59 // if this assert, you have a doubly message name in your interface definition !
62 res
= handlers
.insert(std::make_pair(std::string("CS_UPCNF"), &CCharacterSyncSkel::updateCharNewbieFlag_skel
));
63 // if this assert, you have a doubly message name in your interface definition !
66 res
= handlers
.insert(std::make_pair(std::string("CS_UPDCA"), &CCharacterSyncSkel::updateCharAllegiance_skel
));
67 // if this assert, you have a doubly message name in your interface definition !
70 res
= handlers
.insert(std::make_pair(std::string("CS_UPDCHMSI"), &CCharacterSyncSkel::updateCharHomeMainlandSessionId_skel
));
71 // if this assert, you have a doubly message name in your interface definition !
74 res
= handlers
.insert(std::make_pair(std::string("CS_UPDCS"), &CCharacterSyncSkel::syncUserChars_skel
));
75 // if this assert, you have a doubly message name in your interface definition !
83 bool CCharacterSyncSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
85 const TMessageHandlerMap
&mh
= getMessageHandlers();
87 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
94 TMessageHandler cmd
= it
->second
;
95 (this->*cmd
)(sender
, message
);
101 void CCharacterSyncSkel::addCharacter_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
103 H_AUTO(CCharacterSyncSkel_addCharacter_CS_ACH
);
105 nlRead(__message
, serial
, charInfo
);
106 addCharacter(sender
, charInfo
);
109 void CCharacterSyncSkel::deleteCharacter_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
111 H_AUTO(CCharacterSyncSkel_deleteCharacter_CS_DCH
);
113 nlRead(__message
, serial
, charId
);
114 deleteCharacter(sender
, charId
);
117 void CCharacterSyncSkel::updateCharGuild_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
119 H_AUTO(CCharacterSyncSkel_updateCharGuild_CS_UPDCG
);
120 NLMISC::CEntityId charEId
;
121 nlRead(__message
, serial
, charEId
);
123 nlRead(__message
, serial
, guildId
);
124 updateCharGuild(sender
, charEId
, guildId
);
127 void CCharacterSyncSkel::updateCharRespawnPoints_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
129 H_AUTO(CCharacterSyncSkel_updateCharRespawnPoints_CS_UPDCR
);
130 NLMISC::CEntityId charEId
;
131 nlRead(__message
, serial
, charEId
);
132 CONTINENT::TRespawnPointCounters respawnPoints
;
133 nlRead(__message
, serialCont
, respawnPoints
);
134 updateCharRespawnPoints(sender
, charEId
, respawnPoints
);
137 void CCharacterSyncSkel::updateCharsBestLevel_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
139 H_AUTO(CCharacterSyncSkel_updateCharsBestLevel_CS_UPDCL
);
140 std::vector
< TCharBestLevelInfo
> charLevelInfos
;
141 nlRead(__message
, serialCont
, charLevelInfos
);
142 updateCharsBestLevel(sender
, charLevelInfos
);
145 void CCharacterSyncSkel::updateCharNewbieFlag_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
147 H_AUTO(CCharacterSyncSkel_updateCharNewbieFlag_CS_UPCNF
);
148 NLMISC::CEntityId charEId
;
149 nlRead(__message
, serial
, charEId
);
151 nlRead(__message
, serial
, newbie
);
152 updateCharNewbieFlag(sender
, charEId
, newbie
);
155 void CCharacterSyncSkel::updateCharAllegiance_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
157 H_AUTO(CCharacterSyncSkel_updateCharAllegiance_CS_UPDCA
);
158 NLMISC::CEntityId charEId
;
159 nlRead(__message
, serial
, charEId
);
160 TCivilisation civilisation
;
161 nlRead(__message
, serial
, civilisation
);
163 nlRead(__message
, serial
, cult
);
164 updateCharAllegiance(sender
, charEId
, civilisation
, cult
);
167 void CCharacterSyncSkel::updateCharHomeMainlandSessionId_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
169 H_AUTO(CCharacterSyncSkel_updateCharHomeMainlandSessionId_CS_UPDCHMSI
);
170 NLMISC::CEntityId charEId
;
171 nlRead(__message
, serial
, charEId
);
172 TSessionId homeMainlandSessionId
;
173 nlRead(__message
, serial
, homeMainlandSessionId
);
174 updateCharHomeMainlandSessionId(sender
, charEId
, homeMainlandSessionId
);
177 void CCharacterSyncSkel::syncUserChars_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
179 H_AUTO(CCharacterSyncSkel_syncUserChars_CS_UPDCS
);
181 nlRead(__message
, serial
, userId
);
182 std::vector
< TCharInfo
> charInfos
;
183 nlRead(__message
, serialCont
, charInfos
);
184 syncUserChars(sender
, userId
, charInfos
);
186 // A new character have been create by a client
187 void CCharacterSyncProxy::addCharacter(NLNET::IModule
*sender
, const TCharInfo
&charInfo
)
189 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
191 // immediate local synchronous dispatching
192 _LocalModuleSkel
->addCharacter(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charInfo
);
196 // send the message for remote dispatching and execution or local queing
197 NLNET::CMessage __message
;
199 buildMessageFor_addCharacter(__message
, charInfo
);
201 _ModuleProxy
->sendModuleMessage(sender
, __message
);
204 // A character have been deleted
205 void CCharacterSyncProxy::deleteCharacter(NLNET::IModule
*sender
, uint32 charId
)
207 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
209 // immediate local synchronous dispatching
210 _LocalModuleSkel
->deleteCharacter(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charId
);
214 // send the message for remote dispatching and execution or local queing
215 NLNET::CMessage __message
;
217 buildMessageFor_deleteCharacter(__message
, charId
);
219 _ModuleProxy
->sendModuleMessage(sender
, __message
);
222 // A character guild have changed
223 void CCharacterSyncProxy::updateCharGuild(NLNET::IModule
*sender
, const NLMISC::CEntityId
&charEId
, uint32 guildId
)
225 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
227 // immediate local synchronous dispatching
228 _LocalModuleSkel
->updateCharGuild(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charEId
, guildId
);
232 // send the message for remote dispatching and execution or local queing
233 NLNET::CMessage __message
;
235 buildMessageFor_updateCharGuild(__message
, charEId
, guildId
);
237 _ModuleProxy
->sendModuleMessage(sender
, __message
);
240 // Update the respawn points count of a character
241 void CCharacterSyncProxy::updateCharRespawnPoints(NLNET::IModule
*sender
, const NLMISC::CEntityId
&charEId
, const CONTINENT::TRespawnPointCounters
&respawnPoints
)
243 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
245 // immediate local synchronous dispatching
246 _LocalModuleSkel
->updateCharRespawnPoints(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charEId
, respawnPoints
);
250 // send the message for remote dispatching and execution or local queing
251 NLNET::CMessage __message
;
253 buildMessageFor_updateCharRespawnPoints(__message
, charEId
, respawnPoints
);
255 _ModuleProxy
->sendModuleMessage(sender
, __message
);
258 // Update the best level for a set of characters
259 void CCharacterSyncProxy::updateCharsBestLevel(NLNET::IModule
*sender
, const std::vector
< TCharBestLevelInfo
> &charLevelInfos
)
261 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
263 // immediate local synchronous dispatching
264 _LocalModuleSkel
->updateCharsBestLevel(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charLevelInfos
);
268 // send the message for remote dispatching and execution or local queing
269 NLNET::CMessage __message
;
271 buildMessageFor_updateCharsBestLevel(__message
, charLevelInfos
);
273 _ModuleProxy
->sendModuleMessage(sender
, __message
);
276 // Update the newbie flag of a characters
277 void CCharacterSyncProxy::updateCharNewbieFlag(NLNET::IModule
*sender
, const NLMISC::CEntityId
&charEId
, bool newbie
)
279 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
281 // immediate local synchronous dispatching
282 _LocalModuleSkel
->updateCharNewbieFlag(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charEId
, newbie
);
286 // send the message for remote dispatching and execution or local queing
287 NLNET::CMessage __message
;
289 buildMessageFor_updateCharNewbieFlag(__message
, charEId
, newbie
);
291 _ModuleProxy
->sendModuleMessage(sender
, __message
);
294 // Update the allegiance of a characters
295 void CCharacterSyncProxy::updateCharAllegiance(NLNET::IModule
*sender
, const NLMISC::CEntityId
&charEId
, TCivilisation civilisation
, TCult cult
)
297 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
299 // immediate local synchronous dispatching
300 _LocalModuleSkel
->updateCharAllegiance(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charEId
, civilisation
, cult
);
304 // send the message for remote dispatching and execution or local queing
305 NLNET::CMessage __message
;
307 buildMessageFor_updateCharAllegiance(__message
, charEId
, civilisation
, cult
);
309 _ModuleProxy
->sendModuleMessage(sender
, __message
);
312 // The home mainland has changed (used when converting a character file from an old version)
313 void CCharacterSyncProxy::updateCharHomeMainlandSessionId(NLNET::IModule
*sender
, const NLMISC::CEntityId
&charEId
, TSessionId homeMainlandSessionId
)
315 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
317 // immediate local synchronous dispatching
318 _LocalModuleSkel
->updateCharHomeMainlandSessionId(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charEId
, homeMainlandSessionId
);
322 // send the message for remote dispatching and execution or local queing
323 NLNET::CMessage __message
;
325 buildMessageFor_updateCharHomeMainlandSessionId(__message
, charEId
, homeMainlandSessionId
);
327 _ModuleProxy
->sendModuleMessage(sender
, __message
);
330 // The characters for a player have been loaded
331 // EGS send the full list to SU to make
332 // sure any divergence in the database is cleared
333 // SU send back the list of character with there
334 // unified names and home session ID
335 void CCharacterSyncProxy::syncUserChars(NLNET::IModule
*sender
, uint32 userId
, const std::vector
< TCharInfo
> &charInfos
)
337 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
339 // immediate local synchronous dispatching
340 _LocalModuleSkel
->syncUserChars(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), userId
, charInfos
);
344 // send the message for remote dispatching and execution or local queing
345 NLNET::CMessage __message
;
347 buildMessageFor_syncUserChars(__message
, userId
, charInfos
);
349 _ModuleProxy
->sendModuleMessage(sender
, __message
);
353 // Message serializer. Return the message received in reference for easier integration
354 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_addCharacter(NLNET::CMessage
&__message
, const TCharInfo
&charInfo
)
356 __message
.setType("CS_ACH");
357 nlWrite(__message
, serial
, const_cast < TCharInfo
& > (charInfo
));
363 // Message serializer. Return the message received in reference for easier integration
364 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_deleteCharacter(NLNET::CMessage
&__message
, uint32 charId
)
366 __message
.setType("CS_DCH");
367 nlWrite(__message
, serial
, charId
);
373 // Message serializer. Return the message received in reference for easier integration
374 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_updateCharGuild(NLNET::CMessage
&__message
, const NLMISC::CEntityId
&charEId
, uint32 guildId
)
376 __message
.setType("CS_UPDCG");
377 nlWrite(__message
, serial
, const_cast < NLMISC::CEntityId
& > (charEId
));
378 nlWrite(__message
, serial
, guildId
);
384 // Message serializer. Return the message received in reference for easier integration
385 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_updateCharRespawnPoints(NLNET::CMessage
&__message
, const NLMISC::CEntityId
&charEId
, const CONTINENT::TRespawnPointCounters
&respawnPoints
)
387 __message
.setType("CS_UPDCR");
388 nlWrite(__message
, serial
, const_cast < NLMISC::CEntityId
& > (charEId
));
389 nlWrite(__message
, serialCont
, const_cast < CONTINENT::TRespawnPointCounters
& > (respawnPoints
));
395 // Message serializer. Return the message received in reference for easier integration
396 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_updateCharsBestLevel(NLNET::CMessage
&__message
, const std::vector
< TCharBestLevelInfo
> &charLevelInfos
)
398 __message
.setType("CS_UPDCL");
399 nlWrite(__message
, serialCont
, const_cast < std::vector
< TCharBestLevelInfo
>& > (charLevelInfos
));
405 // Message serializer. Return the message received in reference for easier integration
406 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_updateCharNewbieFlag(NLNET::CMessage
&__message
, const NLMISC::CEntityId
&charEId
, bool newbie
)
408 __message
.setType("CS_UPCNF");
409 nlWrite(__message
, serial
, const_cast < NLMISC::CEntityId
& > (charEId
));
410 nlWrite(__message
, serial
, newbie
);
416 // Message serializer. Return the message received in reference for easier integration
417 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_updateCharAllegiance(NLNET::CMessage
&__message
, const NLMISC::CEntityId
&charEId
, TCivilisation civilisation
, TCult cult
)
419 __message
.setType("CS_UPDCA");
420 nlWrite(__message
, serial
, const_cast < NLMISC::CEntityId
& > (charEId
));
421 nlWrite(__message
, serial
, civilisation
);
422 nlWrite(__message
, serial
, cult
);
428 // Message serializer. Return the message received in reference for easier integration
429 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_updateCharHomeMainlandSessionId(NLNET::CMessage
&__message
, const NLMISC::CEntityId
&charEId
, TSessionId homeMainlandSessionId
)
431 __message
.setType("CS_UPDCHMSI");
432 nlWrite(__message
, serial
, const_cast < NLMISC::CEntityId
& > (charEId
));
433 nlWrite(__message
, serial
, homeMainlandSessionId
);
439 // Message serializer. Return the message received in reference for easier integration
440 const NLNET::CMessage
&CCharacterSyncProxy::buildMessageFor_syncUserChars(NLNET::CMessage
&__message
, uint32 userId
, const std::vector
< TCharInfo
> &charInfos
)
442 __message
.setType("CS_UPDCS");
443 nlWrite(__message
, serial
, userId
);
444 nlWrite(__message
, serialCont
, const_cast < std::vector
< TCharInfo
>& > (charInfos
));
450 /////////////////////////////////////////////////////////////////
451 // WARNING : this is a generated file, don't change it !
452 /////////////////////////////////////////////////////////////////
455 const CNameUnifierSkel::TMessageHandlerMap
&CNameUnifierSkel::getMessageHandlers() const
457 static TMessageHandlerMap handlers
;
458 static bool init
= false;
462 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
464 res
= handlers
.insert(std::make_pair(std::string("NU_RNUC"), &CNameUnifierSkel::registerNameUnifierClient_skel
));
465 // if this assert, you have a doubly message name in your interface definition !
466 nlassert(res
.second
);
468 res
= handlers
.insert(std::make_pair(std::string("NU_VCN"), &CNameUnifierSkel::validateCharacterName_skel
));
469 // if this assert, you have a doubly message name in your interface definition !
470 nlassert(res
.second
);
472 res
= handlers
.insert(std::make_pair(std::string("NU_ANTC"), &CNameUnifierSkel::assignNameToCharacter_skel
));
473 // if this assert, you have a doubly message name in your interface definition !
474 nlassert(res
.second
);
476 res
= handlers
.insert(std::make_pair(std::string("NU_RC"), &CNameUnifierSkel::renameCharacter_skel
));
477 // if this assert, you have a doubly message name in your interface definition !
478 nlassert(res
.second
);
480 res
= handlers
.insert(std::make_pair(std::string("NU_RLGN"), &CNameUnifierSkel::registerLoadedGuildNames_skel
));
481 // if this assert, you have a doubly message name in your interface definition !
482 nlassert(res
.second
);
484 res
= handlers
.insert(std::make_pair(std::string("NU_VGN"), &CNameUnifierSkel::validateGuildName_skel
));
485 // if this assert, you have a doubly message name in your interface definition !
486 nlassert(res
.second
);
488 res
= handlers
.insert(std::make_pair(std::string("NU_AG"), &CNameUnifierSkel::addGuild_skel
));
489 // if this assert, you have a doubly message name in your interface definition !
490 nlassert(res
.second
);
492 res
= handlers
.insert(std::make_pair(std::string("NU_RG"), &CNameUnifierSkel::removeGuild_skel
));
493 // if this assert, you have a doubly message name in your interface definition !
494 nlassert(res
.second
);
501 bool CNameUnifierSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
503 const TMessageHandlerMap
&mh
= getMessageHandlers();
505 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
512 TMessageHandler cmd
= it
->second
;
513 (this->*cmd
)(sender
, message
);
519 void CNameUnifierSkel::registerNameUnifierClient_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&/* __message */)
521 H_AUTO(CNameUnifierSkel_registerNameUnifierClient_NU_RNUC
);
522 registerNameUnifierClient(sender
);
525 void CNameUnifierSkel::validateCharacterName_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
527 H_AUTO(CNameUnifierSkel_validateCharacterName_NU_VCN
);
529 nlRead(__message
, serial
, userId
);
531 nlRead(__message
, serial
, charIndex
);
533 nlRead(__message
, serial
, name
);
534 uint32 homeMainlandSessionId
;
535 nlRead(__message
, serial
, homeMainlandSessionId
);
536 validateCharacterName(sender
, userId
, charIndex
, name
, homeMainlandSessionId
);
539 void CNameUnifierSkel::assignNameToCharacter_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
541 H_AUTO(CNameUnifierSkel_assignNameToCharacter_NU_ANTC
);
543 nlRead(__message
, serial
, charId
);
545 nlRead(__message
, serial
, name
);
546 uint32 homeSessionId
;
547 nlRead(__message
, serial
, homeSessionId
);
548 assignNameToCharacter(sender
, charId
, name
, homeSessionId
);
551 void CNameUnifierSkel::renameCharacter_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
553 H_AUTO(CNameUnifierSkel_renameCharacter_NU_RC
);
555 nlRead(__message
, serial
, charId
);
556 renameCharacter(sender
, charId
);
559 void CNameUnifierSkel::registerLoadedGuildNames_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
561 H_AUTO(CNameUnifierSkel_registerLoadedGuildNames_NU_RLGN
);
563 nlRead(__message
, serial
, chardId
);
564 std::vector
< CGuildInfo
> guildInfos
;
565 nlRead(__message
, serialCont
, guildInfos
);
566 registerLoadedGuildNames(sender
, chardId
, guildInfos
);
569 void CNameUnifierSkel::validateGuildName_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
571 H_AUTO(CNameUnifierSkel_validateGuildName_NU_VGN
);
573 nlRead(__message
, serial
, guildId
);
575 nlRead(__message
, serial
, guildName
);
576 validateGuildName(sender
, guildId
, guildName
);
579 void CNameUnifierSkel::addGuild_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
581 H_AUTO(CNameUnifierSkel_addGuild_NU_AG
);
583 nlRead(__message
, serial
, shardId
);
585 nlRead(__message
, serial
, guildId
);
587 nlRead(__message
, serial
, guildName
);
588 addGuild(sender
, shardId
, guildId
, guildName
);
591 void CNameUnifierSkel::removeGuild_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
593 H_AUTO(CNameUnifierSkel_removeGuild_NU_RG
);
595 nlRead(__message
, serial
, shardId
);
597 nlRead(__message
, serial
, guildId
);
598 removeGuild(sender
, shardId
, guildId
);
600 // EGS register it's name unifier in order to receive
601 // an updated eid to name translation table
602 void CNameUnifierProxy::registerNameUnifierClient(NLNET::IModule
*sender
)
604 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
606 // immediate local synchronous dispatching
607 _LocalModuleSkel
->registerNameUnifierClient(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
));
611 // send the message for remote dispatching and execution or local queing
612 NLNET::CMessage __message
;
614 buildMessageFor_registerNameUnifierClient(__message
);
616 _ModuleProxy
->sendModuleMessage(sender
, __message
);
619 // EGS ask to validate a character name
620 // If the NU valide the name, it temporary
621 // lock it to the associated player.
622 // This function is called before character creation.
623 void CNameUnifierProxy::validateCharacterName(NLNET::IModule
*sender
, uint32 userId
, uint8 charIndex
, const std::string
&name
, uint32 homeMainlandSessionId
)
625 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
627 // immediate local synchronous dispatching
628 _LocalModuleSkel
->validateCharacterName(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), userId
, charIndex
, name
, homeMainlandSessionId
);
632 // send the message for remote dispatching and execution or local queing
633 NLNET::CMessage __message
;
635 buildMessageFor_validateCharacterName(__message
, userId
, charIndex
, name
, homeMainlandSessionId
);
637 _ModuleProxy
->sendModuleMessage(sender
, __message
);
640 // EGS ask to assign a name to a character
641 // This function is called during character creation
642 void CNameUnifierProxy::assignNameToCharacter(NLNET::IModule
*sender
, uint32 charId
, const std::string
&name
, uint32 homeSessionId
)
644 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
646 // immediate local synchronous dispatching
647 _LocalModuleSkel
->assignNameToCharacter(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charId
, name
, homeSessionId
);
651 // send the message for remote dispatching and execution or local queing
652 NLNET::CMessage __message
;
654 buildMessageFor_assignNameToCharacter(__message
, charId
, name
, homeSessionId
);
656 _ModuleProxy
->sendModuleMessage(sender
, __message
);
659 // EGS ask to rename a character.
660 // Renaming consist of assigning a default ramdomly generated name to the character
661 void CNameUnifierProxy::renameCharacter(NLNET::IModule
*sender
, uint32 charId
)
663 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
665 // immediate local synchronous dispatching
666 _LocalModuleSkel
->renameCharacter(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charId
);
670 // send the message for remote dispatching and execution or local queing
671 NLNET::CMessage __message
;
673 buildMessageFor_renameCharacter(__message
, charId
);
675 _ModuleProxy
->sendModuleMessage(sender
, __message
);
678 // EGS send info about the list of loaded guild.
679 // The name unifier will update is internal name table if needed
680 // and rename any guild having a conflicting name.
681 // If any guild is renamed, then the name unifier send back
682 // a guildRenamed message to EGS.
683 void CNameUnifierProxy::registerLoadedGuildNames(NLNET::IModule
*sender
, uint32 chardId
, const std::vector
< CGuildInfo
> &guildInfos
)
685 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
687 // immediate local synchronous dispatching
688 _LocalModuleSkel
->registerLoadedGuildNames(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), chardId
, guildInfos
);
692 // send the message for remote dispatching and execution or local queing
693 NLNET::CMessage __message
;
695 buildMessageFor_registerLoadedGuildNames(__message
, chardId
, guildInfos
);
697 _ModuleProxy
->sendModuleMessage(sender
, __message
);
700 // EGS ask to the name unifier to validate a new guild name
701 void CNameUnifierProxy::validateGuildName(NLNET::IModule
*sender
, uint32 guildId
, const ucstring
&guildName
)
703 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
705 // immediate local synchronous dispatching
706 _LocalModuleSkel
->validateGuildName(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), guildId
, guildName
);
710 // send the message for remote dispatching and execution or local queing
711 NLNET::CMessage __message
;
713 buildMessageFor_validateGuildName(__message
, guildId
, guildName
);
715 _ModuleProxy
->sendModuleMessage(sender
, __message
);
718 // EGS add newly created guild info
719 void CNameUnifierProxy::addGuild(NLNET::IModule
*sender
, uint32 shardId
, uint32 guildId
, const ucstring
&guildName
)
721 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
723 // immediate local synchronous dispatching
724 _LocalModuleSkel
->addGuild(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), shardId
, guildId
, guildName
);
728 // send the message for remote dispatching and execution or local queing
729 NLNET::CMessage __message
;
731 buildMessageFor_addGuild(__message
, shardId
, guildId
, guildName
);
733 _ModuleProxy
->sendModuleMessage(sender
, __message
);
736 // EGS remove deleted guild info
737 void CNameUnifierProxy::removeGuild(NLNET::IModule
*sender
, uint32 shardId
, uint32 guildId
)
739 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
741 // immediate local synchronous dispatching
742 _LocalModuleSkel
->removeGuild(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), shardId
, guildId
);
746 // send the message for remote dispatching and execution or local queing
747 NLNET::CMessage __message
;
749 buildMessageFor_removeGuild(__message
, shardId
, guildId
);
751 _ModuleProxy
->sendModuleMessage(sender
, __message
);
755 // Message serializer. Return the message received in reference for easier integration
756 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_registerNameUnifierClient(NLNET::CMessage
&__message
)
758 __message
.setType("NU_RNUC");
764 // Message serializer. Return the message received in reference for easier integration
765 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_validateCharacterName(NLNET::CMessage
&__message
, uint32 userId
, uint8 charIndex
, const std::string
&name
, uint32 homeMainlandSessionId
)
767 __message
.setType("NU_VCN");
768 nlWrite(__message
, serial
, userId
);
769 nlWrite(__message
, serial
, charIndex
);
770 nlWrite(__message
, serial
, const_cast < std::string
& > (name
));
771 nlWrite(__message
, serial
, homeMainlandSessionId
);
777 // Message serializer. Return the message received in reference for easier integration
778 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_assignNameToCharacter(NLNET::CMessage
&__message
, uint32 charId
, const std::string
&name
, uint32 homeSessionId
)
780 __message
.setType("NU_ANTC");
781 nlWrite(__message
, serial
, charId
);
782 nlWrite(__message
, serial
, const_cast < std::string
& > (name
));
783 nlWrite(__message
, serial
, homeSessionId
);
789 // Message serializer. Return the message received in reference for easier integration
790 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_renameCharacter(NLNET::CMessage
&__message
, uint32 charId
)
792 __message
.setType("NU_RC");
793 nlWrite(__message
, serial
, charId
);
799 // Message serializer. Return the message received in reference for easier integration
800 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_registerLoadedGuildNames(NLNET::CMessage
&__message
, uint32 chardId
, const std::vector
< CGuildInfo
> &guildInfos
)
802 __message
.setType("NU_RLGN");
803 nlWrite(__message
, serial
, chardId
);
804 nlWrite(__message
, serialCont
, const_cast < std::vector
< CGuildInfo
>& > (guildInfos
));
810 // Message serializer. Return the message received in reference for easier integration
811 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_validateGuildName(NLNET::CMessage
&__message
, uint32 guildId
, const ucstring
&guildName
)
813 __message
.setType("NU_VGN");
814 nlWrite(__message
, serial
, guildId
);
815 nlWrite(__message
, serial
, const_cast < ucstring
& > (guildName
));
821 // Message serializer. Return the message received in reference for easier integration
822 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_addGuild(NLNET::CMessage
&__message
, uint32 shardId
, uint32 guildId
, const ucstring
&guildName
)
824 __message
.setType("NU_AG");
825 nlWrite(__message
, serial
, shardId
);
826 nlWrite(__message
, serial
, guildId
);
827 nlWrite(__message
, serial
, const_cast < ucstring
& > (guildName
));
833 // Message serializer. Return the message received in reference for easier integration
834 const NLNET::CMessage
&CNameUnifierProxy::buildMessageFor_removeGuild(NLNET::CMessage
&__message
, uint32 shardId
, uint32 guildId
)
836 __message
.setType("NU_RG");
837 nlWrite(__message
, serial
, shardId
);
838 nlWrite(__message
, serial
, guildId
);
844 /////////////////////////////////////////////////////////////////
845 // WARNING : this is a generated file, don't change it !
846 /////////////////////////////////////////////////////////////////
849 const CNameUnifierClientSkel::TMessageHandlerMap
&CNameUnifierClientSkel::getMessageHandlers() const
851 static TMessageHandlerMap handlers
;
852 static bool init
= false;
856 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
858 res
= handlers
.insert(std::make_pair(std::string("NUC_IET"), &CNameUnifierClientSkel::initEIdTranslator_skel
));
859 // if this assert, you have a doubly message name in your interface definition !
860 nlassert(res
.second
);
862 res
= handlers
.insert(std::make_pair(std::string("NUC_UET"), &CNameUnifierClientSkel::updateEIdTranslator_skel
));
863 // if this assert, you have a doubly message name in your interface definition !
864 nlassert(res
.second
);
866 res
= handlers
.insert(std::make_pair(std::string("NUC_VCNR"), &CNameUnifierClientSkel::validateCharacterNameResult_skel
));
867 // if this assert, you have a doubly message name in your interface definition !
868 nlassert(res
.second
);
870 res
= handlers
.insert(std::make_pair(std::string("NUC_ACNR"), &CNameUnifierClientSkel::assignCharacterNameResult_skel
));
871 // if this assert, you have a doubly message name in your interface definition !
872 nlassert(res
.second
);
874 res
= handlers
.insert(std::make_pair(std::string("NUC_CR"), &CNameUnifierClientSkel::characterRenamed_skel
));
875 // if this assert, you have a doubly message name in your interface definition !
876 nlassert(res
.second
);
878 res
= handlers
.insert(std::make_pair(std::string("NUC_UCUAV"), &CNameUnifierClientSkel::userCharUpdatedAndValidated_skel
));
879 // if this assert, you have a doubly message name in your interface definition !
880 nlassert(res
.second
);
882 res
= handlers
.insert(std::make_pair(std::string("NUC_UCSF"), &CNameUnifierClientSkel::userCharSyncFailed_skel
));
883 // if this assert, you have a doubly message name in your interface definition !
884 nlassert(res
.second
);
886 res
= handlers
.insert(std::make_pair(std::string("NUC_GR"), &CNameUnifierClientSkel::guildRenamed_skel
));
887 // if this assert, you have a doubly message name in your interface definition !
888 nlassert(res
.second
);
890 res
= handlers
.insert(std::make_pair(std::string("NUC_VGNR"), &CNameUnifierClientSkel::validateGuildNameResult_skel
));
891 // if this assert, you have a doubly message name in your interface definition !
892 nlassert(res
.second
);
894 res
= handlers
.insert(std::make_pair(std::string("NUC_RCFG"), &CNameUnifierClientSkel::removeCharFromGuild_skel
));
895 // if this assert, you have a doubly message name in your interface definition !
896 nlassert(res
.second
);
903 bool CNameUnifierClientSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
905 const TMessageHandlerMap
&mh
= getMessageHandlers();
907 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
914 TMessageHandler cmd
= it
->second
;
915 (this->*cmd
)(sender
, message
);
921 void CNameUnifierClientSkel::initEIdTranslator_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
923 H_AUTO(CNameUnifierClientSkel_initEIdTranslator_NUC_IET
);
925 nlRead(__message
, serial
, firstPacket
);
927 nlRead(__message
, serial
, lastPacket
);
928 std::vector
< TNameEntry
> nameEntries
;
929 nlRead(__message
, serialCont
, nameEntries
);
930 initEIdTranslator(sender
, firstPacket
, lastPacket
, nameEntries
);
933 void CNameUnifierClientSkel::updateEIdTranslator_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
935 H_AUTO(CNameUnifierClientSkel_updateEIdTranslator_NUC_UET
);
936 std::vector
< uint32
> releasedNames
;
937 nlRead(__message
, serialCont
, releasedNames
);
938 std::vector
< TNameEntry
> changedNames
;
939 nlRead(__message
, serialCont
, changedNames
);
940 updateEIdTranslator(sender
, releasedNames
, changedNames
);
943 void CNameUnifierClientSkel::validateCharacterNameResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
945 H_AUTO(CNameUnifierClientSkel_validateCharacterNameResult_NUC_VCNR
);
946 CValidateNameResult nameResult
;
947 nlRead(__message
, serial
, nameResult
);
948 validateCharacterNameResult(sender
, nameResult
);
951 void CNameUnifierClientSkel::assignCharacterNameResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
953 H_AUTO(CNameUnifierClientSkel_assignCharacterNameResult_NUC_ACNR
);
954 CValidateNameResult nameResult
;
955 nlRead(__message
, serial
, nameResult
);
956 assignCharacterNameResult(sender
, nameResult
);
959 void CNameUnifierClientSkel::characterRenamed_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
961 H_AUTO(CNameUnifierClientSkel_characterRenamed_NUC_CR
);
963 nlRead(__message
, serial
, charId
);
965 nlRead(__message
, serial
, newName
);
967 nlRead(__message
, serial
, sendSummary
);
968 characterRenamed(sender
, charId
, newName
, sendSummary
);
971 void CNameUnifierClientSkel::userCharUpdatedAndValidated_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
973 H_AUTO(CNameUnifierClientSkel_userCharUpdatedAndValidated_NUC_UCUAV
);
975 nlRead(__message
, serial
, userId
);
976 std::vector
< TCharSyncResultEntry
> charInfos
;
977 nlRead(__message
, serialCont
, charInfos
);
978 userCharUpdatedAndValidated(sender
, userId
, charInfos
);
981 void CNameUnifierClientSkel::userCharSyncFailed_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
983 H_AUTO(CNameUnifierClientSkel_userCharSyncFailed_NUC_UCSF
);
985 nlRead(__message
, serial
, userId
);
986 userCharSyncFailed(sender
, userId
);
989 void CNameUnifierClientSkel::guildRenamed_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
991 H_AUTO(CNameUnifierClientSkel_guildRenamed_NUC_GR
);
993 nlRead(__message
, serial
, guildId
);
995 nlRead(__message
, serial
, newName
);
996 guildRenamed(sender
, guildId
, newName
);
999 void CNameUnifierClientSkel::validateGuildNameResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
1001 H_AUTO(CNameUnifierClientSkel_validateGuildNameResult_NUC_VGNR
);
1003 nlRead(__message
, serial
, guildId
);
1005 nlRead(__message
, serial
, guildName
);
1006 TCharacterNameResult result
;
1007 nlRead(__message
, serial
, result
);
1008 validateGuildNameResult(sender
, guildId
, guildName
, result
);
1011 void CNameUnifierClientSkel::removeCharFromGuild_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
1013 H_AUTO(CNameUnifierClientSkel_removeCharFromGuild_NUC_RCFG
);
1015 nlRead(__message
, serial
, charId
);
1017 nlRead(__message
, serial
, guildId
);
1018 removeCharFromGuild(sender
, charId
, guildId
);
1020 // The name unifier send the initial content for the Eid translator.
1021 // EGS need to wait until it receive this message before continuing
1022 // it's startup sequence in order to have coherent name in guild.
1023 void CNameUnifierClientProxy::initEIdTranslator(NLNET::IModule
*sender
, bool firstPacket
, bool lastPacket
, const std::vector
< TNameEntry
> &nameEntries
)
1025 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1027 // immediate local synchronous dispatching
1028 _LocalModuleSkel
->initEIdTranslator(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), firstPacket
, lastPacket
, nameEntries
);
1032 // send the message for remote dispatching and execution or local queing
1033 NLNET::CMessage __message
;
1035 buildMessageFor_initEIdTranslator(__message
, firstPacket
, lastPacket
, nameEntries
);
1037 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1040 // The name unifier send an update for the EID translator.
1041 // releasedNames contains a list of charId whose names have been released
1042 // changedNames contains a list of add or update entries
1043 void CNameUnifierClientProxy::updateEIdTranslator(NLNET::IModule
*sender
, const std::vector
< uint32
> &releasedNames
, const std::vector
< TNameEntry
> &changedNames
)
1045 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1047 // immediate local synchronous dispatching
1048 _LocalModuleSkel
->updateEIdTranslator(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), releasedNames
, changedNames
);
1052 // send the message for remote dispatching and execution or local queing
1053 NLNET::CMessage __message
;
1055 buildMessageFor_updateEIdTranslator(__message
, releasedNames
, changedNames
);
1057 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1060 // The name unifier send the result for validation
1061 // of a character name before creation.
1062 void CNameUnifierClientProxy::validateCharacterNameResult(NLNET::IModule
*sender
, const CValidateNameResult
&nameResult
)
1064 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1066 // immediate local synchronous dispatching
1067 _LocalModuleSkel
->validateCharacterNameResult(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), nameResult
);
1071 // send the message for remote dispatching and execution or local queing
1072 NLNET::CMessage __message
;
1074 buildMessageFor_validateCharacterNameResult(__message
, nameResult
);
1076 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1079 // The name unifier send the result for name assignment
1080 // of a new character name during creation.
1081 void CNameUnifierClientProxy::assignCharacterNameResult(NLNET::IModule
*sender
, const CValidateNameResult
&nameResult
)
1083 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1085 // immediate local synchronous dispatching
1086 _LocalModuleSkel
->assignCharacterNameResult(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), nameResult
);
1090 // send the message for remote dispatching and execution or local queing
1091 NLNET::CMessage __message
;
1093 buildMessageFor_assignCharacterNameResult(__message
, nameResult
);
1095 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1098 // The name unifier has renamed a character
1099 // EGS must do what it need to take the new name into account
1100 void CNameUnifierClientProxy::characterRenamed(NLNET::IModule
*sender
, uint32 charId
, const std::string
&newName
, bool sendSummary
)
1102 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1104 // immediate local synchronous dispatching
1105 _LocalModuleSkel
->characterRenamed(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charId
, newName
, sendSummary
);
1109 // send the message for remote dispatching and execution or local queing
1110 NLNET::CMessage __message
;
1112 buildMessageFor_characterRenamed(__message
, charId
, newName
, sendSummary
);
1114 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1117 // The name unifier has updated/validated/eventualy renamed
1118 // all the characters send by EGS for a user.
1119 // EGS can proceed to send the characters summary to client
1120 // The result message contains the list of all characters
1121 // with their unified name and home session id from the
1123 void CNameUnifierClientProxy::userCharUpdatedAndValidated(NLNET::IModule
*sender
, uint32 userId
, const std::vector
< TCharSyncResultEntry
> &charInfos
)
1125 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1127 // immediate local synchronous dispatching
1128 _LocalModuleSkel
->userCharUpdatedAndValidated(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), userId
, charInfos
);
1132 // send the message for remote dispatching and execution or local queing
1133 NLNET::CMessage __message
;
1135 buildMessageFor_userCharUpdatedAndValidated(__message
, userId
, charInfos
);
1137 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1140 // The name unifier has failed tp updated/validated/eventualy renamed
1141 // all the characters send by EGS for a user.
1142 // EGS can proceed to send the characters summary to client
1143 // but the character names are perhaps not good ?
1144 void CNameUnifierClientProxy::userCharSyncFailed(NLNET::IModule
*sender
, uint32 userId
)
1146 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1148 // immediate local synchronous dispatching
1149 _LocalModuleSkel
->userCharSyncFailed(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), userId
);
1153 // send the message for remote dispatching and execution or local queing
1154 NLNET::CMessage __message
;
1156 buildMessageFor_userCharSyncFailed(__message
, userId
);
1158 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1161 // The name unifier has renamed a guild to resolve a name conflict
1162 void CNameUnifierClientProxy::guildRenamed(NLNET::IModule
*sender
, uint32 guildId
, const ucstring
&newName
)
1164 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1166 // immediate local synchronous dispatching
1167 _LocalModuleSkel
->guildRenamed(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), guildId
, newName
);
1171 // send the message for remote dispatching and execution or local queing
1172 NLNET::CMessage __message
;
1174 buildMessageFor_guildRenamed(__message
, guildId
, newName
);
1176 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1179 // The name unifier respond to EGS about guild name validation request
1180 void CNameUnifierClientProxy::validateGuildNameResult(NLNET::IModule
*sender
, uint32 guildId
, const ucstring
&guildName
, TCharacterNameResult result
)
1182 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1184 // immediate local synchronous dispatching
1185 _LocalModuleSkel
->validateGuildNameResult(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), guildId
, guildName
, result
);
1189 // send the message for remote dispatching and execution or local queing
1190 NLNET::CMessage __message
;
1192 buildMessageFor_validateGuildNameResult(__message
, guildId
, guildName
, result
);
1194 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1197 // The unifier has detected an invalid guild/character association
1198 // and ask to the EGS to remove the character from the guild
1199 void CNameUnifierClientProxy::removeCharFromGuild(NLNET::IModule
*sender
, uint32 charId
, uint32 guildId
)
1201 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
1203 // immediate local synchronous dispatching
1204 _LocalModuleSkel
->removeCharFromGuild(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), charId
, guildId
);
1208 // send the message for remote dispatching and execution or local queing
1209 NLNET::CMessage __message
;
1211 buildMessageFor_removeCharFromGuild(__message
, charId
, guildId
);
1213 _ModuleProxy
->sendModuleMessage(sender
, __message
);
1217 // Message serializer. Return the message received in reference for easier integration
1218 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_initEIdTranslator(NLNET::CMessage
&__message
, bool firstPacket
, bool lastPacket
, const std::vector
< TNameEntry
> &nameEntries
)
1220 __message
.setType("NUC_IET");
1221 nlWrite(__message
, serial
, firstPacket
);
1222 nlWrite(__message
, serial
, lastPacket
);
1223 nlWrite(__message
, serialCont
, const_cast < std::vector
< TNameEntry
>& > (nameEntries
));
1229 // Message serializer. Return the message received in reference for easier integration
1230 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_updateEIdTranslator(NLNET::CMessage
&__message
, const std::vector
< uint32
> &releasedNames
, const std::vector
< TNameEntry
> &changedNames
)
1232 __message
.setType("NUC_UET");
1233 nlWrite(__message
, serialCont
, const_cast < std::vector
< uint32
>& > (releasedNames
));
1234 nlWrite(__message
, serialCont
, const_cast < std::vector
< TNameEntry
>& > (changedNames
));
1240 // Message serializer. Return the message received in reference for easier integration
1241 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_validateCharacterNameResult(NLNET::CMessage
&__message
, const CValidateNameResult
&nameResult
)
1243 __message
.setType("NUC_VCNR");
1244 nlWrite(__message
, serial
, const_cast < CValidateNameResult
& > (nameResult
));
1250 // Message serializer. Return the message received in reference for easier integration
1251 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_assignCharacterNameResult(NLNET::CMessage
&__message
, const CValidateNameResult
&nameResult
)
1253 __message
.setType("NUC_ACNR");
1254 nlWrite(__message
, serial
, const_cast < CValidateNameResult
& > (nameResult
));
1260 // Message serializer. Return the message received in reference for easier integration
1261 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_characterRenamed(NLNET::CMessage
&__message
, uint32 charId
, const std::string
&newName
, bool sendSummary
)
1263 __message
.setType("NUC_CR");
1264 nlWrite(__message
, serial
, charId
);
1265 nlWrite(__message
, serial
, const_cast < std::string
& > (newName
));
1266 nlWrite(__message
, serial
, sendSummary
);
1272 // Message serializer. Return the message received in reference for easier integration
1273 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_userCharUpdatedAndValidated(NLNET::CMessage
&__message
, uint32 userId
, const std::vector
< TCharSyncResultEntry
> &charInfos
)
1275 __message
.setType("NUC_UCUAV");
1276 nlWrite(__message
, serial
, userId
);
1277 nlWrite(__message
, serialCont
, const_cast < std::vector
< TCharSyncResultEntry
>& > (charInfos
));
1283 // Message serializer. Return the message received in reference for easier integration
1284 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_userCharSyncFailed(NLNET::CMessage
&__message
, uint32 userId
)
1286 __message
.setType("NUC_UCSF");
1287 nlWrite(__message
, serial
, userId
);
1293 // Message serializer. Return the message received in reference for easier integration
1294 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_guildRenamed(NLNET::CMessage
&__message
, uint32 guildId
, const ucstring
&newName
)
1296 __message
.setType("NUC_GR");
1297 nlWrite(__message
, serial
, guildId
);
1298 nlWrite(__message
, serial
, const_cast < ucstring
& > (newName
));
1304 // Message serializer. Return the message received in reference for easier integration
1305 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_validateGuildNameResult(NLNET::CMessage
&__message
, uint32 guildId
, const ucstring
&guildName
, TCharacterNameResult result
)
1307 __message
.setType("NUC_VGNR");
1308 nlWrite(__message
, serial
, guildId
);
1309 nlWrite(__message
, serial
, const_cast < ucstring
& > (guildName
));
1310 nlWrite(__message
, serial
, result
);
1316 // Message serializer. Return the message received in reference for easier integration
1317 const NLNET::CMessage
&CNameUnifierClientProxy::buildMessageFor_removeCharFromGuild(NLNET::CMessage
&__message
, uint32 charId
, uint32 guildId
)
1319 __message
.setType("NUC_RCFG");
1320 nlWrite(__message
, serial
, charId
);
1321 nlWrite(__message
, serial
, guildId
);