mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Feature] Add Rule to Limit Task Update Messages (#4459)
* [Feature] Add Rule to Limit Task Update Messages * Update task_client_state.cpp * Update task_client_state.cpp * Change rule
This commit is contained in:
parent
ff16a76481
commit
39876ab858
@ -715,6 +715,7 @@ RULE_BOOL(TaskSystem, ExpRewardsIgnoreLevelBasedEXPMods, false, "Rewarding Level
|
|||||||
RULE_INT(TaskSystem, SharedTasksWorldProcessRate, 6000, "Timer interval (milliseconds) that shared tasks are processed in world")
|
RULE_INT(TaskSystem, SharedTasksWorldProcessRate, 6000, "Timer interval (milliseconds) that shared tasks are processed in world")
|
||||||
RULE_INT(TaskSystem, SharedTasksTerminateTimerMS, 120000, "Delay (milliseconds) until a shared task is terminated if requirements are no longer met after member removal (default: 2 minutes)")
|
RULE_INT(TaskSystem, SharedTasksTerminateTimerMS, 120000, "Delay (milliseconds) until a shared task is terminated if requirements are no longer met after member removal (default: 2 minutes)")
|
||||||
RULE_BOOL(TaskSystem, UpdateOneElementPerTask, true, "If true (live-like) task updates only increment the first matching activity. If false all matching elements will be incremented.")
|
RULE_BOOL(TaskSystem, UpdateOneElementPerTask, true, "If true (live-like) task updates only increment the first matching activity. If false all matching elements will be incremented.")
|
||||||
|
RULE_INT(TaskSystem, MaxUpdateMessages, 50, "Maximum update messages for non-GiveCash activity types in IncrementDoneCount")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Range)
|
RULE_CATEGORY(Range)
|
||||||
|
|||||||
@ -869,7 +869,12 @@ int ClientTaskState::IncrementDoneCount(
|
|||||||
if (task_data->type != TaskType::Shared) {
|
if (task_data->type != TaskType::Shared) {
|
||||||
// live messages for each increment of non-shared tasks
|
// live messages for each increment of non-shared tasks
|
||||||
auto activity_type = task_data->activity_information[activity_id].activity_type;
|
auto activity_type = task_data->activity_information[activity_id].activity_type;
|
||||||
int msg_count = activity_type == TaskActivityType::GiveCash ? 1 : count;
|
int msg_count = 1;
|
||||||
|
|
||||||
|
if (activity_type != TaskActivityType::GiveCash) {
|
||||||
|
msg_count = std::min(count, RuleI(TaskSystem, MaxUpdateMessages));
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < msg_count; ++i) {
|
for (int i = 0; i < msg_count; ++i) {
|
||||||
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_data->title.c_str());
|
client->MessageString(Chat::DefaultText, TASK_UPDATED, task_data->title.c_str());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user