mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 21:48:25 +00:00
Renamed DebugCategory to DoLog as the aggregate logging function for simplicity of use and shortened syntax of Log.DoLog
This commit is contained in:
+125
-125
@@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() {
|
||||
MAXTASKSETS, MAXTASKS);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() {
|
||||
int taskID = atoi(row[1]);
|
||||
|
||||
TaskSets[taskSet].push_back(taskID);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() {
|
||||
|
||||
bool TaskManager::LoadSingleTask(int TaskID) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID);
|
||||
|
||||
if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false;
|
||||
|
||||
@@ -115,21 +115,21 @@ bool TaskManager::LoadSingleTask(int TaskID) {
|
||||
void TaskManager::ReloadGoalLists() {
|
||||
|
||||
if(!GoalListManager.LoadLists())
|
||||
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed");
|
||||
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed");
|
||||
}
|
||||
|
||||
bool TaskManager::LoadTasks(int singleTask) {
|
||||
|
||||
// If TaskID !=0, then just load the task specified.
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called");
|
||||
|
||||
std::string query;
|
||||
if(singleTask == 0) {
|
||||
if(!GoalListManager.LoadLists())
|
||||
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed");
|
||||
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed");
|
||||
|
||||
if(!LoadTaskSets())
|
||||
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed");
|
||||
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed");
|
||||
|
||||
query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, "
|
||||
"`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, "
|
||||
@@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
|
||||
if((taskID <= 0) || (taskID >= MAXTASKS)) {
|
||||
// This shouldn't happen, as the SELECT is bounded by MAXTASKS
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
Tasks[taskID]->SequenceMode = ActivitiesSequential;
|
||||
Tasks[taskID]->LastStep = 0;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s",
|
||||
taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward,
|
||||
Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel,
|
||||
Tasks[taskID]->Repeatable ? "Yes" : "No");
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title);
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
"ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
|
||||
if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) {
|
||||
// This shouldn't happen, as the SELECT is bounded by MAXTASKS
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading "
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading "
|
||||
"activities from database", taskID, activityID);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(Tasks[taskID]==nullptr) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
// ERR_NOTASK errors.
|
||||
// Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1
|
||||
if(activityID != Tasks[taskID]->ActivityCount) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID);
|
||||
Tasks[taskID] = nullptr;
|
||||
continue;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]);
|
||||
Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]);
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, "
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, "
|
||||
"GoalMethod: %i, GoalCount: %3i, ZoneID:%3i",
|
||||
Tasks[taskID]->ActivityCount, activityID, taskID,
|
||||
Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type,
|
||||
@@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) {
|
||||
Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount,
|
||||
Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID);
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3);
|
||||
|
||||
Tasks[taskID]->ActivityCount++;
|
||||
}
|
||||
@@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
int characterID = c->CharacterID();
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID);
|
||||
Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID);
|
||||
|
||||
if(state->ActiveTaskCount > 0) {
|
||||
for(int task=0; task<MAXACTIVETASKS; task++) {
|
||||
@@ -316,14 +316,14 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
if(state->ActiveTasks[task].Updated) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID);
|
||||
|
||||
std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) "
|
||||
"VALUES (%i, %i, %i, %i)",
|
||||
characterID, taskID, task, state->ActiveTasks[task].AcceptedTime);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
else
|
||||
state->ActiveTasks[task].Updated = false;
|
||||
|
||||
@@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
if(!state->ActiveTasks[task].Activity[activityIndex].Updated)
|
||||
continue;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i",
|
||||
characterID, task, activityIndex);
|
||||
|
||||
if(updatedActivityCount==0)
|
||||
@@ -358,11 +358,11 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
if(updatedActivityCount == 0)
|
||||
continue;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str());
|
||||
auto results = database.QueryDatabase(query);
|
||||
|
||||
if(!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
for(unsigned int i=state->LastCompletedTaskLoaded; i<state->CompletedTasks.size(); i++) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i);
|
||||
int taskID = state->CompletedTasks[i].TaskID;
|
||||
|
||||
if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr))
|
||||
@@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) {
|
||||
query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j);
|
||||
results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -459,14 +459,14 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
state->ActiveTaskCount = 0;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID);
|
||||
|
||||
std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` "
|
||||
"FROM `character_tasks` "
|
||||
"WHERE `charid` = %i ORDER BY acceptedtime", characterID);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
int slot = atoi(row[1]);
|
||||
|
||||
if((taskID<0) || (taskID>=MAXTASKS)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID);
|
||||
continue;
|
||||
}
|
||||
|
||||
if((slot<0) || (slot>=MAXACTIVETASKS)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
++state->ActiveTaskCount;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime);
|
||||
}
|
||||
|
||||
// Load Activities
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID);
|
||||
|
||||
query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` "
|
||||
"FROM `character_activities` "
|
||||
@@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
"ORDER BY `taskid` ASC, `activityid` ASC", characterID);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()){
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int taskID = atoi(row[0]);
|
||||
if((taskID<0) || (taskID>=MAXTASKS)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID);
|
||||
continue;
|
||||
}
|
||||
|
||||
int activityID = atoi(row[1]);
|
||||
if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
}
|
||||
|
||||
if(activeTaskIndex == -1) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed);
|
||||
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
characterID);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
|
||||
int taskID = atoi(row[0]);
|
||||
if((taskID <= 0) || (taskID >=MAXTASKS)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
// completed.
|
||||
int activityID = atoi(row[1]);
|
||||
if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -634,12 +634,12 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
characterID, MAXTASKS);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str());
|
||||
else
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
int taskID = atoi(row[0]);
|
||||
state->EnabledTasks.push_back(taskID);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID);
|
||||
}
|
||||
|
||||
// Check that there is an entry in the client task state for every activity in each task
|
||||
@@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. "
|
||||
"Removing from memory. Contact a GM to resolve this.",i, taskID);
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID);
|
||||
state->ActiveTasks[i].TaskID=TASKSLOTEMPTY;
|
||||
continue;
|
||||
|
||||
@@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
"Removing from memory. Contact a GM to resolve this.",
|
||||
taskID, Tasks[taskID]->Title);
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for "
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for "
|
||||
"Task %i either missing from client state or from task.", characterID, j, taskID);
|
||||
state->ActiveTasks[i].TaskID=TASKSLOTEMPTY;
|
||||
break;
|
||||
@@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) {
|
||||
if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY)
|
||||
state->UnlockActivities(characterID, i);
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) {
|
||||
}
|
||||
}
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list ");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list ");
|
||||
for(unsigned int i=0; i<EnabledTasks.size(); i++)
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] %i", EnabledTasks[i]);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] %i", EnabledTasks[i]);
|
||||
|
||||
if(tasksEnabled.size() == 0 )
|
||||
return;
|
||||
@@ -722,10 +722,10 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) {
|
||||
queryStream << ( i ? ", " : "" ) << StringFormat("(%i, %i)", characterID, tasksEnabled[i]);
|
||||
|
||||
std::string query = queryStream.str();
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Executing query %s", query.c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Executing query %s", query.c_str());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -757,9 +757,9 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) {
|
||||
}
|
||||
}
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list ");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list ");
|
||||
for(unsigned int i=0; i<EnabledTasks.size(); i++)
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] %i", EnabledTasks[i]);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] %i", EnabledTasks[i]);
|
||||
|
||||
if(tasksDisabled.size() == 0)
|
||||
return;
|
||||
@@ -771,10 +771,10 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) {
|
||||
|
||||
queryStream << ")";
|
||||
std::string query = queryStream.str();
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Executing query %s", query.c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Executing query %s", query.c_str());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
bool ClientTaskState::IsTaskEnabled(int TaskID) {
|
||||
@@ -908,7 +908,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
|
||||
int TaskListIndex = 0;
|
||||
int PlayerLevel = c->GetLevel();
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID,
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID,
|
||||
state->EnabledTasks.size());
|
||||
if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return;
|
||||
|
||||
@@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
|
||||
|
||||
if(TaskSets[TaskSetID][0] == 0) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID);
|
||||
std::vector<int>::iterator Iterator = TaskSets[TaskSetID].begin();
|
||||
|
||||
while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) {
|
||||
@@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
|
||||
while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) &&
|
||||
(TaskListIndex < MAXCHOOSERENTRIES)) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)",
|
||||
EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex,
|
||||
TaskSets[TaskSetID][TaskSetIndex]);
|
||||
|
||||
@@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task
|
||||
return;
|
||||
}
|
||||
// Titanium OpCode: 0x5e7c
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount);
|
||||
char *Ptr;
|
||||
int PlayerLevel = c->GetLevel();
|
||||
|
||||
@@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task
|
||||
|
||||
void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount);
|
||||
|
||||
int PlayerLevel = c->GetLevel();
|
||||
|
||||
@@ -1275,16 +1275,16 @@ int ClientTaskState::GetActiveTaskID(int index) {
|
||||
|
||||
static void DeleteCompletedTaskFromDatabase(int charID, int taskID) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID);
|
||||
|
||||
const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str());
|
||||
}
|
||||
|
||||
bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
@@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
// On loading the client state, all activities that are not completed, are
|
||||
// marked as hidden. For Sequential (non-stepped) mode, we mark the first
|
||||
// activity as active if not complete.
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i",
|
||||
CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode);
|
||||
if(Task->SequenceMode == ActivitiesSequential) {
|
||||
|
||||
@@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
}
|
||||
if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) {
|
||||
if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled");
|
||||
std::vector<CompletedTaskInformation>::iterator Iterator = CompletedTasks.begin();
|
||||
int ErasedElements = 0;
|
||||
while(Iterator != CompletedTasks.end()) {
|
||||
@@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
else
|
||||
++Iterator;
|
||||
}
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements);
|
||||
if(ErasedElements) {
|
||||
LastCompletedTaskLoaded -= ErasedElements;
|
||||
DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID);
|
||||
@@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
|
||||
CompletedTasks.push_back(cti);
|
||||
}
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete);
|
||||
return AllActivitiesComplete;
|
||||
}
|
||||
|
||||
@@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
|
||||
bool CurrentStepComplete = true;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep);
|
||||
// If CurrentStep is -1, this is the first call to this method since loading the
|
||||
// client state. Unlock all activities with a step number of 0
|
||||
if(ActiveTasks[TaskIndex].CurrentStep == -1) {
|
||||
@@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
// If we are only keeping one completed record per task, and the player has done
|
||||
// the same task again, erase the previous completed entry for this task.
|
||||
if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled");
|
||||
std::vector<CompletedTaskInformation>::iterator Iterator = CompletedTasks.begin();
|
||||
int ErasedElements = 0;
|
||||
while(Iterator != CompletedTasks.end()) {
|
||||
@@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) {
|
||||
else
|
||||
++Iterator;
|
||||
}
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements);
|
||||
if(ErasedElements) {
|
||||
LastCompletedTaskLoaded -= ErasedElements;
|
||||
DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID);
|
||||
@@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI
|
||||
|
||||
int Ret = false;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID);
|
||||
|
||||
// If the client has no tasks, there is nothing further to check.
|
||||
|
||||
@@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI
|
||||
if(Task->Activity[j].Type != ActivityType) continue;
|
||||
// Is there a zone restriction on the activity ?
|
||||
if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check",
|
||||
c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID);
|
||||
continue;
|
||||
}
|
||||
@@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI
|
||||
continue;
|
||||
}
|
||||
// We found an active task to kill this type of NPC, so increment the done count
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC");
|
||||
IncrementDoneCount(c, Task, i, j);
|
||||
Ret = true;
|
||||
}
|
||||
@@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI
|
||||
|
||||
// If the client has no tasks, there is nothing further to check.
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID);
|
||||
|
||||
if(ActiveTaskCount == 0) return;
|
||||
|
||||
@@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI
|
||||
if(Task->Activity[j].Type != (int)Type) continue;
|
||||
// Is there a zone restriction on the activity ?
|
||||
if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check",
|
||||
c->GetName(), Type, ItemID);
|
||||
continue;
|
||||
}
|
||||
@@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI
|
||||
continue;
|
||||
}
|
||||
// We found an active task related to this item, so increment the done count
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem");
|
||||
IncrementDoneCount(c, Task, i, j, Count);
|
||||
}
|
||||
}
|
||||
@@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) {
|
||||
|
||||
// If the client has no tasks, there is nothing further to check.
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID);
|
||||
if(ActiveTaskCount == 0) return;
|
||||
|
||||
for(int i=0; i<MAXACTIVETASKS; i++) {
|
||||
@@ -1648,7 +1648,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) {
|
||||
// We are only interested in explore activities
|
||||
if(Task->Activity[j].Type != ActivityExplore) continue;
|
||||
if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check",
|
||||
c->GetName(), ExploreID);
|
||||
continue;
|
||||
}
|
||||
@@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) {
|
||||
}
|
||||
// We found an active task to explore this area, so set done count to goal count
|
||||
// (Only a goal count of 1 makes sense for explore activities?)
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore");
|
||||
IncrementDoneCount(c, Task, i, j,
|
||||
Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount);
|
||||
|
||||
@@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i
|
||||
|
||||
bool Ret = false;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID);
|
||||
|
||||
if(ActiveTaskCount == 0) return false;
|
||||
|
||||
@@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i
|
||||
(Task->Activity[j].Type != ActivityGiveCash)) continue;
|
||||
// Is there a zone restriction on the activity ?
|
||||
if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i",
|
||||
c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID);
|
||||
continue;
|
||||
}
|
||||
@@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i
|
||||
// Is the activity related to these items ?
|
||||
//
|
||||
if((Task->Activity[j].Type == ActivityGiveCash) && Cash) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash");
|
||||
IncrementDoneCount(c, Task, i, j, Cash);
|
||||
Ret = true;
|
||||
}
|
||||
@@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i
|
||||
continue;
|
||||
}
|
||||
// We found an active task related to this item, so increment the done count
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem");
|
||||
IncrementDoneCount(c, Task, i, j, 1);
|
||||
Ret = true;
|
||||
}
|
||||
@@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) {
|
||||
|
||||
// If the client has no tasks, there is nothing further to check.
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID);
|
||||
if(ActiveTaskCount == 0) return;
|
||||
|
||||
for(int i=0; i<MAXACTIVETASKS; i++) {
|
||||
@@ -1772,13 +1772,13 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) {
|
||||
if(Task->Activity[j].Type != ActivityTouch) continue;
|
||||
if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue;
|
||||
if(Task->Activity[j].ZoneID != ZoneID) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check",
|
||||
c->GetName());
|
||||
continue;
|
||||
}
|
||||
// We found an active task to zone into this zone, so set done count to goal count
|
||||
// (Only a goal count of 1 makes sense for touch activities?)
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch");
|
||||
IncrementDoneCount(c, Task, i, j,
|
||||
Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount);
|
||||
}
|
||||
@@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) {
|
||||
}
|
||||
void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount");
|
||||
|
||||
ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count;
|
||||
|
||||
@@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T
|
||||
ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true;
|
||||
// Have we reached the goal count for this activity ?
|
||||
if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i",
|
||||
ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount,
|
||||
Task->Activity[ActivityID].GoalCount,
|
||||
ActivityID);
|
||||
@@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T
|
||||
ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted;
|
||||
// Unlock subsequent activities for this task
|
||||
bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete);
|
||||
// and by the 'Task Stage Completed' message
|
||||
c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex);
|
||||
// Send the updated task/activity list to the client
|
||||
@@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) {
|
||||
|
||||
void ClientTaskState::FailTask(Client *c, int TaskID) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount);
|
||||
if(ActiveTaskCount == 0) return;
|
||||
|
||||
for(int i=0; i<MAXACTIVETASKS; i++) {
|
||||
@@ -2009,7 +2009,7 @@ void ClientTaskState::FailTask(Client *c, int TaskID) {
|
||||
|
||||
bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i).", TaskID, ActivityID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i).", TaskID, ActivityID);
|
||||
// Quick sanity check
|
||||
if(ActivityID<0) return false;
|
||||
if(ActiveTaskCount == 0) return false;
|
||||
@@ -2034,7 +2034,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) {
|
||||
// The ActivityID is out of range
|
||||
if(ActivityID >= Task->ActivityCount) return false;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID,
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID,
|
||||
ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State);
|
||||
|
||||
|
||||
@@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) {
|
||||
void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/)
|
||||
{
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count);
|
||||
|
||||
// Quick sanity check
|
||||
if((ActivityID<0) || (ActiveTaskCount==0)) return;
|
||||
@@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID,
|
||||
|
||||
// The Activity is not currently active
|
||||
if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return;
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity");
|
||||
IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update);
|
||||
|
||||
}
|
||||
|
||||
void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID);
|
||||
|
||||
// Quick sanity check
|
||||
if((ActivityID<0) || (ActiveTaskCount==0)) return;
|
||||
@@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) {
|
||||
// The Activity is not currently active
|
||||
if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount");
|
||||
|
||||
ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0;
|
||||
|
||||
@@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) {
|
||||
if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1;
|
||||
|
||||
for(unsigned int i=0; i<CompletedTasks.size(); i++) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing completed task %i with %i", CompletedTasks[i].TaskID, TaskID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing completed task %i with %i", CompletedTasks[i].TaskID, TaskID);
|
||||
if(CompletedTasks[i].TaskID == TaskID) return 1;
|
||||
}
|
||||
|
||||
@@ -2275,7 +2275,7 @@ void Client::SendTaskComplete(int TaskIndex) {
|
||||
|
||||
void ClientTaskState::SendTaskHistory(Client *c, int TaskIndex) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Task History Requested for Completed Task Index %i", TaskIndex);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Task History Requested for Completed Task Index %i", TaskIndex);
|
||||
|
||||
// We only sent the most recent 50 completed tasks, so we need to offset the Index the client sent to us.
|
||||
|
||||
@@ -2406,7 +2406,7 @@ void Client::SendTaskFailed(int TaskID, int TaskIndex) {
|
||||
//tac->unknown5 = 0x00000001;
|
||||
tac->unknown5 = 0; // 0 for task complete or failed.
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed");
|
||||
_pkt(TASKS__PACKETS, outapp);
|
||||
|
||||
QueuePacket(outapp);
|
||||
@@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State)
|
||||
if(State->CompletedTasks.size() > 50)
|
||||
FirstTaskToSend = State->CompletedTasks.size() - 50;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i",
|
||||
State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend);
|
||||
/*
|
||||
for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) {
|
||||
@@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) {
|
||||
int StartTime = c->GetTaskStartTime(TaskIndex);
|
||||
|
||||
SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID));
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID));
|
||||
|
||||
int Sequence = 0;
|
||||
for(int Activity=0; Activity<GetActivityCount(TaskID); Activity++) {
|
||||
if(c->GetTaskActivityState(TaskIndex, Activity) != ActivityHidden) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete);
|
||||
if(Activity==GetActivityCount(TaskID)-1)
|
||||
SendTaskActivityLong(c, TaskID, Activity, TaskIndex,
|
||||
Tasks[TaskID]->Activity[Activity].Optional,
|
||||
@@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) {
|
||||
Tasks[TaskID]->Activity[Activity].Optional, 0);
|
||||
}
|
||||
else {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex);
|
||||
SendTaskActivityShort(c, TaskID, Activity, TaskIndex);
|
||||
}
|
||||
Sequence++;
|
||||
@@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta
|
||||
|
||||
int StartTime = c->GetTaskStartTime(TaskIndex);
|
||||
SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal);
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID));
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID));
|
||||
|
||||
int Sequence = 0;
|
||||
|
||||
for(int Activity=0; Activity<GetActivityCount(TaskID); Activity++) {
|
||||
if(c->GetTaskActivityState(TaskIndex, Activity) != ActivityHidden) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete);
|
||||
if(Activity==GetActivityCount(TaskID)-1)
|
||||
SendTaskActivityLong(c, TaskID, Activity, TaskIndex,
|
||||
Tasks[TaskID]->Activity[Activity].Optional, TaskComplete);
|
||||
@@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta
|
||||
Tasks[TaskID]->Activity[Activity].Optional, 0);
|
||||
}
|
||||
else {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex);
|
||||
SendTaskActivityShort(c, TaskID, Activity, TaskIndex);
|
||||
}
|
||||
Sequence++;
|
||||
@@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD
|
||||
cts->SequenceNumber = SequenceNumber;
|
||||
cts->unknown4 = 0x00000002;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask");
|
||||
_pkt(TASKS__PACKETS, outapp);
|
||||
|
||||
c->QueuePacket(outapp);
|
||||
@@ -2932,24 +2932,24 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD
|
||||
void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) {
|
||||
|
||||
int characterID = c->CharacterID();
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber);
|
||||
|
||||
std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i",
|
||||
characterID, ActiveTasks[sequenceNumber].TaskID);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str());
|
||||
|
||||
query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i",
|
||||
characterID, ActiveTasks[sequenceNumber].TaskID);
|
||||
results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str());
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str());
|
||||
|
||||
ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY;
|
||||
ActiveTaskCount--;
|
||||
@@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) {
|
||||
//
|
||||
int FreeSlot = -1;
|
||||
for(int i=0; i<MAXACTIVETASKS; i++) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Looking for free slot in slot %i, found TaskID of %i",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Looking for free slot in slot %i, found TaskID of %i",
|
||||
i, ActiveTasks[i].TaskID);
|
||||
if(ActiveTasks[i].TaskID == 0) {
|
||||
FreeSlot = i;
|
||||
@@ -3045,11 +3045,11 @@ void ClientTaskState::ProcessTaskProximities(Client *c, float X, float Y, float
|
||||
|
||||
if((LastX==X) && (LastY==Y) && (LastZ==Z)) return;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking proximities for Position %8.3f, %8.3f, %8.3f\n", X, Y, Z);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking proximities for Position %8.3f, %8.3f, %8.3f\n", X, Y, Z);
|
||||
int ExploreID = taskmanager->ProximityManager.CheckProximities(X, Y, Z);
|
||||
|
||||
if(ExploreID>0) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID);
|
||||
UpdateTasksOnExplore(c, ExploreID);
|
||||
}
|
||||
}
|
||||
@@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() {
|
||||
|
||||
bool TaskGoalListManager::LoadLists() {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called");
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called");
|
||||
|
||||
for(int i=0; i< NumberOfLists; i++)
|
||||
safe_delete_array(TaskGoalLists[i].GoalItemEntries);
|
||||
@@ -3088,12 +3088,12 @@ bool TaskGoalListManager::LoadLists() {
|
||||
"ORDER BY `listid`";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
NumberOfLists = results.RowCount();
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists);
|
||||
|
||||
TaskGoalLists = new TaskGoalList_Struct[NumberOfLists];
|
||||
|
||||
@@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() {
|
||||
listID, size);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str());
|
||||
TaskGoalLists[listIndex].Size = 0;
|
||||
continue;
|
||||
}
|
||||
@@ -3207,7 +3207,7 @@ std::vector<int> TaskGoalListManager::GetListContents(int ListID) {
|
||||
|
||||
bool TaskGoalListManager::IsInList(int ListID, int Entry) {
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry);
|
||||
|
||||
int ListIndex = GetListByID(ListID);
|
||||
|
||||
@@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) {
|
||||
else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry])
|
||||
LastEntry = MiddleEntry - 1;
|
||||
else {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() {
|
||||
bool TaskProximityManager::LoadProximities(int zoneID) {
|
||||
TaskProximity proximity;
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID);
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID);
|
||||
TaskProximities.clear();
|
||||
|
||||
std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, "
|
||||
@@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) {
|
||||
"ORDER BY `zoneid` ASC", zoneID);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) {
|
||||
|
||||
TaskProximity* P = &TaskProximities[i];
|
||||
|
||||
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f",
|
||||
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f",
|
||||
X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ);
|
||||
|
||||
if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY ||
|
||||
|
||||
Reference in New Issue
Block a user