mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Add log aliases to make logging much easier to use (All FMT driven)
This commit is contained in:
+41
-41
@@ -235,7 +235,7 @@ std::vector<std::string> ParseRecipients(std::string RecipientString) {
|
||||
|
||||
static void ProcessMailTo(Client *c, std::string MailMessage) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str());
|
||||
|
||||
std::vector<std::string> Recipients;
|
||||
|
||||
@@ -304,7 +304,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) {
|
||||
|
||||
if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(),
|
||||
Log(Logs::Detail, Logs::UCSServer, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(),
|
||||
c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str());
|
||||
|
||||
int PacketLength = 10 + Recipient.length() + Subject.length();
|
||||
@@ -397,7 +397,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) {
|
||||
|
||||
static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Received buddy command with parameters %s", Buddy.c_str());
|
||||
c->GeneralChannelMessage("Buddy list modified");
|
||||
|
||||
uint8 SubAction = 1;
|
||||
@@ -426,7 +426,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
||||
|
||||
static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Received ignore command with parameters %s", Ignoree.c_str());
|
||||
c->GeneralChannelMessage("Ignore list modified");
|
||||
|
||||
uint8 SubAction = 0;
|
||||
@@ -482,12 +482,12 @@ Clientlist::Clientlist(int ChatPort) {
|
||||
|
||||
const ucsconfig *Config = ucsconfig::get();
|
||||
|
||||
Log(Logs::General, Logs::UCS_Server, "Loading '%s'", Config->MailOpCodesFile.c_str());
|
||||
Log(Logs::General, Logs::UCSServer, "Loading '%s'", Config->MailOpCodesFile.c_str());
|
||||
if (!ChatOpMgr->LoadOpcodes(Config->MailOpCodesFile.c_str()))
|
||||
exit(1);
|
||||
|
||||
chatsf->OnNewConnection([this](std::shared_ptr<EQ::Net::EQStream> stream) {
|
||||
LogF(Logs::General, Logs::Login_Server, "New Client UDP connection from {0}:{1}", stream->GetRemoteIP(), stream->GetRemotePort());
|
||||
LogF(Logs::General, Logs::Loginserver, "New Client UDP connection from {0}:{1}", stream->GetRemoteIP(), stream->GetRemotePort());
|
||||
stream->SetOpcodeManager(&ChatOpMgr);
|
||||
|
||||
auto c = new Client(stream);
|
||||
@@ -567,13 +567,13 @@ void Clientlist::CheckForStaleConnections(Client *c) {
|
||||
if (((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName())
|
||||
&& (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removing old connection for %s", c->GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Removing old connection for %s", c->GetName().c_str());
|
||||
|
||||
struct in_addr in;
|
||||
|
||||
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
Log(Logs::Detail, Logs::UCSServer, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
ntohs((*Iterator)->ClientStream->GetRemotePort()));
|
||||
|
||||
safe_delete((*Iterator));
|
||||
@@ -592,7 +592,7 @@ void Clientlist::Process()
|
||||
struct in_addr in;
|
||||
in.s_addr = (*it)->ClientStream->GetRemoteIP();
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
Log(Logs::Detail, Logs::UCSServer, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
ntohs((*it)->ClientStream->GetRemotePort()));
|
||||
|
||||
safe_delete((*it));
|
||||
@@ -618,7 +618,7 @@ void Clientlist::Process()
|
||||
VARSTRUCT_DECODE_STRING(MailBox, PacketBuffer);
|
||||
|
||||
if (strlen(PacketBuffer) != 9) {
|
||||
Log(Logs::Detail, Logs::UCS_Server,
|
||||
Log(Logs::Detail, Logs::UCSServer,
|
||||
"Mail key is the wrong size. Version of world incompatible with UCS.");
|
||||
KeyValid = false;
|
||||
break;
|
||||
@@ -640,11 +640,11 @@ void Clientlist::Process()
|
||||
else
|
||||
CharacterName = MailBoxString.substr(LastPeriod + 1);
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received login for user %s with key %s",
|
||||
Log(Logs::Detail, Logs::UCSServer, "Received login for user %s with key %s",
|
||||
MailBox, Key);
|
||||
|
||||
if (!database.VerifyMailKey(CharacterName, (*it)->ClientStream->GetRemoteIP(), Key)) {
|
||||
Log(Logs::Detail, Logs::UCS_Server,
|
||||
Log(Logs::Detail, Logs::UCSServer,
|
||||
"Chat Key for %s does not match, closing connection.", MailBox);
|
||||
KeyValid = false;
|
||||
break;
|
||||
@@ -670,7 +670,7 @@ void Clientlist::Process()
|
||||
}
|
||||
|
||||
default: {
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Unhandled chat opcode %8X", opcode);
|
||||
Log(Logs::Detail, Logs::UCSServer, "Unhandled chat opcode %8X", opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -680,7 +680,7 @@ void Clientlist::Process()
|
||||
struct in_addr in;
|
||||
in.s_addr = (*it)->ClientStream->GetRemoteIP();
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server,
|
||||
Log(Logs::Detail, Logs::UCSServer,
|
||||
"Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i",
|
||||
inet_ntoa(in), ntohs((*it)->ClientStream->GetRemotePort()), KeyValid,
|
||||
(*it)->GetForceDisconnect());
|
||||
@@ -823,7 +823,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString)
|
||||
break;
|
||||
|
||||
case CommandSetMessageStatus:
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Set Message Status, Params: %s", Parameters.c_str());
|
||||
ProcessSetMessageStatus(Parameters);
|
||||
break;
|
||||
|
||||
@@ -848,7 +848,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString)
|
||||
|
||||
default:
|
||||
c->SendHelp();
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Unhandled OP_Mail command: %s", CommandString.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -859,7 +859,7 @@ void Clientlist::CloseAllConnections() {
|
||||
|
||||
for (Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Removing client %s", (*Iterator)->GetName().c_str());
|
||||
|
||||
(*Iterator)->CloseConnection();
|
||||
}
|
||||
@@ -868,7 +868,7 @@ void Clientlist::CloseAllConnections() {
|
||||
void Client::AddCharacter(int CharID, const char *CharacterName, int Level) {
|
||||
|
||||
if (!CharacterName) return;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str());
|
||||
CharacterEntry NewCharacter;
|
||||
NewCharacter.CharID = CharID;
|
||||
NewCharacter.Name = CharacterName;
|
||||
@@ -933,7 +933,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) {
|
||||
for (int i = 0; i < MAX_JOINED_CHANNELS; i++)
|
||||
if (JoinedChannels[i] == nullptr) {
|
||||
JoinedChannels[i] = JoinedChannel;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -974,7 +974,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
|
||||
int NumberOfChannels = ChannelCount();
|
||||
|
||||
@@ -1073,7 +1073,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
|
||||
|
||||
void Client::LeaveChannels(std::string ChannelNameList) {
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
|
||||
std::string::size_type CurrentPos = 0;
|
||||
|
||||
@@ -1249,7 +1249,7 @@ void Client::SendChannelMessage(std::string Message)
|
||||
|
||||
std::string ChannelName = Message.substr(1, MessageStart - 1);
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str());
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@@ -1392,7 +1392,7 @@ void Client::SendChannelMessageByNumber(std::string Message) {
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(),
|
||||
Log(Logs::Detail, Logs::UCSServer, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(),
|
||||
Message.substr(MessageStart + 1).c_str());
|
||||
|
||||
if (RuleB(Chat, EnableAntiSpam))
|
||||
@@ -1600,7 +1600,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) {
|
||||
else
|
||||
Message = "Password change on channel " + ChannelName;
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str());
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@@ -1655,7 +1655,7 @@ void Client::SetChannelOwner(std::string CommandString) {
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str());
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@@ -1743,7 +1743,7 @@ void Client::ChannelInvite(std::string CommandString) {
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Invitee);
|
||||
|
||||
@@ -1871,7 +1871,7 @@ void Client::ChannelGrantModerator(std::string CommandString) {
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Moderator);
|
||||
|
||||
@@ -1952,7 +1952,7 @@ void Client::ChannelGrantVoice(std::string CommandString) {
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Voicee);
|
||||
|
||||
@@ -2040,7 +2040,7 @@ void Client::ChannelKick(std::string CommandString) {
|
||||
if ((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Kickee);
|
||||
|
||||
@@ -2150,28 +2150,28 @@ void Client::SetConnectionType(char c) {
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeChat;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::Titanium;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Chat (Titanium)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Chat (Titanium)");
|
||||
break;
|
||||
}
|
||||
case EQEmu::versions::ucsTitaniumMail:
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeMail;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::Titanium;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Mail (Titanium)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Mail (Titanium)");
|
||||
break;
|
||||
}
|
||||
case EQEmu::versions::ucsSoFCombined:
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::SoF;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (SoF)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Combined (SoF)");
|
||||
break;
|
||||
}
|
||||
case EQEmu::versions::ucsSoDCombined:
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::SoD;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (SoD)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Combined (SoD)");
|
||||
break;
|
||||
}
|
||||
case EQEmu::versions::ucsUFCombined:
|
||||
@@ -2179,7 +2179,7 @@ void Client::SetConnectionType(char c) {
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::UF;
|
||||
UnderfootOrLater = true;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (Underfoot)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Combined (Underfoot)");
|
||||
break;
|
||||
}
|
||||
case EQEmu::versions::ucsRoFCombined:
|
||||
@@ -2187,7 +2187,7 @@ void Client::SetConnectionType(char c) {
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::RoF;
|
||||
UnderfootOrLater = true;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (RoF)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Combined (RoF)");
|
||||
break;
|
||||
}
|
||||
case EQEmu::versions::ucsRoF2Combined:
|
||||
@@ -2195,14 +2195,14 @@ void Client::SetConnectionType(char c) {
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::RoF2;
|
||||
UnderfootOrLater = true;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (RoF2)");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is Combined (RoF2)");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeUnknown;
|
||||
ClientVersion_ = EQEmu::versions::ClientVersion::Unknown;
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is unknown.");
|
||||
Log(Logs::Detail, Logs::UCSServer, "Connection type is unknown.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2279,12 +2279,12 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin
|
||||
|
||||
void Client::ChangeMailBox(int NewMailBox)
|
||||
{
|
||||
Log(Logs::Detail, Logs::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox);
|
||||
Log(Logs::Detail, Logs::UCSServer, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox);
|
||||
|
||||
SetMailBox(NewMailBox);
|
||||
auto id = std::to_string(NewMailBox);
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "New mailbox is %s", MailBoxName().c_str());
|
||||
Log(Logs::Detail, Logs::UCSServer, "New mailbox is %s", MailBoxName().c_str());
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_MailboxChange, id.length() + 1);
|
||||
|
||||
@@ -2353,13 +2353,13 @@ std::string Client::MailBoxName() {
|
||||
|
||||
if ((Characters.empty()) || (CurrentMailBox > (Characters.size() - 1)))
|
||||
{
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
Log(Logs::Detail, Logs::UCSServer, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
CurrentMailBox, Characters.size());
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
Log(Logs::Detail, Logs::UCSServer, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
CurrentMailBox, Characters.size());
|
||||
|
||||
return Characters[CurrentMailBox].Name;
|
||||
|
||||
Reference in New Issue
Block a user