7 #include "../clib/cfgelem.h" 8 #include "../clib/cfgfile.h" 9 #include "../clib/cfgsect.h" 10 #include "../clib/fileutil.h" 11 #include "../clib/streamsaver.h" 12 #include "../plib/systemstate.h" 34 for ( const_iterator citr = begin(), citrend = end(); citr != citrend; ++citr )
36 os() <<
"\t" << tag <<
"\t0x" << fmt::hex( *citr ) <<
pf_endl;
41 : _guildid( elem.remove_ushort(
"GUILDID" ) ),
42 _member_serials( elem,
"MEMBER" ),
43 _allyguild_serials( elem,
"ALLYGUILD" ),
44 _enemyguild_serials( elem,
"ENEMYGUILD" ),
67 unsigned int mserial = ( *itr );
68 SerialSet::iterator last_itr = itr;
92 unsigned int mserial = ( *itr );
93 SerialSet::iterator last_itr = itr;
169 sw() <<
"}" << pf_endl <<
pf_endl;
180 return ( g1 == g2 || g1->
hasAlly( g2 ) );
192 Guild* guild = ( *itr ).second.get();
208 while ( cf.
read( elem ) )
210 if ( sect_general.
matches( elem ) )
214 else if ( sect_guild.
matches( elem ) )
231 const Guild* guild = _guild.second.get();
239 Guild* guild =
nullptr;
241 guild = ( *itr ).second.get();
244 guild =
new Guild( guildid );
257 Guild* guild =
nullptr;
260 guild = ( *itr ).second.get();
267 return sizeof(
unsigned int )
268 + 3 *
sizeof(
void* ) +
269 _member_serials.size() * (
sizeof(
unsigned int ) + 3 *
sizeof(
void* ) ) +
270 3 *
sizeof(
void* ) +
272 3 *
sizeof(
void* ) +
static Guild * FindGuild(unsigned int guildid)
void printProperties(Clib::StreamWriter &sw) const
Guild(Clib::ConfigElem &elem)
size_t estimateSize() const
std::string world_data_path
static bool AreAllies(Guild *g1, Guild *g2)
static bool AreEnemies(Guild *g1, Guild *g2)
void addMember(unsigned int serial)
unsigned int remove_ulong(const char *propname)
unsigned int guildid() const
size_t estimatedSize() const
void writeOn(Clib::StreamWriter &sw, const char *tag) const
SerialSet _member_serials
bool matches(const ConfigElem &elem)
void registerWithMembers()
void send_move(Client *client, const Character *chr)
const unsigned CST_NORMAL
SerialSet _allyguild_serials
const unsigned CST_UNIQUE
void readProperties(Clib::ConfigElem &elem)
Mobile::Character * system_find_mobile(u32 serial)
void update_online_members()
bool remove_prop(const char *propname, std::string *value)
static Guild * FindOrCreateGuild(unsigned int guildid, unsigned int memberserial)
static void update_online_members_remove(Mobile::Character *chr)
SerialSet _enemyguild_serials
void write_guilds(Clib::StreamWriter &sw)
bool hasEnemy(const Guild *g2) const
bool hasAlly(const Guild *g2) const
bool FileExists(const char *filename)
void printOn(Clib::StreamWriter &sw) const
void send_remove_character_to_nearby_cansee(const Character *chr)
bool read(ConfigElem &elem)
void send_create_mobile_to_nearby_cansee(const Character *chr)