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
+35 -35
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())) {