mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
[Tasks] Schema simplification (#2449)
* Combine task_activity item and npc fields This will make tooling easier. While denormalizing goallists may not be ideal, it decouples tasks from rewards which share the table and removes a redundant column in favor of a using the delimited string which better matches live packet data. * [Tasks] Deprecate goallists table, migrate reward goal lists, simplify logic * Update 2022_09_25_task_concat_matchlists.sql * Update 2022_09_25_task_concat_matchlists.sql * Tweaks * Fix reward column name in conversion script * Task reward stacking * Update task_client_state.cpp * Implement stack counts * Fix reward item instance memory leak * Validate reward item instance * Fix item reward message * Fix findtask Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -13,30 +13,31 @@ void command_findtask(Client *c, const Seperator *sep)
|
||||
if (sep->IsNumber(1)) {
|
||||
auto task_id = std::stoul(sep->arg[1]);
|
||||
auto task_name = task_manager->GetTaskName(task_id);
|
||||
auto task_message = (
|
||||
|
||||
std::string task_message = (
|
||||
!task_name.empty() ?
|
||||
fmt::format(
|
||||
"Task {}: {}",
|
||||
task_id,
|
||||
task_name
|
||||
).c_str() :
|
||||
) :
|
||||
fmt::format(
|
||||
"Task ID {} was not found.",
|
||||
task_id
|
||||
).c_str()
|
||||
)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
task_message
|
||||
task_message.c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
if (!search_criteria.empty()) {
|
||||
int found_count = 0;
|
||||
for (const auto& task : task_manager->GetTaskData()) {
|
||||
auto task_name = task.second.title;
|
||||
int found_count = 0;
|
||||
for (const auto &task: task_manager->GetTaskData()) {
|
||||
auto task_name = task.second.title;
|
||||
std::string task_name_lower = Strings::ToLower(task_name);
|
||||
if (task_name_lower.find(search_criteria) == std::string::npos) {
|
||||
continue;
|
||||
|
||||
@@ -191,12 +191,7 @@ void command_task(Client *c, const Seperator *sep)
|
||||
return;
|
||||
} else if (is_reload) {
|
||||
if (arguments >= 2) {
|
||||
if (!strcasecmp(sep->arg[2], "lists")) {
|
||||
c->Message(Chat::Yellow, "Attempting to reload goal lists.");
|
||||
worldserver.SendReloadTasks(RELOADTASKGOALLISTS);
|
||||
c->Message(Chat::Yellow, "Successfully reloaded goal lists.");
|
||||
return;
|
||||
} else if (!strcasecmp(sep->arg[2], "sets")) {
|
||||
if (!strcasecmp(sep->arg[2], "sets")) {
|
||||
c->Message(Chat::Yellow, "Attempting to reload task sets.");
|
||||
worldserver.SendReloadTasks(RELOADTASKSETS);
|
||||
c->Message(Chat::Yellow, "Successfully reloaded task sets.");
|
||||
|
||||
Reference in New Issue
Block a user