mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9607] Fix SMSG_GUILD_INFO time part.
This commit is contained in:
parent
bb1638fd2b
commit
faa07b3ca5
4 changed files with 9 additions and 25 deletions
|
|
@ -41,9 +41,7 @@ Guild::Guild()
|
|||
m_BorderColor = 0;
|
||||
m_BackgroundColor = 0;
|
||||
|
||||
m_CreatedYear = 0;
|
||||
m_CreatedMonth = 0;
|
||||
m_CreatedDay = 0;
|
||||
m_CreatedDate = 0;
|
||||
|
||||
m_GuildBankMoney = 0;
|
||||
m_PurchasedTabs = 0;
|
||||
|
|
@ -224,21 +222,13 @@ bool Guild::LoadGuildFromDB(QueryResult *guildDataResult)
|
|||
m_BackgroundColor = fields[7].GetUInt32();
|
||||
GINFO = fields[8].GetCppString();
|
||||
MOTD = fields[9].GetCppString();
|
||||
time_t time = fields[10].GetUInt64();
|
||||
m_CreatedDate = fields[10].GetUInt64();
|
||||
m_GuildBankMoney = fields[11].GetUInt64();
|
||||
m_PurchasedTabs = fields[12].GetUInt32();
|
||||
|
||||
if (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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -301,9 +301,7 @@ class Guild
|
|||
std::string const& GetMOTD() const { return MOTD; }
|
||||
std::string const& GetGINFO() const { return GINFO; }
|
||||
|
||||
uint32 GetCreatedYear() const { return m_CreatedYear; }
|
||||
uint32 GetCreatedMonth() const { return m_CreatedMonth; }
|
||||
uint32 GetCreatedDay() const { return m_CreatedDay; }
|
||||
time_t GetCreatedDate() const { return m_CreatedDate; }
|
||||
|
||||
uint32 GetEmblemStyle() const { return m_EmblemStyle; }
|
||||
uint32 GetEmblemColor() const { return m_EmblemColor; }
|
||||
|
|
@ -437,9 +435,7 @@ class Guild
|
|||
uint64 m_LeaderGuid;
|
||||
std::string MOTD;
|
||||
std::string GINFO;
|
||||
uint32 m_CreatedYear;
|
||||
uint32 m_CreatedMonth;
|
||||
uint32 m_CreatedDay;
|
||||
time_t m_CreatedDate;
|
||||
|
||||
uint32 m_EmblemStyle;
|
||||
uint32 m_EmblemColor;
|
||||
|
|
|
|||
|
|
@ -226,13 +226,11 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
|
|||
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->GetCreatedDay();
|
||||
data << guild->GetCreatedMonth();
|
||||
data << guild->GetCreatedYear();
|
||||
data << guild->GetMemberSize();
|
||||
data << guild->GetMemberSize();
|
||||
data << uint32(secsToTimeBitFields(guild->GetCreatedDate())); // 3.x (prev. day + month + year)
|
||||
data << uint32(guild->GetMemberSize()); // amount of chars
|
||||
data << uint32(guild->GetMemberSize()); // amount of accounts (TODO: implement)
|
||||
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9606"
|
||||
#define REVISION_NR "9607"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue