mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
- Cleanup messages and logic. - Add saylinks to messages for ease of use when searching for commands as most have help messages when using them incorrectly or require no arguments and can be used immediately from the say link.
90 lines
1.3 KiB
C++
Executable File
90 lines
1.3 KiB
C++
Executable File
#include "../client.h"
|
|
|
|
void command_logcommand(Client *c, std::string message)
|
|
{
|
|
int admin = c->Admin();
|
|
|
|
bool log = false;
|
|
switch (zone->loglevelvar) { //catch failsafe
|
|
case 9: { // log only LeadGM
|
|
if (
|
|
admin >= AccountStatus::GMLeadAdmin &&
|
|
admin < AccountStatus::GMMgmt
|
|
) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 8: { // log only GM
|
|
if (
|
|
admin >= AccountStatus::GMAdmin &&
|
|
admin < AccountStatus::GMLeadAdmin
|
|
) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 1: {
|
|
if (admin >= AccountStatus::GMMgmt) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 2: {
|
|
if (admin >= AccountStatus::GMLeadAdmin) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 3: {
|
|
if (admin >= AccountStatus::GMAdmin) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 4: {
|
|
if (admin >= AccountStatus::QuestTroupe) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 5: {
|
|
if (admin >= AccountStatus::ApprenticeGuide) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 6: {
|
|
if (admin >= AccountStatus::Steward) {
|
|
log = true;
|
|
}
|
|
|
|
break;
|
|
}
|
|
case 7: {
|
|
log = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (log) {
|
|
database.logevents(
|
|
c->AccountName(),
|
|
c->AccountID(),
|
|
admin,
|
|
c->GetName(),
|
|
c->GetTarget() ? c->GetTarget()->GetName() : "None",
|
|
"Command",
|
|
message.c_str(),
|
|
1
|
|
);
|
|
}
|
|
}
|