[9607] Fix SMSG_GUILD_INFO time part.

This commit is contained in:
Machiavelli 2010-03-19 17:18:27 +01:00 committed by XTZGZoReX
parent bb1638fd2b
commit faa07b3ca5
4 changed files with 9 additions and 25 deletions

View file

@ -41,9 +41,7 @@ Guild::Guild()
m_BorderColor = 0; m_BorderColor = 0;
m_BackgroundColor = 0; m_BackgroundColor = 0;
m_CreatedYear = 0; m_CreatedDate = 0;
m_CreatedMonth = 0;
m_CreatedDay = 0;
m_GuildBankMoney = 0; m_GuildBankMoney = 0;
m_PurchasedTabs = 0; m_PurchasedTabs = 0;
@ -224,21 +222,13 @@ bool Guild::LoadGuildFromDB(QueryResult *guildDataResult)
m_BackgroundColor = fields[7].GetUInt32(); m_BackgroundColor = fields[7].GetUInt32();
GINFO = fields[8].GetCppString(); GINFO = fields[8].GetCppString();
MOTD = fields[9].GetCppString(); MOTD = fields[9].GetCppString();
time_t time = fields[10].GetUInt64(); m_CreatedDate = fields[10].GetUInt64();
m_GuildBankMoney = fields[11].GetUInt64(); m_GuildBankMoney = fields[11].GetUInt64();
m_PurchasedTabs = fields[12].GetUInt32(); m_PurchasedTabs = fields[12].GetUInt32();
if (m_PurchasedTabs > GUILD_BANK_MAX_TABS) if (m_PurchasedTabs > GUILD_BANK_MAX_TABS)
m_PurchasedTabs = GUILD_BANK_MAX_TABS; m_PurchasedTabs = GUILD_BANK_MAX_TABS;
if (time > 0)
{
tm local = *(localtime(&time)); // dereference and assign
m_CreatedDay = local.tm_mday;
m_CreatedMonth = local.tm_mon + 1;
m_CreatedYear = local.tm_year + 1900;
}
return true; return true;
} }

View file

@ -301,9 +301,7 @@ class Guild
std::string const& GetMOTD() const { return MOTD; } std::string const& GetMOTD() const { return MOTD; }
std::string const& GetGINFO() const { return GINFO; } std::string const& GetGINFO() const { return GINFO; }
uint32 GetCreatedYear() const { return m_CreatedYear; } time_t GetCreatedDate() const { return m_CreatedDate; }
uint32 GetCreatedMonth() const { return m_CreatedMonth; }
uint32 GetCreatedDay() const { return m_CreatedDay; }
uint32 GetEmblemStyle() const { return m_EmblemStyle; } uint32 GetEmblemStyle() const { return m_EmblemStyle; }
uint32 GetEmblemColor() const { return m_EmblemColor; } uint32 GetEmblemColor() const { return m_EmblemColor; }
@ -437,9 +435,7 @@ class Guild
uint64 m_LeaderGuid; uint64 m_LeaderGuid;
std::string MOTD; std::string MOTD;
std::string GINFO; std::string GINFO;
uint32 m_CreatedYear; time_t m_CreatedDate;
uint32 m_CreatedMonth;
uint32 m_CreatedDay;
uint32 m_EmblemStyle; uint32 m_EmblemStyle;
uint32 m_EmblemColor; uint32 m_EmblemColor;

View file

@ -226,13 +226,11 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
return; return;
} }
WorldPacket data(SMSG_GUILD_INFO, (5*4 + guild->GetName().size() + 1)); WorldPacket data(SMSG_GUILD_INFO, (guild->GetName().size() + 4 + 4 + 4));
data << guild->GetName(); data << guild->GetName();
data << guild->GetCreatedDay(); data << uint32(secsToTimeBitFields(guild->GetCreatedDate())); // 3.x (prev. day + month + year)
data << guild->GetCreatedMonth(); data << uint32(guild->GetMemberSize()); // amount of chars
data << guild->GetCreatedYear(); data << uint32(guild->GetMemberSize()); // amount of accounts (TODO: implement)
data << guild->GetMemberSize();
data << guild->GetMemberSize();
SendPacket(&data); SendPacket(&data);
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9606" #define REVISION_NR "9607"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__