@ -167,7 +167,7 @@ void CGuildManager::release()
# ifndef USE_PDS
# ifndef USE_PDS
if ( _Instance - > _Container )
if ( _Instance - > _Container )
{
{
for ( map < EGSPD : : TGuildId , EGSPD : : CGuildPD * > : : iterator it = _Instance - > _Container - > getGuildsBegin ( ) ; it ! = _Instance - > _Container - > getGuildsEnd ( ) ; + + it )
for ( map < EGSPD : : TGuildId , EGSPD : : CGuildPD * > : : iterator it = _Instance - > _Container - > getGuildsBegin ( ) ; it ! = _Instance - > _Container - > getGuildsEnd ( ) ; + + it )
{
{
CGuild * guild = EGS_PD_CAST < CGuild * > ( ( * it ) . second ) ;
CGuild * guild = EGS_PD_CAST < CGuild * > ( ( * it ) . second ) ;
@ -175,7 +175,7 @@ void CGuildManager::release()
_Instance - > saveGuild ( guild ) ;
_Instance - > saveGuild ( guild ) ;
}
}
}
}
# endif
# endif
delete _Instance ;
delete _Instance ;
_Instance = NULL ;
_Instance = NULL ;
}
}
@ -311,7 +311,7 @@ void CGuildManager::saveGuild( CGuild* guild )
EGS_PD_AST ( guild ) ;
EGS_PD_AST ( guild ) ;
if ( guild - > isProxy ( ) )
if ( guild - > isProxy ( ) )
return ;
return ;
uint32 id = guild - > getId ( ) ;
uint32 id = guild - > getId ( ) ;
{
{
H_AUTO ( CGuildManagerSaveGUILD_FAME )
H_AUTO ( CGuildManagerSaveGUILD_FAME )
@ -333,7 +333,7 @@ void CGuildManager::saveGuild( CGuild* guild )
}
}
else
else
{
{
string fileName = NLMISC : : toString ( " guilds/guild_%05u.bin " , id & 0x000fffff ) ;
string fileName = NLMISC : : toString ( " guilds/guild_%05u.bin " , id & 0x000fffff ) ;
if ( UseBS )
if ( UseBS )
{
{
@ -429,7 +429,7 @@ CGuild *CGuildManager::createGuildProxy(uint32 guildId, const ucstring & guildNa
EGSPD : : CGuildFameContainerPD * fameCont = EGSPD : : CGuildFameContainerPD : : create ( CEntityId ( RYZOMID : : guild , guildId ) ) ;
EGSPD : : CGuildFameContainerPD * fameCont = EGSPD : : CGuildFameContainerPD : : create ( CEntityId ( RYZOMID : : guild , guildId ) ) ;
EGS_PD_AST ( fameCont ) ;
EGS_PD_AST ( fameCont ) ;
guild - > setFameContainer ( fameCont ) ;
guild - > setFameContainer ( fameCont ) ;
/// register guild in other system
/// register guild in other system
guild - > registerGuild ( ) ;
guild - > registerGuild ( ) ;
@ -449,7 +449,7 @@ CGuild *CGuildManager::createGuildProxy(uint32 guildId, const ucstring & guildNa
// {
// {
// guild->setRolemastersValid( (EGSPD::CSPType::TSPType)i, false );
// guild->setRolemastersValid( (EGSPD::CSPType::TSPType)i, false );
// }
// }
// init the guild strings
// init the guild strings
guild - > setName ( guildName ) ;
guild - > setName ( guildName ) ;
guild - > setDescription ( description ) ;
guild - > setDescription ( description ) ;
@ -485,7 +485,7 @@ void CGuildManager::dumpGuilds( bool onlyLocal, NLMISC::CLog & log )const
count + + ;
count + + ;
const ucstring & name = guild - > getName ( ) ;
const ucstring & name = guild - > getName ( ) ;
log . displayNL ( " id = %s %s %s, name = '%s', %u members " ,
log . displayNL ( " id = %s %s %s, name = '%s', %u members " ,
guildIdToString ( it - > first ) . c_str ( ) ,
guildIdToString ( it - > first ) . c_str ( ) ,
( it - > first ) > > 20 = = IService : : getInstance ( ) - > getShardId ( ) ? " (Local) " : " (Foreign) " ,
( it - > first ) > > 20 = = IService : : getInstance ( ) - > getShardId ( ) ? " (Local) " : " (Foreign) " ,
guild - > getEId ( ) . toString ( ) . c_str ( ) ,
guild - > getEId ( ) . toString ( ) . c_str ( ) ,
name . toString ( ) . c_str ( ) ,
name . toString ( ) . c_str ( ) ,
@ -568,7 +568,7 @@ CGuild * CGuildManager::getGuildFromId( EGSPD::TGuildId id )
// std::pair< std::map<ucstring,EGSPD::TGuildId>::iterator, std::map<ucstring,EGSPD::TGuildId>::iterator > thePair = _GuildsAwaitingString.equal_range( str );
// std::pair< std::map<ucstring,EGSPD::TGuildId>::iterator, std::map<ucstring,EGSPD::TGuildId>::iterator > thePair = _GuildsAwaitingString.equal_range( str );
// if ( thePair.first == thePair.second )
// if ( thePair.first == thePair.second )
// return false;
// return false;
//
//
// for ( std::map<ucstring,EGSPD::TGuildId>::iterator it = thePair.first; it != thePair.second;++it )
// for ( std::map<ucstring,EGSPD::TGuildId>::iterator it = thePair.first; it != thePair.second;++it )
// {
// {
// TGuildId guildId = it->second;
// TGuildId guildId = it->second;
@ -586,7 +586,7 @@ bool CGuildManager::checkGuildMemberShip( const EGSPD::TCharacterId & userId, co
// if we have no container, it means that the shard is not initialized yet and that players are loaded for check purpose
// if we have no container, it means that the shard is not initialized yet and that players are loaded for check purpose
if ( ! _Container )
if ( ! _Container )
return true ;
return true ;
EGSPD : : CGuildPD * guild = _Container - > getGuilds ( guildId ) ;
EGSPD : : CGuildPD * guild = _Container - > getGuilds ( guildId ) ;
if ( ! guild )
if ( ! guild )
return false ;
return false ;
@ -732,7 +732,7 @@ void CGuildManager::createGuild(CGuildCharProxy & proxy,const ucstring & guildNa
uint32 guildId = getFreeGuildId ( ) ;
uint32 guildId = getFreeGuildId ( ) ;
// boris 2006 : validate the name with the Shard unifier and store guild creation info when SU returns
// boris 2006 : validate the name with the Shard unifier and store guild creation info when SU returns
// store the creation data
// store the creation data
TPendingGuildCreate pgc ;
TPendingGuildCreate pgc ;
pgc . CreatorChar = proxy . getId ( ) ;
pgc . CreatorChar = proxy . getId ( ) ;
pgc . GuildName = guildName ;
pgc . GuildName = guildName ;
@ -753,7 +753,7 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
BOMB_IF ( it = = _PendingGuildCreates . end ( ) , " CGuildManager::createGuildStep2 : can't find guild " < < guildId < < " in the pending guild creation " , return ) ;
BOMB_IF ( it = = _PendingGuildCreates . end ( ) , " CGuildManager::createGuildStep2 : can't find guild " < < guildId < < " in the pending guild creation " , return ) ;
TPendingGuildCreate pgc = it - > second ;
TPendingGuildCreate pgc = it - > second ;
_PendingGuildCreates . erase ( it ) ;
_PendingGuildCreates . erase ( it ) ;
if ( result ! = CHARSYNC : : TCharacterNameResult : : cnr_ok )
if ( result ! = CHARSYNC : : TCharacterNameResult : : cnr_ok )
{
{
// no valid name
// no valid name
@ -789,7 +789,7 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
proxy . sendSystemMessage ( " GUILD_CREATED " ) ;
proxy . sendSystemMessage ( " GUILD_CREATED " ) ;
proxy . spendMoney ( GuildCreationCost . get ( ) ) ;
proxy . spendMoney ( GuildCreationCost . get ( ) ) ;
// create the guild through PDS
// create the guild through PDS
CGuild * guild = EGS_PD_CAST < CGuild * > ( EGSPD : : CGuildPD : : create ( guildId ) ) ;
CGuild * guild = EGS_PD_CAST < CGuild * > ( EGSPD : : CGuildPD : : create ( guildId ) ) ;
EGS_PD_AST ( guild ) ;
EGS_PD_AST ( guild ) ;
@ -799,7 +799,7 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
EGSPD : : CGuildFameContainerPD * fameCont = EGSPD : : CGuildFameContainerPD : : create ( CEntityId ( RYZOMID : : guild , guildId ) ) ;
EGSPD : : CGuildFameContainerPD * fameCont = EGSPD : : CGuildFameContainerPD : : create ( CEntityId ( RYZOMID : : guild , guildId ) ) ;
EGS_PD_AST ( fameCont ) ;
EGS_PD_AST ( fameCont ) ;
guild - > setFameContainer ( fameCont ) ;
guild - > setFameContainer ( fameCont ) ;
/// register guild in other system
/// register guild in other system
guild - > registerGuild ( ) ;
guild - > registerGuild ( ) ;
@ -807,7 +807,7 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
// inform the SU that a new guild now exist (to update the ring database).
// inform the SU that a new guild now exist (to update the ring database).
if ( IShardUnifierEvent : : getInstance ( ) )
if ( IShardUnifierEvent : : getInstance ( ) )
IShardUnifierEvent : : getInstance ( ) - > addGuild ( guildId , guildName ) ;
IShardUnifierEvent : : getInstance ( ) - > addGuild ( guildId , guildName ) ;
// set initial guild fames
// set initial guild fames
guild - > setStartFameAndAllegiance ( proxy . getId ( ) ) ;
guild - > setStartFameAndAllegiance ( proxy . getId ( ) ) ;
@ -823,7 +823,7 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
// {
// {
// guild->setRolemastersValid( (EGSPD::CSPType::TSPType)i, false );
// guild->setRolemastersValid( (EGSPD::CSPType::TSPType)i, false );
// }
// }
// init the guild strings
// init the guild strings
guild - > setName ( guildName ) ;
guild - > setName ( guildName ) ;
guild - > setDescription ( pgc . Description ) ;
guild - > setDescription ( pgc . Description ) ;
@ -834,7 +834,6 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
// EGSPD::PDSLib.getStringManager().addString( stringEId, guildName );
// EGSPD::PDSLib.getStringManager().addString( stringEId, guildName );
// stringEId.setType( RYZOMID::guildDescription );
// stringEId.setType( RYZOMID::guildDescription );
// EGSPD::PDSLib.getStringManager().addString( stringEId, pgc.Description );
// EGSPD::PDSLib.getStringManager().addString( stringEId, pgc.Description );
// create a new guild member
// create a new guild member
CGuildMember * memberCore = guild - > newMember ( proxy . getId ( ) ) ;
CGuildMember * memberCore = guild - > newMember ( proxy . getId ( ) ) ;
@ -844,21 +843,21 @@ void CGuildManager::createGuildStep2(uint32 guildId, const ucstring &guildName,
memberCore - > setEnterTime ( CTickEventHandler : : getGameCycle ( ) ) ;
memberCore - > setEnterTime ( CTickEventHandler : : getGameCycle ( ) ) ;
STOP_IF ( ! guild - > setMemberGrade ( memberCore , EGSPD : : CGuildGrade : : Leader ) , " Failed to set grade to leader for new guild " < < guildId < < " creator " < < character - > getId ( ) . toString ( ) ) ;
STOP_IF ( ! guild - > setMemberGrade ( memberCore , EGSPD : : CGuildGrade : : Leader ) , " Failed to set grade to leader for new guild " < < guildId < < " creator " < < character - > getId ( ) . toString ( ) ) ;
// memberCore->setMemberGrade( EGSPD::CGuildGrade::Leader );
// memberCore->setMemberGrade( EGSPD::CGuildGrade::Leader );
// create the leader module to init properties
// create the leader module to init properties
// CGuildLeaderModule * leader = new CGuildLeaderModule( proxy, memberCore );
// CGuildLeaderModule * leader = new CGuildLeaderModule( proxy, memberCore );
// guild->setMemberOnline( memberCore, proxy.getId().getDynamicId() );
// guild->setMemberOnline( memberCore, proxy.getId().getDynamicId() );
// broadcast the new guild info
// broadcast the new guild info
IGuildUnifier : : getInstance ( ) - > guildCreated ( guild ) ;
IGuildUnifier : : getInstance ( ) - > guildCreated ( guild ) ;
// close guild creation interface
// close guild creation interface
PlayerManager . sendImpulseToClient ( proxy . getId ( ) , " GUILD:ABORT_CREATION " ) ;
PlayerManager . sendImpulseToClient ( proxy . getId ( ) , " GUILD:ABORT_CREATION " ) ;
/// end current bot chat
/// end current bot chat
proxy . endBotChat ( ) ;
proxy . endBotChat ( ) ;
proxy . updateTarget ( ) ;
proxy . updateTarget ( ) ;
_ExistingGuildNames . insert ( NLMISC : : toLower ( guild - > getName ( ) . toString ( ) . c_str ( ) ) ) ;
_ExistingGuildNames . insert ( NLMISC : : toLower ( guild - > getName ( ) . toString ( ) ) ) ;
// ask the client to open it's guild interface
// ask the client to open it's guild interface
PlayerManager . sendImpulseToClient ( proxy . getId ( ) , " GUILD:OPEN_GUILD_WINDOW " ) ;
PlayerManager . sendImpulseToClient ( proxy . getId ( ) , " GUILD:OPEN_GUILD_WINDOW " ) ;
@ -901,11 +900,11 @@ void CGuildManager::deleteGuild(uint32 id)
if ( ! guild - > isProxy ( ) )
if ( ! guild - > isProxy ( ) )
{
{
CMailForumValidator : : removeGuild ( name ) ;
CMailForumValidator : : removeGuild ( name ) ;
CStatDB : : getInstance ( ) - > removeGuild ( id ) ;
CStatDB : : getInstance ( ) - > removeGuild ( id ) ;
}
}
_ExistingGuildNames . erase ( NLMISC : : toLower ( guild - > getName ( ) . toString ( ) . c_str ( ) ) ) ;
_ExistingGuildNames . erase ( NLMISC : : toLower ( guild - > getName ( ) . toString ( ) ) ) ;
guild - > unregisterGuild ( ) ;
guild - > unregisterGuild ( ) ;
if ( ! guild - > isProxy ( ) )
if ( ! guild - > isProxy ( ) )
@ -936,7 +935,7 @@ void CGuildManager::deleteGuild(uint32 id)
// }
// }
// else
// else
// _FreeGuildIds.insert(id);
// _FreeGuildIds.insert(id);
}
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
@ -956,25 +955,25 @@ void CGuildManager::characterDeleted( CCharacter & user )
nlwarning ( " <GUILD>invalid guild id %s " , guildIdToString ( user . getGuildId ( ) ) . c_str ( ) ) ;
nlwarning ( " <GUILD>invalid guild id %s " , guildIdToString ( user . getGuildId ( ) ) . c_str ( ) ) ;
return ;
return ;
}
}
if ( guild - > isProxy ( ) )
if ( guild - > isProxy ( ) )
{
{
// for proxyfied guild, we wait the action of the origin shard
// for proxyfied guild, we wait the action of the origin shard
return ;
return ;
}
}
CGuildMember * userMember = EGS_PD_CAST < CGuildMember * > ( guild - > getMembers ( user . getId ( ) ) ) ;
CGuildMember * userMember = EGS_PD_CAST < CGuildMember * > ( guild - > getMembers ( user . getId ( ) ) ) ;
if ( ! userMember )
if ( ! userMember )
{
{
nlwarning ( " <GUILD>'%s' is not in guild %s " , user . getId ( ) . toString ( ) . c_str ( ) , guildIdToString ( user . getGuildId ( ) ) . c_str ( ) ) ;
nlwarning ( " <GUILD>'%s' is not in guild %s " , user . getId ( ) . toString ( ) . c_str ( ) , guildIdToString ( user . getGuildId ( ) ) . c_str ( ) ) ;
return ;
return ;
}
}
if ( userMember - > getGrade ( ) = = EGSPD : : CGuildGrade : : Leader )
if ( userMember - > getGrade ( ) = = EGSPD : : CGuildGrade : : Leader )
{
{
// the leader quits : find a successor
// the leader quits : find a successor
CGuildMember * successor = NULL ;
CGuildMember * successor = NULL ;
// best successor is the member with best grade. If more than 1 user fits, take the older in the guild
// best successor is the member with best grade. If more than 1 user fits, take the older in the guild
for ( map < EGSPD : : TCharacterId , EGSPD : : CGuildMemberPD * > : : iterator it = guild - > getMembersBegin ( ) ;
for ( map < EGSPD : : TCharacterId , EGSPD : : CGuildMemberPD * > : : iterator it = guild - > getMembersBegin ( ) ;
it ! = guild - > getMembersEnd ( ) ;
it ! = guild - > getMembersEnd ( ) ;
+ + it )
+ + it )
@ -992,7 +991,7 @@ void CGuildManager::characterDeleted( CCharacter & user )
successor = member ;
successor = member ;
}
}
}
}
// if the guild is still valid, set the successor as leader
// if the guild is still valid, set the successor as leader
if ( successor )
if ( successor )
@ -1000,13 +999,13 @@ void CGuildManager::characterDeleted( CCharacter & user )
guild - > decGradeCount ( successor - > getGrade ( ) ) ;
guild - > decGradeCount ( successor - > getGrade ( ) ) ;
guild - > incGradeCount ( EGSPD : : CGuildGrade : : Leader ) ;
guild - > incGradeCount ( EGSPD : : CGuildGrade : : Leader ) ;
successor - > setMemberGrade ( EGSPD : : CGuildGrade : : Leader ) ;
successor - > setMemberGrade ( EGSPD : : CGuildGrade : : Leader ) ;
// tell guild
// tell guild
SM_STATIC_PARAMS_1 ( params , STRING_MANAGER : : player ) ;
SM_STATIC_PARAMS_1 ( params , STRING_MANAGER : : player ) ;
params [ 0 ] . setEIdAIAlias ( successor - > getIngameEId ( ) , CAIAliasTranslator : : getInstance ( ) - > getAIAlias ( successor - > getIngameEId ( ) ) ) ;
params [ 0 ] . setEIdAIAlias ( successor - > getIngameEId ( ) , CAIAliasTranslator : : getInstance ( ) - > getAIAlias ( successor - > getIngameEId ( ) ) ) ;
guild - > sendMessageToGuildMembers ( " GUILD_NEW_LEADER " , params ) ;
guild - > sendMessageToGuildMembers ( " GUILD_NEW_LEADER " , params ) ;
// If the player is online, the module must be recreated. Do as the reference was destroyed
// If the player is online, the module must be recreated. Do as the reference was destroyed
CGuildMemberModule * successorModule = NULL ;
CGuildMemberModule * successorModule = NULL ;
if ( successor - > getReferencingModule ( successorModule ) )
if ( successor - > getReferencingModule ( successorModule ) )
@ -1025,7 +1024,7 @@ void CGuildManager::characterDeleted( CCharacter & user )
guild - > incGradeCount ( EGSPD : : CGuildGrade : : Member ) ;
guild - > incGradeCount ( EGSPD : : CGuildGrade : : Member ) ;
guild - > decGradeCount ( EGSPD : : CGuildGrade : : Leader ) ;
guild - > decGradeCount ( EGSPD : : CGuildGrade : : Leader ) ;
}
}
guild - > deleteMember ( userMember ) ;
guild - > deleteMember ( userMember ) ;
if ( guild - > getMembersBegin ( ) = = guild - > getMembersEnd ( ) )
if ( guild - > getMembersBegin ( ) = = guild - > getMembersEnd ( ) )
{
{
@ -1156,7 +1155,7 @@ void CGuildManager::callback(const CFileDescription& fileDescription, NLMISC::IS
static CPersistentDataRecord pdr ;
static CPersistentDataRecord pdr ;
pdr . clear ( ) ;
pdr . clear ( ) ;
pdr . fromBuffer ( dataStream ) ;
pdr . fromBuffer ( dataStream ) ;
guild = EGS_PD_CAST < CGuild * > ( EGSPD : : CGuildPD : : create ( guildId ) ) ;
guild = EGS_PD_CAST < CGuild * > ( EGSPD : : CGuildPD : : create ( guildId ) ) ;
EGS_PD_AST ( guild ) ;
EGS_PD_AST ( guild ) ;
// store it as loast loaded guild
// store it as loast loaded guild
@ -1245,7 +1244,7 @@ void CGuildManager::callback(const CFileDescription& fileDescription, NLMISC::IS
// nlinfo("Loading outposts from save files...");
// nlinfo("Loading outposts from save files...");
// COutpostManager::getInstance().loadOutpostSaveFiles();
// COutpostManager::getInstance().loadOutpostSaveFiles();
//
//
// // Send the guild list to SU to synchronize the ring database and name manager
// // Send the guild list to SU to synchronize the ring database and name manager
// // (and eventualy rename some conflicting guilds)
// // (and eventualy rename some conflicting guilds)
// {
// {
// std::vector<CHARSYNC::CGuildInfo> guildInfos;
// std::vector<CHARSYNC::CGuildInfo> guildInfos;
@ -1287,7 +1286,7 @@ void CGuildManager::callback(const CFileDescription& fileDescription, NLMISC::IS
// gi.setGuildName(guild->getName());
// gi.setGuildName(guild->getName());
//
//
// guildInfos.push_back(gi);
// guildInfos.push_back(gi);
//
//
// IShardUnifierEvent::getInstance()->registerLoadedGuildNames(guildInfos);
// IShardUnifierEvent::getInstance()->registerLoadedGuildNames(guildInfos);
// }
// }
//
//
@ -1305,7 +1304,7 @@ void CGuildManager::loadGuilds()
return ;
return ;
IService : : getInstance ( ) - > setCurrentStatus ( " Loading Guilds " ) ;
IService : : getInstance ( ) - > setCurrentStatus ( " Loading Guilds " ) ;
// create the container if it was not loaded
// create the container if it was not loaded
if ( _Container = = NULL )
if ( _Container = = NULL )
_Container = EGSPD : : CGuildContainerPD : : create ( 1 ) ;
_Container = EGSPD : : CGuildContainerPD : : create ( 1 ) ;
@ -1366,7 +1365,7 @@ void CGuildManager::loadGuilds()
nlinfo ( " Loading outposts from save files... " ) ;
nlinfo ( " Loading outposts from save files... " ) ;
COutpostManager : : getInstance ( ) . loadOutpostSaveFiles ( ) ;
COutpostManager : : getInstance ( ) . loadOutpostSaveFiles ( ) ;
// Send the guild list to SU to synchronize the ring database and name manager
// Send the guild list to SU to synchronize the ring database and name manager
// (and eventualy rename some conflicting guilds)
// (and eventualy rename some conflicting guilds)
if ( DontUseSU . get ( ) = = 0 )
if ( DontUseSU . get ( ) = = 0 )
{
{
@ -1424,8 +1423,8 @@ void CGuildManager::registerGuildAfterLoading(CGuild *guildToRegister)
// const ucstring & str = guildToRegister->getDescription();
// const ucstring & str = guildToRegister->getDescription();
// _GuildsAwaitingString.insert( make_pair( str, guildToRegister->getId() ) );
// _GuildsAwaitingString.insert( make_pair( str, guildToRegister->getId() ) );
// }
// }
_ExistingGuildNames . insert ( NLMISC : : toLower ( guildToRegister - > getName ( ) . toString ( ) . c_str ( ) ) ) ;
_ExistingGuildNames . insert ( NLMISC : : toLower ( guildToRegister - > getName ( ) . toString ( ) ) ) ;
}
}
}
}
@ -1447,7 +1446,7 @@ void CGuildManager::checkMemberConsistency(CGuild *guildToCheck)
first - > first . toString ( ) . c_str ( ) ,
first - > first . toString ( ) . c_str ( ) ,
gid ,
gid ,
guildToCheck - > getId ( ) ) ;
guildToCheck - > getId ( ) ) ;
memberToRemove . insert ( first - > first ) ;
memberToRemove . insert ( first - > first ) ;
}
}
else
else
@ -1469,9 +1468,9 @@ void CGuildManager::checkMemberConsistency(CGuild *guildToCheck)
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
bool CGuildManager : : checkGuildStrings ( CGuildCharProxy & proxy , const ucstring & name , const ucstring & description )
bool CGuildManager : : checkGuildStrings ( CGuildCharProxy & proxy , const ucstring & name , const ucstring & description )
{
{
if ( name . empty ( ) )
if ( name . empty ( ) )
return false ;
return false ;
// check if name already exists in the player list
// check if name already exists in the player list
if ( NLMISC : : CEntityIdTranslator : : getInstance ( ) - > entityNameExists ( name ) )
if ( NLMISC : : CEntityIdTranslator : : getInstance ( ) - > entityNameExists ( name ) )
{
{
@ -1508,7 +1507,7 @@ bool CGuildManager::checkGuildStrings(CGuildCharProxy & proxy,const ucstring & n
{
{
proxy . sendSystemMessage ( " GUILD_NAME_BAD_CHAR " ) ;
proxy . sendSystemMessage ( " GUILD_NAME_BAD_CHAR " ) ;
return false ;
return false ;
}
}
prevBlank = true ;
prevBlank = true ;
}
}
else
else
@ -1668,7 +1667,7 @@ restartMemberLoop:
// A character connect/disconnect on another shard, update the online tags
// A character connect/disconnect on another shard, update the online tags
void CGuildManager : : characterConnectionEvent ( const NLMISC : : CEntityId & eid , bool online )
void CGuildManager : : characterConnectionEvent ( const NLMISC : : CEntityId & eid , bool online )
{
{
// iterate over all guild, for each look the member list and update online state if it is the concerned character
// iterate over all guild, for each look the member list and update online state if it is the concerned character
if ( _Container = = NULL )
if ( _Container = = NULL )
@ -1830,7 +1829,7 @@ NLMISC_CLASS_COMMAND_IMPL(CGuildManager, unloadGuild)
// force a save of the guild
// force a save of the guild
saveGuild ( guild ) ;
saveGuild ( guild ) ;
// a little fake : we make the guild 'foreign' to skip deletion of the file
// a little fake : we make the guild 'foreign' to skip deletion of the file
guild - > setProxy ( true ) ;
guild - > setProxy ( true ) ;
// remove all but the last members
// remove all but the last members
@ -1930,7 +1929,7 @@ NLMISC_CLASS_COMMAND_IMPL(CGuildManager, addGuildMember)
// return false;
// return false;
//
//
// TGuildId guildId = atoi(args[0].c_str());
// TGuildId guildId = atoi(args[0].c_str());
//
//
// CGuild *guild = getGuildFromId(guildId);
// CGuild *guild = getGuildFromId(guildId);
// if (guild == NULL)
// if (guild == NULL)
// {
// {