diff --git a/zone/command.cpp b/zone/command.cpp index 35ca539e8..df31b604b 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -366,7 +366,6 @@ int command_init(void) { command_add("path","- view and edit pathing",200,command_path) || command_add("flags","- displays the flags of you or your target",0,command_flags) || command_add("flagedit","- Edit zone flags on your target",100,command_flagedit) || - command_add("mlog","- Manage log settings",250,command_mlog) || command_add("aggro","(range) [-v] - Display aggro information for all mobs 'range' distance from your target. -v is verbose faction info.",80,command_aggro) || command_add("hatelist"," - Display hate list for target.", 80,command_hatelist) || command_add("aggrozone","[aggro] - Aggro every mob in the zone with X aggro. Default is 0. Not recommend if you're not invulnerable.",100,command_aggrozone) || @@ -7444,165 +7443,6 @@ void command_flagedit(Client *c, const Seperator *sep) { c->Message(15, "Invalid action specified. use '#flagedit help' for help"); } -void command_mlog(Client *c, const Seperator *sep) { - //super-command for managing log settings - if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #mlog [subcommand]."); - c->Message(0, "-- Mob Logging Togglers --"); - c->Message(0, "...target [on|off] - Set logging enabled for your target"); - c->Message(0, "...all [on|off] - Set logging enabled for all mobs and clients (prolly a bad idea)"); - c->Message(0, "...mobs [on|off] - Set logging enabled for all mobs"); - c->Message(0, "...clients [on|off] - Set logging enabled for all clients"); - c->Message(0, "...radius [on|off] [radius] - Set logging enable for all mobs and clients within `radius`"); - c->Message(0, "-------------"); - c->Message(0, "-- Log Settings --"); - c->Message(0, "...list [category] - List all log types in specified category, or all categories if none specified."); - c->Message(0, "...setcat [category] [on|off] - Enable/Disable all types in a specified category"); - c->Message(0, "...set [type] [on|off] - Enable/Disable the specified log type"); - c->Message(0, "...load [filename] - Load log type settings from the file `filename`"); - return; - } - bool onoff; - std::string on("on"); - std::string off("off"); - - if(!strcasecmp(sep->arg[1], "target")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument. Expected on/off."); return; } - - Mob *tgt = c->GetTarget(); - if(tgt == nullptr) { - c->Message(13, "You must have a target for this command."); - return; - } - - if(onoff) - tgt->EnableLogging(); - else - tgt->DisableLogging(); - - c->Message(0, "Logging has been enabled on %s", tgt->GetName()); - } else if(!strcasecmp(sep->arg[1], "all")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - entity_list.RadialSetLogging(c, onoff, true, true); - - c->Message(0, "Logging has been enabled for all entities"); - } else if(!strcasecmp(sep->arg[1], "mobs")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - entity_list.RadialSetLogging(c, onoff, false, true); - - c->Message(0, "Logging has been enabled for all mobs"); - } else if(!strcasecmp(sep->arg[1], "clients")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - entity_list.RadialSetLogging(c, onoff, true, false); - - c->Message(0, "Logging has been enabled for all clients"); - } else if(!strcasecmp(sep->arg[1], "radius")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - float radius = atof(sep->arg[3]); - if(radius <= 0) { - c->Message(13, "Invalid radius %f", radius); - return; - } - - entity_list.RadialSetLogging(c, onoff, false, true, radius); - - c->Message(0, "Logging has been enabled for all entities within %f", radius); - } else if(!strcasecmp(sep->arg[1], "list")) { - int r; - if(sep->arg[2][0] == '\0') { - c->Message(0, "Listing all log categories:"); - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - c->Message(0, "Category %d: %s", r, log_category_names[r]); - } - } else { - //first we have to find the category ID. - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - if(!strcasecmp(log_category_names[r], sep->arg[2])) - break; - } - if(r == NUMBER_OF_LOG_CATEGORIES) { - c->Message(13, "Unable to find category '%s'", sep->arg[2]); - return; - } - int logcat = r; - c->Message(0, "Types for category %d: %s", logcat, log_category_names[logcat]); - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(log_type_info[r].category != logcat) - continue; - c->Message(0, "...%d: %s (%s)", r, log_type_info[r].name, is_log_enabled(LogType(r))?"enabled":"disabled"); - } - } - } else if(!strcasecmp(sep->arg[1], "setcat")) { - if(on == sep->arg[3]) onoff = true; - else if(off == sep->arg[3]) onoff = false; - else { c->Message(13, "Invalid argument %s. Expected on/off.", sep->arg[3]); return; } - - int r; - //first we have to find the category ID. - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - if(!strcasecmp(log_category_names[r], sep->arg[2])) - break; - } - if(r == NUMBER_OF_LOG_CATEGORIES) { - c->Message(13, "Unable to find category '%s'", sep->arg[2]); - return; - } - - LogCategory logcat = LogCategory(r); - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(log_type_info[r].category != logcat) - continue; - - if(onoff) { - log_enable(LogType(r)); - c->Message(0, "Log type %s (%d) has been enabled", log_type_info[r].name, r); - } else { - log_disable(LogType(r)); - c->Message(0, "Log type %s (%d) has been disabled", log_type_info[r].name, r); - } - } - } else if(!strcasecmp(sep->arg[1], "set")) { - if(on == sep->arg[3]) onoff = true; - else if(off == sep->arg[3]) onoff = false; - else { c->Message(13, "Invalid argument %s. Expected on/off.", sep->arg[3]); return; } - - //first we have to find the category ID. - int r; - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(!strcasecmp(log_type_info[r].name, sep->arg[2])) - break; - } - if(r == NUMBER_OF_LOG_TYPES) { - c->Message(13, "Unable to find log type %s", sep->arg[2]); - return; - } - - if(onoff) { - log_enable(LogType(r)); - c->Message(0, "Log type %s (%d) has been enabled", log_type_info[r].name, r); - } else { - log_disable(LogType(r)); - c->Message(0, "Log type %s (%d) has been disabled", log_type_info[r].name, r); - } - } else { - c->Message(15, "Invalid action specified. use '#mlog help' for help"); - } -} - void command_serverrules(Client *c, const Seperator *sep) { c->SendRules(c); diff --git a/zone/command.h b/zone/command.h index c3825a66a..ab32bfd5e 100644 --- a/zone/command.h +++ b/zone/command.h @@ -269,7 +269,6 @@ void command_aggrozone(Client *c, const Seperator *sep); void command_reloadstatic(Client *c, const Seperator *sep); void command_flags(Client *c, const Seperator *sep); void command_flagedit(Client *c, const Seperator *sep); -void command_mlog(Client *c, const Seperator *sep); void command_serverrules(Client *c, const Seperator *sep); void command_acceptrules(Client *c, const Seperator *sep); void command_guildcreate(Client *c, const Seperator *sep);