Logs::Guilds to LogGuilds

This commit is contained in:
Akkadius 2019-09-02 02:24:34 -05:00
parent 31cebb5793
commit 2b1950d2e2
6 changed files with 117 additions and 119 deletions

View File

@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() {
ClearGuilds();
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to load guilds when we have no database object.");
LogGuilds("Requested to load guilds when we have no database object");
return(false);
}
@ -77,13 +77,13 @@ bool BaseGuildManager::LoadGuilds() {
uint8 rankn = atoi(row[1]);
if(rankn > GUILD_MAX_RANK) {
Log(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
LogGuilds("Found invalid (too high) rank [{}] for guild [{}], skipping", rankn, guild_id);
continue;
}
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
Log(Logs::Detail, Logs::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id);
LogGuilds("Found rank [{}] for non-existent guild [{}], skipping", rankn, guild_id);
continue;
}
@ -105,7 +105,7 @@ bool BaseGuildManager::LoadGuilds() {
bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id);
LogGuilds("Requested to refresh guild [{}] when we have no database object", guild_id);
return(false);
}
@ -123,7 +123,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
if (results.RowCount() == 0)
{
Log(Logs::Detail, Logs::Guilds, "Unable to find guild %d in the database.", guild_id);
LogGuilds("Unable to find guild [{}] in the database", guild_id);
return false;
}
@ -145,7 +145,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
uint8 rankn = atoi(row[1]);
if(rankn > GUILD_MAX_RANK) {
Log(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
LogGuilds("Found invalid (too high) rank [{}] for guild [{}], skipping", rankn, guild_id);
continue;
}
@ -162,7 +162,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false;
}
Log(Logs::Detail, Logs::Guilds, "Successfully refreshed guild %d from the database.", guild_id);
LogGuilds("Successfully refreshed guild [{}] from the database", guild_id);
return true;
}
@ -214,14 +214,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con
bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to store guild %d when we have no database object.", guild_id);
LogGuilds("Requested to store guild [{}] when we have no database object", guild_id);
return(false);
}
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
Log(Logs::Detail, Logs::Guilds, "Requested to store non-existent guild %d", guild_id);
LogGuilds("Requested to store non-existent guild [{}]", guild_id);
return(false);
}
GuildInfo *info = res->second;
@ -289,14 +289,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
safe_delete_array(title_esc);
}
Log(Logs::Detail, Logs::Guilds, "Stored guild %d in the database", guild_id);
LogGuilds("Stored guild [{}] in the database", guild_id);
return true;
}
uint32 BaseGuildManager::_GetFreeGuildID() {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested find a free guild ID when we have no database object.");
LogGuilds("Requested find a free guild ID when we have no database object");
return(GUILD_NONE);
}
@ -330,12 +330,12 @@ uint32 BaseGuildManager::_GetFreeGuildID() {
if (results.RowCount() == 0)
{
Log(Logs::Detail, Logs::Guilds, "Located free guild ID %d in the database", index);
LogGuilds("Located free guild ID [{}] in the database", index);
return index;
}
}
Log(Logs::Detail, Logs::Guilds, "Unable to find a free guild ID when requested.");
LogGuilds("Unable to find a free guild ID when requested");
return GUILD_NONE;
}
@ -505,11 +505,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) {
//now store the resulting guild setup into the DB.
if(!_StoreGuildDB(new_id)) {
Log(Logs::Detail, Logs::Guilds, "Error storing new guild. It may have been partially created which may need manual removal.");
LogGuilds("Error storing new guild. It may have been partially created which may need manual removal");
return(GUILD_NONE);
}
Log(Logs::Detail, Logs::Guilds, "Created guild %d in the database.", new_id);
LogGuilds("Created guild [{}] in the database", new_id);
return(new_id);
}
@ -525,7 +525,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
}
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to delete guild %d when we have no database object.", guild_id);
LogGuilds("Requested to delete guild [{}] when we have no database object", guild_id);
return(false);
}
@ -545,14 +545,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id);
QueryWithLogging(query, "deleting guild bank");
Log(Logs::Detail, Logs::Guilds, "Deleted guild %d from the database.", guild_id);
LogGuilds("Deleted guild [{}] from the database", guild_id);
return(true);
}
bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to rename guild %d when we have no database object.", guild_id);
LogGuilds("Requested to rename guild [{}] when we have no database object", guild_id);
return false;
}
@ -573,13 +573,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
if (!results.Success())
{
Log(Logs::Detail, Logs::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success());
LogGuilds("Error renaming guild [{}] [{}]: [{}]", guild_id, query.c_str(), results.Success());
safe_delete_array(esc);
return false;
}
safe_delete_array(esc);
Log(Logs::Detail, Logs::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name);
LogGuilds("Renamed guild [{}] ([{}]) to [{}] in database", info->name.c_str(), guild_id, name);
info->name = name; //update our local record.
@ -588,7 +588,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id);
LogGuilds("Requested to set the leader for guild [{}] when we have no database object", guild_id);
return false;
}
@ -614,7 +614,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
if(!DBSetGuildRank(leader, GUILD_LEADER))
return false;
Log(Logs::Detail, Logs::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader);
LogGuilds("Set guild leader for guild [{}] to [{}] in the database", guild_id, leader);
info->leader_char_id = leader; //update our local record.
@ -623,7 +623,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id);
LogGuilds("Requested to set the MOTD for guild [{}] when we have no database object", guild_id);
return(false);
}
@ -654,7 +654,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c
safe_delete_array(esc);
safe_delete_array(esc_set);
Log(Logs::Detail, Logs::Guilds, "Set MOTD for guild %d in the database", guild_id);
LogGuilds("Set MOTD for guild [{}] in the database", guild_id);
info->motd = motd; //update our local record.
info->motd_setter = setter; //update our local record.
@ -688,7 +688,7 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL)
}
safe_delete_array(esc);
Log(Logs::Detail, Logs::Guilds, "Set URL for guild %d in the database", GuildID);
LogGuilds("Set URL for guild [{}] in the database", GuildID);
info->url = URL; //update our local record.
@ -722,7 +722,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
}
safe_delete_array(esc);
Log(Logs::Detail, Logs::Guilds, "Set Channel for guild %d in the database", GuildID);
LogGuilds("Set Channel for guild [{}] in the database", GuildID);
info->channel = Channel; //update our local record.
@ -731,7 +731,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id);
LogGuilds("Requested to set char to guild [{}] when we have no database object", guild_id);
return(false);
}
@ -753,7 +753,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
return false;
}
}
Log(Logs::Detail, Logs::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank);
LogGuilds("Set char [{}] to guild [{}] and rank [{}] in the database", charid, guild_id, rank);
return true;
}
@ -845,7 +845,7 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) {
return false;
}
Log(Logs::Detail, Logs::Guilds, "Set public not for char %d", charid);
LogGuilds("Set public not for char [{}]", charid);
return true;
}
@ -924,14 +924,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
members.push_back(ci);
}
Log(Logs::Detail, Logs::Guilds, "Retreived entire guild member list for guild %d from the database", guild_id);
LogGuilds("Retreived entire guild member list for guild [{}] from the database", guild_id);
return true;
}
bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested char info on %s when we have no database object.", char_name);
LogGuilds("Requested char info on [{}] when we have no database object", char_name);
return(false);
}
@ -953,7 +953,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
auto row = results.begin();
ProcessGuildMember(row, into);
Log(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %s from the database", char_name);
LogGuilds("Retreived guild member info for char [{}] from the database", char_name);
return true;
@ -962,7 +962,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
if(m_db == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Requested char info on %d when we have no database object.", char_id);
LogGuilds("Requested char info on [{}] when we have no database object", char_id);
return false;
}
@ -983,7 +983,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
auto row = results.begin();
ProcessGuildMember(row, into);
Log(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %d", char_id);
LogGuilds("Retreived guild member info for char [{}]", char_id);
return true;
@ -1098,16 +1098,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const {
bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const {
if(guild_id == GUILD_NONE) {
Log(Logs::Detail, Logs::Guilds, "Check leader for char %d: not a guild.", char_id);
LogGuilds("Check leader for char [{}]: not a guild", char_id);
return(false);
}
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
Log(Logs::Detail, Logs::Guilds, "Check leader for char %d: invalid guild.", char_id);
LogGuilds("Check leader for char [{}]: invalid guild", char_id);
return(false); //invalid guild
}
Log(Logs::Detail, Logs::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id);
LogGuilds("Check leader for guild [{}], char [{}]: leader id=[{}]", guild_id, char_id, res->second->leader_char_id);
return(char_id == res->second->leader_char_id);
}
@ -1137,20 +1137,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha
bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
if(status >= 250) {
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status);
LogGuilds("Check permission on guild [{}] with user status [{}] > 250, granted", guild_id, status);
return(true); //250+ as allowed anything
}
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status);
LogGuilds("Check permission on guild [{}] with user status [{}], no such guild, denied", guild_id, status);
return(false); //invalid guild
}
bool granted = (res->second->minstatus <= status);
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s",
LogGuilds("Check permission on guild [{}] ([{}]) with user status [{}]. Min status [{}]: [{}]",
res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied");
return(granted);
@ -1158,21 +1158,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const {
if(rank > GUILD_MAX_RANK) {
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.",
LogGuilds("Check permission on guild [{}] and rank [{}] for action [{}] ([{}]): Invalid rank, denied",
guild_id, rank, GuildActionNames[act], act);
return(false); //invalid rank
}
std::map<uint32, GuildInfo *>::const_iterator res;
res = m_guilds.find(guild_id);
if(res == m_guilds.end()) {
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.",
LogGuilds("Check permission on guild [{}] and rank [{}] for action [{}] ([{}]): Invalid guild, denied",
guild_id, rank, GuildActionNames[act], act);
return(false); //invalid guild
}
bool granted = res->second->ranks[rank].permissions[act];
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s",
LogGuilds("Check permission on guild [{}] ([{}]) and rank [{}] ([{}]) for action [{}] ([{}]): [{}]",
res->second->name.c_str(), guild_id,
res->second->ranks[rank].name.c_str(), rank,
GuildActionNames[act], act,

View File

@ -34,7 +34,7 @@ WorldGuildManager guild_mgr;
void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
Log(Logs::Detail, Logs::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
LogGuilds("Broadcasting guild refresh for [{}], changes: name=[{}], motd=[{}], rank=d, relation=[{}]", guild_id, name, motd, rank, relation);
auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
s->guild_id = guild_id;
@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd,
}
void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
Log(Logs::Detail, Logs::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id);
LogGuilds("Broadcasting char refresh for [{}] from guild [{}] to world", charid, guild_id);
auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
s->guild_id = guild_id;
@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui
}
void WorldGuildManager::SendGuildDelete(uint32 guild_id) {
Log(Logs::Detail, Logs::Guilds, "Broadcasting guild delete for guild %d to world", guild_id);
LogGuilds("Broadcasting guild delete for guild [{}] to world", guild_id);
auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
s->guild_id = guild_id;
@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
case ServerOP_RefreshGuild: {
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
LogGuilds("Received ServerOP_RefreshGuild of incorrect size [{}], expected [{}]", pack->size, sizeof(ServerGuildRefresh_Struct));
return;
}
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
LogGuilds("Received and broadcasting guild refresh for [{}], changes: name=[{}], motd=[{}], rank=d, relation=[{}]", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
//broadcast this packet to all zones.
zoneserver_list.SendPacket(pack);
//preform a local refresh.
if(!RefreshGuild(s->guild_id)) {
Log(Logs::Detail, Logs::Guilds, "Unable to preform local refresh on guild %d", s->guild_id);
LogGuilds("Unable to preform local refresh on guild [{}]", s->guild_id);
//can we do anything?
}
@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
case ServerOP_GuildCharRefresh: {
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
LogGuilds("Received ServerOP_RefreshGuild of incorrect size [{}], expected [{}]", pack->size, sizeof(ServerGuildCharRefresh_Struct));
return;
}
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id);
LogGuilds("Received and broadcasting guild member refresh for char [{}] to all zones with members of guild [{}]", s->char_id, s->guild_id);
//preform the local update
client_list.UpdateClientGuild(s->char_id, s->guild_id);
@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
case ServerOP_DeleteGuild: {
if(pack->size != sizeof(ServerGuildID_Struct)) {
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
LogGuilds("Received ServerOP_DeleteGuild of incorrect size [{}], expected [{}]", pack->size, sizeof(ServerGuildID_Struct));
return;
}
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id);
LogGuilds("Received and broadcasting guild delete for guild [{}]", s->guild_id);
//broadcast this packet to all zones.
zoneserver_list.SendPacket(pack);
//preform a local refresh.
if(!LocalDeleteGuild(s->guild_id)) {
Log(Logs::Detail, Logs::Guilds, "Unable to preform local delete on guild %d", s->guild_id);
LogGuilds("Unable to preform local delete on guild [{}]", s->guild_id);
//can we do anything?
}
@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
case ServerOP_GuildMemberUpdate: {
if(pack->size != sizeof(ServerGuildMemberUpdate_Struct))
{
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct));
LogGuilds("Received ServerOP_GuildMemberUpdate of incorrect size [{}], expected [{}]", pack->size, sizeof(ServerGuildMemberUpdate_Struct));
return;
}
@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
}
default:
Log(Logs::Detail, Logs::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode);
LogGuilds("Unknown packet {:#04x} received from zone??", pack->opcode);
break;
}
}

View File

@ -5896,7 +5896,7 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app)
void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GetGuildMOTD");
LogGuilds("Received OP_GetGuildMOTD");
SendGuildMOTD(true);
@ -5909,7 +5909,7 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app)
void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GetGuildsList");
LogGuilds("Received OP_GetGuildsList");
SendGuildList();
}
@ -7271,7 +7271,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app)
uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID());
Log(Logs::Detail, Logs::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(),
LogGuilds("[{}]: Creating guild [{}] with leader [{}] via UF+ GUI. It was given id [{}]", GetName(),
GuildName, CharacterID(), (unsigned long)NewGuildID);
if (NewGuildID == GUILD_NONE)
@ -7293,12 +7293,12 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app)
void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildDelete");
LogGuilds("Received OP_GuildDelete");
if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID()))
Message(0, "You are not a guild leader or not in a guild.");
else {
Log(Logs::Detail, Logs::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID());
LogGuilds("Deleting guild [{}] ([{}])", guild_mgr.GetGuildName(GuildID()), GuildID());
if (!guild_mgr.DeleteGuild(GuildID()))
Message(0, "Guild delete failed.");
else {
@ -7309,10 +7309,10 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app)
void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildDemote");
LogGuilds("Received OP_GuildDemote");
if (app->size != sizeof(GuildDemoteStruct)) {
Log(Logs::Detail, Logs::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct));
LogGuilds("Error: app size of [{}] != size of GuildDemoteStruct of [{}]\n", app->size, sizeof(GuildDemoteStruct));
return;
}
@ -7342,7 +7342,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app)
uint8 rank = gci.rank - 1;
Log(Logs::Detail, Logs::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)",
LogGuilds("Demoting [{}] ([{}]) from rank [{}] ([{}]) to [{}] ([{}]) in [{}] ([{}])",
demote->target, gci.char_id,
guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank,
guild_mgr.GetRankName(GuildID(), rank), rank,
@ -7360,7 +7360,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app)
void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildInvite");
LogGuilds("Received OP_GuildInvite");
if (app->size != sizeof(GuildCommand_Struct)) {
std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl;
@ -7401,7 +7401,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
//we could send this to the member and prompt them to see if they want to
//be demoted (I guess), but I dont see a point in that.
Log(Logs::Detail, Logs::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)",
LogGuilds("[{}] ([{}]) is demoting [{}] ([{}]) to rank [{}] in guild [{}] ([{}])",
GetName(), CharacterID(),
client->GetName(), client->CharacterID(),
gc->officer,
@ -7420,7 +7420,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
return;
}
Log(Logs::Detail, Logs::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)",
LogGuilds("[{}] ([{}]) is asking to promote [{}] ([{}]) to rank [{}] in guild [{}] ([{}])",
GetName(), CharacterID(),
client->GetName(), client->CharacterID(),
gc->officer,
@ -7432,7 +7432,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
if (gc->guildeqid == 0)
gc->guildeqid = GuildID();
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size);
LogGuilds("Sending OP_GuildInvite for promotion to [{}], length [{}]", client->GetName(), app->size);
client->QueuePacket(app);
}
@ -7455,7 +7455,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
return;
}
Log(Logs::Detail, Logs::Guilds, "Inviting %s (%d) into guild %s (%d)",
LogGuilds("Inviting [{}] ([{}]) into guild [{}] ([{}])",
client->GetName(), client->CharacterID(),
guild_mgr.GetGuildName(GuildID()), GuildID());
@ -7475,7 +7475,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
gc->officer = 8;
}
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size);
LogGuilds("Sending OP_GuildInvite for invite to [{}], length [{}]", client->GetName(), app->size);
client->SetPendingGuildInvitation(true);
client->QueuePacket(app);
@ -7498,7 +7498,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildInviteAccept");
LogGuilds("Received OP_GuildInviteAccept");
SetPendingGuildInvitation(false);
@ -7536,7 +7536,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
else if (!worldserver.Connected())
Message(0, "Error: World server disconnected");
else {
Log(Logs::Detail, Logs::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s",
LogGuilds("Guild Invite Accept: guild [{}], response [{}], inviter [{}], person [{}]",
gj->guildeqid, gj->response, gj->inviter, gj->newmember);
//ok, the invite is also used for changing rank as well.
@ -7566,7 +7566,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
if (gj->guildeqid == GuildID()) {
//only need to change rank.
Log(Logs::Detail, Logs::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)",
LogGuilds("Changing guild rank of [{}] ([{}]) to rank [{}] in guild [{}] ([{}])",
GetName(), CharacterID(),
gj->response,
guild_mgr.GetGuildName(GuildID()), GuildID());
@ -7578,7 +7578,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
}
else {
Log(Logs::Detail, Logs::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d",
LogGuilds("Adding [{}] ([{}]) to guild [{}] ([{}]) at rank [{}]",
GetName(), CharacterID(),
guild_mgr.GetGuildName(gj->guildeqid), gj->guildeqid,
gj->response);
@ -7607,10 +7607,10 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildLeader");
LogGuilds("Received OP_GuildLeader");
if (app->size < 2) {
Log(Logs::Detail, Logs::Guilds, "Invalid length %d on OP_GuildLeader", app->size);
LogGuilds("Invalid length [{}] on OP_GuildLeader", app->size);
return;
}
@ -7629,7 +7629,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app)
Client* newleader = entity_list.GetClientByName(gml->target);
if (newleader) {
Log(Logs::Detail, Logs::Guilds, "Transfering leadership of %s (%d) to %s (%d)",
LogGuilds("Transfering leadership of [{}] ([{}]) to [{}] ([{}])",
guild_mgr.GetGuildName(GuildID()), GuildID(),
newleader->GetName(), newleader->CharacterID());
@ -7650,9 +7650,9 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app)
void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Got OP_GuildManageBanker of len %d", app->size);
LogGuilds("Got OP_GuildManageBanker of len [{}]", app->size);
if (app->size != sizeof(GuildManageBanker_Struct)) {
Log(Logs::Detail, Logs::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct));
LogGuilds("Error: app size of [{}] != size of OP_GuildManageBanker of [{}]\n", app->size, sizeof(GuildManageBanker_Struct));
return;
}
GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer;
@ -7727,16 +7727,16 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app)
void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Got OP_GuildPeace of len %d", app->size);
LogGuilds("Got OP_GuildPeace of len [{}]", app->size);
return;
}
void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildPromote");
LogGuilds("Received OP_GuildPromote");
if (app->size != sizeof(GuildPromoteStruct)) {
Log(Logs::Detail, Logs::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct));
LogGuilds("Error: app size of [{}] != size of GuildDemoteStruct of [{}]\n", app->size, sizeof(GuildPromoteStruct));
return;
}
@ -7768,7 +7768,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app)
}
Log(Logs::Detail, Logs::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)",
LogGuilds("Promoting [{}] ([{}]) from rank [{}] ([{}]) to [{}] ([{}]) in [{}] ([{}])",
promote->target, gci.char_id,
guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank,
guild_mgr.GetRankName(GuildID(), rank), rank,
@ -7785,7 +7785,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app)
void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildPublicNote");
LogGuilds("Received OP_GuildPublicNote");
if (app->size < sizeof(GuildUpdate_PublicNote)) {
// client calls for a motd on login even if they arent in a guild
@ -7804,7 +7804,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app)
return;
}
Log(Logs::Detail, Logs::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s",
LogGuilds("Setting public note on [{}] ([{}]) in guild [{}] ([{}]) to: [{}]",
gpn->target, gci.char_id,
guild_mgr.GetGuildName(GuildID()), GuildID(),
gpn->note);
@ -7821,7 +7821,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app)
void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_GuildRemove");
LogGuilds("Received OP_GuildRemove");
if (app->size != sizeof(GuildCommand_Struct)) {
std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl;
@ -7851,7 +7851,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app)
}
char_id = client->CharacterID();
Log(Logs::Detail, Logs::Guilds, "Removing %s (%d) from guild %s (%d)",
LogGuilds("Removing [{}] ([{}]) from guild [{}] ([{}])",
client->GetName(), client->CharacterID(),
guild_mgr.GetGuildName(GuildID()), GuildID());
}
@ -7867,7 +7867,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app)
}
char_id = gci.char_id;
Log(Logs::Detail, Logs::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)",
LogGuilds("Removing remote/offline [{}] ([{}]) into guild [{}] ([{}])",
gci.char_name.c_str(), gci.char_id,
guild_mgr.GetGuildName(GuildID()), GuildID());
}
@ -7977,7 +7977,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app)
void Client::Handle_OP_GuildWar(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Got OP_GuildWar of len %d", app->size);
LogGuilds("Got OP_GuildWar of len [{}]", app->size);
return;
}
@ -12286,7 +12286,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app)
{
Log(Logs::Detail, Logs::Guilds, "Received OP_SetGuildMOTD");
LogGuilds("Received OP_SetGuildMOTD");
if (app->size != sizeof(GuildMOTD_Struct)) {
// client calls for a motd on login even if they arent in a guild
@ -12304,7 +12304,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app)
GuildMOTD_Struct* gmotd = (GuildMOTD_Struct*)app->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Setting MOTD for %s (%d) to: %s - %s",
LogGuilds("Setting MOTD for [{}] ([{}]) to: [{}] - [{}]",
guild_mgr.GetGuildName(GuildID()), GuildID(), GetName(), gmotd->motd);
if (!guild_mgr.SetGuildMOTD(GuildID(), gmotd->motd, GetName())) {

View File

@ -5968,9 +5968,9 @@ void command_guild(Client *c, const Seperator *sep)
}
if(guild_id == GUILD_NONE) {
Log(Logs::Detail, Logs::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid);
LogGuilds("[{}]: Removing [{}] ([{}]) from guild with GM command", c->GetName(), sep->arg[2], charid);
} else {
Log(Logs::Detail, Logs::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id);
LogGuilds("[{}]: Putting [{}] ([{}]) into guild [{}] ([{}]) with GM command", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id);
}
if(!guild_mgr.SetGuild(charid, guild_id, GUILD_MEMBER)) {
@ -6017,8 +6017,7 @@ void command_guild(Client *c, const Seperator *sep)
return;
}
Log(Logs::Detail, Logs::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(),
sep->arg[2], charid, rank);
LogGuilds("[{}]: Setting [{}] ([{}])'s guild rank to [{}] with GM command", c->GetName(), sep->arg[2], charid, rank);
if(!guild_mgr.SetGuildRank(charid, rank))
c->Message(Chat::Red, "Error while setting rank %d on '%s'.", rank, sep->arg[2]);
@ -6059,7 +6058,7 @@ void command_guild(Client *c, const Seperator *sep)
uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader);
Log(Logs::Detail, Logs::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(),
LogGuilds("[{}]: Creating guild [{}] with leader [{}] with GM command. It was given id [{}]", c->GetName(),
sep->argplus[3], leader, (unsigned long)id);
if (id == GUILD_NONE)
@ -6098,7 +6097,7 @@ void command_guild(Client *c, const Seperator *sep)
}
}
Log(Logs::Detail, Logs::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(),
LogGuilds("[{}]: Deleting guild [{}] ([{}]) with GM command", c->GetName(),
guild_mgr.GetGuildName(id), id);
if (!guild_mgr.DeleteGuild(id))
@ -6132,7 +6131,7 @@ void command_guild(Client *c, const Seperator *sep)
}
}
Log(Logs::Detail, Logs::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(),
LogGuilds("[{}]: Renaming guild [{}] ([{}]) to [{}] with GM command", c->GetName(),
guild_mgr.GetGuildName(id), id, sep->argplus[3]);
if (!guild_mgr.RenameGuild(id, sep->argplus[3]))
@ -6183,7 +6182,7 @@ void command_guild(Client *c, const Seperator *sep)
}
}
Log(Logs::Detail, Logs::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(),
LogGuilds("[{}]: Setting leader of guild [{}] ([{}]) to [{}] with GM command", c->GetName(),
guild_mgr.GetGuildName(id), id, leader);
if(!guild_mgr.SetGuildLeader(id, leader))

View File

@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
}
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);
LogGuilds("Sending OP_GuildMOTD of length [{}]", outapp->size);
FastQueuePacket(&outapp);
}
@ -147,10 +147,10 @@ void Client::SendGuildSpawnAppearance() {
if (!IsInAGuild()) {
// clear guildtag
SendAppearancePacket(AT_GuildID, GUILD_NONE);
Log(Logs::Detail, Logs::Guilds, "Sending spawn appearance for no guild tag.");
LogGuilds("Sending spawn appearance for no guild tag");
} else {
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
Log(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
LogGuilds("Sending spawn appearance for guild [{}] at rank [{}]", GuildID(), rank);
SendAppearancePacket(AT_GuildID, GuildID());
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
@ -174,11 +174,11 @@ void Client::SendGuildList() {
//ask the guild manager to build us a nice guild list packet
outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size);
if(outapp->pBuffer == nullptr) {
Log(Logs::Detail, Logs::Guilds, "Unable to make guild list!");
LogGuilds("Unable to make guild list!");
return;
}
Log(Logs::Detail, Logs::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size);
LogGuilds("Sending OP_ZoneGuildList of length [{}]", outapp->size);
FastQueuePacket(&outapp);
}
@ -195,7 +195,7 @@ void Client::SendGuildMembers() {
outapp->pBuffer = data;
data = nullptr;
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size);
LogGuilds("Sending OP_GuildMemberList of length [{}]", outapp->size);
FastQueuePacket(&outapp);
@ -227,7 +227,7 @@ void Client::RefreshGuildInfo()
CharGuildInfo info;
if(!guild_mgr.GetCharInfo(CharacterID(), info)) {
Log(Logs::Detail, Logs::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID());
LogGuilds("Unable to obtain guild char info for [{}] ([{}])", GetName(), CharacterID());
return;
}
@ -341,7 +341,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){
outgj->rank = gj->rank;
outgj->zoneid = gj->zoneid;
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size);
LogGuilds("Sending OP_GuildManageAdd for join of length [{}]", outapp->size);
FastQueuePacket(&outapp);

View File

@ -32,7 +32,7 @@ extern WorldServer worldserver;
extern volatile bool is_zone_loaded;
void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
Log(Logs::Detail, Logs::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
LogGuilds("Sending guild refresh for [{}] to world, changes: name=[{}], motd=[{}], rank=d, relation=[{}]", guild_id, name, motd, rank, relation);
auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
s->guild_id = guild_id;
@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b
void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
if(guild_id == 0) {
Log(Logs::Detail, Logs::Guilds, "Guild lookup for char %d when sending char refresh.", charid);
LogGuilds("Guild lookup for char [{}] when sending char refresh", charid);
CharGuildInfo gci;
if(!GetCharInfo(charid, gci)) {
@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin
}
}
Log(Logs::Detail, Logs::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id);
LogGuilds("Sending char refresh for [{}] from guild [{}] to world", charid, guild_id);
auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID)
}
void ZoneGuildManager::SendGuildDelete(uint32 guild_id) {
Log(Logs::Detail, Logs::Guilds, "Sending guild delete for guild %d to world", guild_id);
LogGuilds("Sending guild delete for guild [{}] to world", guild_id);
auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
s->guild_id = guild_id;
@ -266,7 +266,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
}
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
LogGuilds("Received guild refresh from world for [{}], changes: name=[{}], motd=[{}], rank=[{}], relation=[{}]", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
//reload all the guild details from the database.
RefreshGuild(s->guild_id);
@ -300,7 +300,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
}
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id);
LogGuilds("Received guild member refresh from world for char [{}] from guild [{}]", s->char_id, s->guild_id);
Client *c = entity_list.GetClientByCharID(s->char_id);
@ -369,7 +369,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
}
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
Log(Logs::Detail, Logs::Guilds, "Received guild delete from world for guild %d", s->guild_id);
LogGuilds("Received guild delete from world for guild [{}]", s->guild_id);
//clear all the guild tags.
entity_list.RefreshAllGuildInfo(s->guild_id);
@ -417,23 +417,22 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
if (!c || !c->IsInAGuild())
{
Log(Logs::Detail, Logs::Guilds,"Invalid Client or not in guild. ID=%i", FromID);
LogGuilds("Invalid Client or not in guild. ID=[{}]", FromID);
break;
}
Log(Logs::Detail, Logs::Guilds,"Processing ServerOP_OnlineGuildMembersResponse");
LogGuilds("Processing ServerOP_OnlineGuildMembersResponse");
auto outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
char Name[64];
gmus->LastSeen = time(nullptr);
gmus->InstanceID = 0;
gmus->GuildID = c->GuildID();
for (int i=0;i<Count;i++)
{
for (int i = 0; i < Count; i++) {
// Just make the packet once and swap out name/zone and send
VARSTRUCT_DECODE_STRING(Name, Buffer);
strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName));
gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
Log(Logs::Detail, Logs::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID);
LogGuilds("Sending OP_GuildMemberUpdate to [{}]. Name=[{}] ZoneID=[{}]", FromID, Name, gmus->ZoneID);
c->QueuePacket(outapp);
}
safe_delete(outapp);