fix(Core/Guild): Implement gender in guild (#4017)

This commit is contained in:
Kitzunu
2020-12-24 22:38:56 +01:00
committed by GitHub
parent 6a95e61801
commit 1ed80e9596
4 changed files with 17 additions and 11 deletions

View File

@@ -592,15 +592,17 @@ void Guild::Member::SetStats(Player* player)
m_name = player->GetName();
m_level = player->getLevel();
m_class = player->getClass();
m_gender = player->getGender();
m_zoneId = player->GetZoneId();
m_accountId = player->GetSession()->GetAccountId();
}
void Guild::Member::SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId)
void Guild::Member::SetStats(std::string const& name, uint8 level, uint8 _class, uint8 gender, uint32 zoneId, uint32 accountId)
{
m_name = name;
m_level = level;
m_class = _class;
m_gender = gender;
m_zoneId = zoneId;
m_accountId = accountId;
}
@@ -670,9 +672,10 @@ bool Guild::Member::LoadFromDB(Field* fields)
SetStats(fields[12].GetString(),
fields[13].GetUInt8(), // characters.level
fields[14].GetUInt8(), // characters.class
fields[15].GetUInt16(), // characters.zone
fields[16].GetUInt32()); // characters.account
m_logoutTime = fields[17].GetUInt32(); // characters.logout_time
fields[15].GetUInt8(), // characters.gender
fields[16].GetUInt16(), // characters.zone
fields[17].GetUInt32()); // characters.account
m_logoutTime = fields[18].GetUInt32(); // characters.logout_time
if (!CheckStats())
return false;
@@ -711,7 +714,7 @@ void Guild::Member::WritePacket(WorldPacket& data, bool sendOfficerNote) const
<< uint32(m_rankId)
<< uint8(m_level)
<< uint8(m_class)
<< uint8(0)
<< uint8(m_gender)
<< uint32(m_zoneId);
if (!m_flags)
@@ -2257,8 +2260,9 @@ bool Guild::AddMember(uint64 guid, uint8 rankId)
name,
fields[1].GetUInt8(),
fields[2].GetUInt8(),
fields[3].GetUInt16(),
fields[4].GetUInt32());
fields[3].GetUInt8(),
fields[4].GetUInt16(),
fields[5].GetUInt32());
ok = member->CheckStats();
}

View File

@@ -289,7 +289,7 @@ public: // pussywizard: public class Member
}
void SetStats(Player* player);
void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId);
void SetStats(std::string const& name, uint8 level, uint8 _class, uint8 gender, uint32 zoneId, uint32 accountId);
bool CheckStats() const;
void SetPublicNote(std::string const& publicNote);
@@ -314,6 +314,7 @@ public: // pussywizard: public class Member
std::string GetOfficerNote() const { return m_officerNote; }
uint8 GetClass() const { return m_class; }
uint8 GetLevel() const { return m_level; }
uint8 GetGender() const { return m_gender; }
uint8 GetFlags() const { return m_flags; }
uint32 GetZoneId() const { return m_zoneId; }
bool IsOnline() { return (m_flags & GUILDMEMBER_STATUS_ONLINE); }
@@ -339,6 +340,7 @@ public: // pussywizard: public class Member
uint32 m_zoneId;
uint8 m_level;
uint8 m_class;
uint8 m_gender;
uint8 m_flags;
uint64 m_logoutTime;
uint32 m_accountId;

View File

@@ -169,8 +169,8 @@ void GuildMgr::LoadGuilds()
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, `rank`, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, "
// 11 12 13 14 15 16 17
"w.money, c.name, c.level, c.class, c.zone, c.account, c.logout_time "
// 11 12 13 14 15 16 17 18
"w.money, c.name, c.level, c.class, c.gender, c.zone, c.account, c.logout_time "
"FROM guild_member gm "
"LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid "
"LEFT JOIN characters c ON c.guid = gm.guid ORDER BY guildid ASC");