mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
Rename reference logger to Log
This commit is contained in:
parent
126eca2ad6
commit
7dbde36b03
@ -27,7 +27,7 @@
|
|||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
#include "../../common/string_util.h"
|
#include "../../common/string_util.h"
|
||||||
|
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase *db);
|
void ExportSpells(SharedDatabase *db);
|
||||||
void ExportSkillCaps(SharedDatabase *db);
|
void ExportSkillCaps(SharedDatabase *db);
|
||||||
@ -35,25 +35,25 @@ void ExportBaseData(SharedDatabase *db);
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformClientExport);
|
RegisterExecutablePlatform(ExePlatformClientExport);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "Client Files Export Utility");
|
Log.Log(EQEmuLogSys::Status, "Client Files Export Utility");
|
||||||
if(!EQEmuConfig::LoadConfig()) {
|
if(!EQEmuConfig::LoadConfig()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
|
Log.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmuConfig *config = EQEmuConfig::get();
|
const EQEmuConfig *config = EQEmuConfig::get();
|
||||||
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedDatabase database;
|
SharedDatabase database;
|
||||||
logger.Log(EQEmuLogSys::Status, "Connecting to database...");
|
Log.Log(EQEmuLogSys::Status, "Connecting to database...");
|
||||||
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
||||||
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
|
Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
|
||||||
"database connection");
|
"database connection");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -66,11 +66,11 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase *db) {
|
void ExportSpells(SharedDatabase *db) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Exporting Spells...");
|
Log.Log(EQEmuLogSys::Status, "Exporting Spells...");
|
||||||
|
|
||||||
FILE *f = fopen("export/spells_us.txt", "w");
|
FILE *f = fopen("export/spells_us.txt", "w");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping.");
|
Log.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) {
|
|||||||
fprintf(f, "%s\n", line.c_str());
|
fprintf(f, "%s\n", line.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) {
|
|||||||
class_id, skill_id);
|
class_id, skill_id);
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
|
|||||||
class_id, skill_id, level);
|
class_id, skill_id, level);
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,11 +140,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExportSkillCaps(SharedDatabase *db) {
|
void ExportSkillCaps(SharedDatabase *db) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Exporting Skill Caps...");
|
Log.Log(EQEmuLogSys::Status, "Exporting Skill Caps...");
|
||||||
|
|
||||||
FILE *f = fopen("export/SkillCaps.txt", "w");
|
FILE *f = fopen("export/SkillCaps.txt", "w");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
|
Log.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,11 +169,11 @@ void ExportSkillCaps(SharedDatabase *db) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExportBaseData(SharedDatabase *db) {
|
void ExportBaseData(SharedDatabase *db) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Exporting Base Data...");
|
Log.Log(EQEmuLogSys::Status, "Exporting Base Data...");
|
||||||
|
|
||||||
FILE *f = fopen("export/BaseData.txt", "w");
|
FILE *f = fopen("export/BaseData.txt", "w");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping.");
|
Log.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) {
|
|||||||
fprintf(f, "%s\n", line.c_str());
|
fprintf(f, "%s\n", line.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
#include "../../common/string_util.h"
|
#include "../../common/string_util.h"
|
||||||
|
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
void ImportSpells(SharedDatabase *db);
|
void ImportSpells(SharedDatabase *db);
|
||||||
void ImportSkillCaps(SharedDatabase *db);
|
void ImportSkillCaps(SharedDatabase *db);
|
||||||
@ -33,25 +33,25 @@ void ImportBaseData(SharedDatabase *db);
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "Client Files Import Utility");
|
Log.Log(EQEmuLogSys::Status, "Client Files Import Utility");
|
||||||
if(!EQEmuConfig::LoadConfig()) {
|
if(!EQEmuConfig::LoadConfig()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
|
Log.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmuConfig *config = EQEmuConfig::get();
|
const EQEmuConfig *config = EQEmuConfig::get();
|
||||||
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedDatabase database;
|
SharedDatabase database;
|
||||||
logger.Log(EQEmuLogSys::Status, "Connecting to database...");
|
Log.Log(EQEmuLogSys::Status, "Connecting to database...");
|
||||||
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
||||||
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
|
Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
|
||||||
"database connection");
|
"database connection");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) {
|
|||||||
const std::string query = "DESCRIBE spells_new";
|
const std::string query = "DESCRIBE spells_new";
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,10 +76,10 @@ int GetSpellColumns(SharedDatabase *db) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImportSpells(SharedDatabase *db) {
|
void ImportSpells(SharedDatabase *db) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Importing Spells...");
|
Log.Log(EQEmuLogSys::Status, "Importing Spells...");
|
||||||
FILE *f = fopen("import/spells_us.txt", "r");
|
FILE *f = fopen("import/spells_us.txt", "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping.");
|
Log.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,23 +142,23 @@ void ImportSpells(SharedDatabase *db) {
|
|||||||
|
|
||||||
spells_imported++;
|
spells_imported++;
|
||||||
if(spells_imported % 1000 == 0) {
|
if(spells_imported % 1000 == 0) {
|
||||||
logger.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported);
|
Log.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(spells_imported % 1000 != 0) {
|
if(spells_imported % 1000 != 0) {
|
||||||
logger.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported);
|
Log.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportSkillCaps(SharedDatabase *db) {
|
void ImportSkillCaps(SharedDatabase *db) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Importing Skill Caps...");
|
Log.Log(EQEmuLogSys::Status, "Importing Skill Caps...");
|
||||||
|
|
||||||
FILE *f = fopen("import/SkillCaps.txt", "r");
|
FILE *f = fopen("import/SkillCaps.txt", "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
|
Log.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,11 +190,11 @@ void ImportSkillCaps(SharedDatabase *db) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImportBaseData(SharedDatabase *db) {
|
void ImportBaseData(SharedDatabase *db) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Importing Base Data...");
|
Log.Log(EQEmuLogSys::Status, "Importing Base Data...");
|
||||||
|
|
||||||
FILE *f = fopen("import/BaseData.txt", "r");
|
FILE *f = fopen("import/BaseData.txt", "r");
|
||||||
if(!f) {
|
if(!f) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping.");
|
Log.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Crash, buffer);
|
Log.Log(EQEmuLogSys::Crash, buffer);
|
||||||
StackWalker::OnOutput(szText);
|
StackWalker::OnOutput(szText);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo)
|
|||||||
switch(ExceptionInfo->ExceptionRecord->ExceptionCode)
|
switch(ExceptionInfo->ExceptionRecord->ExceptionCode)
|
||||||
{
|
{
|
||||||
case EXCEPTION_ACCESS_VIOLATION:
|
case EXCEPTION_ACCESS_VIOLATION:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
|
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_BREAKPOINT:
|
case EXCEPTION_BREAKPOINT:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_DATATYPE_MISALIGNMENT:
|
case EXCEPTION_DATATYPE_MISALIGNMENT:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_DENORMAL_OPERAND:
|
case EXCEPTION_FLT_DENORMAL_OPERAND:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
|
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_INEXACT_RESULT:
|
case EXCEPTION_FLT_INEXACT_RESULT:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_INVALID_OPERATION:
|
case EXCEPTION_FLT_INVALID_OPERATION:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_OVERFLOW:
|
case EXCEPTION_FLT_OVERFLOW:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_STACK_CHECK:
|
case EXCEPTION_FLT_STACK_CHECK:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_FLT_UNDERFLOW:
|
case EXCEPTION_FLT_UNDERFLOW:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_ILLEGAL_INSTRUCTION:
|
case EXCEPTION_ILLEGAL_INSTRUCTION:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_IN_PAGE_ERROR:
|
case EXCEPTION_IN_PAGE_ERROR:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_INT_DIVIDE_BY_ZERO:
|
case EXCEPTION_INT_DIVIDE_BY_ZERO:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_INT_OVERFLOW:
|
case EXCEPTION_INT_OVERFLOW:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_INVALID_DISPOSITION:
|
case EXCEPTION_INVALID_DISPOSITION:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
|
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_PRIV_INSTRUCTION:
|
case EXCEPTION_PRIV_INSTRUCTION:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_SINGLE_STEP:
|
case EXCEPTION_SINGLE_STEP:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP");
|
||||||
break;
|
break;
|
||||||
case EXCEPTION_STACK_OVERFLOW:
|
case EXCEPTION_STACK_OVERFLOW:
|
||||||
logger.Log(EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW");
|
Log.Log(EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logger.Log(EQEmuLogSys::Crash, "Unknown Exception");
|
Log.Log(EQEmuLogSys::Crash, "Unknown Exception");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,12 +84,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
|
|||||||
uint32 errnum= 0;
|
uint32 errnum= 0;
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
|
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
|
Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port);
|
Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
|
|||||||
charid = GetCharacterID(pp->name);
|
charid = GetCharacterID(pp->name);
|
||||||
|
|
||||||
if(!charid) {
|
if(!charid) {
|
||||||
logger.Log(EQEmuLogSys::Error, "StoreCharacter: no character id");
|
Log.Log(EQEmuLogSys::Error, "StoreCharacter: no character id");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,10 +736,10 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
|
|||||||
auto results = QueryDatabase(invquery);
|
auto results = QueryDatabase(invquery);
|
||||||
|
|
||||||
if (!results.RowsAffected())
|
if (!results.RowsAffected())
|
||||||
logger.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str());
|
||||||
#if EQDEBUG >= 9
|
#if EQDEBUG >= 9
|
||||||
else
|
else
|
||||||
logger.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str());
|
Log.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
|
|||||||
std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id);
|
std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) {
|
|||||||
std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID);
|
std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) {
|
void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) {
|
||||||
std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID);
|
std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetLFG(uint32 CharID, bool LFG) {
|
void Database::SetLFG(uint32 CharID, bool LFG) {
|
||||||
std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID);
|
std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) {
|
void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) {
|
||||||
std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID);
|
std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::AddReport(std::string who, std::string against, std::string lines) {
|
void Database::AddReport(std::string who, std::string against, std::string lines) {
|
||||||
@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines
|
|||||||
safe_delete_array(escape_str);
|
safe_delete_array(escape_str);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) {
|
void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) {
|
||||||
@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
|
|||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
|
|||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::ClearAllGroups(void)
|
void Database::ClearAllGroups(void)
|
||||||
@ -3255,14 +3255,14 @@ uint32 Database::GetGroupID(const char* name){
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
if (results.RowCount() == 0)
|
||||||
{
|
{
|
||||||
// Commenting this out until logging levels can prevent this from going to console
|
// Commenting this out until logging levels can prevent this from going to console
|
||||||
//logger.Log(EQEmuLogSys::Debug, "Character not in a group: %s", name);
|
//Log.Log(EQEmuLogSys::Debug, "Character not in a group: %s", name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
|||||||
result = QueryDatabase(query);
|
result = QueryDatabase(query);
|
||||||
|
|
||||||
if(!result.Success()) {
|
if(!result.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &ch
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,7 +158,7 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...)
|
|||||||
va_list argptr, tmpargptr;
|
va_list argptr, tmpargptr;
|
||||||
va_start(argptr, fmt);
|
va_start(argptr, fmt);
|
||||||
|
|
||||||
logger.Log(id, vStringFormat(fmt, argptr).c_str());
|
Log.Log(id, vStringFormat(fmt, argptr).c_str());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) {
|
|||||||
|
|
||||||
OpMgr = nullptr;
|
OpMgr = nullptr;
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
|
EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
|
||||||
{
|
{
|
||||||
EQRawApplicationPacket *ap=nullptr;
|
EQRawApplicationPacket *ap=nullptr;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size);
|
||||||
_raw(NET__APP_CREATE_HEX, 0xFFFF, p);
|
_raw(NET__APP_CREATE_HEX, 0xFFFF, p);
|
||||||
ap = p->MakeAppPacket();
|
ap = p->MakeAppPacket();
|
||||||
return ap;
|
return ap;
|
||||||
@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
|
|||||||
EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len)
|
EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len)
|
||||||
{
|
{
|
||||||
EQRawApplicationPacket *ap=nullptr;
|
EQRawApplicationPacket *ap=nullptr;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len);
|
||||||
_hex(NET__APP_CREATE_HEX, buf, len);
|
_hex(NET__APP_CREATE_HEX, buf, len);
|
||||||
ap = new EQRawApplicationPacket(buf, len);
|
ap = new EQRawApplicationPacket(buf, len);
|
||||||
return ap;
|
return ap;
|
||||||
@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) {
|
if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L);
|
||||||
_raw(NET__DEBUG, 0xFFFF, p);
|
_raw(NET__DEBUG, 0xFFFF, p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
while(processed < p->size) {
|
while(processed < p->size) {
|
||||||
subpacket_length=*(p->pBuffer+processed);
|
subpacket_length=*(p->pBuffer+processed);
|
||||||
EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length);
|
EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length);
|
||||||
_raw(NET__NET_CREATE_HEX, 0xFFFF, subp);
|
_raw(NET__NET_CREATE_HEX, 0xFFFF, subp);
|
||||||
subp->copyInfo(p);
|
subp->copyInfo(p);
|
||||||
ProcessPacket(subp);
|
ProcessPacket(subp);
|
||||||
@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
while(processed<p->size) {
|
while(processed<p->size) {
|
||||||
EQRawApplicationPacket *ap=nullptr;
|
EQRawApplicationPacket *ap=nullptr;
|
||||||
if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) {
|
if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
||||||
ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length);
|
ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length);
|
||||||
processed+=subpacket_length+1;
|
processed+=subpacket_length+1;
|
||||||
} else {
|
} else {
|
||||||
subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1));
|
subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
||||||
ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length);
|
ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length);
|
||||||
processed+=subpacket_length+3;
|
processed+=subpacket_length+3;
|
||||||
}
|
}
|
||||||
@ -178,29 +178,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_Packet: {
|
case OP_Packet: {
|
||||||
if(!p->pBuffer || (p->Size() < 4))
|
if(!p->pBuffer || (p->Size() < 4))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||||
SeqOrder check=CompareSequence(NextInSeq,seq);
|
SeqOrder check=CompareSequence(NextInSeq,seq);
|
||||||
if (check == SeqFuture) {
|
if (check == SeqFuture) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||||
_raw(NET__DEBUG, seq, p);
|
_raw(NET__DEBUG, seq, p);
|
||||||
|
|
||||||
PacketQueue[seq]=p->Copy();
|
PacketQueue[seq]=p->Copy();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||||
|
|
||||||
//SendOutOfOrderAck(seq);
|
//SendOutOfOrderAck(seq);
|
||||||
|
|
||||||
} else if (check == SeqPast) {
|
} else if (check == SeqPast) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||||
_raw(NET__DEBUG, seq, p);
|
_raw(NET__DEBUG, seq, p);
|
||||||
SendOutOfOrderAck(seq); //we already got this packet but it was out of order
|
SendOutOfOrderAck(seq); //we already got this packet but it was out of order
|
||||||
} else {
|
} else {
|
||||||
// In case we did queue one before as well.
|
// In case we did queue one before as well.
|
||||||
EQProtocolPacket *qp=RemoveQueue(seq);
|
EQProtocolPacket *qp=RemoveQueue(seq);
|
||||||
if (qp) {
|
if (qp) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq);
|
||||||
delete qp;
|
delete qp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
// Check for an embedded OP_AppCombinded (protocol level 0x19)
|
// Check for an embedded OP_AppCombinded (protocol level 0x19)
|
||||||
if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) {
|
if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) {
|
||||||
EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2);
|
EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size);
|
||||||
_raw(NET__NET_CREATE_HEX, seq, subp);
|
_raw(NET__NET_CREATE_HEX, seq, subp);
|
||||||
subp->copyInfo(p);
|
subp->copyInfo(p);
|
||||||
ProcessPacket(subp);
|
ProcessPacket(subp);
|
||||||
@ -228,29 +228,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_Fragment: {
|
case OP_Fragment: {
|
||||||
if(!p->pBuffer || (p->Size() < 4))
|
if(!p->pBuffer || (p->Size() < 4))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||||
SeqOrder check=CompareSequence(NextInSeq,seq);
|
SeqOrder check=CompareSequence(NextInSeq,seq);
|
||||||
if (check == SeqFuture) {
|
if (check == SeqFuture) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||||
_raw(NET__DEBUG, seq, p);
|
_raw(NET__DEBUG, seq, p);
|
||||||
|
|
||||||
PacketQueue[seq]=p->Copy();
|
PacketQueue[seq]=p->Copy();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size());
|
||||||
|
|
||||||
//SendOutOfOrderAck(seq);
|
//SendOutOfOrderAck(seq);
|
||||||
|
|
||||||
} else if (check == SeqPast) {
|
} else if (check == SeqPast) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||||
_raw(NET__DEBUG, seq, p);
|
_raw(NET__DEBUG, seq, p);
|
||||||
SendOutOfOrderAck(seq);
|
SendOutOfOrderAck(seq);
|
||||||
} else {
|
} else {
|
||||||
// In case we did queue one before as well.
|
// In case we did queue one before as well.
|
||||||
EQProtocolPacket *qp=RemoveQueue(seq);
|
EQProtocolPacket *qp=RemoveQueue(seq);
|
||||||
if (qp) {
|
if (qp) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq);
|
||||||
delete qp;
|
delete qp;
|
||||||
}
|
}
|
||||||
SetNextAckToSend(seq);
|
SetNextAckToSend(seq);
|
||||||
@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
if (oversize_buffer) {
|
if (oversize_buffer) {
|
||||||
memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2);
|
memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2);
|
||||||
oversize_offset+=p->size-2;
|
oversize_offset+=p->size-2;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length);
|
||||||
if (oversize_offset==oversize_length) {
|
if (oversize_offset==oversize_length) {
|
||||||
if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) {
|
if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) {
|
||||||
EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset);
|
EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size);
|
||||||
//_raw(NET__NET_CREATE_HEX, subp);
|
//_raw(NET__NET_CREATE_HEX, subp);
|
||||||
subp->copyInfo(p);
|
subp->copyInfo(p);
|
||||||
ProcessPacket(subp);
|
ProcessPacket(subp);
|
||||||
delete subp;
|
delete subp;
|
||||||
} else {
|
} else {
|
||||||
EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset);
|
EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size);
|
||||||
if (ap) {
|
if (ap) {
|
||||||
ap->copyInfo(p);
|
ap->copyInfo(p);
|
||||||
InboundQueuePush(ap);
|
InboundQueuePush(ap);
|
||||||
@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
oversize_buffer=new unsigned char[oversize_length];
|
oversize_buffer=new unsigned char[oversize_length];
|
||||||
memcpy(oversize_buffer,p->pBuffer+6,p->size-6);
|
memcpy(oversize_buffer,p->pBuffer+6,p->size-6);
|
||||||
oversize_offset=p->size-6;
|
oversize_offset=p->size-6;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_KeepAlive: {
|
case OP_KeepAlive: {
|
||||||
#ifndef COLLECTOR
|
#ifndef COLLECTOR
|
||||||
NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size));
|
NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OP_Ack: {
|
case OP_Ack: {
|
||||||
if(!p->pBuffer || (p->Size() < 4))
|
if(!p->pBuffer || (p->Size() < 4))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef COLLECTOR
|
#ifndef COLLECTOR
|
||||||
@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_SessionRequest: {
|
case OP_SessionRequest: {
|
||||||
if(p->Size() < sizeof(SessionRequest))
|
if(p->Size() < sizeof(SessionRequest))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef COLLECTOR
|
#ifndef COLLECTOR
|
||||||
if (GetState()==ESTABLISHED) {
|
if (GetState()==ESTABLISHED) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts);
|
||||||
|
|
||||||
// client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case
|
// client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case
|
||||||
// streamactive means we identified the opcode for the stream, we cannot re-establish this connection
|
// streamactive means we identified the opcode for the stream, we cannot re-establish this connection
|
||||||
@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
SessionRequest *Request=(SessionRequest *)p->pBuffer;
|
SessionRequest *Request=(SessionRequest *)p->pBuffer;
|
||||||
Session=ntohl(Request->Session);
|
Session=ntohl(Request->Session);
|
||||||
SetMaxLen(ntohl(Request->MaxLength));
|
SetMaxLen(ntohl(Request->MaxLength));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen);
|
||||||
SetState(ESTABLISHED);
|
SetState(ESTABLISHED);
|
||||||
#ifndef COLLECTOR
|
#ifndef COLLECTOR
|
||||||
Key=0x11223344;
|
Key=0x11223344;
|
||||||
@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_SessionResponse: {
|
case OP_SessionResponse: {
|
||||||
if(p->Size() < sizeof(SessionResponse))
|
if(p->Size() < sizeof(SessionResponse))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
compressed=(Response->Format&FLAG_COMPRESSED);
|
compressed=(Response->Format&FLAG_COMPRESSED);
|
||||||
encoded=(Response->Format&FLAG_ENCODED);
|
encoded=(Response->Format&FLAG_ENCODED);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no");
|
||||||
|
|
||||||
// Kinda kludgy, but trie for now
|
// Kinda kludgy, but trie for now
|
||||||
if (StreamType==UnknownStream) {
|
if (StreamType==UnknownStream) {
|
||||||
@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
EQStreamState state = GetState();
|
EQStreamState state = GetState();
|
||||||
if(state == ESTABLISHED) {
|
if(state == ESTABLISHED) {
|
||||||
//client initiated disconnect?
|
//client initiated disconnect?
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L);
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
SetState(CLOSED);
|
SetState(CLOSED);
|
||||||
} else if(state == CLOSING) {
|
} else if(state == CLOSING) {
|
||||||
//we were waiting for this anyways, ignore pending messages, send the reply and be closed.
|
//we were waiting for this anyways, ignore pending messages, send the reply and be closed.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L);
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
SetState(CLOSED);
|
SetState(CLOSED);
|
||||||
} else {
|
} else {
|
||||||
//we are expecting this (or have already gotten it, but dont care either way)
|
//we are expecting this (or have already gotten it, but dont care either way)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L);
|
||||||
SetState(CLOSED);
|
SetState(CLOSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_OutOfOrderAck: {
|
case OP_OutOfOrderAck: {
|
||||||
if(!p->pBuffer || (p->Size() < 4))
|
if(!p->pBuffer || (p->Size() < 4))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef COLLECTOR
|
#ifndef COLLECTOR
|
||||||
@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
MOutboundQueue.lock();
|
MOutboundQueue.lock();
|
||||||
|
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
//if the packet they got out of order is between our last acked packet and the last sent packet, then its valid.
|
//if the packet they got out of order is between our last acked packet and the last sent packet, then its valid.
|
||||||
if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) {
|
if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L,
|
||||||
seq, SequencedBase, SequencedBase+NextSequencedSend);
|
seq, SequencedBase, SequencedBase+NextSequencedSend);
|
||||||
|
|
||||||
bool retransmit_acked_packets = false;
|
bool retransmit_acked_packets = false;
|
||||||
@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
if(!retransmit_acked_packets) {
|
if(!retransmit_acked_packets) {
|
||||||
uint16 sqsize = SequencedQueue.size();
|
uint16 sqsize = SequencedQueue.size();
|
||||||
uint16 index = seq - SequencedBase;
|
uint16 index = seq - SequencedBase;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
|
||||||
if (index < sqsize) {
|
if (index < sqsize) {
|
||||||
std::deque<EQProtocolPacket *>::iterator sitr;
|
std::deque<EQProtocolPacket *>::iterator sitr;
|
||||||
sitr = SequencedQueue.begin();
|
sitr = SequencedQueue.begin();
|
||||||
@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
|
|
||||||
NextSequencedSend = 0;
|
NextSequencedSend = 0;
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
MOutboundQueue.unlock();
|
MOutboundQueue.unlock();
|
||||||
#endif
|
#endif
|
||||||
@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
case OP_SessionStatRequest: {
|
case OP_SessionStatRequest: {
|
||||||
if(p->Size() < sizeof(SessionStats))
|
if(p->Size() < sizeof(SessionStats))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifndef COLLECTOR
|
#ifndef COLLECTOR
|
||||||
SessionStats *Stats=(SessionStats *)p->pBuffer;
|
SessionStats *Stats=(SessionStats *)p->pBuffer;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L,
|
||||||
(unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta),
|
(unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta),
|
||||||
(unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta),
|
(unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta),
|
||||||
(unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta));
|
(unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta));
|
||||||
@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
|||||||
}
|
}
|
||||||
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
|
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
|
||||||
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
|
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OP_SessionStatResponse: {
|
case OP_SessionStatResponse: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OP_OutOfSession: {
|
case OP_OutOfSession: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(OpMgr == nullptr || *OpMgr == nullptr) {
|
if(OpMgr == nullptr || *OpMgr == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L);
|
||||||
delete pack;
|
delete pack;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
|
|
||||||
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
|
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
|
||||||
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
|
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size);
|
||||||
|
|
||||||
unsigned char *tmpbuff=new unsigned char[p->size+3];
|
unsigned char *tmpbuff=new unsigned char[p->size+3];
|
||||||
length=p->serialize(opcode, tmpbuff);
|
length=p->serialize(opcode, tmpbuff);
|
||||||
@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
*(uint32 *)(out->pBuffer+2)=htonl(p->Size());
|
*(uint32 *)(out->pBuffer+2)=htonl(p->Size());
|
||||||
used=MaxLen-10;
|
used=MaxLen-10;
|
||||||
memcpy(out->pBuffer+6,tmpbuff,used);
|
memcpy(out->pBuffer+6,tmpbuff,used);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size());
|
||||||
SequencedPush(out);
|
SequencedPush(out);
|
||||||
|
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
|||||||
out->size=chunksize+2;
|
out->size=chunksize+2;
|
||||||
SequencedPush(out);
|
SequencedPush(out);
|
||||||
used+=chunksize;
|
used+=chunksize;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size);
|
||||||
}
|
}
|
||||||
delete p;
|
delete p;
|
||||||
delete[] tmpbuff;
|
delete[] tmpbuff;
|
||||||
@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p)
|
|||||||
#else
|
#else
|
||||||
MOutboundQueue.lock();
|
MOutboundQueue.lock();
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase);
|
||||||
*(uint16 *)(p->pBuffer)=htons(NextOutSeq);
|
*(uint16 *)(p->pBuffer)=htons(NextOutSeq);
|
||||||
SequencedQueue.push_back(p);
|
SequencedQueue.push_back(p);
|
||||||
NextOutSeq++;
|
NextOutSeq++;
|
||||||
|
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
MOutboundQueue.unlock();
|
MOutboundQueue.unlock();
|
||||||
#endif
|
#endif
|
||||||
@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p)
|
|||||||
delete p;
|
delete p;
|
||||||
#else
|
#else
|
||||||
MOutboundQueue.lock();
|
MOutboundQueue.lock();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size);
|
||||||
NonSequencedQueue.push(p);
|
NonSequencedQueue.push(p);
|
||||||
MOutboundQueue.unlock();
|
MOutboundQueue.unlock();
|
||||||
#endif
|
#endif
|
||||||
@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p)
|
|||||||
void EQStream::SendAck(uint16 seq)
|
void EQStream::SendAck(uint16 seq)
|
||||||
{
|
{
|
||||||
uint16 Seq=htons(seq);
|
uint16 Seq=htons(seq);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq);
|
||||||
SetLastAckSent(seq);
|
SetLastAckSent(seq);
|
||||||
NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16)));
|
NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQStream::SendOutOfOrderAck(uint16 seq)
|
void EQStream::SendOutOfOrderAck(uint16 seq)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq);
|
||||||
uint16 Seq=htons(seq);
|
uint16 Seq=htons(seq);
|
||||||
NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16)));
|
NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16)));
|
||||||
}
|
}
|
||||||
@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
// if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue
|
// if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue
|
||||||
if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend &&
|
if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend &&
|
||||||
(GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) {
|
(GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked "
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked "
|
||||||
"buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend);
|
"buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend);
|
||||||
NextSequencedSend = 0;
|
NextSequencedSend = 0;
|
||||||
retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet
|
retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet
|
||||||
@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd)
|
|||||||
// If we don't have a packet to try to combine into, use this one as the base
|
// If we don't have a packet to try to combine into, use this one as the base
|
||||||
// And remove it form the queue
|
// And remove it form the queue
|
||||||
p = NonSequencedQueue.front();
|
p = NonSequencedQueue.front();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size);
|
||||||
NonSequencedQueue.pop();
|
NonSequencedQueue.pop();
|
||||||
} else if (!p->combine(NonSequencedQueue.front())) {
|
} else if (!p->combine(NonSequencedQueue.front())) {
|
||||||
// Tryint to combine this packet with the base didn't work (too big maybe)
|
// Tryint to combine this packet with the base didn't work (too big maybe)
|
||||||
// So just send the base packet (we'll try this packet again later)
|
// So just send the base packet (we'll try this packet again later)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size);
|
||||||
ReadyToSend.push(p);
|
ReadyToSend.push(p);
|
||||||
BytesWritten+=p->size;
|
BytesWritten+=p->size;
|
||||||
p=nullptr;
|
p=nullptr;
|
||||||
|
|
||||||
if (BytesWritten > threshold) {
|
if (BytesWritten > threshold) {
|
||||||
// Sent enough this round, lets stop to be fair
|
// Sent enough this round, lets stop to be fair
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Combine worked, so just remove this packet and it's spot in the queue
|
// Combine worked, so just remove this packet and it's spot in the queue
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size);
|
||||||
delete NonSequencedQueue.front();
|
delete NonSequencedQueue.front();
|
||||||
NonSequencedQueue.pop();
|
NonSequencedQueue.pop();
|
||||||
}
|
}
|
||||||
@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd)
|
|||||||
|
|
||||||
if (sitr!=SequencedQueue.end()) {
|
if (sitr!=SequencedQueue.end()) {
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging...
|
uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging...
|
||||||
|
|
||||||
if(SequencedQueue.empty()) {
|
if(SequencedQueue.empty()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
||||||
SeqEmpty=true;
|
SeqEmpty=true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) {
|
||||||
if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) {
|
if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
|
||||||
sitr++;
|
sitr++;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
} else if (!p) {
|
} else if (!p) {
|
||||||
// If we don't have a packet to try to combine into, use this one as the base
|
// If we don't have a packet to try to combine into, use this one as the base
|
||||||
// Copy it first as it will still live until it is acked
|
// Copy it first as it will still live until it is acked
|
||||||
p=(*sitr)->Copy();
|
p=(*sitr)->Copy();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||||
++sitr;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
} else if (!p->combine(*sitr)) {
|
} else if (!p->combine(*sitr)) {
|
||||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||||
// So just send the base packet (we'll try this packet again later)
|
// So just send the base packet (we'll try this packet again later)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
||||||
ReadyToSend.push(p);
|
ReadyToSend.push(p);
|
||||||
BytesWritten+=p->size;
|
BytesWritten+=p->size;
|
||||||
p=nullptr;
|
p=nullptr;
|
||||||
|
|
||||||
if (BytesWritten > threshold) {
|
if (BytesWritten > threshold) {
|
||||||
// Sent enough this round, lets stop to be fair
|
// Sent enough this round, lets stop to be fair
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Combine worked
|
// Combine worked
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||||
++sitr;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
}
|
}
|
||||||
@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd)
|
|||||||
// If we don't have a packet to try to combine into, use this one as the base
|
// If we don't have a packet to try to combine into, use this one as the base
|
||||||
// Copy it first as it will still live until it is acked
|
// Copy it first as it will still live until it is acked
|
||||||
p=(*sitr)->Copy();
|
p=(*sitr)->Copy();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||||
++sitr;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
} else if (!p->combine(*sitr)) {
|
} else if (!p->combine(*sitr)) {
|
||||||
// Trying to combine this packet with the base didn't work (too big maybe)
|
// Trying to combine this packet with the base didn't work (too big maybe)
|
||||||
// So just send the base packet (we'll try this packet again later)
|
// So just send the base packet (we'll try this packet again later)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
||||||
ReadyToSend.push(p);
|
ReadyToSend.push(p);
|
||||||
BytesWritten+=p->size;
|
BytesWritten+=p->size;
|
||||||
p=nullptr;
|
p=nullptr;
|
||||||
|
|
||||||
if (BytesWritten > threshold) {
|
if (BytesWritten > threshold) {
|
||||||
// Sent enough this round, lets stop to be fair
|
// Sent enough this round, lets stop to be fair
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Combine worked
|
// Combine worked
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||||
++sitr;
|
++sitr;
|
||||||
NextSequencedSend++;
|
NextSequencedSend++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No more sequenced packets
|
// No more sequenced packets
|
||||||
@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
|
|
||||||
// We have a packet still, must have run out of both seq and non-seq, so send it
|
// We have a packet still, must have run out of both seq and non-seq, so send it
|
||||||
if (p) {
|
if (p) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||||
ReadyToSend.push(p);
|
ReadyToSend.push(p);
|
||||||
BytesWritten+=p->size;
|
BytesWritten+=p->size;
|
||||||
}
|
}
|
||||||
@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd)
|
|||||||
if(SeqEmpty && NonSeqEmpty) {
|
if(SeqEmpty && NonSeqEmpty) {
|
||||||
//no more data to send
|
//no more data to send
|
||||||
if(CheckState(CLOSING)) {
|
if(CheckState(CLOSING)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L );
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L );
|
||||||
//we are waiting for the queues to empty, now we can do our disconnect.
|
//we are waiting for the queues to empty, now we can do our disconnect.
|
||||||
//this packet will not actually go out until the next call to Write().
|
//this packet will not actually go out until the next call to Write().
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses
|
|||||||
|
|
||||||
out->size=sizeof(SessionResponse);
|
out->size=sizeof(SessionResponse);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L,
|
||||||
(unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no");
|
(unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no");
|
||||||
|
|
||||||
NonSequencedPush(out);
|
NonSequencedPush(out);
|
||||||
@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess
|
|||||||
Request->Session=htonl(time(nullptr));
|
Request->Session=htonl(time(nullptr));
|
||||||
Request->MaxLength=htonl(512);
|
Request->MaxLength=htonl(512);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
|
||||||
|
|
||||||
NonSequencedPush(out);
|
NonSequencedPush(out);
|
||||||
}
|
}
|
||||||
@ -932,7 +932,7 @@ void EQStream::_SendDisconnect()
|
|||||||
*(uint32 *)out->pBuffer=htonl(Session);
|
*(uint32 *)out->pBuffer=htonl(Session);
|
||||||
NonSequencedPush(out);
|
NonSequencedPush(out);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQStream::InboundQueuePush(EQRawApplicationPacket *p)
|
void EQStream::InboundQueuePush(EQRawApplicationPacket *p)
|
||||||
@ -959,7 +959,7 @@ EQRawApplicationPacket *p=nullptr;
|
|||||||
if(OpMgr != nullptr && *OpMgr != nullptr) {
|
if(OpMgr != nullptr && *OpMgr != nullptr) {
|
||||||
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
||||||
if (emu_op == OP_Unknown) {
|
if (emu_op == OP_Unknown) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->SetOpcode(emu_op);
|
p->SetOpcode(emu_op);
|
||||||
@ -986,7 +986,7 @@ EQRawApplicationPacket *p=nullptr;
|
|||||||
if(OpMgr != nullptr && *OpMgr != nullptr) {
|
if(OpMgr != nullptr && *OpMgr != nullptr) {
|
||||||
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
||||||
if(emu_op == OP_Unknown) {
|
if(emu_op == OP_Unknown) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->SetOpcode(emu_op);
|
p->SetOpcode(emu_op);
|
||||||
@ -1014,7 +1014,7 @@ void EQStream::InboundQueueClear()
|
|||||||
{
|
{
|
||||||
EQApplicationPacket *p=nullptr;
|
EQApplicationPacket *p=nullptr;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L);
|
||||||
|
|
||||||
MInboundQueue.lock();
|
MInboundQueue.lock();
|
||||||
if (!InboundQueue.empty()) {
|
if (!InboundQueue.empty()) {
|
||||||
@ -1057,7 +1057,7 @@ void EQStream::OutboundQueueClear()
|
|||||||
{
|
{
|
||||||
EQProtocolPacket *p=nullptr;
|
EQProtocolPacket *p=nullptr;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L);
|
||||||
|
|
||||||
MOutboundQueue.lock();
|
MOutboundQueue.lock();
|
||||||
while(!NonSequencedQueue.empty()) {
|
while(!NonSequencedQueue.empty()) {
|
||||||
@ -1079,7 +1079,7 @@ void EQStream::PacketQueueClear()
|
|||||||
{
|
{
|
||||||
EQProtocolPacket *p=nullptr;
|
EQProtocolPacket *p=nullptr;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L);
|
||||||
|
|
||||||
if(!PacketQueue.empty()) {
|
if(!PacketQueue.empty()) {
|
||||||
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
|
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
|
||||||
@ -1111,7 +1111,7 @@ uint32 newlength=0;
|
|||||||
delete p;
|
delete p;
|
||||||
ProcessQueue();
|
ProcessQueue();
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L);
|
||||||
_hex(NET__NET_CREATE_HEX, buffer, length);
|
_hex(NET__NET_CREATE_HEX, buffer, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1141,33 +1141,33 @@ std::deque<EQProtocolPacket *>::iterator itr, tmp;
|
|||||||
MOutboundQueue.lock();
|
MOutboundQueue.lock();
|
||||||
//do a bit of sanity checking.
|
//do a bit of sanity checking.
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
SeqOrder ord = CompareSequence(SequencedBase, seq);
|
SeqOrder ord = CompareSequence(SequencedBase, seq);
|
||||||
if(ord == SeqInOrder) {
|
if(ord == SeqInOrder) {
|
||||||
//they are not acking anything new...
|
//they are not acking anything new...
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq);
|
||||||
} else if(ord == SeqPast) {
|
} else if(ord == SeqPast) {
|
||||||
//they are nacking blocks going back before our buffer, wtf?
|
//they are nacking blocks going back before our buffer, wtf?
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase);
|
||||||
|
|
||||||
|
|
||||||
//this is a good ack, we get to ack some blocks.
|
//this is a good ack, we get to ack some blocks.
|
||||||
seq++; //we stop at the block right after their ack, counting on the wrap of both numbers.
|
seq++; //we stop at the block right after their ack, counting on the wrap of both numbers.
|
||||||
while(SequencedBase != seq) {
|
while(SequencedBase != seq) {
|
||||||
if(SequencedQueue.empty()) {
|
if(SequencedQueue.empty()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend);
|
||||||
SequencedBase = NextOutSeq;
|
SequencedBase = NextOutSeq;
|
||||||
NextSequencedSend = 0;
|
NextSequencedSend = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend);
|
||||||
//clean out the acked packet
|
//clean out the acked packet
|
||||||
delete SequencedQueue.front();
|
delete SequencedQueue.front();
|
||||||
SequencedQueue.pop_front();
|
SequencedQueue.pop_front();
|
||||||
@ -1178,10 +1178,10 @@ logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKE
|
|||||||
SequencedBase++;
|
SequencedBase++;
|
||||||
}
|
}
|
||||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||||
}
|
}
|
||||||
if(NextSequencedSend > SequencedQueue.size()) {
|
if(NextSequencedSend > SequencedQueue.size()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1191,7 +1191,7 @@ if(NextSequencedSend > SequencedQueue.size()) {
|
|||||||
void EQStream::SetNextAckToSend(uint32 seq)
|
void EQStream::SetNextAckToSend(uint32 seq)
|
||||||
{
|
{
|
||||||
MAcks.lock();
|
MAcks.lock();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq);
|
||||||
NextAckToSend=seq;
|
NextAckToSend=seq;
|
||||||
MAcks.unlock();
|
MAcks.unlock();
|
||||||
}
|
}
|
||||||
@ -1199,7 +1199,7 @@ void EQStream::SetNextAckToSend(uint32 seq)
|
|||||||
void EQStream::SetLastAckSent(uint32 seq)
|
void EQStream::SetLastAckSent(uint32 seq)
|
||||||
{
|
{
|
||||||
MAcks.lock();
|
MAcks.lock();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq);
|
||||||
LastAckSent=seq;
|
LastAckSent=seq;
|
||||||
MAcks.unlock();
|
MAcks.unlock();
|
||||||
}
|
}
|
||||||
@ -1212,10 +1212,10 @@ void EQStream::ProcessQueue()
|
|||||||
|
|
||||||
EQProtocolPacket *qp=nullptr;
|
EQProtocolPacket *qp=nullptr;
|
||||||
while((qp=RemoveQueue(NextInSeq))!=nullptr) {
|
while((qp=RemoveQueue(NextInSeq))!=nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq);
|
||||||
ProcessPacket(qp);
|
ProcessPacket(qp);
|
||||||
delete qp;
|
delete qp;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1226,21 +1226,21 @@ EQProtocolPacket *qp=nullptr;
|
|||||||
if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) {
|
if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) {
|
||||||
qp=itr->second;
|
qp=itr->second;
|
||||||
PacketQueue.erase(itr);
|
PacketQueue.erase(itr);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||||
}
|
}
|
||||||
return qp;
|
return qp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EQStream::SetStreamType(EQStreamType type)
|
void EQStream::SetStreamType(EQStreamType type)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type));
|
||||||
StreamType=type;
|
StreamType=type;
|
||||||
switch (StreamType) {
|
switch (StreamType) {
|
||||||
case LoginStream:
|
case LoginStream:
|
||||||
app_opcode_size=1;
|
app_opcode_size=1;
|
||||||
compressed=false;
|
compressed=false;
|
||||||
encoded=false;
|
encoded=false;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size);
|
||||||
break;
|
break;
|
||||||
case ChatOrMailStream:
|
case ChatOrMailStream:
|
||||||
case ChatStream:
|
case ChatStream:
|
||||||
@ -1248,7 +1248,7 @@ void EQStream::SetStreamType(EQStreamType type)
|
|||||||
app_opcode_size=1;
|
app_opcode_size=1;
|
||||||
compressed=false;
|
compressed=false;
|
||||||
encoded=true;
|
encoded=true;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size);
|
||||||
break;
|
break;
|
||||||
case ZoneStream:
|
case ZoneStream:
|
||||||
case WorldStream:
|
case WorldStream:
|
||||||
@ -1256,7 +1256,7 @@ void EQStream::SetStreamType(EQStreamType type)
|
|||||||
app_opcode_size=2;
|
app_opcode_size=2;
|
||||||
compressed=true;
|
compressed=true;
|
||||||
encoded=false;
|
encoded=false;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1306,7 +1306,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq)
|
|||||||
|
|
||||||
void EQStream::SetState(EQStreamState state) {
|
void EQStream::SetState(EQStreamState state) {
|
||||||
MState.lock();
|
MState.lock();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state);
|
||||||
State=state;
|
State=state;
|
||||||
MState.unlock();
|
MState.unlock();
|
||||||
}
|
}
|
||||||
@ -1318,29 +1318,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) {
|
|||||||
|
|
||||||
EQStreamState orig_state = GetState();
|
EQStreamState orig_state = GetState();
|
||||||
if (orig_state == CLOSING && !outgoing_data) {
|
if (orig_state == CLOSING && !outgoing_data) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L);
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
SetState(DISCONNECTING);
|
SetState(DISCONNECTING);
|
||||||
} else if (LastPacket && (now-LastPacket) > timeout) {
|
} else if (LastPacket && (now-LastPacket) > timeout) {
|
||||||
switch(orig_state) {
|
switch(orig_state) {
|
||||||
case CLOSING:
|
case CLOSING:
|
||||||
//if we time out in the closing state, they are not acking us, just give up
|
//if we time out in the closing state, they are not acking us, just give up
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L);
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
SetState(CLOSED);
|
SetState(CLOSED);
|
||||||
break;
|
break;
|
||||||
case DISCONNECTING:
|
case DISCONNECTING:
|
||||||
//we timed out waiting for them to send us the disconnect reply, just give up.
|
//we timed out waiting for them to send us the disconnect reply, just give up.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L);
|
||||||
SetState(CLOSED);
|
SetState(CLOSED);
|
||||||
break;
|
break;
|
||||||
case CLOSED:
|
case CLOSED:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L);
|
||||||
break;
|
break;
|
||||||
case ESTABLISHED:
|
case ESTABLISHED:
|
||||||
//we timed out during normal operation. Try to be nice about it.
|
//we timed out during normal operation. Try to be nice about it.
|
||||||
//we will almost certainly time out again waiting for the disconnect reply, but oh well.
|
//we will almost certainly time out again waiting for the disconnect reply, but oh well.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L);
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
SetState(DISCONNECTING);
|
SetState(DISCONNECTING);
|
||||||
break;
|
break;
|
||||||
@ -1369,11 +1369,11 @@ void EQStream::AdjustRates(uint32 average_delta)
|
|||||||
MRate.lock();
|
MRate.lock();
|
||||||
RateThreshold=RATEBASE/average_delta;
|
RateThreshold=RATEBASE/average_delta;
|
||||||
DecayRate=DECAYBASE/average_delta;
|
DecayRate=DECAYBASE/average_delta;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||||
RateThreshold, DecayRate, average_delta);
|
RateThreshold, DecayRate, average_delta);
|
||||||
MRate.unlock();
|
MRate.unlock();
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L,
|
||||||
average_delta, AVERAGE_DELTA_MAX);
|
average_delta, AVERAGE_DELTA_MAX);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1381,7 +1381,7 @@ void EQStream::AdjustRates(uint32 average_delta)
|
|||||||
MRate.lock();
|
MRate.lock();
|
||||||
RateThreshold=RATEBASE/average_delta;
|
RateThreshold=RATEBASE/average_delta;
|
||||||
DecayRate=DECAYBASE/average_delta;
|
DecayRate=DECAYBASE/average_delta;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||||
RateThreshold, DecayRate, average_delta);
|
RateThreshold, DecayRate, average_delta);
|
||||||
MRate.unlock();
|
MRate.unlock();
|
||||||
}
|
}
|
||||||
@ -1391,12 +1391,12 @@ void EQStream::AdjustRates(uint32 average_delta)
|
|||||||
void EQStream::Close() {
|
void EQStream::Close() {
|
||||||
if(HasOutgoingData()) {
|
if(HasOutgoingData()) {
|
||||||
//there is pending data, wait for it to go out.
|
//there is pending data, wait for it to go out.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L);
|
||||||
SetState(CLOSING);
|
SetState(CLOSING);
|
||||||
} else {
|
} else {
|
||||||
//otherwise, we are done, we can drop immediately.
|
//otherwise, we are done, we can drop immediately.
|
||||||
_SendDisconnect();
|
_SendDisconnect();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L);
|
||||||
SetState(DISCONNECTING);
|
SetState(DISCONNECTING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1424,19 +1424,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) {
|
|||||||
} else if(p->opcode == sig->first_eq_opcode) {
|
} else if(p->opcode == sig->first_eq_opcode) {
|
||||||
//opcode matches, check length..
|
//opcode matches, check length..
|
||||||
if(p->size == sig->first_length) {
|
if(p->size == sig->first_length) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
|
||||||
res = MatchSuccessful;
|
res = MatchSuccessful;
|
||||||
} else if(sig->first_length == 0) {
|
} else if(sig->first_length == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size);
|
||||||
res = MatchSuccessful;
|
res = MatchSuccessful;
|
||||||
} else {
|
} else {
|
||||||
//opcode matched but length did not.
|
//opcode matched but length did not.
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length);
|
||||||
res = MatchFailed;
|
res = MatchFailed;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//first opcode did not match..
|
//first opcode did not match..
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode);
|
||||||
res = MatchFailed;
|
res = MatchFailed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs)
|
|||||||
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
|
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fs->ReaderLoop();
|
fs->ReaderLoop();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
THREAD_RETURN(nullptr);
|
THREAD_RETURN(nullptr);
|
||||||
@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs)
|
|||||||
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
|
EQStreamFactory *fs=(EQStreamFactory *)eqfs;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fs->WriterLoop();
|
fs->WriterLoop();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
THREAD_RETURN(nullptr);
|
THREAD_RETURN(nullptr);
|
||||||
|
|||||||
@ -46,7 +46,7 @@ void EQStreamIdentifier::Process() {
|
|||||||
//first see if this stream has expired
|
//first see if this stream has expired
|
||||||
if(r->expire.Check(false)) {
|
if(r->expire.Check(false)) {
|
||||||
//this stream has failed to match any pattern in our timeframe.
|
//this stream has failed to match any pattern in our timeframe.
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
|
||||||
r->stream->ReleaseFromUse();
|
r->stream->ReleaseFromUse();
|
||||||
delete r;
|
delete r;
|
||||||
cur = m_streams.erase(cur);
|
cur = m_streams.erase(cur);
|
||||||
@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() {
|
|||||||
}
|
}
|
||||||
if(r->stream->GetState() != ESTABLISHED) {
|
if(r->stream->GetState() != ESTABLISHED) {
|
||||||
//the stream closed before it was identified.
|
//the stream closed before it was identified.
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
|
||||||
switch(r->stream->GetState())
|
switch(r->stream->GetState())
|
||||||
{
|
{
|
||||||
case ESTABLISHED:
|
case ESTABLISHED:
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established");
|
||||||
break;
|
break;
|
||||||
case CLOSING:
|
case CLOSING:
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing");
|
||||||
break;
|
break;
|
||||||
case DISCONNECTING:
|
case DISCONNECTING:
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting");
|
||||||
break;
|
break;
|
||||||
case CLOSED:
|
case CLOSED:
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
r->stream->ReleaseFromUse();
|
r->stream->ReleaseFromUse();
|
||||||
@ -103,13 +103,13 @@ void EQStreamIdentifier::Process() {
|
|||||||
switch(res) {
|
switch(res) {
|
||||||
case EQStream::MatchNotReady:
|
case EQStream::MatchNotReady:
|
||||||
//the stream has not received enough packets to compare with this signature
|
//the stream has not received enough packets to compare with this signature
|
||||||
// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
|
// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
|
||||||
all_ready = false;
|
all_ready = false;
|
||||||
break;
|
break;
|
||||||
case EQStream::MatchSuccessful: {
|
case EQStream::MatchSuccessful: {
|
||||||
//yay, a match.
|
//yay, a match.
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
|
||||||
|
|
||||||
// before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further
|
// before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further
|
||||||
r->stream->SetActive(true);
|
r->stream->SetActive(true);
|
||||||
@ -123,7 +123,7 @@ void EQStreamIdentifier::Process() {
|
|||||||
}
|
}
|
||||||
case EQStream::MatchFailed:
|
case EQStream::MatchFailed:
|
||||||
//do nothing...
|
//do nothing...
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ void EQStreamIdentifier::Process() {
|
|||||||
//if we checked all patches and did not find a match.
|
//if we checked all patches and did not find a match.
|
||||||
if(all_ready && !found_one) {
|
if(all_ready && !found_one) {
|
||||||
//the stream cannot be identified.
|
//the stream cannot be identified.
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()));
|
||||||
r->stream->ReleaseFromUse();
|
r->stream->ReleaseFromUse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ private:
|
|||||||
void ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message);
|
void ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern EQEmuLogSys logger;
|
extern EQEmuLogSys Log;
|
||||||
|
|
||||||
/* If you add to this, make sure you update LogCategory */
|
/* If you add to this, make sure you update LogCategory */
|
||||||
static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = {
|
static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = {
|
||||||
|
|||||||
@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename)
|
|||||||
of.open(filename);
|
of.open(filename);
|
||||||
if(!of)
|
if(!of)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename);
|
Log.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//Enable for debugging
|
//Enable for debugging
|
||||||
@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename)
|
|||||||
in.open(filename);
|
in.open(filename);
|
||||||
if(!in)
|
if(!in)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename);
|
Log.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
in >> version;
|
in >> version;
|
||||||
in.ignore(80, '\n');
|
in.ignore(80, '\n');
|
||||||
if(version != EQT_VERSION)
|
if(version != EQT_VERSION)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION);
|
Log.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//in >> eqTime.start_eqtime.day;
|
//in >> eqTime.start_eqtime.day;
|
||||||
|
|||||||
@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() {
|
|||||||
ClearGuilds();
|
ClearGuilds();
|
||||||
|
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object.");
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() {
|
|||||||
uint8 rankn = atoi(row[1]);
|
uint8 rankn = atoi(row[1]);
|
||||||
|
|
||||||
if(rankn > GUILD_MAX_RANK) {
|
if(rankn > GUILD_MAX_RANK) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = m_guilds.find(guild_id);
|
res = m_guilds.find(guild_id);
|
||||||
if(res == m_guilds.end()) {
|
if(res == m_guilds.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() {
|
|||||||
|
|
||||||
bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
if (results.RowCount() == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
|||||||
uint8 rankn = atoi(row[1]);
|
uint8 rankn = atoi(row[1]);
|
||||||
|
|
||||||
if(rankn > GUILD_MAX_RANK) {
|
if(rankn > GUILD_MAX_RANK) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
|||||||
rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false;
|
rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con
|
|||||||
|
|
||||||
bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||||
res = m_guilds.find(guild_id);
|
res = m_guilds.find(guild_id);
|
||||||
if(res == m_guilds.end()) {
|
if(res == m_guilds.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
GuildInfo *info = res->second;
|
GuildInfo *info = res->second;
|
||||||
@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
|||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
//clear out old `guild_ranks` entries
|
//clear out old `guild_ranks` entries
|
||||||
query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
|
query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
|
||||||
results = m_db->QueryDatabase(query);
|
results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
//escape our strings.
|
//escape our strings.
|
||||||
char *name_esc = new char[info->name.length()*2+1];
|
char *name_esc = new char[info->name.length()*2+1];
|
||||||
@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(name_esc);
|
safe_delete_array(name_esc);
|
||||||
safe_delete_array(motd_esc);
|
safe_delete_array(motd_esc);
|
||||||
safe_delete_array(motd_set_esc);
|
safe_delete_array(motd_set_esc);
|
||||||
@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(title_esc);
|
safe_delete_array(title_esc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
safe_delete_array(title_esc);
|
safe_delete_array(title_esc);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 BaseGuildManager::_GetFreeGuildID() {
|
uint32 BaseGuildManager::_GetFreeGuildID() {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object.");
|
||||||
return(GUILD_NONE);
|
return(GUILD_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,18 +337,18 @@ uint32 BaseGuildManager::_GetFreeGuildID() {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
if (results.RowCount() == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested.");
|
||||||
return GUILD_NONE;
|
return GUILD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) {
|
|||||||
|
|
||||||
//now store the resulting guild setup into the DB.
|
//now store the resulting guild setup into the DB.
|
||||||
if(!_StoreGuildDB(new_id)) {
|
if(!_StoreGuildDB(new_id)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal.");
|
||||||
return(GUILD_NONE);
|
return(GUILD_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id);
|
||||||
|
|
||||||
return(new_id);
|
return(new_id);
|
||||||
}
|
}
|
||||||
@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
|
|||||||
query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id);
|
query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id);
|
||||||
QueryWithLogging(query, "deleting guild bank");
|
QueryWithLogging(query, "deleting guild bank");
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id);
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success());
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name);
|
||||||
|
|
||||||
info->name = name; //update our local record.
|
info->name = name; //update our local record.
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
|||||||
|
|
||||||
bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
|||||||
if(!DBSetGuildRank(leader, GUILD_LEADER))
|
if(!DBSetGuildRank(leader, GUILD_LEADER))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader);
|
||||||
|
|
||||||
info->leader_char_id = leader; //update our local record.
|
info->leader_char_id = leader; //update our local record.
|
||||||
|
|
||||||
@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
|||||||
|
|
||||||
bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) {
|
bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
safe_delete_array(esc_set);
|
safe_delete_array(esc_set);
|
||||||
return false;
|
return false;
|
||||||
@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c
|
|||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
safe_delete_array(esc_set);
|
safe_delete_array(esc_set);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id);
|
||||||
|
|
||||||
info->motd = motd; //update our local record.
|
info->motd = motd; //update our local record.
|
||||||
info->motd_setter = setter; //update our local record.
|
info->motd_setter = setter; //update our local record.
|
||||||
@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL)
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID);
|
||||||
|
|
||||||
info->url = URL; //update our local record.
|
info->url = URL; //update our local record.
|
||||||
|
|
||||||
@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID);
|
||||||
|
|
||||||
info->channel = Channel; //update our local record.
|
info->channel = Channel; //update our local record.
|
||||||
|
|
||||||
@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
|
|||||||
|
|
||||||
bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
|||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
|||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID)
|
|||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID)
|
|||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
|
|||||||
std::string query = StringFormat(GuildMemberBaseQuery " WHERE g.guild_id=%d", guild_id);
|
std::string query = StringFormat(GuildMemberBaseQuery " WHERE g.guild_id=%d", guild_id);
|
||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
|
|||||||
members.push_back(ci);
|
members.push_back(ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived entire guild member list for guild %d from the database", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived entire guild member list for guild %d from the database", guild_id);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %s when we have no database object.", char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %s when we have no database object.", char_name);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -969,7 +969,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
|||||||
safe_delete_array(esc);
|
safe_delete_array(esc);
|
||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
|||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
ProcessGuildMember(row, into);
|
ProcessGuildMember(row, into);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
|||||||
|
|
||||||
bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
||||||
if(m_db == nullptr) {
|
if(m_db == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
|||||||
#endif
|
#endif
|
||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
|||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
ProcessGuildMember(row, into);
|
ProcessGuildMember(row, into);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const {
|
|||||||
|
|
||||||
bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const {
|
bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const {
|
||||||
if(guild_id == GUILD_NONE) {
|
if(guild_id == GUILD_NONE) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||||
res = m_guilds.find(guild_id);
|
res = m_guilds.find(guild_id);
|
||||||
if(res == m_guilds.end()) {
|
if(res == m_guilds.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id);
|
||||||
return(false); //invalid guild
|
return(false); //invalid guild
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id);
|
||||||
return(char_id == res->second->leader_char_id);
|
return(char_id == res->second->leader_char_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha
|
|||||||
|
|
||||||
bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
|
bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
|
||||||
if(status >= 250) {
|
if(status >= 250) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status);
|
||||||
return(true); //250+ as allowed anything
|
return(true); //250+ as allowed anything
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||||
res = m_guilds.find(guild_id);
|
res = m_guilds.find(guild_id);
|
||||||
if(res == m_guilds.end()) {
|
if(res == m_guilds.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status);
|
||||||
return(false); //invalid guild
|
return(false); //invalid guild
|
||||||
}
|
}
|
||||||
|
|
||||||
bool granted = (res->second->minstatus <= status);
|
bool granted = (res->second->minstatus <= status);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s",
|
||||||
res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied");
|
res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied");
|
||||||
|
|
||||||
return(granted);
|
return(granted);
|
||||||
@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
|
|||||||
|
|
||||||
bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const {
|
bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const {
|
||||||
if(rank > GUILD_MAX_RANK) {
|
if(rank > GUILD_MAX_RANK) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.",
|
||||||
guild_id, rank, GuildActionNames[act], act);
|
guild_id, rank, GuildActionNames[act], act);
|
||||||
return(false); //invalid rank
|
return(false); //invalid rank
|
||||||
}
|
}
|
||||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||||
res = m_guilds.find(guild_id);
|
res = m_guilds.find(guild_id);
|
||||||
if(res == m_guilds.end()) {
|
if(res == m_guilds.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.",
|
||||||
guild_id, rank, GuildActionNames[act], act);
|
guild_id, rank, GuildActionNames[act], act);
|
||||||
return(false); //invalid guild
|
return(false); //invalid guild
|
||||||
}
|
}
|
||||||
|
|
||||||
bool granted = res->second->ranks[rank].permissions[act];
|
bool granted = res->second->ranks[rank].permissions[act];
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s",
|
||||||
res->second->name.c_str(), guild_id,
|
res->second->name.c_str(), guild_id,
|
||||||
res->second->ranks[rank].name.c_str(), rank,
|
res->second->ranks[rank].name.c_str(), rank,
|
||||||
GuildActionNames[act], act,
|
GuildActionNames[act], act,
|
||||||
@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
|
|||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result == INVALID_INDEX) {
|
if (result == INVALID_INDEX) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
|
Log.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
|
||||||
Inventory::MarkDirty(inst); // Slot not found, clean up
|
Inventory::MarkDirty(inst); // Slot not found, clean up
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
#define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \
|
#define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \
|
||||||
if(Packet->size != sizeof(StructName)) \
|
if(Packet->size != sizeof(StructName)) \
|
||||||
{ \
|
{ \
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \
|
||||||
DumpPacket(Packet); \
|
DumpPacket(Packet); \
|
||||||
return; \
|
return; \
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ namespace RoF
|
|||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ namespace RoF
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
@ -93,10 +93,10 @@ namespace RoF
|
|||||||
opfile += name;
|
opfile += name;
|
||||||
opfile += ".conf";
|
opfile += ".conf";
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ namespace RoF
|
|||||||
|
|
||||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -551,7 +551,7 @@ namespace RoF
|
|||||||
|
|
||||||
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
||||||
|
|
||||||
delete in;
|
delete in;
|
||||||
@ -585,13 +585,13 @@ namespace RoF
|
|||||||
safe_delete_array(Serialized);
|
safe_delete_array(Serialized);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
delete[] __emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
@ -952,16 +952,16 @@ namespace RoF
|
|||||||
|
|
||||||
ENCODE(OP_GroupUpdate)
|
ENCODE(OP_GroupUpdate)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
||||||
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
||||||
{
|
{
|
||||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -979,7 +979,7 @@ namespace RoF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//if(gjs->action == groupActLeave)
|
//if(gjs->action == groupActLeave)
|
||||||
// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -996,19 +996,19 @@ namespace RoF
|
|||||||
if (in->size == sizeof(GroupUpdate2_Struct))
|
if (in->size == sizeof(GroupUpdate2_Struct))
|
||||||
{
|
{
|
||||||
// Group Update2
|
// Group Update2
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
||||||
|
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
unsigned char *__emu_buffer = in->pBuffer;
|
||||||
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
||||||
|
|
||||||
int MemberCount = 1;
|
int MemberCount = 1;
|
||||||
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||||
if (gu2->membername[i][0] != '\0')
|
if (gu2->membername[i][0] != '\0')
|
||||||
{
|
{
|
||||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||||
@ -1016,7 +1016,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
||||||
|
|
||||||
@ -1078,7 +1078,7 @@ namespace RoF
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||||
|
|
||||||
@ -1386,7 +1386,7 @@ namespace RoF
|
|||||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
||||||
|
|
||||||
if (!serialized) {
|
if (!serialized) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2556,7 +2556,7 @@ namespace RoF
|
|||||||
|
|
||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||||
|
|
||||||
unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
||||||
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
||||||
@ -3321,7 +3321,7 @@ namespace RoF
|
|||||||
|
|
||||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3654,16 +3654,16 @@ namespace RoF
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
||||||
|
|
||||||
emu = (Spawn_Struct *)__emu_buffer;
|
emu = (Spawn_Struct *)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
||||||
|
|
||||||
char *Buffer = (char *)in->pBuffer, *BufferStart;
|
char *Buffer = (char *)in->pBuffer, *BufferStart;
|
||||||
|
|
||||||
@ -3902,9 +3902,9 @@ namespace RoF
|
|||||||
Buffer += 29;
|
Buffer += 29;
|
||||||
if (Buffer != (BufferStart + PacketSize))
|
if (Buffer != (BufferStart + PacketSize))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
||||||
}
|
}
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size);
|
||||||
//_hex(NET__ERROR, outapp->pBuffer, outapp->size);
|
//_hex(NET__ERROR, outapp->pBuffer, outapp->size);
|
||||||
dest->FastQueuePacket(&outapp, ack_req);
|
dest->FastQueuePacket(&outapp, ack_req);
|
||||||
}
|
}
|
||||||
@ -4298,7 +4298,7 @@ namespace RoF
|
|||||||
DECODE(OP_GroupDisband)
|
DECODE(OP_GroupDisband)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
||||||
@ -4312,7 +4312,7 @@ namespace RoF
|
|||||||
DECODE(OP_GroupFollow)
|
DECODE(OP_GroupFollow)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -4326,7 +4326,7 @@ namespace RoF
|
|||||||
DECODE(OP_GroupFollow2)
|
DECODE(OP_GroupFollow2)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -4340,7 +4340,7 @@ namespace RoF
|
|||||||
DECODE(OP_GroupInvite)
|
DECODE(OP_GroupInvite)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
||||||
@ -4353,7 +4353,7 @@ namespace RoF
|
|||||||
|
|
||||||
DECODE(OP_GroupInvite2)
|
DECODE(OP_GroupInvite2)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
||||||
DECODE_FORWARD(OP_GroupInvite);
|
DECODE_FORWARD(OP_GroupInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4497,8 +4497,8 @@ namespace RoF
|
|||||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||||
emu->from_slot = RoFToServerSlot(eq->from_slot);
|
emu->from_slot = RoFToServerSlot(eq->from_slot);
|
||||||
emu->to_slot = RoFToServerSlot(eq->to_slot);
|
emu->to_slot = RoFToServerSlot(eq->to_slot);
|
||||||
IN(number_in_stack);
|
IN(number_in_stack);
|
||||||
@ -4827,7 +4827,7 @@ namespace RoF
|
|||||||
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
||||||
|
|
||||||
const Item_Struct *item = inst->GetUnscaledItem();
|
const Item_Struct *item = inst->GetUnscaledItem();
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
||||||
|
|
||||||
RoF::structs::ItemSerializationHeader hdr;
|
RoF::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -4936,7 +4936,7 @@ namespace RoF
|
|||||||
}
|
}
|
||||||
|
|
||||||
ss.write((const char*)&null_term, sizeof(uint8));
|
ss.write((const char*)&null_term, sizeof(uint8));
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct));
|
||||||
RoF::structs::ItemBodyStruct ibs;
|
RoF::structs::ItemBodyStruct ibs;
|
||||||
memset(&ibs, 0, sizeof(RoF::structs::ItemBodyStruct));
|
memset(&ibs, 0, sizeof(RoF::structs::ItemBodyStruct));
|
||||||
|
|
||||||
@ -5043,7 +5043,7 @@ namespace RoF
|
|||||||
ss.write((const char*)&null_term, sizeof(uint8));
|
ss.write((const char*)&null_term, sizeof(uint8));
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct));
|
||||||
RoF::structs::ItemSecondaryBodyStruct isbs;
|
RoF::structs::ItemSecondaryBodyStruct isbs;
|
||||||
memset(&isbs, 0, sizeof(RoF::structs::ItemSecondaryBodyStruct));
|
memset(&isbs, 0, sizeof(RoF::structs::ItemSecondaryBodyStruct));
|
||||||
|
|
||||||
@ -5084,7 +5084,7 @@ namespace RoF
|
|||||||
ss.write((const char*)&null_term, sizeof(uint8));
|
ss.write((const char*)&null_term, sizeof(uint8));
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct));
|
||||||
RoF::structs::ItemTertiaryBodyStruct itbs;
|
RoF::structs::ItemTertiaryBodyStruct itbs;
|
||||||
memset(&itbs, 0, sizeof(RoF::structs::ItemTertiaryBodyStruct));
|
memset(&itbs, 0, sizeof(RoF::structs::ItemTertiaryBodyStruct));
|
||||||
|
|
||||||
@ -5123,7 +5123,7 @@ namespace RoF
|
|||||||
// Effect Structures Broken down to allow variable length strings for effect names
|
// Effect Structures Broken down to allow variable length strings for effect names
|
||||||
int32 effect_unknown = 0;
|
int32 effect_unknown = 0;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct));
|
||||||
RoF::structs::ClickEffectStruct ices;
|
RoF::structs::ClickEffectStruct ices;
|
||||||
memset(&ices, 0, sizeof(RoF::structs::ClickEffectStruct));
|
memset(&ices, 0, sizeof(RoF::structs::ClickEffectStruct));
|
||||||
|
|
||||||
@ -5150,7 +5150,7 @@ namespace RoF
|
|||||||
|
|
||||||
ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7
|
ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct));
|
||||||
RoF::structs::ProcEffectStruct ipes;
|
RoF::structs::ProcEffectStruct ipes;
|
||||||
memset(&ipes, 0, sizeof(RoF::structs::ProcEffectStruct));
|
memset(&ipes, 0, sizeof(RoF::structs::ProcEffectStruct));
|
||||||
|
|
||||||
@ -5174,7 +5174,7 @@ namespace RoF
|
|||||||
|
|
||||||
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5
|
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct));
|
||||||
RoF::structs::WornEffectStruct iwes;
|
RoF::structs::WornEffectStruct iwes;
|
||||||
memset(&iwes, 0, sizeof(RoF::structs::WornEffectStruct));
|
memset(&iwes, 0, sizeof(RoF::structs::WornEffectStruct));
|
||||||
|
|
||||||
@ -5265,7 +5265,7 @@ namespace RoF
|
|||||||
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6
|
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6
|
||||||
// End of Effects
|
// End of Effects
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
||||||
RoF::structs::ItemQuaternaryBodyStruct iqbs;
|
RoF::structs::ItemQuaternaryBodyStruct iqbs;
|
||||||
memset(&iqbs, 0, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
memset(&iqbs, 0, sizeof(RoF::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
@ -5455,7 +5455,7 @@ namespace RoF
|
|||||||
RoFSlot.MainSlot = TempSlot;
|
RoFSlot.MainSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01);
|
||||||
|
|
||||||
return RoFSlot;
|
return RoFSlot;
|
||||||
}
|
}
|
||||||
@ -5496,7 +5496,7 @@ namespace RoF
|
|||||||
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01);
|
||||||
|
|
||||||
return RoFSlot;
|
return RoFSlot;
|
||||||
}
|
}
|
||||||
@ -5601,7 +5601,7 @@ namespace RoF
|
|||||||
ServerSlot = INVALID_INDEX;
|
ServerSlot = INVALID_INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot);
|
||||||
|
|
||||||
return ServerSlot;
|
return ServerSlot;
|
||||||
}
|
}
|
||||||
@ -5636,7 +5636,7 @@ namespace RoF
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot);
|
||||||
|
|
||||||
return ServerSlot;
|
return ServerSlot;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ namespace RoF2
|
|||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ namespace RoF2
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
@ -93,10 +93,10 @@ namespace RoF2
|
|||||||
opfile += name;
|
opfile += name;
|
||||||
opfile += ".conf";
|
opfile += ".conf";
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ namespace RoF2
|
|||||||
|
|
||||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -617,7 +617,7 @@ namespace RoF2
|
|||||||
|
|
||||||
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
||||||
|
|
||||||
delete in;
|
delete in;
|
||||||
@ -651,13 +651,13 @@ namespace RoF2
|
|||||||
safe_delete_array(Serialized);
|
safe_delete_array(Serialized);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
delete[] __emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
@ -1018,16 +1018,16 @@ namespace RoF2
|
|||||||
|
|
||||||
ENCODE(OP_GroupUpdate)
|
ENCODE(OP_GroupUpdate)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
||||||
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
||||||
{
|
{
|
||||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -1045,7 +1045,7 @@ namespace RoF2
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//if(gjs->action == groupActLeave)
|
//if(gjs->action == groupActLeave)
|
||||||
// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -1062,19 +1062,19 @@ namespace RoF2
|
|||||||
if (in->size == sizeof(GroupUpdate2_Struct))
|
if (in->size == sizeof(GroupUpdate2_Struct))
|
||||||
{
|
{
|
||||||
// Group Update2
|
// Group Update2
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
||||||
|
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
unsigned char *__emu_buffer = in->pBuffer;
|
||||||
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
||||||
|
|
||||||
int MemberCount = 1;
|
int MemberCount = 1;
|
||||||
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||||
if (gu2->membername[i][0] != '\0')
|
if (gu2->membername[i][0] != '\0')
|
||||||
{
|
{
|
||||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||||
@ -1082,7 +1082,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
||||||
|
|
||||||
@ -1144,7 +1144,7 @@ namespace RoF2
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||||
|
|
||||||
@ -1452,7 +1452,7 @@ namespace RoF2
|
|||||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType);
|
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType);
|
||||||
|
|
||||||
if (!serialized) {
|
if (!serialized) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2640,7 +2640,7 @@ namespace RoF2
|
|||||||
// Think we need 1 byte of padding at the end
|
// Think we need 1 byte of padding at the end
|
||||||
outapp->WriteUInt8(0); // Unknown
|
outapp->WriteUInt8(0); // Unknown
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||||
|
|
||||||
unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
||||||
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
||||||
@ -3387,7 +3387,7 @@ namespace RoF2
|
|||||||
|
|
||||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3721,16 +3721,16 @@ namespace RoF2
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
||||||
|
|
||||||
emu = (Spawn_Struct *)__emu_buffer;
|
emu = (Spawn_Struct *)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
||||||
|
|
||||||
char *Buffer = (char *)in->pBuffer, *BufferStart;
|
char *Buffer = (char *)in->pBuffer, *BufferStart;
|
||||||
|
|
||||||
@ -3973,9 +3973,9 @@ namespace RoF2
|
|||||||
Buffer += 29;
|
Buffer += 29;
|
||||||
if (Buffer != (BufferStart + PacketSize))
|
if (Buffer != (BufferStart + PacketSize))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
||||||
}
|
}
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size);
|
||||||
//_hex(NET__ERROR, outapp->pBuffer, outapp->size);
|
//_hex(NET__ERROR, outapp->pBuffer, outapp->size);
|
||||||
dest->FastQueuePacket(&outapp, ack_req);
|
dest->FastQueuePacket(&outapp, ack_req);
|
||||||
}
|
}
|
||||||
@ -4370,7 +4370,7 @@ namespace RoF2
|
|||||||
DECODE(OP_GroupDisband)
|
DECODE(OP_GroupDisband)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
||||||
@ -4384,7 +4384,7 @@ namespace RoF2
|
|||||||
DECODE(OP_GroupFollow)
|
DECODE(OP_GroupFollow)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -4398,7 +4398,7 @@ namespace RoF2
|
|||||||
DECODE(OP_GroupFollow2)
|
DECODE(OP_GroupFollow2)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -4412,7 +4412,7 @@ namespace RoF2
|
|||||||
DECODE(OP_GroupInvite)
|
DECODE(OP_GroupInvite)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
||||||
@ -4425,7 +4425,7 @@ namespace RoF2
|
|||||||
|
|
||||||
DECODE(OP_GroupInvite2)
|
DECODE(OP_GroupInvite2)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
||||||
DECODE_FORWARD(OP_GroupInvite);
|
DECODE_FORWARD(OP_GroupInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4568,8 +4568,8 @@ namespace RoF2
|
|||||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||||
emu->from_slot = RoF2ToServerSlot(eq->from_slot);
|
emu->from_slot = RoF2ToServerSlot(eq->from_slot);
|
||||||
emu->to_slot = RoF2ToServerSlot(eq->to_slot);
|
emu->to_slot = RoF2ToServerSlot(eq->to_slot);
|
||||||
IN(number_in_stack);
|
IN(number_in_stack);
|
||||||
@ -4898,7 +4898,7 @@ namespace RoF2
|
|||||||
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
||||||
|
|
||||||
const Item_Struct *item = inst->GetUnscaledItem();
|
const Item_Struct *item = inst->GetUnscaledItem();
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
||||||
|
|
||||||
RoF2::structs::ItemSerializationHeader hdr;
|
RoF2::structs::ItemSerializationHeader hdr;
|
||||||
|
|
||||||
@ -5006,7 +5006,7 @@ namespace RoF2
|
|||||||
}
|
}
|
||||||
|
|
||||||
ss.write((const char*)&null_term, sizeof(uint8));
|
ss.write((const char*)&null_term, sizeof(uint8));
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct));
|
||||||
RoF2::structs::ItemBodyStruct ibs;
|
RoF2::structs::ItemBodyStruct ibs;
|
||||||
memset(&ibs, 0, sizeof(RoF2::structs::ItemBodyStruct));
|
memset(&ibs, 0, sizeof(RoF2::structs::ItemBodyStruct));
|
||||||
|
|
||||||
@ -5113,7 +5113,7 @@ namespace RoF2
|
|||||||
ss.write((const char*)&null_term, sizeof(uint8));
|
ss.write((const char*)&null_term, sizeof(uint8));
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct));
|
||||||
RoF2::structs::ItemSecondaryBodyStruct isbs;
|
RoF2::structs::ItemSecondaryBodyStruct isbs;
|
||||||
memset(&isbs, 0, sizeof(RoF2::structs::ItemSecondaryBodyStruct));
|
memset(&isbs, 0, sizeof(RoF2::structs::ItemSecondaryBodyStruct));
|
||||||
|
|
||||||
@ -5154,7 +5154,7 @@ namespace RoF2
|
|||||||
ss.write((const char*)&null_term, sizeof(uint8));
|
ss.write((const char*)&null_term, sizeof(uint8));
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct));
|
||||||
RoF2::structs::ItemTertiaryBodyStruct itbs;
|
RoF2::structs::ItemTertiaryBodyStruct itbs;
|
||||||
memset(&itbs, 0, sizeof(RoF2::structs::ItemTertiaryBodyStruct));
|
memset(&itbs, 0, sizeof(RoF2::structs::ItemTertiaryBodyStruct));
|
||||||
|
|
||||||
@ -5193,7 +5193,7 @@ namespace RoF2
|
|||||||
// Effect Structures Broken down to allow variable length strings for effect names
|
// Effect Structures Broken down to allow variable length strings for effect names
|
||||||
int32 effect_unknown = 0;
|
int32 effect_unknown = 0;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct));
|
||||||
RoF2::structs::ClickEffectStruct ices;
|
RoF2::structs::ClickEffectStruct ices;
|
||||||
memset(&ices, 0, sizeof(RoF2::structs::ClickEffectStruct));
|
memset(&ices, 0, sizeof(RoF2::structs::ClickEffectStruct));
|
||||||
|
|
||||||
@ -5220,7 +5220,7 @@ namespace RoF2
|
|||||||
|
|
||||||
ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7
|
ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct));
|
||||||
RoF2::structs::ProcEffectStruct ipes;
|
RoF2::structs::ProcEffectStruct ipes;
|
||||||
memset(&ipes, 0, sizeof(RoF2::structs::ProcEffectStruct));
|
memset(&ipes, 0, sizeof(RoF2::structs::ProcEffectStruct));
|
||||||
|
|
||||||
@ -5244,7 +5244,7 @@ namespace RoF2
|
|||||||
|
|
||||||
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5
|
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct));
|
||||||
RoF2::structs::WornEffectStruct iwes;
|
RoF2::structs::WornEffectStruct iwes;
|
||||||
memset(&iwes, 0, sizeof(RoF2::structs::WornEffectStruct));
|
memset(&iwes, 0, sizeof(RoF2::structs::WornEffectStruct));
|
||||||
|
|
||||||
@ -5335,7 +5335,7 @@ namespace RoF2
|
|||||||
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6
|
ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6
|
||||||
// End of Effects
|
// End of Effects
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
||||||
RoF2::structs::ItemQuaternaryBodyStruct iqbs;
|
RoF2::structs::ItemQuaternaryBodyStruct iqbs;
|
||||||
memset(&iqbs, 0, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
memset(&iqbs, 0, sizeof(RoF2::structs::ItemQuaternaryBodyStruct));
|
||||||
|
|
||||||
@ -5546,7 +5546,7 @@ namespace RoF2
|
|||||||
RoF2Slot.MainSlot = TempSlot;
|
RoF2Slot.MainSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01);
|
||||||
|
|
||||||
return RoF2Slot;
|
return RoF2Slot;
|
||||||
}
|
}
|
||||||
@ -5587,7 +5587,7 @@ namespace RoF2
|
|||||||
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01);
|
||||||
|
|
||||||
return RoF2Slot;
|
return RoF2Slot;
|
||||||
}
|
}
|
||||||
@ -5696,7 +5696,7 @@ namespace RoF2
|
|||||||
ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN;
|
ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot);
|
||||||
|
|
||||||
return ServerSlot;
|
return ServerSlot;
|
||||||
}
|
}
|
||||||
@ -5731,7 +5731,7 @@ namespace RoF2
|
|||||||
ServerSlot = TempSlot;
|
ServerSlot = TempSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot);
|
||||||
|
|
||||||
return ServerSlot;
|
return ServerSlot;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ namespace SoD
|
|||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ namespace SoD
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
@ -91,10 +91,10 @@ namespace SoD
|
|||||||
opfile += name;
|
opfile += name;
|
||||||
opfile += ".conf";
|
opfile += ".conf";
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +247,7 @@ namespace SoD
|
|||||||
|
|
||||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ namespace SoD
|
|||||||
|
|
||||||
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
||||||
|
|
||||||
delete in;
|
delete in;
|
||||||
@ -391,13 +391,13 @@ namespace SoD
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
delete[] __emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
@ -683,16 +683,16 @@ namespace SoD
|
|||||||
|
|
||||||
ENCODE(OP_GroupUpdate)
|
ENCODE(OP_GroupUpdate)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
||||||
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
||||||
{
|
{
|
||||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -710,7 +710,7 @@ namespace SoD
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//if(gjs->action == groupActLeave)
|
//if(gjs->action == groupActLeave)
|
||||||
// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -727,19 +727,19 @@ namespace SoD
|
|||||||
if (in->size == sizeof(GroupUpdate2_Struct))
|
if (in->size == sizeof(GroupUpdate2_Struct))
|
||||||
{
|
{
|
||||||
// Group Update2
|
// Group Update2
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
||||||
|
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
unsigned char *__emu_buffer = in->pBuffer;
|
||||||
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
||||||
|
|
||||||
int MemberCount = 1;
|
int MemberCount = 1;
|
||||||
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||||
if (gu2->membername[i][0] != '\0')
|
if (gu2->membername[i][0] != '\0')
|
||||||
{
|
{
|
||||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||||
@ -747,7 +747,7 @@ namespace SoD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
||||||
char *Buffer = (char *)outapp->pBuffer;
|
char *Buffer = (char *)outapp->pBuffer;
|
||||||
@ -807,7 +807,7 @@ namespace SoD
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||||
|
|
||||||
@ -967,7 +967,7 @@ namespace SoD
|
|||||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
||||||
|
|
||||||
if (!serialized) {
|
if (!serialized) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2108,7 +2108,7 @@ namespace SoD
|
|||||||
|
|
||||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2363,16 +2363,16 @@ namespace SoD
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
||||||
|
|
||||||
emu = (Spawn_Struct *)__emu_buffer;
|
emu = (Spawn_Struct *)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
||||||
|
|
||||||
char *Buffer = (char *)in->pBuffer;
|
char *Buffer = (char *)in->pBuffer;
|
||||||
|
|
||||||
@ -2963,7 +2963,7 @@ namespace SoD
|
|||||||
DECODE(OP_GroupDisband)
|
DECODE(OP_GroupDisband)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
||||||
@ -2977,7 +2977,7 @@ namespace SoD
|
|||||||
DECODE(OP_GroupFollow)
|
DECODE(OP_GroupFollow)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -2991,7 +2991,7 @@ namespace SoD
|
|||||||
DECODE(OP_GroupFollow2)
|
DECODE(OP_GroupFollow2)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -3005,7 +3005,7 @@ namespace SoD
|
|||||||
DECODE(OP_GroupInvite)
|
DECODE(OP_GroupInvite)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
||||||
@ -3018,7 +3018,7 @@ namespace SoD
|
|||||||
|
|
||||||
DECODE(OP_GroupInvite2)
|
DECODE(OP_GroupInvite2)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
||||||
DECODE_FORWARD(OP_GroupInvite);
|
DECODE_FORWARD(OP_GroupInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3091,7 +3091,7 @@ namespace SoD
|
|||||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||||
|
|
||||||
emu->from_slot = SoDToServerSlot(eq->from_slot);
|
emu->from_slot = SoDToServerSlot(eq->from_slot);
|
||||||
emu->to_slot = SoDToServerSlot(eq->to_slot);
|
emu->to_slot = SoDToServerSlot(eq->to_slot);
|
||||||
@ -3384,7 +3384,7 @@ namespace SoD
|
|||||||
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
||||||
|
|
||||||
const Item_Struct *item = inst->GetUnscaledItem();
|
const Item_Struct *item = inst->GetUnscaledItem();
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
||||||
SoD::structs::ItemSerializationHeader hdr;
|
SoD::structs::ItemSerializationHeader hdr;
|
||||||
hdr.stacksize = stackable ? charges : 1;
|
hdr.stacksize = stackable ? charges : 1;
|
||||||
hdr.unknown004 = 0;
|
hdr.unknown004 = 0;
|
||||||
|
|||||||
@ -50,7 +50,7 @@ namespace SoF
|
|||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ namespace SoF
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
@ -91,10 +91,10 @@ namespace SoF
|
|||||||
opfile += name;
|
opfile += name;
|
||||||
opfile += ".conf";
|
opfile += ".conf";
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ namespace SoF
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
@ -337,7 +337,7 @@ namespace SoF
|
|||||||
|
|
||||||
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
||||||
|
|
||||||
delete in;
|
delete in;
|
||||||
@ -371,13 +371,13 @@ namespace SoF
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
delete[] __emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
@ -766,7 +766,7 @@ namespace SoF
|
|||||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
||||||
|
|
||||||
if (!serialized) {
|
if (!serialized) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1707,7 +1707,7 @@ namespace SoF
|
|||||||
|
|
||||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1887,7 +1887,7 @@ namespace SoF
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2096,7 +2096,7 @@ namespace SoF
|
|||||||
//kill off the emu structure and send the eq packet.
|
//kill off the emu structure and send the eq packet.
|
||||||
delete[] __emu_buffer;
|
delete[] __emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawns");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawns");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
@ -2429,7 +2429,7 @@ namespace SoF
|
|||||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||||
|
|
||||||
emu->from_slot = SoFToServerSlot(eq->from_slot);
|
emu->from_slot = SoFToServerSlot(eq->from_slot);
|
||||||
emu->to_slot = SoFToServerSlot(eq->to_slot);
|
emu->to_slot = SoFToServerSlot(eq->to_slot);
|
||||||
@ -2708,7 +2708,7 @@ namespace SoF
|
|||||||
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
||||||
|
|
||||||
const Item_Struct *item = inst->GetUnscaledItem();
|
const Item_Struct *item = inst->GetUnscaledItem();
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
||||||
SoF::structs::ItemSerializationHeader hdr;
|
SoF::structs::ItemSerializationHeader hdr;
|
||||||
hdr.stacksize = stackable ? charges : 1;
|
hdr.stacksize = stackable ? charges : 1;
|
||||||
hdr.unknown004 = 0;
|
hdr.unknown004 = 0;
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
//check length of packet before decoding. Call before setup.
|
//check length of packet before decoding. Call before setup.
|
||||||
#define ENCODE_LENGTH_EXACT(struct_) \
|
#define ENCODE_LENGTH_EXACT(struct_) \
|
||||||
if((*p)->size != sizeof(struct_)) { \
|
if((*p)->size != sizeof(struct_)) { \
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
||||||
_hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \
|
_hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \
|
||||||
delete *p; \
|
delete *p; \
|
||||||
*p = nullptr; \
|
*p = nullptr; \
|
||||||
@ -72,7 +72,7 @@
|
|||||||
}
|
}
|
||||||
#define ENCODE_LENGTH_ATLEAST(struct_) \
|
#define ENCODE_LENGTH_ATLEAST(struct_) \
|
||||||
if((*p)->size < sizeof(struct_)) { \
|
if((*p)->size < sizeof(struct_)) { \
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
||||||
_hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \
|
_hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \
|
||||||
delete *p; \
|
delete *p; \
|
||||||
*p = nullptr; \
|
*p = nullptr; \
|
||||||
@ -127,14 +127,14 @@
|
|||||||
#define DECODE_LENGTH_EXACT(struct_) \
|
#define DECODE_LENGTH_EXACT(struct_) \
|
||||||
if(__packet->size != sizeof(struct_)) { \
|
if(__packet->size != sizeof(struct_)) { \
|
||||||
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \
|
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
||||||
_hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \
|
_hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \
|
||||||
return; \
|
return; \
|
||||||
}
|
}
|
||||||
#define DECODE_LENGTH_ATLEAST(struct_) \
|
#define DECODE_LENGTH_ATLEAST(struct_) \
|
||||||
if(__packet->size < sizeof(struct_)) { \
|
if(__packet->size < sizeof(struct_)) { \
|
||||||
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \
|
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
||||||
_hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \
|
_hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \
|
||||||
return; \
|
return; \
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ namespace Titanium
|
|||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ namespace Titanium
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
@ -89,10 +89,10 @@ namespace Titanium
|
|||||||
opfile += name;
|
opfile += name;
|
||||||
opfile += ".conf";
|
opfile += ".conf";
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ namespace Titanium
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
@ -268,7 +268,7 @@ namespace Titanium
|
|||||||
|
|
||||||
int itemcount = in->size / sizeof(InternalSerializedItem_Struct);
|
int itemcount = in->size / sizeof(InternalSerializedItem_Struct);
|
||||||
if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -285,7 +285,7 @@ namespace Titanium
|
|||||||
safe_delete_array(serialized);
|
safe_delete_array(serialized);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -635,7 +635,7 @@ namespace Titanium
|
|||||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
||||||
|
|
||||||
if (!serialized) {
|
if (!serialized) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1157,7 +1157,7 @@ namespace Titanium
|
|||||||
|
|
||||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1274,7 +1274,7 @@ namespace Titanium
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1623,7 +1623,7 @@ namespace Titanium
|
|||||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||||
|
|
||||||
emu->from_slot = TitaniumToServerSlot(eq->from_slot);
|
emu->from_slot = TitaniumToServerSlot(eq->from_slot);
|
||||||
emu->to_slot = TitaniumToServerSlot(eq->to_slot);
|
emu->to_slot = TitaniumToServerSlot(eq->to_slot);
|
||||||
|
|||||||
@ -50,7 +50,7 @@ namespace Underfoot
|
|||||||
//TODO: figure out how to support shared memory with multiple patches...
|
//TODO: figure out how to support shared memory with multiple patches...
|
||||||
opcodes = new RegularOpcodeManager();
|
opcodes = new RegularOpcodeManager();
|
||||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ namespace Underfoot
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
@ -91,10 +91,10 @@ namespace Underfoot
|
|||||||
opfile += name;
|
opfile += name;
|
||||||
opfile += ".conf";
|
opfile += ".conf";
|
||||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ namespace Underfoot
|
|||||||
|
|
||||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ namespace Underfoot
|
|||||||
|
|
||||||
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct));
|
||||||
|
|
||||||
delete in;
|
delete in;
|
||||||
@ -526,13 +526,13 @@ namespace Underfoot
|
|||||||
safe_delete_array(Serialized);
|
safe_delete_array(Serialized);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] __emu_buffer;
|
delete[] __emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
|
|
||||||
dest->FastQueuePacket(&in, ack_req);
|
dest->FastQueuePacket(&in, ack_req);
|
||||||
@ -839,16 +839,16 @@ namespace Underfoot
|
|||||||
|
|
||||||
ENCODE(OP_GroupUpdate)
|
ENCODE(OP_GroupUpdate)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate");
|
||||||
EQApplicationPacket *in = *p;
|
EQApplicationPacket *in = *p;
|
||||||
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action);
|
||||||
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband))
|
||||||
{
|
{
|
||||||
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername))
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -867,7 +867,7 @@ namespace Underfoot
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//if(gjs->action == groupActLeave)
|
//if(gjs->action == groupActLeave)
|
||||||
// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct));
|
||||||
|
|
||||||
@ -884,19 +884,19 @@ namespace Underfoot
|
|||||||
if (in->size == sizeof(GroupUpdate2_Struct))
|
if (in->size == sizeof(GroupUpdate2_Struct))
|
||||||
{
|
{
|
||||||
// Group Update2
|
// Group Update2
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2");
|
||||||
|
|
||||||
unsigned char *__emu_buffer = in->pBuffer;
|
unsigned char *__emu_buffer = in->pBuffer;
|
||||||
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname);
|
||||||
|
|
||||||
int MemberCount = 1;
|
int MemberCount = 1;
|
||||||
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1;
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]);
|
||||||
if (gu2->membername[i][0] != '\0')
|
if (gu2->membername[i][0] != '\0')
|
||||||
{
|
{
|
||||||
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
PacketLength += (22 + strlen(gu2->membername[i]) + 1);
|
||||||
@ -904,7 +904,7 @@ namespace Underfoot
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname);
|
||||||
|
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength);
|
||||||
|
|
||||||
@ -964,7 +964,7 @@ namespace Underfoot
|
|||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername);
|
||||||
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
ENCODE_LENGTH_EXACT(GroupJoin_Struct);
|
||||||
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct);
|
||||||
|
|
||||||
@ -1190,7 +1190,7 @@ namespace Underfoot
|
|||||||
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0);
|
||||||
|
|
||||||
if (!serialized) {
|
if (!serialized) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2374,7 +2374,7 @@ namespace Underfoot
|
|||||||
|
|
||||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2624,16 +2624,16 @@ namespace Underfoot
|
|||||||
//determine and verify length
|
//determine and verify length
|
||||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||||
delete in;
|
delete in;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name);
|
||||||
|
|
||||||
emu = (Spawn_Struct *)__emu_buffer;
|
emu = (Spawn_Struct *)__emu_buffer;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount);
|
||||||
|
|
||||||
char *Buffer = (char *)in->pBuffer;
|
char *Buffer = (char *)in->pBuffer;
|
||||||
|
|
||||||
@ -3276,7 +3276,7 @@ namespace Underfoot
|
|||||||
DECODE(OP_GroupDisband)
|
DECODE(OP_GroupDisband)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct);
|
||||||
@ -3290,7 +3290,7 @@ namespace Underfoot
|
|||||||
DECODE(OP_GroupFollow)
|
DECODE(OP_GroupFollow)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -3304,7 +3304,7 @@ namespace Underfoot
|
|||||||
DECODE(OP_GroupFollow2)
|
DECODE(OP_GroupFollow2)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupFollow_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct);
|
||||||
@ -3318,7 +3318,7 @@ namespace Underfoot
|
|||||||
DECODE(OP_GroupInvite)
|
DECODE(OP_GroupInvite)
|
||||||
{
|
{
|
||||||
//EQApplicationPacket *in = __packet;
|
//EQApplicationPacket *in = __packet;
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite");
|
||||||
//_hex(NET__ERROR, in->pBuffer, in->size);
|
//_hex(NET__ERROR, in->pBuffer, in->size);
|
||||||
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
DECODE_LENGTH_EXACT(structs::GroupInvite_Struct);
|
||||||
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct);
|
||||||
@ -3331,7 +3331,7 @@ namespace Underfoot
|
|||||||
|
|
||||||
DECODE(OP_GroupInvite2)
|
DECODE(OP_GroupInvite2)
|
||||||
{
|
{
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding");
|
||||||
DECODE_FORWARD(OP_GroupInvite);
|
DECODE_FORWARD(OP_GroupInvite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3406,7 +3406,7 @@ namespace Underfoot
|
|||||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||||
|
|
||||||
emu->from_slot = UnderfootToServerSlot(eq->from_slot);
|
emu->from_slot = UnderfootToServerSlot(eq->from_slot);
|
||||||
emu->to_slot = UnderfootToServerSlot(eq->to_slot);
|
emu->to_slot = UnderfootToServerSlot(eq->to_slot);
|
||||||
@ -3629,7 +3629,7 @@ namespace Underfoot
|
|||||||
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary);
|
||||||
|
|
||||||
const Item_Struct *item = inst->GetUnscaledItem();
|
const Item_Struct *item = inst->GetUnscaledItem();
|
||||||
//logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
//Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name);
|
||||||
Underfoot::structs::ItemSerializationHeader hdr;
|
Underfoot::structs::ItemSerializationHeader hdr;
|
||||||
hdr.stacksize = stackable ? charges : 1;
|
hdr.stacksize = stackable ? charges : 1;
|
||||||
hdr.unknown004 = 0;
|
hdr.unknown004 = 0;
|
||||||
|
|||||||
@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
#if EQDEBUG > 5
|
#if EQDEBUG > 5
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
#if EQDEBUG > 5
|
#if EQDEBUG > 5
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str());
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
#if EQDEBUG > 5
|
#if EQDEBUG > 5
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) {
|
|||||||
/* This function checks if the timer triggered */
|
/* This function checks if the timer triggered */
|
||||||
bool PersistentTimer::Expired(Database *db, bool iReset) {
|
bool PersistentTimer::Expired(Database *db, bool iReset) {
|
||||||
if (this == nullptr) {
|
if (this == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n");
|
Log.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n");
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
uint32 current_time = get_current_time();
|
uint32 current_time = get_current_time();
|
||||||
@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
#if EQDEBUG > 5
|
#if EQDEBUG > 5
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
#if EQDEBUG > 5
|
#if EQDEBUG > 5
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
#if EQDEBUG > 5
|
#if EQDEBUG > 5
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str());
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector<const char *> &into
|
|||||||
if(catname != nullptr) {
|
if(catname != nullptr) {
|
||||||
cat = FindCategory(catname);
|
cat = FindCategory(catname);
|
||||||
if(cat == InvalidCategory) {
|
if(cat == InvalidCategory) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas
|
|||||||
switch(type) {
|
switch(type) {
|
||||||
case IntRule:
|
case IntRule:
|
||||||
m_RuleIntValues [index] = atoi(rule_value);
|
m_RuleIntValues [index] = atoi(rule_value);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]);
|
||||||
break;
|
break;
|
||||||
case RealRule:
|
case RealRule:
|
||||||
m_RuleRealValues[index] = atof(rule_value);
|
m_RuleRealValues[index] = atof(rule_value);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]);
|
||||||
break;
|
break;
|
||||||
case BoolRule:
|
case BoolRule:
|
||||||
uint32 val = 0;
|
uint32 val = 0;
|
||||||
if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1"))
|
if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1"))
|
||||||
val = 1;
|
val = 1;
|
||||||
m_RuleBoolValues[index] = val;
|
m_RuleBoolValues[index] = val;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RuleManager::ResetRules() {
|
void RuleManager::ResetRules() {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values");
|
||||||
#define RULE_INT(cat, rule, default_value) \
|
#define RULE_INT(cat, rule, default_value) \
|
||||||
m_RuleIntValues[ Int__##rule ] = default_value;
|
m_RuleIntValues[ Int__##rule ] = default_value;
|
||||||
#define RULE_REAL(cat, rule, default_value) \
|
#define RULE_REAL(cat, rule, default_value) \
|
||||||
@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 &
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) {
|
|||||||
|
|
||||||
m_activeRuleset = _FindOrCreateRuleset(db, ruleset);
|
m_activeRuleset = _FindOrCreateRuleset(db, ruleset);
|
||||||
if(m_activeRuleset == -1) {
|
if(m_activeRuleset == -1) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_activeName = ruleset;
|
m_activeName = ruleset;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) {
|
|||||||
|
|
||||||
int rsid = GetRulesetID(db, ruleset);
|
int rsid = GetRulesetID(db, ruleset);
|
||||||
if(rsid < 0) {
|
if(rsid < 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid);
|
||||||
|
|
||||||
m_activeRuleset = rsid;
|
m_activeRuleset = rsid;
|
||||||
m_activeName = ruleset;
|
m_activeName = ruleset;
|
||||||
@ -282,13 +282,13 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto row = results.begin(); row != results.end(); ++row)
|
for(auto row = results.begin(); row != results.end(); ++row)
|
||||||
if(!SetRule(row[0], row[1], nullptr, false))
|
if(!SetRule(row[0], row[1], nullptr, false))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) {
|
|||||||
m_activeRuleset, _GetRuleName(type, index), vstr);
|
m_activeRuleset, _GetRuleName(type, index), vstr);
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) {
|
|||||||
safe_delete_array(rst);
|
safe_delete_array(rst);
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map<int, std::string> &into) {
|
|||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (results.Success())
|
if (results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite
|
|||||||
account_id, slot_id);
|
account_id, slot_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
//returning true is less harmful in the face of a query error
|
//returning true is less harmful in the face of a query error
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
|
|||||||
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id);
|
std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) {
|
|||||||
char_id, base_slot_id, (base_slot_id+10));
|
char_id, base_slot_id, (base_slot_id+10));
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
|
|||||||
std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id);
|
std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
|
|||||||
account_id, base_slot_id, (base_slot_id+10));
|
account_id, base_slot_id, (base_slot_id+10));
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
|
|||||||
"FROM sharedbank WHERE acctid=%i", id);
|
"FROM sharedbank WHERE acctid=%i", id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
|
|||||||
const Item_Struct* item = GetItem(item_id);
|
const Item_Struct* item = GetItem(item_id);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
logger.Log(EQEmuLogSys::Error,
|
Log.Log(EQEmuLogSys::Error,
|
||||||
"Warning: %s %i has an invalid item_id %i in inventory slot %i",
|
"Warning: %s %i has an invalid item_id %i in inventory slot %i",
|
||||||
((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id);
|
((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id);
|
||||||
continue;
|
continue;
|
||||||
@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) {
|
|||||||
if (put_slot_id != INVALID_INDEX)
|
if (put_slot_id != INVALID_INDEX)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i",
|
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i",
|
||||||
((is_charid==true)? "charid": "acctid"), id, item_id, slot_id);
|
((is_charid==true)? "charid": "acctid"), id, item_id, slot_id);
|
||||||
|
|
||||||
if (is_charid)
|
if (is_charid)
|
||||||
@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
|
|||||||
"FROM inventory WHERE charid = %i ORDER BY slotid", char_id);
|
"FROM inventory WHERE charid = %i ORDER BY slotid", char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
logger.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
|
Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
|
|||||||
const Item_Struct* item = GetItem(item_id);
|
const Item_Struct* item = GetItem(item_id);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
logger.Log(EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id);
|
Log.Log(EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
|
|||||||
else if (slot_id >= 3111 && slot_id <= 3179)
|
else if (slot_id >= 3111 && slot_id <= 3179)
|
||||||
{
|
{
|
||||||
// Admins: please report any occurrences of this error
|
// Admins: please report any occurrences of this error
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id);
|
Log.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id);
|
||||||
put_slot_id = inv->PushCursor(*inst);
|
put_slot_id = inv->PushCursor(*inst);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) {
|
|||||||
|
|
||||||
// Save ptr to item in inventory
|
// Save ptr to item in inventory
|
||||||
if (put_slot_id == INVALID_INDEX) {
|
if (put_slot_id == INVALID_INDEX) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id);
|
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
|
|||||||
name, account_id);
|
name, account_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()){
|
if (!results.Success()){
|
||||||
logger.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
logger.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
|
Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv)
|
|||||||
|
|
||||||
// Save ptr to item in inventory
|
// Save ptr to item in inventory
|
||||||
if (put_slot_id == INVALID_INDEX)
|
if (put_slot_id == INVALID_INDEX)
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id);
|
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) {
|
|||||||
const std::string query = "SELECT MAX(id), count(*) FROM items";
|
const std::string query = "SELECT MAX(id), count(*) FROM items";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() {
|
|||||||
items_hash = new EQEmu::FixedMemoryHashSet<Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), size);
|
items_hash = new EQEmu::FixedMemoryHashSet<Item_Struct>(reinterpret_cast<uint8*>(items_mmf->Get()), size);
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception& ex) {
|
} catch(std::exception& ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
"updated FROM items ORDER BY id";
|
"updated FROM items ORDER BY id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
try {
|
try {
|
||||||
hash.insert(item.ID, item);
|
hash.insert(item.ID, item);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile);
|
Log.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile);
|
||||||
txtout.assign(" ",1);
|
txtout.assign(" ",1);
|
||||||
return txtout;
|
return txtout;
|
||||||
}
|
}
|
||||||
@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) {
|
|||||||
const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction";
|
const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co
|
|||||||
"ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;";
|
"ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() {
|
|||||||
faction_hash = new EQEmu::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), size);
|
faction_hash = new EQEmu::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), size);
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception& ex) {
|
} catch(std::exception& ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1,
|
|||||||
inst = CreateBaseItem(item, charges);
|
inst = CreateBaseItem(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr) {
|
if (inst == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
|
Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
|
||||||
logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin
|
|||||||
inst = CreateBaseItem(item, charges);
|
inst = CreateBaseItem(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr) {
|
if (inst == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
|
Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()");
|
||||||
logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges)
|
|||||||
inst = new ItemInst(item, charges);
|
inst = new ItemInst(item, charges);
|
||||||
|
|
||||||
if (inst == nullptr) {
|
if (inst == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()");
|
Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()");
|
||||||
logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() {
|
|||||||
|
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) {
|
|||||||
const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level";
|
const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe
|
|||||||
"AND `spellid` <= %i", iMaxSpellID);
|
"AND `spellid` <= %i", iMaxSpellID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() {
|
|||||||
std::string query = "SELECT MAX(id) FROM spells_new";
|
std::string query = "SELECT MAX(id) FROM spells_new";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
|||||||
const std::string query = "SELECT * FROM spells_new ORDER BY id ASC";
|
const std::string query = "SELECT * FROM spells_new ORDER BY id ASC";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) {
|
if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
|||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
tempid = atoi(row[0]);
|
tempid = atoi(row[0]);
|
||||||
if(tempid >= max_spells) {
|
if(tempid >= max_spells) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() {
|
|||||||
const std::string query = "SELECT MAX(level) FROM base_data";
|
const std::string query = "SELECT MAX(level) FROM base_data";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() {
|
|||||||
|
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception& ex) {
|
} catch(std::exception& ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) {
|
|||||||
const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC";
|
const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) {
|
|||||||
cl = atoi(row[1]);
|
cl = atoi(row[1]);
|
||||||
|
|
||||||
if(lvl <= 0) {
|
if(lvl <= 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring.");
|
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lvl >= max_level) {
|
if(lvl >= max_level) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring.");
|
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cl <= 0) {
|
if(cl <= 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring.");
|
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cl > 16) {
|
if(cl > 16) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring.");
|
Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot
|
|||||||
const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable";
|
const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d
|
|||||||
const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop";
|
const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) {
|
|||||||
"ON loottable.id = loottable_entries.loottable_id ORDER BY id";
|
"ON loottable.id = loottable_entries.loottable_id ORDER BY id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) {
|
|||||||
"ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id";
|
"ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 current_id = 0;
|
uint32 current_id = 0;
|
||||||
@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() {
|
|||||||
loot_drop_mmf->Size());
|
loot_drop_mmf->Size());
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) {
|
|||||||
return &loot_table_hash->at(loottable_id);
|
return &loot_table_hash->at(loottable_id);
|
||||||
}
|
}
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what());
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) {
|
|||||||
return &loot_drop_hash->at(lootdrop_id);
|
return &loot_drop_hash->at(lootdrop_id);
|
||||||
}
|
}
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what());
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -839,7 +839,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType)
|
|||||||
// If we have a DamageShieldType for this spell from the damageshieldtypes table, return that,
|
// If we have a DamageShieldType for this spell from the damageshieldtypes table, return that,
|
||||||
// else, make a guess, based on the resist type. Default return value is DS_THORNS
|
// else, make a guess, based on the resist type. Default return value is DS_THORNS
|
||||||
if (IsValidSpell(spell_id)) {
|
if (IsValidSpell(spell_id)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id,
|
||||||
spells[spell_id].name, spells[spell_id].DamageShieldType);
|
spells[spell_id].name, spells[spell_id].DamageShieldType);
|
||||||
|
|
||||||
if (spells[spell_id].DamageShieldType)
|
if (spells[spell_id].DamageShieldType)
|
||||||
|
|||||||
@ -39,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo
|
|||||||
EQApplicationPacket *p = *in_p;
|
EQApplicationPacket *p = *in_p;
|
||||||
*in_p = nullptr;
|
*in_p = nullptr;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode()));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode()));
|
||||||
|
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StructStrategy::ErrorDecoder(EQApplicationPacket *p) {
|
void StructStrategy::ErrorDecoder(EQApplicationPacket *p) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode()));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode()));
|
||||||
p->SetOpcode(OP_Unknown);
|
p->SetOpcode(OP_Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) {
|
|||||||
}
|
}
|
||||||
TCPConnection* tcpc = (TCPConnection*) tmp;
|
TCPConnection* tcpc = (TCPConnection*) tmp;
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
tcpc->MLoopRunning.lock();
|
tcpc->MLoopRunning.lock();
|
||||||
while (tcpc->RunLoop()) {
|
while (tcpc->RunLoop()) {
|
||||||
@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) {
|
|||||||
tcpc->MLoopRunning.unlock();
|
tcpc->MLoopRunning.unlock();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
THREAD_RETURN(nullptr);
|
THREAD_RETURN(nullptr);
|
||||||
|
|||||||
@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
|
|||||||
BaseTCPServer* tcps = (BaseTCPServer*) tmp;
|
BaseTCPServer* tcps = (BaseTCPServer*) tmp;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tcps->MLoopRunning.lock();
|
tcps->MLoopRunning.lock();
|
||||||
@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
|
|||||||
tcps->MLoopRunning.unlock();
|
tcps->MLoopRunning.unlock();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
THREAD_RETURN(nullptr);
|
THREAD_RETURN(nullptr);
|
||||||
|
|||||||
@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() {
|
|||||||
Timeoutable *it = *cur;
|
Timeoutable *it = *cur;
|
||||||
if(it->next_check.Check()) {
|
if(it->next_check.Check()) {
|
||||||
#ifdef TIMEOUT_DEBUG
|
#ifdef TIMEOUT_DEBUG
|
||||||
logger.Log(EQEmuLogSys::Debug, "Checking timeout on 0x%x\n", it);
|
Log.Log(EQEmuLogSys::Debug, "Checking timeout on 0x%x\n", it);
|
||||||
#endif
|
#endif
|
||||||
it->CheckTimeout();
|
it->CheckTimeout();
|
||||||
}
|
}
|
||||||
@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) {
|
|||||||
DeleteMember(who); //just in case... prolly not needed.
|
DeleteMember(who); //just in case... prolly not needed.
|
||||||
members.push_back(who);
|
members.push_back(who);
|
||||||
#ifdef TIMEOUT_DEBUG
|
#ifdef TIMEOUT_DEBUG
|
||||||
logger.Log(EQEmuLogSys::Debug, "Adding timeoutable 0x%x\n", who);
|
Log.Log(EQEmuLogSys::Debug, "Adding timeoutable 0x%x\n", who);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimeoutManager::DeleteMember(Timeoutable *who) {
|
void TimeoutManager::DeleteMember(Timeoutable *who) {
|
||||||
#ifdef TIMEOUT_DEBUG
|
#ifdef TIMEOUT_DEBUG
|
||||||
logger.Log(EQEmuLogSys::Debug, "Removing timeoutable 0x%x\n", who);
|
Log.Log(EQEmuLogSys::Debug, "Removing timeoutable 0x%x\n", who);
|
||||||
#endif
|
#endif
|
||||||
std::vector<Timeoutable *>::iterator cur,end;
|
std::vector<Timeoutable *>::iterator cur,end;
|
||||||
cur = members.begin();
|
cur = members.begin();
|
||||||
|
|||||||
@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) {
|
|||||||
|
|
||||||
void WorldConnection::OnConnected() {
|
void WorldConnection::OnConnected() {
|
||||||
const EQEmuConfig *Config=EQEmuConfig::get();
|
const EQEmuConfig *Config=EQEmuConfig::get();
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort);
|
||||||
|
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16);
|
ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16);
|
||||||
MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer);
|
MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer);
|
||||||
@ -76,7 +76,7 @@ bool WorldConnection::Connect() {
|
|||||||
if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) {
|
if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
bool RunLoops = false;
|
bool RunLoops = false;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ void CatchSignal(int sig_num);
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
RegisterExecutablePlatform(ExePlatformLaunch);
|
RegisterExecutablePlatform(ExePlatformLaunch);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
std::string launcher_name;
|
std::string launcher_name;
|
||||||
@ -47,13 +47,13 @@ int main(int argc, char *argv[]) {
|
|||||||
launcher_name = argv[1];
|
launcher_name = argv[1];
|
||||||
}
|
}
|
||||||
if(launcher_name.length() < 1) {
|
if(launcher_name.length() < 1) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration..");
|
||||||
if (!EQEmuConfig::LoadConfig()) {
|
if (!EQEmuConfig::LoadConfig()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const EQEmuConfig *Config = EQEmuConfig::get();
|
const EQEmuConfig *Config = EQEmuConfig::get();
|
||||||
@ -62,16 +62,16 @@ int main(int argc, char *argv[]) {
|
|||||||
* Setup nice signal handlers
|
* Setup nice signal handlers
|
||||||
*/
|
*/
|
||||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
|
|||||||
std::map<std::string, ZoneLaunch *> zones;
|
std::map<std::string, ZoneLaunch *> zones;
|
||||||
WorldServer world(zones, launcher_name.c_str(), Config);
|
WorldServer world(zones, launcher_name.c_str(), Config);
|
||||||
if (!world.Connect()) {
|
if (!world.Connect()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry.");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, ZoneLaunch *>::iterator zone, zend;
|
std::map<std::string, ZoneLaunch *>::iterator zone, zend;
|
||||||
@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop...");
|
||||||
|
|
||||||
// zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1");
|
// zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1");
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num);
|
||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,14 +74,14 @@ void WorldServer::Process() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_ZAAuthFailed: {
|
case ServerOP_ZAAuthFailed: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect");
|
||||||
pTryReconnect = false;
|
pTryReconnect = false;
|
||||||
Disconnect();
|
Disconnect();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_LauncherZoneRequest: {
|
case ServerOP_LauncherZoneRequest: {
|
||||||
if(pack->size != sizeof(LauncherZoneRequest)) {
|
if(pack->size != sizeof(LauncherZoneRequest)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer;
|
const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer;
|
||||||
@ -90,9 +90,9 @@ void WorldServer::Process() {
|
|||||||
switch(ZoneRequestCommands(lzr->command)) {
|
switch(ZoneRequestCommands(lzr->command)) {
|
||||||
case ZR_Start: {
|
case ZR_Start: {
|
||||||
if(m_zones.find(lzr->short_name) != m_zones.end()) {
|
if(m_zones.find(lzr->short_name) != m_zones.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name);
|
||||||
ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config);
|
ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config);
|
||||||
m_zones[lzr->short_name] = l;
|
m_zones[lzr->short_name] = l;
|
||||||
}
|
}
|
||||||
@ -101,9 +101,9 @@ void WorldServer::Process() {
|
|||||||
case ZR_Restart: {
|
case ZR_Restart: {
|
||||||
std::map<std::string, ZoneLaunch *>::iterator res = m_zones.find(lzr->short_name);
|
std::map<std::string, ZoneLaunch *>::iterator res = m_zones.find(lzr->short_name);
|
||||||
if(res == m_zones.end()) {
|
if(res == m_zones.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name);
|
||||||
res->second->Restart();
|
res->second->Restart();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -111,9 +111,9 @@ void WorldServer::Process() {
|
|||||||
case ZR_Stop: {
|
case ZR_Stop: {
|
||||||
std::map<std::string, ZoneLaunch *>::iterator res = m_zones.find(lzr->short_name);
|
std::map<std::string, ZoneLaunch *>::iterator res = m_zones.find(lzr->short_name);
|
||||||
if(res == m_zones.end()) {
|
if(res == m_zones.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name);
|
||||||
res->second->Stop();
|
res->second->Stop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -127,7 +127,7 @@ void WorldServer::Process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ void ZoneLaunch::Start() {
|
|||||||
//spec is consumed, even on failure
|
//spec is consumed, even on failure
|
||||||
m_ref = ProcLauncher::get()->Launch(spec);
|
m_ref = ProcLauncher::get()->Launch(spec);
|
||||||
if(m_ref == ProcLauncher::ProcError) {
|
if(m_ref == ProcLauncher::ProcError) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName);
|
||||||
m_timer.Start(m_config->RestartWait);
|
m_timer.Start(m_config->RestartWait);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -84,17 +84,17 @@ void ZoneLaunch::Start() {
|
|||||||
|
|
||||||
SendStatus();
|
SendStatus();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneLaunch::Restart() {
|
void ZoneLaunch::Restart() {
|
||||||
switch(m_state) {
|
switch(m_state) {
|
||||||
case StateRestartPending:
|
case StateRestartPending:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str());
|
||||||
break;
|
break;
|
||||||
case StateStartPending:
|
case StateStartPending:
|
||||||
//we havent started yet, do nothing
|
//we havent started yet, do nothing
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str());
|
||||||
break;
|
break;
|
||||||
case StateStarted:
|
case StateStarted:
|
||||||
//process is running along, kill it off..
|
//process is running along, kill it off..
|
||||||
@ -102,20 +102,20 @@ void ZoneLaunch::Restart() {
|
|||||||
break; //we have no proc ref... cannot stop..
|
break; //we have no proc ref... cannot stop..
|
||||||
if(!ProcLauncher::get()->Terminate(m_ref, true)) {
|
if(!ProcLauncher::get()->Terminate(m_ref, true)) {
|
||||||
//failed to terminate the process, its not likely that it will work if we try again, so give up.
|
//failed to terminate the process, its not likely that it will work if we try again, so give up.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
||||||
m_state = StateStopped;
|
m_state = StateStopped;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
||||||
m_timer.Start(m_config->TerminateWait);
|
m_timer.Start(m_config->TerminateWait);
|
||||||
m_state = StateRestartPending;
|
m_state = StateRestartPending;
|
||||||
break;
|
break;
|
||||||
case StateStopPending:
|
case StateStopPending:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str());
|
||||||
break;
|
break;
|
||||||
case StateStopped:
|
case StateStopped:
|
||||||
//process is already stopped... nothing to do..
|
//process is already stopped... nothing to do..
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) {
|
|||||||
switch(m_state) {
|
switch(m_state) {
|
||||||
case StateStartPending:
|
case StateStartPending:
|
||||||
//we havent started yet, transition directly to stopped.
|
//we havent started yet, transition directly to stopped.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str());
|
||||||
m_state = StateStopped;
|
m_state = StateStopped;
|
||||||
break;
|
break;
|
||||||
case StateStarted:
|
case StateStarted:
|
||||||
@ -134,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) {
|
|||||||
break; //we have no proc ref... cannot stop..
|
break; //we have no proc ref... cannot stop..
|
||||||
if(!ProcLauncher::get()->Terminate(m_ref, graceful)) {
|
if(!ProcLauncher::get()->Terminate(m_ref, graceful)) {
|
||||||
//failed to terminate the process, its not likely that it will work if we try again, so give up.
|
//failed to terminate the process, its not likely that it will work if we try again, so give up.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
||||||
m_state = StateStopped;
|
m_state = StateStopped;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
||||||
m_timer.Start(m_config->TerminateWait);
|
m_timer.Start(m_config->TerminateWait);
|
||||||
m_state = StateStopPending;
|
m_state = StateStopPending;
|
||||||
break;
|
break;
|
||||||
case StateStopped:
|
case StateStopped:
|
||||||
//process is already stopped... nothing to do..
|
//process is already stopped... nothing to do..
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,17 +164,17 @@ bool ZoneLaunch::Process() {
|
|||||||
m_timer.Disable();
|
m_timer.Disable();
|
||||||
|
|
||||||
//actually start up the program
|
//actually start up the program
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str());
|
||||||
Start();
|
Start();
|
||||||
|
|
||||||
//now update the shared timer to reflect the proper start interval.
|
//now update the shared timer to reflect the proper start interval.
|
||||||
if(s_running == 1) {
|
if(s_running == 1) {
|
||||||
//we are the first zone started. wait that interval.
|
//we are the first zone started. wait that interval.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait);
|
||||||
s_startTimer.Start(m_config->InitialBootWait);
|
s_startTimer.Start(m_config->InitialBootWait);
|
||||||
} else {
|
} else {
|
||||||
//just some follow on zone, use that interval.
|
//just some follow on zone, use that interval.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval);
|
||||||
s_startTimer.Start(m_config->ZoneBootInterval);
|
s_startTimer.Start(m_config->ZoneBootInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ bool ZoneLaunch::Process() {
|
|||||||
//waiting for notification that our child has died..
|
//waiting for notification that our child has died..
|
||||||
if(m_timer.Check()) {
|
if(m_timer.Check()) {
|
||||||
//we have timed out, try to kill the child again
|
//we have timed out, try to kill the child again
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
||||||
Restart();
|
Restart();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -197,12 +197,12 @@ bool ZoneLaunch::Process() {
|
|||||||
//we have timed out, try to kill the child again
|
//we have timed out, try to kill the child again
|
||||||
m_killFails++;
|
m_killFails++;
|
||||||
if(m_killFails > 5) { //should get this number from somewhere..
|
if(m_killFails > 5) { //should get this number from somewhere..
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str());
|
||||||
m_state = StateStopped;
|
m_state = StateStopped;
|
||||||
s_running--;
|
s_running--;
|
||||||
SendStatus();
|
SendStatus();
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
||||||
Stop(false);
|
Stop(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche
|
|||||||
|
|
||||||
switch(m_state) {
|
switch(m_state) {
|
||||||
case StateStartPending:
|
case StateStartPending:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str());
|
||||||
m_state = StateStartPending;
|
m_state = StateStartPending;
|
||||||
m_timer.Start(m_config->RestartWait);
|
m_timer.Start(m_config->RestartWait);
|
||||||
break;
|
break;
|
||||||
case StateStarted:
|
case StateStarted:
|
||||||
//something happened to our happy process...
|
//something happened to our happy process...
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str());
|
||||||
m_state = StateStartPending;
|
m_state = StateStartPending;
|
||||||
m_timer.Start(m_config->RestartWait);
|
m_timer.Start(m_config->RestartWait);
|
||||||
break;
|
break;
|
||||||
case StateRestartPending:
|
case StateRestartPending:
|
||||||
//it finally died, start it on up again
|
//it finally died, start it on up again
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str());
|
||||||
m_state = StateStartPending;
|
m_state = StateStartPending;
|
||||||
break;
|
break;
|
||||||
case StateStopPending:
|
case StateStopPending:
|
||||||
//it finally died, transition to close.
|
//it finally died, transition to close.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str());
|
||||||
m_state = StateStopped;
|
m_state = StateStopped;
|
||||||
break;
|
break;
|
||||||
case StateStopped:
|
case StateStopped:
|
||||||
//we already thought it was stopped... dont care...
|
//we already thought it was stopped... dont care...
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
|
|||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf))
|
if (!Open(host, user, passwd, database, port, &errnum, errbuf))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
|
Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||||
HandleMysqlError(errnum);
|
HandleMysqlError(errnum);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port);
|
Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message,
|
|||||||
safe_delete_array(escapedMessage);
|
safe_delete_array(escapedMessage);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) {
|
|||||||
QS->char2_money.silver, QS->char2_money.copper, QS->char2_count);
|
QS->char2_money.silver, QS->char2_money.copper, QS->char2_count);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(detailCount == 0)
|
if(detailCount == 0)
|
||||||
@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) {
|
|||||||
QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5);
|
QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount)
|
|||||||
QS->npc_count);
|
QS->npc_count);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(detailCount == 0)
|
if(detailCount == 0)
|
||||||
@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount)
|
|||||||
QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4,
|
QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4,
|
||||||
QS->items[i].aug_5);
|
QS->items[i].aug_5);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){
|
|||||||
QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID);
|
QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(members == 0)
|
if(members == 0)
|
||||||
@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){
|
|||||||
lastIndex, QS->Chars[i].char_id);
|
lastIndex, QS->Chars[i].char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) {
|
|||||||
QS->char_id, QS->stack_size, QS->char_count, QS->char_count);
|
QS->char_id, QS->stack_size, QS->char_count, QS->char_count);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(items == 0)
|
if(items == 0)
|
||||||
@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) {
|
|||||||
QS->items[i].aug_5);
|
QS->items[i].aug_5);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) {
|
|||||||
QS->char_count, QS->postaction);
|
QS->char_count, QS->postaction);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(items == 0)
|
if(items == 0)
|
||||||
@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) {
|
|||||||
QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5);
|
QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3
|
|||||||
QS->char_money.copper, QS->char_count);
|
QS->char_money.copper, QS->char_count);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(items == 0)
|
if(items == 0)
|
||||||
@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3
|
|||||||
QS->items[i].aug_5);
|
QS->items[i].aug_5);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) {
|
|||||||
std::string query(queryBuffer);
|
std::string query(queryBuffer);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ bool LFGuildManager::LoadDatabase()
|
|||||||
"`aacount`, `timezone`, `timeposted` FROM `lfguild`";
|
"`aacount`, `timezone`, `timeposted` FROM `lfguild`";
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char
|
|||||||
std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From);
|
std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
uint32 Now = time(nullptr);
|
uint32 Now = time(nullptr);
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char
|
|||||||
From, Comments, Level, Class, AAPoints, TimeZone, Now);
|
From, Comments, Level, Class, AAPoints, TimeZone, Now);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30);
|
ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30);
|
||||||
@ -288,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char
|
|||||||
std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName);
|
std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
uint32 Now = time(nullptr);
|
uint32 Now = time(nullptr);
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char
|
|||||||
Classes, AACount, TimeZone, Now);
|
Classes, AACount, TimeZone, Now);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ void LFGuildManager::ExpireEntries()
|
|||||||
std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str());
|
std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
it = Players.erase(it);
|
it = Players.erase(it);
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ void LFGuildManager::ExpireEntries()
|
|||||||
std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str());
|
std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
it2 = Guilds.erase(it2);
|
it2 = Guilds.erase(it2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ LFGuildManager lfguildmanager;
|
|||||||
std::string WorldShortName;
|
std::string WorldShortName;
|
||||||
const queryservconfig *Config;
|
const queryservconfig *Config;
|
||||||
WorldServer *worldserver = 0;
|
WorldServer *worldserver = 0;
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num) {
|
||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
@ -50,7 +50,7 @@ void CatchSignal(int sig_num) {
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
RegisterExecutablePlatform(ExePlatformQueryServ);
|
RegisterExecutablePlatform(ExePlatformQueryServ);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
Timer LFGuildExpireTimer(60000);
|
Timer LFGuildExpireTimer(60000);
|
||||||
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
||||||
@ -65,16 +65,16 @@ int main() {
|
|||||||
</qsdatabase>
|
</qsdatabase>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ.");
|
||||||
if (!queryservconfig::LoadConfig()) {
|
if (!queryservconfig::LoadConfig()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Config = queryservconfig::get();
|
Config = queryservconfig::get();
|
||||||
WorldShortName = Config->ShortName;
|
WorldShortName = Config->ShortName;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL...");
|
||||||
|
|
||||||
/* MySQL Connection */
|
/* MySQL Connection */
|
||||||
if (!database.Connect(
|
if (!database.Connect(
|
||||||
@ -83,22 +83,22 @@ int main() {
|
|||||||
Config->QSDatabasePassword.c_str(),
|
Config->QSDatabasePassword.c_str(),
|
||||||
Config->QSDatabaseDB.c_str(),
|
Config->QSDatabaseDB.c_str(),
|
||||||
Config->QSDatabasePort)) {
|
Config->QSDatabasePort)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize Logging */
|
/* Initialize Logging */
|
||||||
if (!load_log_settings(Config->LogSettingsFile.c_str()))
|
if (!load_log_settings(Config->LogSettingsFile.c_str()))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
||||||
|
|
||||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ WorldServer::~WorldServer()
|
|||||||
|
|
||||||
void WorldServer::OnConnected()
|
void WorldServer::OnConnected()
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World.");
|
||||||
WorldConnection::OnConnected();
|
WorldConnection::OnConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ void WorldServer::Process()
|
|||||||
ServerPacket *pack = 0;
|
ServerPacket *pack = 0;
|
||||||
while((pack = tcpc.PopPacket()))
|
while((pack = tcpc.PopPacket()))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode);
|
||||||
switch(pack->opcode) {
|
switch(pack->opcode) {
|
||||||
case 0: {
|
case 0: {
|
||||||
break;
|
break;
|
||||||
@ -148,7 +148,7 @@ void WorldServer::Process()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -33,29 +33,29 @@
|
|||||||
#include "spells.h"
|
#include "spells.h"
|
||||||
#include "base_data.h"
|
#include "base_data.h"
|
||||||
|
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "Shared Memory Loader Program");
|
Log.Log(EQEmuLogSys::Status, "Shared Memory Loader Program");
|
||||||
if(!EQEmuConfig::LoadConfig()) {
|
if(!EQEmuConfig::LoadConfig()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
|
Log.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EQEmuConfig *config = EQEmuConfig::get();
|
const EQEmuConfig *config = EQEmuConfig::get();
|
||||||
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
if(!load_log_settings(config->LogSettingsFile.c_str())) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedDatabase database;
|
SharedDatabase database;
|
||||||
logger.Log(EQEmuLogSys::Status, "Connecting to database...");
|
Log.Log(EQEmuLogSys::Status, "Connecting to database...");
|
||||||
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
|
||||||
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
|
Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
|
||||||
"database connection");
|
"database connection");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -114,61 +114,61 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(load_all || load_items) {
|
if(load_all || load_items) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading items...");
|
Log.Log(EQEmuLogSys::Status, "Loading items...");
|
||||||
try {
|
try {
|
||||||
LoadItems(&database);
|
LoadItems(&database);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "%s", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(load_all || load_factions) {
|
if(load_all || load_factions) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading factions...");
|
Log.Log(EQEmuLogSys::Status, "Loading factions...");
|
||||||
try {
|
try {
|
||||||
LoadFactions(&database);
|
LoadFactions(&database);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "%s", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(load_all || load_loot) {
|
if(load_all || load_loot) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading loot...");
|
Log.Log(EQEmuLogSys::Status, "Loading loot...");
|
||||||
try {
|
try {
|
||||||
LoadLoot(&database);
|
LoadLoot(&database);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "%s", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(load_all || load_skill_caps) {
|
if(load_all || load_skill_caps) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading skill caps...");
|
Log.Log(EQEmuLogSys::Status, "Loading skill caps...");
|
||||||
try {
|
try {
|
||||||
LoadSkillCaps(&database);
|
LoadSkillCaps(&database);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "%s", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(load_all || load_spells) {
|
if(load_all || load_spells) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading spells...");
|
Log.Log(EQEmuLogSys::Status, "Loading spells...");
|
||||||
try {
|
try {
|
||||||
LoadSpells(&database);
|
LoadSpells(&database);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "%s", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(load_all || load_bd) {
|
if(load_all || load_bd) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading base data...");
|
Log.Log(EQEmuLogSys::Status, "Loading base data...");
|
||||||
try {
|
try {
|
||||||
LoadBaseData(&database);
|
LoadBaseData(&database);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "%s", ex.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in
|
|||||||
|
|
||||||
Moderated = false;
|
Moderated = false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
|
||||||
Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus);
|
Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -149,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) {
|
|||||||
|
|
||||||
void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
|
void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str());
|
||||||
|
|
||||||
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
|
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
|
|||||||
|
|
||||||
void ChatChannelList::RemoveAllChannels() {
|
void ChatChannelList::RemoveAllChannels() {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels");
|
||||||
|
|
||||||
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
|
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ void ChatChannel::AddClient(Client *c) {
|
|||||||
|
|
||||||
if(IsClientInChannel(c)) {
|
if(IsClientInChannel(c)) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ void ChatChannel::AddClient(Client *c) {
|
|||||||
|
|
||||||
int AccountStatus = c->GetAccountStatus();
|
int AccountStatus = c->GetAccountStatus();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
|
||||||
|
|
||||||
LinkedListIterator<Client*> iterator(ClientsInChannel);
|
LinkedListIterator<Client*> iterator(ClientsInChannel);
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) {
|
|||||||
|
|
||||||
if(!c) return false;
|
if(!c) return false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
|
||||||
|
|
||||||
bool HideMe = c->GetHideMe();
|
bool HideMe = c->GetHideMe();
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) {
|
|||||||
if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0))
|
if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str());
|
||||||
|
|
||||||
DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000);
|
DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000);
|
||||||
}
|
}
|
||||||
@ -397,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) {
|
|||||||
|
|
||||||
if(ChannelClient)
|
if(ChannelClient)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s",
|
||||||
ChannelClient->GetName().c_str(), Sender->GetName().c_str());
|
ChannelClient->GetName().c_str(), Sender->GetName().c_str());
|
||||||
ChannelClient->SendChannelMessage(Name, Message, Sender);
|
ChannelClient->SendChannelMessage(Name, Message, Sender);
|
||||||
}
|
}
|
||||||
@ -479,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
|
||||||
|
|
||||||
ChatChannel *RequiredChannel = FindChannel(NormalisedName);
|
ChatChannel *RequiredChannel = FindChannel(NormalisedName);
|
||||||
|
|
||||||
@ -555,7 +555,7 @@ void ChatChannelList::Process() {
|
|||||||
|
|
||||||
if(CurrentChannel && CurrentChannel->ReadyToDelete()) {
|
if(CurrentChannel && CurrentChannel->ReadyToDelete()) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.",
|
||||||
CurrentChannel->GetName().c_str());
|
CurrentChannel->GetName().c_str());
|
||||||
|
|
||||||
RemoveChannel(CurrentChannel);
|
RemoveChannel(CurrentChannel);
|
||||||
@ -572,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) {
|
|||||||
|
|
||||||
Invitees.push_back(Invitee);
|
Invitees.push_back(Invitee);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) {
|
|||||||
|
|
||||||
Invitees.erase(Iterator);
|
Invitees.erase(Iterator);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -613,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) {
|
|||||||
|
|
||||||
Moderators.push_back(Moderator);
|
Moderators.push_back(Moderator);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -628,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) {
|
|||||||
|
|
||||||
Moderators.erase(Iterator);
|
Moderators.erase(Iterator);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -654,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) {
|
|||||||
|
|
||||||
Voiced.push_back(inVoiced);
|
Voiced.push_back(inVoiced);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -669,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) {
|
|||||||
|
|
||||||
Voiced.erase(Iterator);
|
Voiced.erase(Iterator);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -236,7 +236,7 @@ std::vector<std::string> ParseRecipients(std::string RecipientString) {
|
|||||||
|
|
||||||
static void ProcessMailTo(Client *c, std::string MailMessage) {
|
static void ProcessMailTo(Client *c, std::string MailMessage) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str());
|
||||||
|
|
||||||
std::vector<std::string> Recipients;
|
std::vector<std::string> Recipients;
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) {
|
|||||||
|
|
||||||
if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) {
|
if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(),
|
||||||
c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str());
|
c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str());
|
||||||
|
|
||||||
int PacketLength = 10 + Recipient.length() + Subject.length();
|
int PacketLength = 10 + Recipient.length() + Subject.length();
|
||||||
@ -400,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) {
|
|||||||
|
|
||||||
static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str());
|
||||||
c->GeneralChannelMessage("Buddy list modified");
|
c->GeneralChannelMessage("Buddy list modified");
|
||||||
|
|
||||||
uint8 SubAction = 1;
|
uint8 SubAction = 1;
|
||||||
@ -430,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
|||||||
|
|
||||||
static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
|
static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str());
|
||||||
c->GeneralChannelMessage("Ignore list modified");
|
c->GeneralChannelMessage("Ignore list modified");
|
||||||
|
|
||||||
uint8 SubAction = 0;
|
uint8 SubAction = 0;
|
||||||
@ -481,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
if (chatsf->Open())
|
if (chatsf->Open())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort);
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort);
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -560,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) {
|
|||||||
if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName())
|
if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName())
|
||||||
&& (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) {
|
&& (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str());
|
||||||
|
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
|
|
||||||
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||||
ntohs((*Iterator)->ClientStream->GetRemotePort()));
|
ntohs((*Iterator)->ClientStream->GetRemotePort()));
|
||||||
|
|
||||||
safe_delete((*Iterator));
|
safe_delete((*Iterator));
|
||||||
@ -586,7 +586,7 @@ void Clientlist::Process() {
|
|||||||
|
|
||||||
in.s_addr = eqs->GetRemoteIP();
|
in.s_addr = eqs->GetRemoteIP();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort()));
|
||||||
|
|
||||||
eqs->SetOpcodeManager(&ChatOpMgr);
|
eqs->SetOpcodeManager(&ChatOpMgr);
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ void Clientlist::Process() {
|
|||||||
|
|
||||||
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||||
ntohs((*Iterator)->ClientStream->GetRemotePort()));
|
ntohs((*Iterator)->ClientStream->GetRemotePort()));
|
||||||
|
|
||||||
safe_delete((*Iterator));
|
safe_delete((*Iterator));
|
||||||
@ -646,7 +646,7 @@ void Clientlist::Process() {
|
|||||||
|
|
||||||
if(strlen(PacketBuffer) != 9)
|
if(strlen(PacketBuffer) != 9)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS.");
|
||||||
KeyValid = false;
|
KeyValid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -667,11 +667,11 @@ void Clientlist::Process() {
|
|||||||
else
|
else
|
||||||
CharacterName = MailBoxString.substr(LastPeriod + 1);
|
CharacterName = MailBoxString.substr(LastPeriod + 1);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key);
|
||||||
|
|
||||||
if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) {
|
if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox);
|
||||||
|
|
||||||
KeyValid = false;
|
KeyValid = false;
|
||||||
|
|
||||||
@ -703,7 +703,7 @@ void Clientlist::Process() {
|
|||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -716,7 +716,7 @@ void Clientlist::Process() {
|
|||||||
|
|
||||||
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i",
|
||||||
inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()),
|
inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()),
|
||||||
KeyValid, (*Iterator)->GetForceDisconnect());
|
KeyValid, (*Iterator)->GetForceDisconnect());
|
||||||
|
|
||||||
@ -860,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CommandSetMessageStatus:
|
case CommandSetMessageStatus:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str());
|
||||||
ProcessSetMessageStatus(Parameters);
|
ProcessSetMessageStatus(Parameters);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -885,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
c->SendHelp();
|
c->SendHelp();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,7 +896,7 @@ void Clientlist::CloseAllConnections() {
|
|||||||
|
|
||||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str());
|
||||||
|
|
||||||
(*Iterator)->CloseConnection();
|
(*Iterator)->CloseConnection();
|
||||||
}
|
}
|
||||||
@ -905,7 +905,7 @@ void Clientlist::CloseAllConnections() {
|
|||||||
void Client::AddCharacter(int CharID, const char *CharacterName, int Level) {
|
void Client::AddCharacter(int CharID, const char *CharacterName, int Level) {
|
||||||
|
|
||||||
if(!CharacterName) return;
|
if(!CharacterName) return;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str());
|
||||||
CharacterEntry NewCharacter;
|
CharacterEntry NewCharacter;
|
||||||
NewCharacter.CharID = CharID;
|
NewCharacter.CharID = CharID;
|
||||||
NewCharacter.Name = CharacterName;
|
NewCharacter.Name = CharacterName;
|
||||||
@ -971,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) {
|
|||||||
for(int i = 0; i < MAX_JOINED_CHANNELS; i++)
|
for(int i = 0; i < MAX_JOINED_CHANNELS; i++)
|
||||||
if(JoinedChannels[i] == nullptr) {
|
if(JoinedChannels[i] == nullptr) {
|
||||||
JoinedChannels[i] = JoinedChannel;
|
JoinedChannels[i] = JoinedChannel;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1012,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||||
|
|
||||||
int NumberOfChannels = ChannelCount();
|
int NumberOfChannels = ChannelCount();
|
||||||
|
|
||||||
@ -1113,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
|
|||||||
|
|
||||||
void Client::LeaveChannels(std::string ChannelNameList) {
|
void Client::LeaveChannels(std::string ChannelNameList) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||||
|
|
||||||
std::string::size_type CurrentPos = 0;
|
std::string::size_type CurrentPos = 0;
|
||||||
|
|
||||||
@ -1292,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message)
|
|||||||
|
|
||||||
std::string ChannelName = Message.substr(1, MessageStart-1);
|
std::string ChannelName = Message.substr(1, MessageStart-1);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str());
|
||||||
|
|
||||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||||
|
|
||||||
@ -1435,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(),
|
||||||
Message.substr(MessageStart + 1).c_str());
|
Message.substr(MessageStart + 1).c_str());
|
||||||
|
|
||||||
if(RuleB(Chat, EnableAntiSpam))
|
if(RuleB(Chat, EnableAntiSpam))
|
||||||
@ -1647,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) {
|
|||||||
else
|
else
|
||||||
Message = "Password change on channel " + ChannelName;
|
Message = "Password change on channel " + ChannelName;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str());
|
||||||
|
|
||||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||||
|
|
||||||
@ -1702,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) {
|
|||||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str());
|
||||||
|
|
||||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||||
|
|
||||||
@ -1790,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) {
|
|||||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
||||||
|
|
||||||
Client *RequiredClient = CL->FindCharacter(Invitee);
|
Client *RequiredClient = CL->FindCharacter(Invitee);
|
||||||
|
|
||||||
@ -1918,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) {
|
|||||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
||||||
|
|
||||||
Client *RequiredClient = CL->FindCharacter(Moderator);
|
Client *RequiredClient = CL->FindCharacter(Moderator);
|
||||||
|
|
||||||
@ -1999,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) {
|
|||||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
||||||
|
|
||||||
Client *RequiredClient = CL->FindCharacter(Voicee);
|
Client *RequiredClient = CL->FindCharacter(Voicee);
|
||||||
|
|
||||||
@ -2087,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) {
|
|||||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
||||||
|
|
||||||
Client *RequiredClient = CL->FindCharacter(Kickee);
|
Client *RequiredClient = CL->FindCharacter(Kickee);
|
||||||
|
|
||||||
@ -2196,32 +2196,32 @@ void Client::SetConnectionType(char c) {
|
|||||||
case 'S':
|
case 'S':
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'U':
|
case 'U':
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeCombined;
|
TypeOfConnection = ConnectionTypeCombined;
|
||||||
UnderfootOrLater = true;
|
UnderfootOrLater = true;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'M':
|
case 'M':
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeMail;
|
TypeOfConnection = ConnectionTypeMail;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'C':
|
case 'C':
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeChat;
|
TypeOfConnection = ConnectionTypeChat;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
TypeOfConnection = ConnectionTypeUnknown;
|
TypeOfConnection = ConnectionTypeUnknown;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2299,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin
|
|||||||
|
|
||||||
void Client::ChangeMailBox(int NewMailBox) {
|
void Client::ChangeMailBox(int NewMailBox) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox);
|
||||||
|
|
||||||
SetMailBox(NewMailBox);
|
SetMailBox(NewMailBox);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str());
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_MailboxChange, 2);
|
auto outapp = new EQApplicationPacket(OP_MailboxChange, 2);
|
||||||
|
|
||||||
@ -2377,13 +2377,13 @@ std::string Client::MailBoxName() {
|
|||||||
|
|
||||||
if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1)))
|
if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1)))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||||
CurrentMailBox, Characters.size());
|
CurrentMailBox, Characters.size());
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||||
CurrentMailBox, Characters.size());
|
CurrentMailBox, Characters.size());
|
||||||
|
|
||||||
return Characters[CurrentMailBox].Name;
|
return Characters[CurrentMailBox].Name;
|
||||||
|
|||||||
@ -74,14 +74,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
|
|||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf))
|
if (!Open(host, user, passwd, database, port, &errnum, errbuf))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
|
Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||||
HandleMysqlError(errnum);
|
HandleMysqlError(errnum);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port);
|
Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) {
|
|||||||
client->GetAccountID());
|
client->GetAccountID());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str());
|
||||||
|
|
||||||
if(results.RowCount() != 1)
|
if(results.RowCount() != 1)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) {
|
|||||||
client->SetKarma(atoi(row[2]));
|
client->SetKarma(atoi(row[2]));
|
||||||
client->SetRevoked((atoi(row[3])==1?true:false));
|
client->SetRevoked((atoi(row[3])==1?true:false));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Database::FindAccount(const char *characterName, Client *client) {
|
int Database::FindAccount(const char *characterName, Client *client) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName);
|
||||||
|
|
||||||
|
|
||||||
client->ClearCharacters();
|
client->ClearCharacters();
|
||||||
@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) {
|
|||||||
characterName);
|
characterName);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() != 1) {
|
if (results.RowCount() != 1) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) {
|
|||||||
|
|
||||||
int accountID = atoi(row[1]);
|
int accountID = atoi(row[1]);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID);
|
||||||
|
|
||||||
query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` "
|
query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` "
|
||||||
"WHERE `account_id` = %i AND `name` != '%s'",
|
"WHERE `account_id` = %i AND `name` != '%s'",
|
||||||
@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri
|
|||||||
characterName.c_str());
|
characterName.c_str());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri
|
|||||||
else
|
else
|
||||||
sprintf(combinedKey, "%s", MailKey.c_str());
|
sprintf(combinedKey, "%s", MailKey.c_str());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey);
|
||||||
|
|
||||||
return !strcmp(row[0], combinedKey);
|
return !strcmp(row[0], combinedKey);
|
||||||
}
|
}
|
||||||
@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) {
|
|||||||
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName);
|
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
safe_delete(safeCharName);
|
safe_delete(safeCharName);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
safe_delete(safeCharName);
|
safe_delete(safeCharName);
|
||||||
|
|
||||||
if (results.RowCount() != 1) {
|
if (results.RowCount() != 1) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_
|
|||||||
std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname);
|
std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_
|
|||||||
|
|
||||||
bool Database::LoadChatChannels() {
|
bool Database::LoadChatChannels() {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database.");
|
||||||
|
|
||||||
const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`";
|
const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,25 +267,25 @@ bool Database::LoadChatChannels() {
|
|||||||
|
|
||||||
void Database::SetChannelPassword(std::string channelName, std::string password) {
|
void Database::SetChannelPassword(std::string channelName, std::string password) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str());
|
||||||
|
|
||||||
std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'",
|
std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'",
|
||||||
password.c_str(), channelName.c_str());
|
password.c_str(), channelName.c_str());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetChannelOwner(std::string channelName, std::string owner) {
|
void Database::SetChannelOwner(std::string channelName, std::string owner) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str());
|
||||||
|
|
||||||
std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'",
|
std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'",
|
||||||
owner.c_str(), channelName.c_str());
|
owner.c_str(), channelName.c_str());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) {
|
|||||||
int unknownField3 = 1;
|
int unknownField3 = 1;
|
||||||
int characterID = FindCharacter(client->MailBoxName().c_str());
|
int characterID = FindCharacter(client->MailBoxName().c_str());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID);
|
||||||
|
|
||||||
if(characterID <= 0)
|
if(characterID <= 0)
|
||||||
return;
|
return;
|
||||||
@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) {
|
|||||||
|
|
||||||
int characterID = FindCharacter(client->MailBoxName().c_str());
|
int characterID = FindCharacter(client->MailBoxName().c_str());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID);
|
||||||
|
|
||||||
if(characterID <= 0)
|
if(characterID <= 0)
|
||||||
return;
|
return;
|
||||||
@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) {
|
|||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1]));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1]));
|
||||||
|
|
||||||
int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]);
|
int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]);
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub
|
|||||||
|
|
||||||
characterID = FindCharacter(characterName.c_str());
|
characterID = FindCharacter(characterName.c_str());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID);
|
||||||
|
|
||||||
if(characterID <= 0)
|
if(characterID <= 0)
|
||||||
return false;
|
return false;
|
||||||
@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub
|
|||||||
safe_delete_array(escBody);
|
safe_delete_array(escBody);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str());
|
||||||
|
|
||||||
|
|
||||||
Client *client = CL->IsCharacterOnline(characterName);
|
Client *client = CL->IsCharacterOnline(characterName);
|
||||||
@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub
|
|||||||
|
|
||||||
void Database::SetMessageStatus(int messageNumber, int status) {
|
void Database::SetMessageStatus(int messageNumber, int status) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status);
|
||||||
|
|
||||||
if(status == 0) {
|
if(status == 0) {
|
||||||
std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber);
|
std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber);
|
||||||
@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) {
|
|||||||
std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber);
|
std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::ExpireMail() {
|
void Database::ExpireMail() {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail...");
|
||||||
|
|
||||||
std::string query = "SELECT COUNT(*) FROM `mail`";
|
std::string query = "SELECT COUNT(*) FROM `mail`";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]);
|
||||||
|
|
||||||
// Expire Trash
|
// Expire Trash
|
||||||
if(RuleI(Mail, ExpireTrash) >= 0) {
|
if(RuleI(Mail, ExpireTrash) >= 0) {
|
||||||
@ -524,9 +524,9 @@ void Database::ExpireMail() {
|
|||||||
time(nullptr) - RuleI(Mail, ExpireTrash));
|
time(nullptr) - RuleI(Mail, ExpireTrash));
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(results.Success())
|
if(results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -536,9 +536,9 @@ void Database::ExpireMail() {
|
|||||||
time(nullptr) - RuleI(Mail, ExpireRead));
|
time(nullptr) - RuleI(Mail, ExpireRead));
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(results.Success())
|
if(results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expire Unread
|
// Expire Unread
|
||||||
@ -547,9 +547,9 @@ void Database::ExpireMail() {
|
|||||||
time(nullptr) - RuleI(Mail, ExpireUnread));
|
time(nullptr) - RuleI(Mail, ExpireUnread));
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if(results.Success())
|
if(results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) {
|
|||||||
charID, type, CapitaliseName(name).c_str());
|
charID, type, CapitaliseName(name).c_str());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) {
|
|||||||
charID, type, CapitaliseName(name).c_str());
|
charID, type, CapitaliseName(name).c_str());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector<std::string> &friends
|
|||||||
std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID);
|
std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector<std::string> &friends
|
|||||||
if(atoi(row[0]) == 0)
|
if(atoi(row[0]) == 0)
|
||||||
{
|
{
|
||||||
ignorees.push_back(name);
|
ignorees.push_back(name);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
friends.push_back(name);
|
friends.push_back(name);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
30
ucs/ucs.cpp
30
ucs/ucs.cpp
@ -51,7 +51,7 @@ std::string WorldShortName;
|
|||||||
const ucsconfig *Config;
|
const ucsconfig *Config;
|
||||||
|
|
||||||
WorldServer *worldserver = nullptr;
|
WorldServer *worldserver = nullptr;
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num) {
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ std::string GetMailPrefix() {
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
RegisterExecutablePlatform(ExePlatformUCS);
|
RegisterExecutablePlatform(ExePlatformUCS);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
// Check every minute for unused channels we can delete
|
// Check every minute for unused channels we can delete
|
||||||
@ -78,11 +78,11 @@ int main() {
|
|||||||
|
|
||||||
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server.");
|
||||||
|
|
||||||
if (!ucsconfig::LoadConfig()) {
|
if (!ucsconfig::LoadConfig()) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed.");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -90,13 +90,13 @@ int main() {
|
|||||||
Config = ucsconfig::get();
|
Config = ucsconfig::get();
|
||||||
|
|
||||||
if(!load_log_settings(Config->LogSettingsFile.c_str()))
|
if(!load_log_settings(Config->LogSettingsFile.c_str()))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
||||||
|
|
||||||
WorldShortName = Config->ShortName;
|
WorldShortName = Config->ShortName;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL...");
|
||||||
|
|
||||||
if (!database.Connect(
|
if (!database.Connect(
|
||||||
Config->DatabaseHost.c_str(),
|
Config->DatabaseHost.c_str(),
|
||||||
@ -104,22 +104,22 @@ int main() {
|
|||||||
Config->DatabasePassword.c_str(),
|
Config->DatabasePassword.c_str(),
|
||||||
Config->DatabaseDB.c_str(),
|
Config->DatabaseDB.c_str(),
|
||||||
Config->DatabasePort)) {
|
Config->DatabasePort)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
|
|
||||||
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp);
|
||||||
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules");
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ int main() {
|
|||||||
|
|
||||||
if(Config->ChatPort != Config->MailPort)
|
if(Config->ChatPort != Config->MailPort)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS.");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,11 +138,11 @@ int main() {
|
|||||||
database.LoadChatChannels();
|
database.LoadChatChannels();
|
||||||
|
|
||||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ WorldServer::~WorldServer()
|
|||||||
|
|
||||||
void WorldServer::OnConnected()
|
void WorldServer::OnConnected()
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World.");
|
||||||
WorldConnection::OnConnected();
|
WorldConnection::OnConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ void WorldServer::Process()
|
|||||||
|
|
||||||
while((pack = tcpc.PopPacket()))
|
while((pack = tcpc.PopPacket()))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode);
|
||||||
|
|
||||||
switch(pack->opcode)
|
switch(pack->opcode)
|
||||||
{
|
{
|
||||||
@ -88,7 +88,7 @@ void WorldServer::Process()
|
|||||||
|
|
||||||
std::string Message = Buffer;
|
std::string Message = Buffer;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str());
|
||||||
|
|
||||||
Client *c = CL->FindCharacter(From);
|
Client *c = CL->FindCharacter(From);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ void WorldServer::Process()
|
|||||||
|
|
||||||
if(!c)
|
if(!c)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID());
|
std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||||
dbid_list.push_back(atoi(row[0]));
|
dbid_list.push_back(atoi(row[0]));
|
||||||
@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard()
|
|||||||
x, y, z, GetInstanceID());
|
x, y, z, GetInstanceID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto c_iter = charid_list.begin();
|
auto c_iter = charid_list.begin();
|
||||||
|
|||||||
@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates()
|
|||||||
"graveyard_radius FROM adventure_template";
|
"graveyard_radius FROM adventure_template";
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries()
|
|||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo()
|
|||||||
"AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;";
|
"AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;";
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
168
world/client.cpp
168
world/client.cpp
@ -136,7 +136,7 @@ void Client::SendEnterWorld(std::string name)
|
|||||||
eqs->Close();
|
eqs->Close();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
if (strlen(password) <= 1) {
|
if (strlen(password) <= 1) {
|
||||||
// TODO: Find out how to tell the client wrong username/password
|
// TODO: Find out how to tell the client wrong username/password
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,31 +408,31 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
|||||||
if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password)))
|
if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password)))
|
||||||
#else
|
#else
|
||||||
if (loginserverlist.Connected() == false && !pZoning) {
|
if (loginserverlist.Connected() == false && !pZoning) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password))))
|
if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password))))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) {
|
if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?");
|
||||||
if(!minilogin)
|
if(!minilogin)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable...");
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cle->SetOnline();
|
cle->SetOnline();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)");
|
||||||
|
|
||||||
if(minilogin){
|
if(minilogin){
|
||||||
WorldConfig::DisableStats();
|
WorldConfig::DisableStats();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID());
|
||||||
}
|
}
|
||||||
|
|
||||||
const WorldConfig *Config=WorldConfig::get();
|
const WorldConfig *Config=WorldConfig::get();
|
||||||
@ -465,7 +465,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// TODO: Find out how to tell the client wrong username/password
|
// TODO: Find out how to tell the client wrong username/password
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,7 +479,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
|||||||
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
||||||
{
|
{
|
||||||
if (GetAccountID() == 0) {
|
if (GetAccountID() == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
|||||||
uchar race = app->pBuffer[64];
|
uchar race = app->pBuffer[64];
|
||||||
uchar clas = app->pBuffer[68];
|
uchar clas = app->pBuffer[68];
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas));
|
||||||
|
|
||||||
EQApplicationPacket *outapp;
|
EQApplicationPacket *outapp;
|
||||||
outapp = new EQApplicationPacket;
|
outapp = new EQApplicationPacket;
|
||||||
@ -648,11 +648,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
||||||
if (GetAccountID() == 0) {
|
if (GetAccountID() == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (app->size != sizeof(CharCreate_Struct)) {
|
else if (app->size != sizeof(CharCreate_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct));
|
||||||
DumpPacket(app);
|
DumpPacket(app);
|
||||||
// the previous behavior was essentially returning true here
|
// the previous behavior was essentially returning true here
|
||||||
// but that seems a bit odd to me.
|
// but that seems a bit odd to me.
|
||||||
@ -679,14 +679,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||||
if (GetAccountID() == 0) {
|
if (GetAccountID() == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GetAdmin() < 0)
|
if(GetAdmin() < 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended.");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -702,14 +702,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
uint32 tmpaccid = 0;
|
uint32 tmpaccid = 0;
|
||||||
charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID);
|
charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID);
|
||||||
if (charid == 0 || tmpaccid != GetAccountID()) {
|
if (charid == 0 || tmpaccid != GetAccountID()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name);
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure this account owns this character
|
// Make sure this account owns this character
|
||||||
if (tmpaccid != GetAccountID()) {
|
if (tmpaccid != GetAccountID()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name);
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -737,7 +737,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
zoneID = database.MoveCharacterToBind(charid,4);
|
zoneID = database.MoveCharacterToBind(charid,4);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name);
|
||||||
database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able.");
|
database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able.");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
return true;
|
return true;
|
||||||
@ -770,7 +770,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name);
|
||||||
database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character.");
|
database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character.");
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
return true;
|
return true;
|
||||||
@ -780,7 +780,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
|||||||
if (zoneID == 0 || !database.GetZoneName(zoneID)) {
|
if (zoneID == 0 || !database.GetZoneName(zoneID)) {
|
||||||
// This is to save people in an invalid zone, once it's removed from the DB
|
// This is to save people in an invalid zone, once it's removed from the DB
|
||||||
database.MoveCharacterToZone(charid, "arena");
|
database.MoveCharacterToZone(charid, "arena");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(instanceID > 0)
|
if(instanceID > 0)
|
||||||
@ -894,7 +894,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer);
|
uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer);
|
||||||
if(char_acct_id == GetAccountID()) {
|
if(char_acct_id == GetAccountID()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer);
|
||||||
database.DeleteCharacter((char *)app->pBuffer);
|
database.DeleteCharacter((char *)app->pBuffer);
|
||||||
SendCharInfo();
|
SendCharInfo();
|
||||||
}
|
}
|
||||||
@ -915,25 +915,25 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
EmuOpcode opcode = app->GetOpcode();
|
EmuOpcode opcode = app->GetOpcode();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket");
|
||||||
_pkt(WORLD__CLIENT_TRACE,app);
|
_pkt(WORLD__CLIENT_TRACE,app);
|
||||||
|
|
||||||
if (!eqs->CheckState(ESTABLISHED)) {
|
if (!eqs->CheckState(ESTABLISHED)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses
|
// Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses
|
||||||
if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
|
if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
|
||||||
if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) {
|
if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
||||||
eqs->Close();
|
eqs->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) {
|
if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) {
|
||||||
// Got a packet other than OP_SendLoginInfo when not logged in
|
// Got a packet other than OP_SendLoginInfo when not logged in
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (opcode == OP_AckPacket) {
|
else if (opcode == OP_AckPacket) {
|
||||||
@ -1005,7 +1005,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket");
|
||||||
_pkt(WORLD__CLIENT_ERR,app);
|
_pkt(WORLD__CLIENT_ERR,app);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1024,7 +1024,7 @@ bool Client::Process() {
|
|||||||
to.sin_addr.s_addr = ip;
|
to.sin_addr.s_addr = ip;
|
||||||
|
|
||||||
if (autobootup_timeout.Check()) {
|
if (autobootup_timeout.Check()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow.");
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
}
|
}
|
||||||
if(connect.Check()){
|
if(connect.Check()){
|
||||||
@ -1058,7 +1058,7 @@ bool Client::Process() {
|
|||||||
loginserverlist.SendPacket(pack);
|
loginserverlist.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1107,17 +1107,17 @@ void Client::EnterWorld(bool TryBootup) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (TryBootup) {
|
if (TryBootup) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID);
|
||||||
autobootup_timeout.Start();
|
autobootup_timeout.Start();
|
||||||
pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID);
|
pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID);
|
||||||
if (pwaitingforbootup == 0) {
|
if (pwaitingforbootup == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up.");
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name);
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1126,12 +1126,12 @@ void Client::EnterWorld(bool TryBootup) {
|
|||||||
|
|
||||||
cle->SetChar(charid, char_name);
|
cle->SetChar(charid, char_name);
|
||||||
database.UpdateLiveChar(char_name, GetAccountID());
|
database.UpdateLiveChar(char_name, GetAccountID());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID);
|
||||||
// database.SetAuthentication(account_id, char_name, zone_name, ip);
|
// database.SetAuthentication(account_id, char_name, zone_name, ip);
|
||||||
|
|
||||||
if (seencharsel) {
|
if (seencharsel) {
|
||||||
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) {
|
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked.");
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1169,9 +1169,9 @@ void Client::Clearance(int8 response)
|
|||||||
{
|
{
|
||||||
if (zs == 0)
|
if (zs == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!");
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
@ -1181,20 +1181,20 @@ void Client::Clearance(int8 response)
|
|||||||
EQApplicationPacket* outapp;
|
EQApplicationPacket* outapp;
|
||||||
|
|
||||||
if (zs->GetCAddress() == nullptr) {
|
if (zs->GetCAddress() == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!");
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zoneID == 0) {
|
if (zoneID == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!");
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* zonename = database.GetZoneName(zoneID);
|
const char* zonename = database.GetZoneName(zoneID);
|
||||||
if (zonename == 0) {
|
if (zonename == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!");
|
||||||
ZoneUnavail();
|
ZoneUnavail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1225,7 +1225,7 @@ void Client::Clearance(int8 response)
|
|||||||
}
|
}
|
||||||
strcpy(zsi->ip, zs_addr);
|
strcpy(zsi->ip, zs_addr);
|
||||||
zsi->port =zs->GetCPort();
|
zsi->port =zs->GetCPort();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port);
|
||||||
QueuePacket(outapp);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
@ -1256,7 +1256,7 @@ bool Client::GenPassKey(char* key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) {
|
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode());
|
||||||
_pkt(WORLD__CLIENT_TRACE, app);
|
_pkt(WORLD__CLIENT_TRACE, app);
|
||||||
|
|
||||||
ack_req = true; // It's broke right now, dont delete this line till fix it. =P
|
ack_req = true; // It's broke right now, dont delete this line till fix it. =P
|
||||||
@ -1355,27 +1355,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
|
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s",
|
||||||
cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false");
|
cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d",
|
||||||
cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA,
|
cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA,
|
||||||
stats_sum);
|
stats_sum);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor);
|
||||||
|
|
||||||
/* Validate the char creation struct */
|
/* Validate the char creation struct */
|
||||||
if (ClientVersionBit & BIT_SoFAndLater) {
|
if (ClientVersionBit & BIT_SoFAndLater) {
|
||||||
if (!CheckCharCreateInfoSoF(cc)) {
|
if (!CheckCharCreateInfoSoF(cc)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!CheckCharCreateInfoTitanium(cc)) {
|
if (!CheckCharCreateInfoTitanium(cc)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1437,21 +1437,21 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
|
|
||||||
/* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */
|
/* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */
|
||||||
if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) {
|
if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID));
|
||||||
pp.zone_id = RuleI(World, SoFStartZoneID);
|
pp.zone_id = RuleI(World, SoFStartZoneID);
|
||||||
if (pp.zone_id)
|
if (pp.zone_id)
|
||||||
database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z);
|
database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z);
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID));
|
||||||
} else {
|
} else {
|
||||||
/* if there's a startzone variable put them in there */
|
/* if there's a startzone variable put them in there */
|
||||||
if (database.GetVariable("startzone", startzone, 50)) {
|
if (database.GetVariable("startzone", startzone, 50)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone);
|
||||||
pp.zone_id = database.GetZoneID(startzone);
|
pp.zone_id = database.GetZoneID(startzone);
|
||||||
if (pp.zone_id)
|
if (pp.zone_id)
|
||||||
database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z);
|
database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z);
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone);
|
||||||
} else { /* otherwise use normal starting zone logic */
|
} else { /* otherwise use normal starting zone logic */
|
||||||
bool ValidStartZone = false;
|
bool ValidStartZone = false;
|
||||||
if (ClientVersionBit & BIT_TitaniumAndEarlier)
|
if (ClientVersionBit & BIT_TitaniumAndEarlier)
|
||||||
@ -1490,11 +1490,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
pp.binds[0].z = pp.z;
|
pp.binds[0].z = pp.z;
|
||||||
pp.binds[0].heading = pp.heading;
|
pp.binds[0].heading = pp.heading;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f",
|
||||||
database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading);
|
database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f",
|
||||||
database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z);
|
database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f",
|
||||||
database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z);
|
database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z);
|
||||||
|
|
||||||
/* Starting Items inventory */
|
/* Starting Items inventory */
|
||||||
@ -1503,10 +1503,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
// now we give the pp and the inv we made to StoreCharacter
|
// now we give the pp and the inv we made to StoreCharacter
|
||||||
// to see if we can store it
|
// to see if we can store it
|
||||||
if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) {
|
if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1516,7 +1516,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
|||||||
if (!cc)
|
if (!cc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info...");
|
||||||
|
|
||||||
RaceClassCombos class_combo;
|
RaceClassCombos class_combo;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -1533,7 +1533,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1550,7 +1550,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1563,37 +1563,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
|||||||
allocation.DefaultPointAllocation[6];
|
allocation.DefaultPointAllocation[6];
|
||||||
|
|
||||||
if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) {
|
if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) {
|
if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) {
|
if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) {
|
if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) {
|
if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) {
|
if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) {
|
if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1606,7 +1606,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
|||||||
current_stats += cc->WIS - allocation.BaseStats[5];
|
current_stats += cc->WIS - allocation.BaseStats[5];
|
||||||
current_stats += cc->CHA - allocation.BaseStats[6];
|
current_stats += cc->CHA - allocation.BaseStats[6];
|
||||||
if (current_stats > max_stats) {
|
if (current_stats > max_stats) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1687,7 +1687,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
|||||||
if (!cc)
|
if (!cc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info...");
|
||||||
|
|
||||||
classtemp = cc->class_ - 1;
|
classtemp = cc->class_ - 1;
|
||||||
racetemp = cc->race - 1;
|
racetemp = cc->race - 1;
|
||||||
@ -1700,16 +1700,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
|||||||
// if out of range looking it up in the table would crash stuff
|
// if out of range looking it up in the table would crash stuff
|
||||||
// so we return from these
|
// so we return from these
|
||||||
if (classtemp >= PLAYER_CLASS_COUNT) {
|
if (classtemp >= PLAYER_CLASS_COUNT) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (racetemp >= _TABLE_RACES) {
|
if (racetemp >= _TABLE_RACES) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs?
|
if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs?
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination");
|
||||||
// we return from this one, since if it's an invalid combination our table
|
// we return from this one, since if it's an invalid combination our table
|
||||||
// doesn't have meaningful values for the stats
|
// doesn't have meaningful values for the stats
|
||||||
return false;
|
return false;
|
||||||
@ -1737,43 +1737,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
|||||||
// that are messed up not just the first hit
|
// that are messed up not just the first hit
|
||||||
|
|
||||||
if (bTOTAL + stat_points != cTOTAL) {
|
if (bTOTAL + stat_points != cTOTAL) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL);
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc->STR > bSTR + stat_points || cc->STR < bSTR) {
|
if (cc->STR > bSTR + stat_points || cc->STR < bSTR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
if (cc->STA > bSTA + stat_points || cc->STA < bSTA) {
|
if (cc->STA > bSTA + stat_points || cc->STA < bSTA) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) {
|
if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) {
|
if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) {
|
if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
if (cc->INT > bINT + stat_points || cc->INT < bINT) {
|
if (cc->INT > bINT + stat_points || cc->INT < bINT) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) {
|
if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range");
|
||||||
Charerrors++;
|
Charerrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of)
|
/*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of)
|
||||||
I am NOT writing those tables - kathgar*/
|
I am NOT writing those tables - kathgar*/
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors);
|
||||||
|
|
||||||
return Charerrors == 0;
|
return Charerrors == 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) {
|
|||||||
int16 tmpStatus = WorldConfig::get()->DefaultStatus;
|
int16 tmpStatus = WorldConfig::get()->DefaultStatus;
|
||||||
paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID());
|
paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID());
|
||||||
if (!paccountid) {
|
if (!paccountid) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
strn0cpy(paccountname, plsname, sizeof(paccountname));
|
strn0cpy(paccountname, plsname, sizeof(paccountname));
|
||||||
|
|||||||
@ -56,7 +56,7 @@ void ClientList::Process() {
|
|||||||
if (!iterator.GetData()->Process()) {
|
if (!iterator.GetData()->Process()) {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = iterator.GetData()->GetIP();
|
in.s_addr = iterator.GetData()->GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort());
|
||||||
//the client destructor should take care of this.
|
//the client destructor should take care of this.
|
||||||
// iterator.GetData()->Free();
|
// iterator.GetData()->Free();
|
||||||
iterator.RemoveCurrent();
|
iterator.RemoveCurrent();
|
||||||
@ -425,7 +425,7 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword)
|
|||||||
}
|
}
|
||||||
int16 tmpadmin;
|
int16 tmpadmin;
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login with '%s' and '%s'", iName, iPassword);
|
//Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login with '%s' and '%s'", iName, iPassword);
|
||||||
|
|
||||||
uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin);
|
uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin);
|
||||||
if (accid) {
|
if (accid) {
|
||||||
@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
|||||||
|
|
||||||
if(!from)
|
if(!from)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
|||||||
safe_delete(output);
|
safe_delete(output);
|
||||||
}
|
}
|
||||||
catch(...){
|
catch(...){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
|||||||
safe_delete(pack2);
|
safe_delete(pack2);
|
||||||
}
|
}
|
||||||
catch(...){
|
catch(...){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) {
|
|||||||
|
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while(iterator.MoreElements()) {
|
while(iterator.MoreElements()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData());
|
||||||
if (iterator.GetData()->GetAccountID() == account_id) {
|
if (iterator.GetData()->GetAccountID() == account_id) {
|
||||||
Client* tmp = iterator.GetData();
|
Client* tmp = iterator.GetData();
|
||||||
return tmp;
|
return tmp;
|
||||||
@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) {
|
|||||||
|
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while(iterator.MoreElements()) {
|
while(iterator.MoreElements()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData());
|
||||||
if (iterator.GetData()->GetCharName() == charname) {
|
if (iterator.GetData()->GetCharName() == charname) {
|
||||||
Client* tmp = iterator.GetData();
|
Client* tmp = iterator.GetData();
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ void Console::Die() {
|
|||||||
state = CONSOLE_STATE_CLOSED;
|
state = CONSOLE_STATE_CLOSED;
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort());
|
||||||
tcpc->Disconnect();
|
tcpc->Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ bool Console::Process() {
|
|||||||
if (!tcpc->Connected()) {
|
if (!tcpc->Connected()) {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//if we have not gotten the special markers after this timer, send login prompt
|
//if we have not gotten the special markers after this timer, send login prompt
|
||||||
@ -234,7 +234,7 @@ bool Console::Process() {
|
|||||||
SendMessage(1, "Timeout, disconnecting...");
|
SendMessage(1, "Timeout, disconnecting...");
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,29 +243,29 @@ bool Console::Process() {
|
|||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) {
|
if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) {
|
||||||
auto zs = new ZoneServer(tcpc);
|
auto zs = new ZoneServer(tcpc);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort());
|
||||||
zoneserver_list.Add(zs);
|
zoneserver_list.Add(zs);
|
||||||
numzones++;
|
numzones++;
|
||||||
tcpc = 0;
|
tcpc = 0;
|
||||||
} else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) {
|
} else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort());
|
||||||
launcher_list.Add(tcpc);
|
launcher_list.Add(tcpc);
|
||||||
tcpc = 0;
|
tcpc = 0;
|
||||||
}
|
}
|
||||||
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS)
|
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort());
|
||||||
UCSLink.SetConnection(tcpc);
|
UCSLink.SetConnection(tcpc);
|
||||||
tcpc = 0;
|
tcpc = 0;
|
||||||
}
|
}
|
||||||
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ)
|
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort());
|
||||||
QSLink.SetConnection(tcpc);
|
QSLink.SetConnection(tcpc);
|
||||||
tcpc = 0;
|
tcpc = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) {
|
|||||||
state = CONSOLE_STATE_CLOSED;
|
state = CONSOLE_STATE_CLOSED;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin);
|
||||||
SendMessage(1, 0);
|
SendMessage(1, 0);
|
||||||
SendMessage(2, "Login accepted.");
|
SendMessage(2, "Login accepted.");
|
||||||
state = CONSOLE_STATE_CONNECTED;
|
state = CONSOLE_STATE_CONNECTED;
|
||||||
@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CONSOLE_STATE_CONNECTED: {
|
case CONSOLE_STATE_CONNECTED: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command);
|
||||||
Seperator sep(command);
|
Seperator sep(command);
|
||||||
if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) {
|
if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) {
|
||||||
SendMessage(1, " whoami");
|
SendMessage(1, " whoami");
|
||||||
@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) {
|
|||||||
tmpname[0] = '*';
|
tmpname[0] = '*';
|
||||||
strcpy(&tmpname[1], paccountname);
|
strcpy(&tmpname[1], paccountname);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]);
|
||||||
zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0));
|
zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) {
|
|||||||
#endif
|
#endif
|
||||||
RunLoops = true;
|
RunLoops = true;
|
||||||
SendMessage(1, " Login Server Reconnect manually restarted by Console");
|
SendMessage(1, " Login Server Reconnect manually restarted by Console");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console");
|
||||||
}
|
}
|
||||||
else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) {
|
else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) {
|
||||||
if (strcasecmp(sep.arg[1], "list") == 0) {
|
if (strcasecmp(sep.arg[1], "list") == 0) {
|
||||||
|
|||||||
@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() {
|
|||||||
std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf);
|
std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
||||||
else {
|
else {
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
m_dynamics = atoi(row[0]);
|
m_dynamics = atoi(row[0]);
|
||||||
@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() {
|
|||||||
query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf);
|
query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf);
|
||||||
results = database.QueryDatabase(query);
|
results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) {
|
|||||||
std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count);
|
std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() {
|
|||||||
std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf);
|
std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf);
|
query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf);
|
||||||
results = database.QueryDatabase(query);
|
results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) {
|
|||||||
"VALUES('%s', '%s', %d)", namebuf, zonebuf, port);
|
"VALUES('%s', '%s', %d)", namebuf, zonebuf, port);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
|
|||||||
res = m_zones.find(short_name);
|
res = m_zones.find(short_name);
|
||||||
if(res == m_zones.end()) {
|
if(res == m_zones.end()) {
|
||||||
//not found.
|
//not found.
|
||||||
logger.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name);
|
Log.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
|
|||||||
"launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf);
|
"launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
|
|||||||
res = m_zones.find(short_name);
|
res = m_zones.find(short_name);
|
||||||
if(res == m_zones.end()) {
|
if(res == m_zones.end()) {
|
||||||
//not found.
|
//not found.
|
||||||
logger.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name);
|
Log.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
|
|||||||
"launcher = '%s' AND zone = '%s'", namebuf, zonebuf);
|
"launcher = '%s' AND zone = '%s'", namebuf, zonebuf);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) {
|
|||||||
std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf);
|
std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -75,11 +75,11 @@ EQW::EQW() {
|
|||||||
|
|
||||||
void EQW::AppendOutput(const char *str) {
|
void EQW::AppendOutput(const char *str) {
|
||||||
m_outputBuffer += str;
|
m_outputBuffer += str;
|
||||||
// logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length());
|
// Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &EQW::GetOutput() const {
|
const std::string &EQW::GetOutput() const {
|
||||||
// logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Getting, length %d", m_outputBuffer.length());
|
// Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Getting, length %d", m_outputBuffer.length());
|
||||||
return(m_outputBuffer);
|
return(m_outputBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ void EQW::LSReconnect() {
|
|||||||
pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr);
|
pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr);
|
||||||
#endif
|
#endif
|
||||||
RunLoops = true;
|
RunLoops = true;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) {
|
/*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) {
|
||||||
|
|||||||
@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const {
|
|||||||
int16 status = 0;
|
int16 status = 0;
|
||||||
uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status);
|
uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status);
|
||||||
if(acctid == 0) {
|
if(acctid == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
if(status < httpLoginStatus) {
|
if(status < httpLoginStatus) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EQWHTTPServer::Stop() {
|
void EQWHTTPServer::Stop() {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop.");
|
||||||
m_running = false;
|
m_running = false;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQWHTTPServer::Start(uint16 port, const char *mime_file) {
|
bool EQWHTTPServer::Start(uint16 port, const char *mime_file) {
|
||||||
if(m_running) {
|
if(m_running) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//load up our nice mime types
|
//load up our nice mime types
|
||||||
if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) {
|
if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file);
|
||||||
return(false);
|
return(false);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
//fire up the server thread
|
//fire up the server thread
|
||||||
char errbuf[TCPServer_ErrorBufferSize];
|
char errbuf[TCPServer_ErrorBufferSize];
|
||||||
if(!Open(port, errbuf)) {
|
if(!Open(port, errbuf)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,12 +320,12 @@ bool EQWHTTPServer::Start(uint16 port, const char *mime_file) {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
void EQWHTTPServer::Run() {
|
void EQWHTTPServer::Run() {
|
||||||
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread started on port %d", m_port);
|
Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread started on port %d", m_port);
|
||||||
do {
|
do {
|
||||||
#warning DELETE THIS IF YOU DONT USE IT
|
#warning DELETE THIS IF YOU DONT USE IT
|
||||||
Sleep(10);
|
Sleep(10);
|
||||||
} while(m_running);
|
} while(m_running);
|
||||||
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread terminating on port %d", m_port);
|
Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread terminating on port %d", m_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadReturnType EQWHTTPServer::ThreadProc(void *data) {
|
ThreadReturnType EQWHTTPServer::ThreadProc(void *data) {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ EQWParser::EQWParser() {
|
|||||||
my_perl = perl_alloc();
|
my_perl = perl_alloc();
|
||||||
_empty_sv = newSV(0);
|
_empty_sv = newSV(0);
|
||||||
if(!my_perl)
|
if(!my_perl)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!");
|
||||||
else
|
else
|
||||||
DoInit();
|
DoInit();
|
||||||
}
|
}
|
||||||
@ -182,10 +182,10 @@ void EQWParser::DoInit() {
|
|||||||
|
|
||||||
|
|
||||||
#ifdef EMBPERL_PLUGIN
|
#ifdef EMBPERL_PLUGIN
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins.");
|
||||||
std::string err;
|
std::string err;
|
||||||
if(!eval_file("world", "worldui.pl", err)) {
|
if(!eval_file("world", "worldui.pl", err)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
eval_pv(
|
eval_pv(
|
||||||
|
|||||||
@ -79,7 +79,7 @@ bool LauncherLink::Process() {
|
|||||||
else {
|
else {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -90,7 +90,7 @@ bool LauncherLink::Process() {
|
|||||||
else {
|
else {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -100,7 +100,7 @@ bool LauncherLink::Process() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
}
|
}
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -114,25 +114,25 @@ bool LauncherLink::Process() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_ZAAuth: {
|
case ServerOP_ZAAuth: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_LauncherConnectInfo: {
|
case ServerOP_LauncherConnectInfo: {
|
||||||
const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer;
|
const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer;
|
||||||
if(HasName()) {
|
if(HasName()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_name = it->name;
|
m_name = it->name;
|
||||||
|
|
||||||
EQLConfig *config = launcher_list.GetConfig(m_name.c_str());
|
EQLConfig *config = launcher_list.GetConfig(m_name.c_str());
|
||||||
if(config == nullptr) {
|
if(config == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name);
|
||||||
Disconnect();
|
Disconnect();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name);
|
||||||
|
|
||||||
std::vector<LauncherZone> result;
|
std::vector<LauncherZone> result;
|
||||||
//database.GetLauncherZones(it->name, result);
|
//database.GetLauncherZones(it->name, result);
|
||||||
@ -146,7 +146,7 @@ bool LauncherLink::Process() {
|
|||||||
zs.port = cur->port;
|
zs.port = cur->port;
|
||||||
zs.up = false;
|
zs.up = false;
|
||||||
zs.starts = 0;
|
zs.starts = 0;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port);
|
||||||
m_states[cur->name] = zs;
|
m_states[cur->name] = zs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,17 +162,17 @@ bool LauncherLink::Process() {
|
|||||||
std::map<std::string, ZoneState>::iterator res;
|
std::map<std::string, ZoneState>::iterator res;
|
||||||
res = m_states.find(it->short_name);
|
res = m_states.find(it->short_name);
|
||||||
if(res == m_states.end()) {
|
if(res == m_states.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count);
|
||||||
res->second.up = it->running;
|
res->second.up = it->running;
|
||||||
res->second.starts = it->start_count;
|
res->second.starts = it->start_count;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size);
|
||||||
DumpPacket(pack->pBuffer, pack->size);
|
DumpPacket(pack->pBuffer, pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) {
|
|||||||
zs.port = port;
|
zs.port = port;
|
||||||
zs.up = false;
|
zs.up = false;
|
||||||
zs.starts = 0;
|
zs.starts = 0;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port);
|
||||||
m_states[short_name] = zs;
|
m_states[short_name] = zs;
|
||||||
|
|
||||||
StartZone(short_name);
|
StartZone(short_name);
|
||||||
|
|||||||
@ -60,7 +60,7 @@ void LauncherList::Process() {
|
|||||||
//printf("ProcP %d: %p\n", l->GetID(), l);
|
//printf("ProcP %d: %p\n", l->GetID(), l);
|
||||||
if(!l->Process()) {
|
if(!l->Process()) {
|
||||||
//launcher has died before it identified itself.
|
//launcher has died before it identified itself.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID());
|
||||||
cur = m_pendingLaunchers.erase(cur);
|
cur = m_pendingLaunchers.erase(cur);
|
||||||
delete l;
|
delete l;
|
||||||
} else if(l->HasName()) {
|
} else if(l->HasName()) {
|
||||||
@ -72,10 +72,10 @@ void LauncherList::Process() {
|
|||||||
std::map<std::string, LauncherLink *>::iterator res;
|
std::map<std::string, LauncherLink *>::iterator res;
|
||||||
res = m_launchers.find(name);
|
res = m_launchers.find(name);
|
||||||
if(res != m_launchers.end()) {
|
if(res != m_launchers.end()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str());
|
||||||
delete res->second;
|
delete res->second;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
||||||
//put the launcher in the list.
|
//put the launcher in the list.
|
||||||
m_launchers[name] = l;
|
m_launchers[name] = l;
|
||||||
} else {
|
} else {
|
||||||
@ -91,7 +91,7 @@ void LauncherList::Process() {
|
|||||||
//printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l);
|
//printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l);
|
||||||
if(!l->Process()) {
|
if(!l->Process()) {
|
||||||
//launcher has died before it identified itself.
|
//launcher has died before it identified itself.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID());
|
||||||
curl = m_launchers.erase(curl);
|
curl = m_launchers.erase(curl);
|
||||||
delete l;
|
delete l;
|
||||||
} else {
|
} else {
|
||||||
@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) {
|
|||||||
|
|
||||||
void LauncherList::Add(EmuTCPConnection *conn) {
|
void LauncherList::Add(EmuTCPConnection *conn) {
|
||||||
auto it = new LauncherLink(nextID++, conn);
|
auto it = new LauncherLink(nextID++, conn);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID());
|
||||||
m_pendingLaunchers.push_back(it);
|
m_pendingLaunchers.push_back(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ bool LoginServer::Process() {
|
|||||||
ServerPacket *pack = 0;
|
ServerPacket *pack = 0;
|
||||||
while((pack = tcpc->PopPacket()))
|
while((pack = tcpc->PopPacket()))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode);
|
||||||
_hex(WORLD__LS_TRACE,pack->pBuffer,pack->size);
|
_hex(WORLD__LS_TRACE,pack->pBuffer,pack->size);
|
||||||
|
|
||||||
switch(pack->opcode) {
|
switch(pack->opcode) {
|
||||||
@ -160,12 +160,12 @@ bool LoginServer::Process() {
|
|||||||
case ServerOP_LSFatalError: {
|
case ServerOP_LSFatalError: {
|
||||||
#ifndef IGNORE_LS_FATAL_ERROR
|
#ifndef IGNORE_LS_FATAL_ERROR
|
||||||
WorldConfig::DisableLoginserver();
|
WorldConfig::DisableLoginserver();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect.");
|
||||||
#else
|
#else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError.");
|
||||||
#endif
|
#endif
|
||||||
if (pack->size > 1) {
|
if (pack->size > 1) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -177,18 +177,18 @@ bool LoginServer::Process() {
|
|||||||
case ServerOP_LSRemoteAddr: {
|
case ServerOP_LSRemoteAddr: {
|
||||||
if (!Config->WorldAddress.length()) {
|
if (!Config->WorldAddress.length()) {
|
||||||
WorldConfig::SetWorldAddress((char *)pack->pBuffer);
|
WorldConfig::SetWorldAddress((char *)pack->pBuffer);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_LSAccountUpdate: {
|
case ServerOP_LSAccountUpdate: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver");
|
||||||
CanAccountUpdate = true;
|
CanAccountUpdate = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size);
|
||||||
DumpPacket(pack->pBuffer, pack->size);
|
DumpPacket(pack->pBuffer, pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -202,10 +202,10 @@ bool LoginServer::Process() {
|
|||||||
bool LoginServer::InitLoginServer() {
|
bool LoginServer::InitLoginServer() {
|
||||||
if(Connected() == false) {
|
if(Connected() == false) {
|
||||||
if(ConnectReady()) {
|
if(ConnectReady()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort);
|
||||||
Connect();
|
Connect();
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d",
|
||||||
LoginServerAddress,LoginServerPort);
|
LoginServerAddress,LoginServerPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,29 +216,29 @@ bool LoginServer::Connect() {
|
|||||||
char tmp[25];
|
char tmp[25];
|
||||||
if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){
|
if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){
|
||||||
minilogin = true;
|
minilogin = true;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
minilogin = false;
|
minilogin = false;
|
||||||
|
|
||||||
if (minilogin && WorldConfig::get()->WorldAddress.length()==0) {
|
if (minilogin && WorldConfig::get()->WorldAddress.length()==0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the <address> element in the <world> section.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the <address> element in the <world> section.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char errbuf[TCPConnection_ErrorBufferSize];
|
char errbuf[TCPConnection_ErrorBufferSize];
|
||||||
if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) {
|
if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LoginServerIP == 0 || LoginServerPort == 0) {
|
if (LoginServerIP == 0 || LoginServerPort == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) {
|
if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
||||||
if (minilogin)
|
if (minilogin)
|
||||||
SendInfo();
|
SendInfo();
|
||||||
else
|
else
|
||||||
@ -248,7 +248,7 @@ bool LoginServer::Connect() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ void LoginServer::SendStatus() {
|
|||||||
void LoginServer::SendAccountUpdate(ServerPacket* pack) {
|
void LoginServer::SendAccountUpdate(ServerPacket* pack) {
|
||||||
ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer;
|
ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer;
|
||||||
if(CanUpdate()) {
|
if(CanUpdate()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
||||||
strn0cpy(s->worldaccount, LoginAccount, 30);
|
strn0cpy(s->worldaccount, LoginAccount, 30);
|
||||||
strn0cpy(s->worldpassword, LoginPassword, 30);
|
strn0cpy(s->worldpassword, LoginPassword, 30);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
|
|||||||
@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) {
|
|||||||
bool LoginServerList::SendAccountUpdate(ServerPacket* pack) {
|
bool LoginServerList::SendAccountUpdate(ServerPacket* pack) {
|
||||||
LinkedListIterator<LoginServer*> iterator(list);
|
LinkedListIterator<LoginServer*> iterator(list);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers");
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while(iterator.MoreElements()){
|
while(iterator.MoreElements()){
|
||||||
if(iterator.GetData()->CanUpdate()) {
|
if(iterator.GetData()->CanUpdate()) {
|
||||||
|
|||||||
120
world/net.cpp
120
world/net.cpp
@ -105,7 +105,7 @@ uint32 numclients = 0;
|
|||||||
uint32 numzones = 0;
|
uint32 numzones = 0;
|
||||||
bool holdzones = false;
|
bool holdzones = false;
|
||||||
|
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
extern ConsoleList console_list;
|
extern ConsoleList console_list;
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ void CatchSignal(int sig_num);
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
RegisterExecutablePlatform(ExePlatformWorld);
|
RegisterExecutablePlatform(ExePlatformWorld);
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
set_exception_handler();
|
set_exception_handler();
|
||||||
|
|
||||||
/* Database Version Check */
|
/* Database Version Check */
|
||||||
@ -126,36 +126,36 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load server configuration
|
// Load server configuration
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration..");
|
||||||
if (!WorldConfig::LoadConfig()) {
|
if (!WorldConfig::LoadConfig()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const WorldConfig *Config=WorldConfig::get();
|
const WorldConfig *Config=WorldConfig::get();
|
||||||
|
|
||||||
if(!load_log_settings(Config->LogSettingsFile.c_str()))
|
if(!load_log_settings(Config->LogSettingsFile.c_str()))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -164,7 +164,7 @@ int main(int argc, char** argv) {
|
|||||||
if (Config->LoginCount == 0) {
|
if (Config->LoginCount == 0) {
|
||||||
if (Config->LoginHost.length()) {
|
if (Config->LoginHost.length()) {
|
||||||
loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str());
|
loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LinkedList<LoginConfig*> loginlist=Config->loginlist;
|
LinkedList<LoginConfig*> loginlist=Config->loginlist;
|
||||||
@ -172,19 +172,19 @@ int main(int argc, char** argv) {
|
|||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
while(iterator.MoreElements()) {
|
while(iterator.MoreElements()) {
|
||||||
loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str());
|
loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
|
||||||
iterator.Advance();
|
iterator.Advance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL...");
|
||||||
if (!database.Connect(
|
if (!database.Connect(
|
||||||
Config->DatabaseHost.c_str(),
|
Config->DatabaseHost.c_str(),
|
||||||
Config->DatabaseUsername.c_str(),
|
Config->DatabaseUsername.c_str(),
|
||||||
Config->DatabasePassword.c_str(),
|
Config->DatabasePassword.c_str(),
|
||||||
Config->DatabaseDB.c_str(),
|
Config->DatabaseDB.c_str(),
|
||||||
Config->DatabasePort)) {
|
Config->DatabasePort)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
guild_mgr.SetDatabase(&database);
|
guild_mgr.SetDatabase(&database);
|
||||||
@ -280,56 +280,56 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(Config->WorldHTTPEnabled) {
|
if(Config->WorldHTTPEnabled) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service...");
|
||||||
http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str());
|
http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str());
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions..");
|
||||||
database.CheckDatabaseConversions();
|
database.CheckDatabaseConversions();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables..");
|
||||||
database.LoadVariables();
|
database.LoadVariables();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones..");
|
||||||
database.LoadZoneNames();
|
database.LoadZoneNames();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups..");
|
||||||
database.ClearGroup();
|
database.ClearGroup();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids..");
|
||||||
database.ClearRaid();
|
database.ClearRaid();
|
||||||
database.ClearRaidDetails();
|
database.ClearRaidDetails();
|
||||||
database.ClearRaidLeader();
|
database.ClearRaidLeader();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items..");
|
||||||
if (!database.LoadItems())
|
if (!database.LoadItems())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps..");
|
||||||
if (!database.LoadSkillCaps())
|
if (!database.LoadSkillCaps())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds..");
|
||||||
guild_mgr.LoadGuilds();
|
guild_mgr.LoadGuilds();
|
||||||
//rules:
|
//rules:
|
||||||
{
|
{
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp);
|
||||||
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules");
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(RuleB(World, ClearTempMerchantlist)){
|
if(RuleB(World, ClearTempMerchantlist)){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists..");
|
||||||
database.ClearMerchantTemp();
|
database.ClearMerchantTemp();
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day..");
|
||||||
if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str()))
|
if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str()))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list..");
|
||||||
launcher_list.LoadList();
|
launcher_list.LoadList();
|
||||||
|
|
||||||
char tmp[20];
|
char tmp[20];
|
||||||
@ -338,45 +338,45 @@ int main(int argc, char** argv) {
|
|||||||
if ((strcasecmp(tmp, "1") == 0)) {
|
if ((strcasecmp(tmp, "1") == 0)) {
|
||||||
holdzones = true;
|
holdzones = true;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF");
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures...");
|
||||||
if(!adventure_manager.LoadAdventureTemplates())
|
if(!adventure_manager.LoadAdventureTemplates())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!adventure_manager.LoadAdventureEntries())
|
if(!adventure_manager.LoadAdventureEntries())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates.");
|
||||||
}
|
}
|
||||||
|
|
||||||
adventure_manager.Load();
|
adventure_manager.Load();
|
||||||
adventure_manager.LoadLeaderboardInfo();
|
adventure_manager.LoadLeaderboardInfo();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances");
|
||||||
database.PurgeExpiredInstances();
|
database.PurgeExpiredInstances();
|
||||||
Timer PurgeInstanceTimer(450000);
|
Timer PurgeInstanceTimer(450000);
|
||||||
PurgeInstanceTimer.Start(450000);
|
PurgeInstanceTimer.Start(450000);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info...");
|
||||||
database.LoadCharacterCreateAllocations();
|
database.LoadCharacterCreateAllocations();
|
||||||
database.LoadCharacterCreateCombos();
|
database.LoadCharacterCreateCombos();
|
||||||
|
|
||||||
char errbuf[TCPConnection_ErrorBufferSize];
|
char errbuf[TCPConnection_ErrorBufferSize];
|
||||||
if (tcps.Open(Config->WorldTCPPort, errbuf)) {
|
if (tcps.Open(Config->WorldTCPPort, errbuf)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started.");
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (eqsf.Open()) {
|
if (eqsf.Open()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started.");
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ int main(int argc, char** argv) {
|
|||||||
//structures and opcodes for that patch.
|
//structures and opcodes for that patch.
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = eqs->GetRemoteIP();
|
in.s_addr = eqs->GetRemoteIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort()));
|
||||||
stream_identifier.AddStream(eqs); //takes the stream
|
stream_identifier.AddStream(eqs); //takes the stream
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,19 +417,19 @@ int main(int argc, char** argv) {
|
|||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = eqsi->GetRemoteIP();
|
in.s_addr = eqsi->GetRemoteIP();
|
||||||
if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs.
|
if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
|
||||||
if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table.
|
if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
|
||||||
auto client = new Client(eqsi);
|
auto client = new Client(eqsi);
|
||||||
// @merth: client->zoneattempt=0;
|
// @merth: client->zoneattempt=0;
|
||||||
client_list.Add(client);
|
client_list.Add(client);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
|
||||||
eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream.
|
eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!RuleB(World, UseBannedIPsTable)){
|
if (!RuleB(World, UseBannedIPsTable)){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||||
auto client = new Client(eqsi);
|
auto client = new Client(eqsi);
|
||||||
// @merth: client->zoneattempt=0;
|
// @merth: client->zoneattempt=0;
|
||||||
client_list.Add(client);
|
client_list.Add(client);
|
||||||
@ -441,7 +441,7 @@ int main(int argc, char** argv) {
|
|||||||
while ((tcpc = tcps.NewQueuePop())) {
|
while ((tcpc = tcps.NewQueuePop())) {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = tcpc->GetrIP();
|
in.s_addr = tcpc->GetrIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort());
|
||||||
console_list.Add(new Console(tcpc));
|
console_list.Add(new Console(tcpc));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,16 +492,16 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
Sleep(20);
|
Sleep(20);
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed.");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any).");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any).");
|
||||||
console_list.KillAll();
|
console_list.KillAll();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any).");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any).");
|
||||||
zoneserver_list.KillAll();
|
zoneserver_list.KillAll();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped.");
|
||||||
tcps.Close();
|
tcps.Close();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped.");
|
||||||
eqsf.Close();
|
eqsf.Close();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop...");
|
||||||
http_server.Stop();
|
http_server.Stop();
|
||||||
|
|
||||||
CheckEQEMuErrorAndPause();
|
CheckEQEMuErrorAndPause();
|
||||||
@ -509,9 +509,9 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num);
|
||||||
if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false)
|
if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file.");
|
||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream)
|
|||||||
{
|
{
|
||||||
if(Stream)
|
if(Stream)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ.");
|
||||||
Stream->Disconnect();
|
Stream->Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ bool QueryServConnection::Process()
|
|||||||
{
|
{
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -69,7 +69,7 @@ bool QueryServConnection::Process()
|
|||||||
{
|
{
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -79,7 +79,7 @@ bool QueryServConnection::Process()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
}
|
}
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -97,7 +97,7 @@ bool QueryServConnection::Process()
|
|||||||
}
|
}
|
||||||
case ServerOP_ZAAuth:
|
case ServerOP_ZAAuth:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_QueryServGeneric:
|
case ServerOP_QueryServGeneric:
|
||||||
@ -114,7 +114,7 @@ bool QueryServConnection::Process()
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size);
|
||||||
DumpPacket(pack->pBuffer, pack->size);
|
DumpPacket(pack->pBuffer, pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream)
|
|||||||
{
|
{
|
||||||
if(Stream)
|
if(Stream)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS.");
|
||||||
Stream->Disconnect();
|
Stream->Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ bool UCSConnection::Process()
|
|||||||
{
|
{
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -64,7 +64,7 @@ bool UCSConnection::Process()
|
|||||||
{
|
{
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -74,7 +74,7 @@ bool UCSConnection::Process()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
}
|
}
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -92,12 +92,12 @@ bool UCSConnection::Process()
|
|||||||
}
|
}
|
||||||
case ServerOP_ZAAuth:
|
case ServerOP_ZAAuth:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size);
|
||||||
DumpPacket(pack->pBuffer, pack->size);
|
DumpPacket(pack->pBuffer, pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ WorldGuildManager guild_mgr;
|
|||||||
|
|
||||||
|
|
||||||
void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
|
void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
||||||
auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
|
auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
|
||||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||||
s->guild_id = guild_id;
|
s->guild_id = guild_id;
|
||||||
@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
|
void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id);
|
||||||
auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
||||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||||
s->guild_id = guild_id;
|
s->guild_id = guild_id;
|
||||||
@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WorldGuildManager::SendGuildDelete(uint32 guild_id) {
|
void WorldGuildManager::SendGuildDelete(uint32 guild_id) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id);
|
||||||
auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
||||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||||
s->guild_id = guild_id;
|
s->guild_id = guild_id;
|
||||||
@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
|||||||
|
|
||||||
case ServerOP_RefreshGuild: {
|
case ServerOP_RefreshGuild: {
|
||||||
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
|
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
|
||||||
|
|
||||||
//broadcast this packet to all zones.
|
//broadcast this packet to all zones.
|
||||||
zoneserver_list.SendPacket(pack);
|
zoneserver_list.SendPacket(pack);
|
||||||
|
|
||||||
//preform a local refresh.
|
//preform a local refresh.
|
||||||
if(!RefreshGuild(s->guild_id)) {
|
if(!RefreshGuild(s->guild_id)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id);
|
||||||
//can we do anything?
|
//can we do anything?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
|||||||
|
|
||||||
case ServerOP_GuildCharRefresh: {
|
case ServerOP_GuildCharRefresh: {
|
||||||
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id);
|
||||||
|
|
||||||
//preform the local update
|
//preform the local update
|
||||||
client_list.UpdateClientGuild(s->char_id, s->guild_id);
|
client_list.UpdateClientGuild(s->char_id, s->guild_id);
|
||||||
@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
|||||||
|
|
||||||
case ServerOP_DeleteGuild: {
|
case ServerOP_DeleteGuild: {
|
||||||
if(pack->size != sizeof(ServerGuildID_Struct)) {
|
if(pack->size != sizeof(ServerGuildID_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id);
|
||||||
|
|
||||||
//broadcast this packet to all zones.
|
//broadcast this packet to all zones.
|
||||||
zoneserver_list.SendPacket(pack);
|
zoneserver_list.SendPacket(pack);
|
||||||
|
|
||||||
//preform a local refresh.
|
//preform a local refresh.
|
||||||
if(!LocalDeleteGuild(s->guild_id)) {
|
if(!LocalDeleteGuild(s->guild_id)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id);
|
||||||
//can we do anything?
|
//can we do anything?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
|||||||
case ServerOP_GuildMemberUpdate: {
|
case ServerOP_GuildMemberUpdate: {
|
||||||
if(pack->size != sizeof(ServerGuildMemberUpdate_Struct))
|
if(pack->size != sizeof(ServerGuildMemberUpdate_Struct))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -298,11 +298,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
|
|||||||
in_cc->race);
|
in_cc->race);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str());
|
Log.Log(EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str());
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
printf("No start_zones entry in database, using defaults\n");
|
printf("No start_zones entry in database, using defaults\n");
|
||||||
@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.Log(EQEmuLogSys::Status, "Found starting location in start_zones");
|
Log.Log(EQEmuLogSys::Status, "Found starting location in start_zones");
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
in_pp->x = atof(row[0]);
|
in_pp->x = atof(row[0]);
|
||||||
in_pp->y = atof(row[1]);
|
in_pp->y = atof(row[1]);
|
||||||
@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru
|
|||||||
in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race);
|
in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str());
|
Log.Log(EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str());
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
printf("No start_zones entry in database, using defaults\n");
|
printf("No start_zones entry in database, using defaults\n");
|
||||||
@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.Log(EQEmuLogSys::Status, "Found starting location in start_zones");
|
Log.Log(EQEmuLogSys::Status, "Found starting location in start_zones");
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
in_pp->x = atof(row[0]);
|
in_pp->x = atof(row[0]);
|
||||||
in_pp->y = atof(row[1]);
|
in_pp->y = atof(row[1]);
|
||||||
@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
|
|||||||
const std::string query = "SELECT name FROM launcher";
|
const std::string query = "SELECT name FROM launcher";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) {
|
|||||||
MailKeyString, CharID);
|
MailKeyString, CharID);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level)
|
|||||||
std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name);
|
std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ void ZSList::KillAll() {
|
|||||||
void ZSList::Process() {
|
void ZSList::Process() {
|
||||||
|
|
||||||
if(shutdowntimer && shutdowntimer->Check()){
|
if(shutdowntimer && shutdowntimer->Check()){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)");
|
||||||
auto pack2 = new ServerPacket;
|
auto pack2 = new ServerPacket;
|
||||||
pack2->opcode = ServerOP_ShutdownAll;
|
pack2->opcode = ServerOP_ShutdownAll;
|
||||||
pack2->size=0;
|
pack2->size=0;
|
||||||
@ -99,10 +99,10 @@ void ZSList::Process() {
|
|||||||
ZoneServer* zs = iterator.GetData();
|
ZoneServer* zs = iterator.GetData();
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = zs->GetIP();
|
in.s_addr = zs->GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort());
|
||||||
zs->LSShutDownUpdate(zs->GetZoneID());
|
zs->LSShutDownUpdate(zs->GetZoneID());
|
||||||
if (holdzones){
|
if (holdzones){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone");
|
||||||
if(!zs->IsStaticZone())
|
if(!zs->IsStaticZone())
|
||||||
RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID());
|
RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID());
|
||||||
else
|
else
|
||||||
@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip
|
|||||||
s->port = port;
|
s->port = port;
|
||||||
s->zoneid = zoneid;
|
s->zoneid = zoneid;
|
||||||
if(zoneid != 0)
|
if(zoneid != 0)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid);
|
||||||
tmp[z]->SendPacket(pack);
|
tmp[z]->SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
safe_delete_array(tmp);
|
safe_delete_array(tmp);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
|
|||||||
char* longname;
|
char* longname;
|
||||||
|
|
||||||
if (iZoneID)
|
if (iZoneID)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID,
|
||||||
iStaticZone ? " (Static)" : "");
|
iStaticZone ? " (Static)" : "");
|
||||||
|
|
||||||
zoneID = iZoneID;
|
zoneID = iZoneID;
|
||||||
@ -188,7 +188,7 @@ bool ZoneServer::Process() {
|
|||||||
else {
|
else {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -199,7 +199,7 @@ bool ZoneServer::Process() {
|
|||||||
else {
|
else {
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed.");
|
||||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||||
SendPacket(pack);
|
SendPacket(pack);
|
||||||
delete pack;
|
delete pack;
|
||||||
@ -209,7 +209,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a <key>STRING</key> element to your <world> element to prevent unauthroized zone access.");
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -541,10 +541,10 @@ bool ZoneServer::Process() {
|
|||||||
|
|
||||||
RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer;
|
RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer;
|
||||||
if (zoneserver_list.SendPacket(pack)){
|
if (zoneserver_list.SendPacket(pack)){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -589,10 +589,10 @@ bool ZoneServer::Process() {
|
|||||||
ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer;
|
ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer;
|
||||||
sci->port = clientport;
|
sci->port = clientport;
|
||||||
SendPacket(&p);
|
SendPacket(&p);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport);
|
||||||
} else {
|
} else {
|
||||||
clientport=sci->port;
|
clientport=sci->port;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -602,7 +602,7 @@ bool ZoneServer::Process() {
|
|||||||
const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer;
|
const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer;
|
||||||
launcher_name = ln->launcher_name;
|
launcher_name = ln->launcher_name;
|
||||||
launched_name = ln->zone_name;
|
launched_name = ln->zone_name;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_ShutdownAll: {
|
case ServerOP_ShutdownAll: {
|
||||||
@ -685,12 +685,12 @@ bool ZoneServer::Process() {
|
|||||||
if(WorldConfig::get()->UpdateStats)
|
if(WorldConfig::get()->UpdateStats)
|
||||||
client = client_list.FindCharacter(ztz->name);
|
client = client_list.FindCharacter(ztz->name);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n",
|
||||||
ztz->name, ztz->current_zone_id, ztz->requested_zone_id);
|
ztz->name, ztz->current_zone_id, ztz->requested_zone_id);
|
||||||
|
|
||||||
/* This is a request from the egress zone */
|
/* This is a request from the egress zone */
|
||||||
if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) {
|
if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name);
|
||||||
|
|
||||||
if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) {
|
if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) {
|
||||||
ztz->response = 0;
|
ztz->response = 0;
|
||||||
@ -708,20 +708,20 @@ bool ZoneServer::Process() {
|
|||||||
|
|
||||||
/* Zone was already running*/
|
/* Zone was already running*/
|
||||||
if(ingress_server) {
|
if(ingress_server) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name);
|
||||||
ztz->response = 1;
|
ztz->response = 1;
|
||||||
}
|
}
|
||||||
/* Boot the Zone*/
|
/* Boot the Zone*/
|
||||||
else {
|
else {
|
||||||
int server_id;
|
int server_id;
|
||||||
if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){
|
if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name);
|
||||||
// bootup successful, ready to rock
|
// bootup successful, ready to rock
|
||||||
ztz->response = 1;
|
ztz->response = 1;
|
||||||
ingress_server = zoneserver_list.FindByID(server_id);
|
ingress_server = zoneserver_list.FindByID(server_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name);
|
||||||
// bootup failed, send back error code 0
|
// bootup failed, send back error code 0
|
||||||
ztz->response = 0;
|
ztz->response = 0;
|
||||||
}
|
}
|
||||||
@ -736,7 +736,7 @@ bool ZoneServer::Process() {
|
|||||||
/* Response from Ingress server, route back to egress */
|
/* Response from Ingress server, route back to egress */
|
||||||
else{
|
else{
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name);
|
||||||
ZoneServer *egress_server = nullptr;
|
ZoneServer *egress_server = nullptr;
|
||||||
if(ztz->current_instance_id > 0) {
|
if(ztz->current_instance_id > 0) {
|
||||||
egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id);
|
egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id);
|
||||||
@ -754,7 +754,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
case ServerOP_ClientList: {
|
case ServerOP_ClientList: {
|
||||||
if (pack->size != sizeof(ServerClientList_Struct)) {
|
if (pack->size != sizeof(ServerClientList_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer);
|
client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer);
|
||||||
@ -763,7 +763,7 @@ bool ZoneServer::Process() {
|
|||||||
case ServerOP_ClientListKA: {
|
case ServerOP_ClientListKA: {
|
||||||
ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer;
|
ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer;
|
||||||
if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) {
|
if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates)));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
client_list.CLEKeepAlive(sclka->numupdates, sclka->wid);
|
client_list.CLEKeepAlive(sclka->numupdates, sclka->wid);
|
||||||
@ -868,7 +868,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
case ServerOP_GMGoto: {
|
case ServerOP_GMGoto: {
|
||||||
if (pack->size != sizeof(ServerGMGoto_Struct)) {
|
if (pack->size != sizeof(ServerGMGoto_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer;
|
ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer;
|
||||||
@ -888,7 +888,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
case ServerOP_Lock: {
|
case ServerOP_Lock: {
|
||||||
if (pack->size != sizeof(ServerLock_Struct)) {
|
if (pack->size != sizeof(ServerLock_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer;
|
ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer;
|
||||||
@ -913,7 +913,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
case ServerOP_Motd: {
|
case ServerOP_Motd: {
|
||||||
if (pack->size != sizeof(ServerMotd_Struct)) {
|
if (pack->size != sizeof(ServerMotd_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer;
|
ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer;
|
||||||
@ -924,7 +924,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
case ServerOP_Uptime: {
|
case ServerOP_Uptime: {
|
||||||
if (pack->size != sizeof(ServerUptime_Struct)) {
|
if (pack->size != sizeof(ServerUptime_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer;
|
ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer;
|
||||||
@ -943,7 +943,7 @@ bool ZoneServer::Process() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_GetWorldTime: {
|
case ServerOP_GetWorldTime: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update");
|
||||||
auto pack = new ServerPacket;
|
auto pack = new ServerPacket;
|
||||||
|
|
||||||
pack->opcode = ServerOP_SyncWorldTime;
|
pack->opcode = ServerOP_SyncWorldTime;
|
||||||
@ -958,17 +958,17 @@ bool ZoneServer::Process() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_SetWorldTime: {
|
case ServerOP_SetWorldTime: {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime");
|
||||||
eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer;
|
eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer;
|
||||||
zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime);
|
zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime);
|
||||||
zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str());
|
zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str());
|
||||||
zoneserver_list.SendTimeSync();
|
zoneserver_list.SendTimeSync();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_IPLookup: {
|
case ServerOP_IPLookup: {
|
||||||
if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) {
|
if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer;
|
ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer;
|
||||||
@ -980,7 +980,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
case ServerOP_LockZone: {
|
case ServerOP_LockZone: {
|
||||||
if (pack->size < sizeof(ServerLockZone_Struct)) {
|
if (pack->size < sizeof(ServerLockZone_Struct)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer;
|
ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer;
|
||||||
@ -1025,10 +1025,10 @@ bool ZoneServer::Process() {
|
|||||||
ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id);
|
ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if (zs->SendPacket(pack)) {
|
if (zs->SendPacket(pack)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1047,10 +1047,10 @@ bool ZoneServer::Process() {
|
|||||||
zs = zoneserver_list.FindByInstanceID(cle->instance());
|
zs = zoneserver_list.FindByInstanceID(cle->instance());
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(zs->SendPacket(pack)) {
|
if(zs->SendPacket(pack)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1067,10 +1067,10 @@ bool ZoneServer::Process() {
|
|||||||
zs = zoneserver_list.FindByInstanceID(s->instance_id);
|
zs = zoneserver_list.FindByInstanceID(s->instance_id);
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(!zs->SendPacket(pack))
|
if(!zs->SendPacket(pack))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1079,10 +1079,10 @@ bool ZoneServer::Process() {
|
|||||||
zs = zoneserver_list.FindByZoneID(cle->zone());
|
zs = zoneserver_list.FindByZoneID(cle->zone());
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(zs->SendPacket(pack)) {
|
if(zs->SendPacket(pack)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1098,10 +1098,10 @@ bool ZoneServer::Process() {
|
|||||||
zs = zoneserver_list.FindByZoneID(s->zone_id);
|
zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(!zs->SendPacket(pack))
|
if(!zs->SendPacket(pack))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1119,10 +1119,10 @@ bool ZoneServer::Process() {
|
|||||||
zs = zoneserver_list.FindByZoneID(s->zone_id);
|
zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(!zs->SendPacket(pack))
|
if(!zs->SendPacket(pack))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1138,10 +1138,10 @@ bool ZoneServer::Process() {
|
|||||||
ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id);
|
ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id);
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(!zs->SendPacket(pack))
|
if(!zs->SendPacket(pack))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1149,10 +1149,10 @@ bool ZoneServer::Process() {
|
|||||||
ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id);
|
ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||||
if(zs) {
|
if(zs) {
|
||||||
if(!zs->SendPacket(pack))
|
if(!zs->SendPacket(pack))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1254,7 +1254,7 @@ bool ZoneServer::Process() {
|
|||||||
|
|
||||||
case ServerOP_LSAccountUpdate:
|
case ServerOP_LSAccountUpdate:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone");
|
||||||
loginserverlist.SendAccountUpdate(pack);
|
loginserverlist.SendAccountUpdate(pack);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1309,7 +1309,7 @@ bool ZoneServer::Process() {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size);
|
||||||
DumpPacket(pack->pBuffer, pack->size);
|
DumpPacket(pack->pBuffer, pack->size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
46
zone/aa.cpp
46
zone/aa.cpp
@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logger.Log(EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action);
|
Log.Log(EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
|||||||
PetRecord record;
|
PetRecord record;
|
||||||
if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
|
if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id);
|
Log.Log(EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id);
|
||||||
Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone);
|
Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
|||||||
const NPCType *npc_type = database.GetNPCType(pet.npc_id);
|
const NPCType *npc_type = database.GetNPCType(pet.npc_id);
|
||||||
if(npc_type == nullptr) {
|
if(npc_type == nullptr) {
|
||||||
//log write
|
//log write
|
||||||
logger.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id);
|
Log.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id);
|
||||||
Message(0,"Unable to find pet!");
|
Message(0,"Unable to find pet!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid
|
|||||||
const NPCType *npc_type = database.GetNPCType(typesid);
|
const NPCType *npc_type = database.GetNPCType(typesid);
|
||||||
if(npc_type == nullptr) {
|
if(npc_type == nullptr) {
|
||||||
//log write
|
//log write
|
||||||
logger.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid);
|
Log.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid);
|
||||||
Message(0,"Unable to find pet!");
|
Message(0,"Unable to find pet!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -951,7 +951,7 @@ void Client::SendAAStats() {
|
|||||||
|
|
||||||
void Client::BuyAA(AA_Action* action)
|
void Client::BuyAA(AA_Action* action)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability);
|
||||||
|
|
||||||
//find the AA information from the database
|
//find the AA information from the database
|
||||||
SendAA_Struct* aa2 = zone->FindAA(action->ability);
|
SendAA_Struct* aa2 = zone->FindAA(action->ability);
|
||||||
@ -963,7 +963,7 @@ void Client::BuyAA(AA_Action* action)
|
|||||||
a = action->ability - i;
|
a = action->ability - i;
|
||||||
if(a <= 0)
|
if(a <= 0)
|
||||||
break;
|
break;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a);
|
||||||
aa2 = zone->FindAA(a);
|
aa2 = zone->FindAA(a);
|
||||||
if(aa2 != nullptr)
|
if(aa2 != nullptr)
|
||||||
break;
|
break;
|
||||||
@ -980,7 +980,7 @@ void Client::BuyAA(AA_Action* action)
|
|||||||
|
|
||||||
uint32 cur_level = GetAA(aa2->id);
|
uint32 cur_level = GetAA(aa2->id);
|
||||||
if((aa2->id + cur_level) != action->ability) { //got invalid AA
|
if((aa2->id + cur_level) != action->ability) { //got invalid AA
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1011,7 +1011,7 @@ void Client::BuyAA(AA_Action* action)
|
|||||||
if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) {
|
if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) {
|
||||||
SetAA(aa2->id, cur_level + 1);
|
SetAA(aa2->id, cur_level + 1);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1);
|
||||||
|
|
||||||
m_pp.aapoints -= real_cost;
|
m_pp.aapoints -= real_cost;
|
||||||
|
|
||||||
@ -1429,10 +1429,10 @@ SendAA_Struct* Zone::FindAA(uint32 id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Zone::LoadAAs() {
|
void Zone::LoadAAs() {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading AA information...");
|
Log.Log(EQEmuLogSys::Status, "Loading AA information...");
|
||||||
totalAAs = database.CountAAs();
|
totalAAs = database.CountAAs();
|
||||||
if(totalAAs == 0) {
|
if(totalAAs == 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to load AAs!");
|
Log.Log(EQEmuLogSys::Error, "Failed to load AAs!");
|
||||||
aas = nullptr;
|
aas = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1447,11 +1447,11 @@ void Zone::LoadAAs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//load AA Effects into aa_effects
|
//load AA Effects into aa_effects
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading AA Effects...");
|
Log.Log(EQEmuLogSys::Status, "Loading AA Effects...");
|
||||||
if (database.LoadAAEffects2())
|
if (database.LoadAAEffects2())
|
||||||
logger.Log(EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size());
|
Log.Log(EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size());
|
||||||
else
|
else
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to load AA Effects!");
|
Log.Log(EQEmuLogSys::Error, "Failed to load AA Effects!");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::LoadAAEffects2() {
|
bool ZoneDatabase::LoadAAEffects2() {
|
||||||
@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() {
|
|||||||
const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC";
|
const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!results.RowCount()) { //no results
|
if (!results.RowCount()) { //no results
|
||||||
logger.Log(EQEmuLogSys::Error, "Error loading AA Effects, none found in the database.");
|
Log.Log(EQEmuLogSys::Error, "Error loading AA Effects, none found in the database.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() {
|
|||||||
"redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions";
|
"redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) {
|
|||||||
std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id);
|
std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){
|
|||||||
const std::string query = "SELECT count(title_sid) FROM altadv_vars";
|
const std::string query = "SELECT count(title_sid) FROM altadv_vars";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() {
|
|||||||
const std::string query = "SELECT count(id) FROM aa_effects";
|
const std::string query = "SELECT count(id) FROM aa_effects";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){
|
|||||||
load[index]->seq = index+1;
|
load[index]->seq = index+1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
AARequiredLevelAndCost.clear();
|
AARequiredLevelAndCost.clear();
|
||||||
query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id";
|
query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id";
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id)
|
|||||||
std::string query = "SET @row = 0"; //initialize "row" variable in database for next query
|
std::string query = "SET @row = 0"; //initialize "row" variable in database for next query
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id)
|
|||||||
"FROM altadv_vars a WHERE skill_id=%i", skill_id);
|
"FROM altadv_vars a WHERE skill_id=%i", skill_id);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -342,17 +342,17 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
|||||||
{
|
{
|
||||||
//FatherNiwtit: make sure we can see them. last since it is very expensive
|
//FatherNiwtit: make sure we can see them. last since it is very expensive
|
||||||
if(CheckLosFN(mob)) {
|
if(CheckLosFN(mob)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
|
||||||
return( mod_will_aggro(mob, this) );
|
return( mod_will_aggro(mob, this) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel()));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel()));
|
||||||
|
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@ -466,7 +466,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
|
|||||||
//Father Nitwit: make sure we can see them.
|
//Father Nitwit: make sure we can see them.
|
||||||
if(mob->CheckLosFN(sender)) {
|
if(mob->CheckLosFN(sender)) {
|
||||||
#if (EQDEBUG>=5)
|
#if (EQDEBUG>=5)
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
|
||||||
sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ()));
|
sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ()));
|
||||||
#endif
|
#endif
|
||||||
mob->AddToHateList(attacker, 1, 0, false);
|
mob->AddToHateList(attacker, 1, 0, false);
|
||||||
@ -693,7 +693,7 @@ type', in which case, the answer is yes.
|
|||||||
}
|
}
|
||||||
while( reverse++ == 0 );
|
while( reverse++ == 0 );
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,7 +833,7 @@ bool Mob::IsBeneficialAllowed(Mob *target)
|
|||||||
}
|
}
|
||||||
while( reverse++ == 0 );
|
while( reverse++ == 0 );
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -945,7 +945,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
|
|||||||
oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION;
|
oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION;
|
||||||
|
|
||||||
#if LOSDEBUG>=5
|
#if LOSDEBUG>=5
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize);
|
||||||
#endif
|
#endif
|
||||||
return zone->zonemap->CheckLoS(myloc, oloc);
|
return zone->zonemap->CheckLoS(myloc, oloc);
|
||||||
}
|
}
|
||||||
|
|||||||
174
zone/attack.cpp
174
zone/attack.cpp
@ -57,7 +57,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
|
|||||||
if (weapon && weapon->IsType(ItemClassCommon)) {
|
if (weapon && weapon->IsType(ItemClassCommon)) {
|
||||||
const Item_Struct* item = weapon->GetItem();
|
const Item_Struct* item = weapon->GetItem();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType);
|
||||||
|
|
||||||
switch (item->ItemType)
|
switch (item->ItemType)
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
if(attacker->IsNPC() && !attacker->IsPet())
|
if(attacker->IsNPC() && !attacker->IsPet())
|
||||||
chancetohit += RuleR(Combat, NPCBonusHitChance);
|
chancetohit += RuleR(Combat, NPCBonusHitChance);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
||||||
|
|
||||||
bool pvpmode = false;
|
bool pvpmode = false;
|
||||||
if(IsClient() && other->IsClient())
|
if(IsClient() && other->IsClient())
|
||||||
@ -208,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
//Calculate the level difference
|
//Calculate the level difference
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit);
|
||||||
|
|
||||||
double level_difference = attacker_level - defender_level;
|
double level_difference = attacker_level - defender_level;
|
||||||
double range = defender->GetLevel();
|
double range = defender->GetLevel();
|
||||||
@ -236,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference);
|
chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit);
|
||||||
|
|
||||||
chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor));
|
chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit);
|
||||||
|
|
||||||
if(attacker->IsClient())
|
if(attacker->IsClient())
|
||||||
{
|
{
|
||||||
chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse)));
|
chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse)));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defender->IsClient())
|
if(defender->IsClient())
|
||||||
{
|
{
|
||||||
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
|
chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense)));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//I dont think this is 100% correct, but at least it does something...
|
//I dont think this is 100% correct, but at least it does something...
|
||||||
if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) {
|
if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) {
|
||||||
chancetohit += attacker->spellbonuses.MeleeSkillCheck;
|
chancetohit += attacker->spellbonuses.MeleeSkillCheck;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
||||||
}
|
}
|
||||||
if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) {
|
if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) {
|
||||||
chancetohit += attacker->itembonuses.MeleeSkillCheck;
|
chancetohit += attacker->itembonuses.MeleeSkillCheck;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Avoidance Bonuses on defender decreases baseline hit chance by percent.
|
//Avoidance Bonuses on defender decreases baseline hit chance by percent.
|
||||||
@ -308,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
//Calculate final chance to hit
|
//Calculate final chance to hit
|
||||||
chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f);
|
chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus);
|
||||||
|
|
||||||
chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker);
|
chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker);
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
//agains a garunteed riposte (for example) discipline... for now, garunteed hit wins
|
//agains a garunteed riposte (for example) discipline... for now, garunteed hit wins
|
||||||
|
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -336,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
|
|||||||
|
|
||||||
float tohit_roll = zone->random.Real(0, 100);
|
float tohit_roll = zone->random.Real(0, 100);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll);
|
||||||
|
|
||||||
return(tohit_roll <= chancetohit);
|
return(tohit_roll <= chancetohit);
|
||||||
}
|
}
|
||||||
@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) {
|
if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) {
|
||||||
damage = -3;
|
damage = -3;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage);
|
||||||
|
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
return true;
|
return true;
|
||||||
@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
|
|||||||
damage -= (myac * zone->random.Int(0, acrandom) / 10000);
|
damage -= (myac * zone->random.Int(0, acrandom) / 10000);
|
||||||
}
|
}
|
||||||
if (damage<1) damage=1;
|
if (damage<1) damage=1;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1128,14 +1128,14 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
{
|
{
|
||||||
if (!other) {
|
if (!other) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!GetTarget())
|
if(!GetTarget())
|
||||||
SetTarget(other);
|
SetTarget(other);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":"");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":"");
|
||||||
|
|
||||||
//SetAttackTimer();
|
//SetAttackTimer();
|
||||||
if (
|
if (
|
||||||
@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
|| (GetHP() < 0)
|
|| (GetHP() < 0)
|
||||||
|| (!IsAttackAllowed(other))
|
|| (!IsAttackAllowed(other))
|
||||||
) {
|
) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances.");
|
||||||
return false; // Only bards can attack while casting
|
return false; // Only bards can attack while casting
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm
|
if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||||
Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable!
|
Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable!
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
if(weapon != nullptr) {
|
if(weapon != nullptr) {
|
||||||
if (!weapon->IsWeapon()) {
|
if (!weapon->IsWeapon()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||||
// also send Packet to near clients
|
// also send Packet to near clients
|
||||||
SkillUseTypes skillinuse;
|
SkillUseTypes skillinuse;
|
||||||
AttackAnimation(skillinuse, Hand, weapon);
|
AttackAnimation(skillinuse, Hand, weapon);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
||||||
|
|
||||||
/// Now figure out damage
|
/// Now figure out damage
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
if(IsBerserk() && GetClass() == BERSERKER){
|
if(IsBerserk() && GetClass() == BERSERKER){
|
||||||
int bonus = 3 + GetLevel()/10; //unverified
|
int bonus = 3 + GetLevel()/10; //unverified
|
||||||
weapon_damage = weapon_damage * (100+bonus) / 100;
|
weapon_damage = weapon_damage * (100+bonus) / 100;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//try a finishing blow.. if successful end the attack
|
//try a finishing blow.. if successful end the attack
|
||||||
@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
damage = mod_client_damage(damage, skillinuse, Hand, weapon, other);
|
damage = mod_client_damage(damage, skillinuse, Hand, weapon, other);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)",
|
||||||
damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel);
|
damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel);
|
||||||
|
|
||||||
int hit_chance_bonus = 0;
|
int hit_chance_bonus = 0;
|
||||||
@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
//check to see if we hit..
|
//check to see if we hit..
|
||||||
if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) {
|
if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0.");
|
||||||
damage = 0;
|
damage = 0;
|
||||||
} else { //we hit, try to avoid it
|
} else { //we hit, try to avoid it
|
||||||
other->AvoidDamage(this, damage);
|
other->AvoidDamage(this, damage);
|
||||||
@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
|||||||
if(damage > 0)
|
if(damage > 0)
|
||||||
CommonOutgoingHitSuccess(other, damage, skillinuse);
|
CommonOutgoingHitSuccess(other, damage, skillinuse);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//riposte
|
//riposte
|
||||||
@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
|
|||||||
}
|
}
|
||||||
|
|
||||||
int exploss = 0;
|
int exploss = 0;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#1: Send death packet to everyone
|
#1: Send death packet to everyone
|
||||||
@ -1692,7 +1692,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
|
|
||||||
if (!other) {
|
if (!other) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
if (other->IsClient())
|
if (other->IsClient())
|
||||||
other->CastToClient()->RemoveXTarget(this, false);
|
other->CastToClient()->RemoveXTarget(this, false);
|
||||||
RemoveFromHateList(other);
|
RemoveFromHateList(other);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
//We dont factor much from the weapon into the attack.
|
//We dont factor much from the weapon into the attack.
|
||||||
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
|
//Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons
|
||||||
if(weapon) {
|
if(weapon) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||||
|
|
||||||
if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){
|
if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
|
|
||||||
//check if we're hitting above our max or below it.
|
//check if we're hitting above our max or below it.
|
||||||
if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) {
|
if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane));
|
||||||
damage = (min_dmg+eleBane);
|
damage = (min_dmg+eleBane);
|
||||||
}
|
}
|
||||||
if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) {
|
if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane));
|
||||||
damage = (max_dmg+eleBane);
|
damage = (max_dmg+eleBane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(other->IsClient() && other->CastToClient()->IsSitting()) {
|
if(other->IsClient() && other->CastToClient()->IsSitting()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane));
|
||||||
damage = (max_dmg+eleBane);
|
damage = (max_dmg+eleBane);
|
||||||
damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse);
|
damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse);
|
||||||
|
|
||||||
@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
hate += opts->hate_flat;
|
hate += opts->hate_flat;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName());
|
||||||
// now add done damage to the hate list
|
// now add done damage to the hate list
|
||||||
other->AddToHateList(this, hate);
|
other->AddToHateList(this, hate);
|
||||||
|
|
||||||
@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
if(damage > 0) {
|
if(damage > 0) {
|
||||||
CommonOutgoingHitSuccess(other, damage, skillinuse);
|
CommonOutgoingHitSuccess(other, damage, skillinuse);
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName());
|
||||||
// now add done damage to the hate list
|
// now add done damage to the hate list
|
||||||
if(damage > 0)
|
if(damage > 0)
|
||||||
other->AddToHateList(this, hate);
|
other->AddToHateList(this, hate);
|
||||||
@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage);
|
||||||
|
|
||||||
if(other->IsClient() && IsPet() && GetOwner()->IsClient()) {
|
if(other->IsClient() && IsPet() && GetOwner()->IsClient()) {
|
||||||
//pets do half damage to clients in pvp
|
//pets do half damage to clients in pvp
|
||||||
@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
|||||||
|
|
||||||
//cant riposte a riposte
|
//cant riposte a riposte
|
||||||
if (bRiposte && damage == -3) {
|
if (bRiposte && damage == -3) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack
|
|||||||
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
||||||
if(attacked_timer.Check())
|
if(attacked_timer.Check())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName());
|
||||||
parse->EventNPC(EVENT_ATTACK, this, other, "", 0);
|
parse->EventNPC(EVENT_ATTACK, this, other, "", 0);
|
||||||
}
|
}
|
||||||
attacked_timer.Start(CombatEventTimer_expire);
|
attacked_timer.Start(CombatEventTimer_expire);
|
||||||
@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) {
|
bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill);
|
||||||
|
|
||||||
Mob *oos = nullptr;
|
Mob *oos = nullptr;
|
||||||
if(killerMob) {
|
if(killerMob) {
|
||||||
@ -2028,7 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
|
|||||||
if (IsEngaged())
|
if (IsEngaged())
|
||||||
{
|
{
|
||||||
zone->DelAggroMob();
|
zone->DelAggroMob();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount());
|
||||||
}
|
}
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
SetPet(0);
|
SetPet(0);
|
||||||
@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
|||||||
if(DS == 0 && rev_ds == 0)
|
if(DS == 0 && rev_ds == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName());
|
||||||
|
|
||||||
//invert DS... spells yield negative values for a true damage shield
|
//invert DS... spells yield negative values for a true damage shield
|
||||||
if(DS < 0) {
|
if(DS < 0) {
|
||||||
@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
|||||||
rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID;
|
rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID;
|
||||||
|
|
||||||
if(rev_ds < 0) {
|
if(rev_ds < 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
||||||
attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
|
attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this
|
||||||
//do we need to send a damage packet here also?
|
//do we need to send a damage packet here also?
|
||||||
}
|
}
|
||||||
@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
|||||||
int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100;
|
int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100;
|
||||||
if(damage_to_reduce >= buffs[slot].melee_rune)
|
if(damage_to_reduce >= buffs[slot].melee_rune)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
||||||
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune);
|
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune);
|
||||||
damage -= buffs[slot].melee_rune;
|
damage -= buffs[slot].melee_rune;
|
||||||
if(!TryFadeEffect(slot))
|
if(!TryFadeEffect(slot))
|
||||||
@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
||||||
" damage remaining.", damage_to_reduce, buffs[slot].melee_rune);
|
" damage remaining.", damage_to_reduce, buffs[slot].melee_rune);
|
||||||
buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce);
|
buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce);
|
||||||
damage -= damage_to_reduce;
|
damage -= damage_to_reduce;
|
||||||
@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
|||||||
|
|
||||||
if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune))
|
if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||||
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune);
|
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune);
|
||||||
damage -= buffs[slot].melee_rune;
|
damage -= buffs[slot].melee_rune;
|
||||||
if(!TryFadeEffect(slot))
|
if(!TryFadeEffect(slot))
|
||||||
@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||||
" damage remaining.", damage_to_reduce, buffs[slot].melee_rune);
|
" damage remaining.", damage_to_reduce, buffs[slot].melee_rune);
|
||||||
|
|
||||||
if (spellbonuses.MitigateMeleeRune[3])
|
if (spellbonuses.MitigateMeleeRune[3])
|
||||||
@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
|
|||||||
|
|
||||||
if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune))
|
if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d"
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d"
|
||||||
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune);
|
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune);
|
||||||
damage -= buffs[slot].magic_rune;
|
damage -= buffs[slot].magic_rune;
|
||||||
if(!TryFadeEffect(slot))
|
if(!TryFadeEffect(slot))
|
||||||
@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||||
" damage remaining.", damage_to_reduce, buffs[slot].magic_rune);
|
" damage remaining.", damage_to_reduce, buffs[slot].magic_rune);
|
||||||
|
|
||||||
if (spellbonuses.MitigateSpellRune[3])
|
if (spellbonuses.MitigateSpellRune[3])
|
||||||
@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
// This method is called with skill_used=ABJURE for Damage Shield damage.
|
// This method is called with skill_used=ABJURE for Damage Shield damage.
|
||||||
bool FromDamageShield = (skill_used == SkillAbjuration);
|
bool FromDamageShield = (skill_used == SkillAbjuration);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d",
|
||||||
damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot);
|
damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot);
|
||||||
|
|
||||||
if (GetInvul() || DivineAura()) {
|
if (GetInvul() || DivineAura()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage);
|
||||||
damage = -5;
|
damage = -5;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
int healed = damage;
|
int healed = damage;
|
||||||
|
|
||||||
healed = attacker->GetActSpellHealing(spell_id, healed);
|
healed = attacker->GetActSpellHealing(spell_id, healed);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName());
|
||||||
attacker->HealDamage(healed);
|
attacker->HealDamage(healed);
|
||||||
|
|
||||||
//we used to do a message to the client, but its gone now.
|
//we used to do a message to the client, but its gone now.
|
||||||
@ -3506,7 +3506,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse())
|
if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse())
|
||||||
{
|
{
|
||||||
if (!pet->IsHeld()) {
|
if (!pet->IsHeld()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName());
|
||||||
pet->AddToHateList(attacker, 1);
|
pet->AddToHateList(attacker, 1);
|
||||||
pet->SetTarget(attacker);
|
pet->SetTarget(attacker);
|
||||||
Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
|
Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
|
||||||
@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
//see if any runes want to reduce this damage
|
//see if any runes want to reduce this damage
|
||||||
if(spell_id == SPELL_UNKNOWN) {
|
if(spell_id == SPELL_UNKNOWN) {
|
||||||
damage = ReduceDamage(damage);
|
damage = ReduceDamage(damage);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage);
|
||||||
damage = ReduceAllDamage(damage);
|
damage = ReduceAllDamage(damage);
|
||||||
TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker);
|
TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker);
|
||||||
} else {
|
} else {
|
||||||
@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
|
|
||||||
//fade mez if we are mezzed
|
//fade mez if we are mezzed
|
||||||
if (IsMezzed() && attacker) {
|
if (IsMezzed() && attacker) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack.");
|
||||||
entity_list.MessageClose_StringID(this, true, 100, MT_WornOff,
|
entity_list.MessageClose_StringID(this, true, 100, MT_WornOff,
|
||||||
HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName());
|
HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName());
|
||||||
BuffFadeByEffect(SE_Mez);
|
BuffFadeByEffect(SE_Mez);
|
||||||
@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
int stun_resist = itembonuses.StunResist + spellbonuses.StunResist;
|
int stun_resist = itembonuses.StunResist + spellbonuses.StunResist;
|
||||||
int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist;
|
int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance);
|
||||||
if (IsClient()) {
|
if (IsClient()) {
|
||||||
stun_resist += aabonuses.StunResist;
|
stun_resist += aabonuses.StunResist;
|
||||||
frontal_stun_resist += aabonuses.FrontalStunResist;
|
frontal_stun_resist += aabonuses.FrontalStunResist;
|
||||||
@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
if (((GetBaseRace() == OGRE && IsClient()) ||
|
if (((GetBaseRace() == OGRE && IsClient()) ||
|
||||||
(frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) &&
|
(frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) &&
|
||||||
!attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
|
!attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist);
|
||||||
} else {
|
} else {
|
||||||
// Normal stun resist check.
|
// Normal stun resist check.
|
||||||
if (stun_resist && zone->random.Roll(stun_resist)) {
|
if (stun_resist && zone->random.Roll(stun_resist)) {
|
||||||
if (IsClient())
|
if (IsClient())
|
||||||
Message_StringID(MT_Stun, SHAKE_OFF_STUN);
|
Message_StringID(MT_Stun, SHAKE_OFF_STUN);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist);
|
||||||
Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds
|
Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
//increment chances of interrupting
|
//increment chances of interrupting
|
||||||
if(IsCasting()) { //shouldnt interrupt on regular spell damage
|
if(IsCasting()) { //shouldnt interrupt on regular spell damage
|
||||||
attacked_count++;
|
attacked_count++;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand)
|
|||||||
ProcChance += ProcChance * ProcBonus / 100.0f;
|
ProcChance += ProcChance * ProcBonus / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||||
return ProcChance;
|
return ProcChance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h
|
|||||||
ProcBonus += static_cast<float>(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f;
|
ProcBonus += static_cast<float>(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f;
|
||||||
ProcChance = ProcChance + (ProcChance * ProcBonus);
|
ProcChance = ProcChance + (ProcChance * ProcBonus);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||||
return ProcChance;
|
return ProcChance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3887,7 +3887,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) {
|
|||||||
|
|
||||||
if (!on) {
|
if (!on) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3918,17 +3918,17 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) {
|
|||||||
void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) {
|
void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) {
|
||||||
if(!on) {
|
if(!on) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsAttackAllowed(on)) {
|
if (!IsAttackAllowed(on)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DivineAura()) {
|
if (DivineAura()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
|
|||||||
static_cast<float>(weapon->ProcRate)) / 100.0f;
|
static_cast<float>(weapon->ProcRate)) / 100.0f;
|
||||||
if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
|
if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
|
||||||
if (weapon->Proc.Level > ourlevel) {
|
if (weapon->Proc.Level > ourlevel) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Tried to proc (%s), but our level (%d) is lower than required (%d)",
|
"Tried to proc (%s), but our level (%d) is lower than required (%d)",
|
||||||
weapon->Name, ourlevel, weapon->Proc.Level);
|
weapon->Name, ourlevel, weapon->Proc.Level);
|
||||||
if (IsPet()) {
|
if (IsPet()) {
|
||||||
@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
|
|||||||
Message_StringID(13, PROC_TOOLOW);
|
Message_StringID(13, PROC_TOOLOW);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)",
|
"Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)",
|
||||||
weapon->Name, weapon->Proc.Effect, WPC * 100);
|
weapon->Name, weapon->Proc.Effect, WPC * 100);
|
||||||
ExecWeaponProc(inst, weapon->Proc.Effect, on);
|
ExecWeaponProc(inst, weapon->Proc.Effect, on);
|
||||||
@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
|||||||
// Perma procs (AAs)
|
// Perma procs (AAs)
|
||||||
if (PermaProcs[i].spellID != SPELL_UNKNOWN) {
|
if (PermaProcs[i].spellID != SPELL_UNKNOWN) {
|
||||||
if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus?
|
if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus?
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Permanent proc %d procing spell %d (%d percent chance)",
|
"Permanent proc %d procing spell %d (%d percent chance)",
|
||||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||||
ExecWeaponProc(nullptr, PermaProcs[i].spellID, on);
|
ExecWeaponProc(nullptr, PermaProcs[i].spellID, on);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Permanent proc %d failed to proc %d (%d percent chance)",
|
"Permanent proc %d failed to proc %d (%d percent chance)",
|
||||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||||
}
|
}
|
||||||
@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
|||||||
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
||||||
float chance = ProcChance * (static_cast<float>(SpellProcs[i].chance) / 100.0f);
|
float chance = ProcChance * (static_cast<float>(SpellProcs[i].chance) / 100.0f);
|
||||||
if (zone->random.Roll(chance)) {
|
if (zone->random.Roll(chance)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Spell proc %d procing spell %d (%.2f percent chance)",
|
"Spell proc %d procing spell %d (%.2f percent chance)",
|
||||||
i, SpellProcs[i].spellID, chance);
|
i, SpellProcs[i].spellID, chance);
|
||||||
ExecWeaponProc(nullptr, SpellProcs[i].spellID, on);
|
ExecWeaponProc(nullptr, SpellProcs[i].spellID, on);
|
||||||
CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID);
|
CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Spell proc %d failed to proc %d (%.2f percent chance)",
|
"Spell proc %d failed to proc %d (%.2f percent chance)",
|
||||||
i, SpellProcs[i].spellID, chance);
|
i, SpellProcs[i].spellID, chance);
|
||||||
}
|
}
|
||||||
@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
|||||||
if (RangedProcs[i].spellID != SPELL_UNKNOWN) {
|
if (RangedProcs[i].spellID != SPELL_UNKNOWN) {
|
||||||
float chance = ProcChance * (static_cast<float>(RangedProcs[i].chance) / 100.0f);
|
float chance = ProcChance * (static_cast<float>(RangedProcs[i].chance) / 100.0f);
|
||||||
if (zone->random.Roll(chance)) {
|
if (zone->random.Roll(chance)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Ranged proc %d procing spell %d (%.2f percent chance)",
|
"Ranged proc %d procing spell %d (%.2f percent chance)",
|
||||||
i, RangedProcs[i].spellID, chance);
|
i, RangedProcs[i].spellID, chance);
|
||||||
ExecWeaponProc(nullptr, RangedProcs[i].spellID, on);
|
ExecWeaponProc(nullptr, RangedProcs[i].spellID, on);
|
||||||
CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID);
|
CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat,
|
||||||
"Ranged proc %d failed to proc %d (%.2f percent chance)",
|
"Ranged proc %d failed to proc %d (%.2f percent chance)",
|
||||||
i, RangedProcs[i].spellID, chance);
|
i, RangedProcs[i].spellID, chance);
|
||||||
}
|
}
|
||||||
@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mob::DoRiposte(Mob* defender) {
|
void Mob::DoRiposte(Mob* defender) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte");
|
||||||
|
|
||||||
if (!defender)
|
if (!defender)
|
||||||
return;
|
return;
|
||||||
@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) {
|
|||||||
|
|
||||||
//Live AA - Double Riposte
|
//Live AA - Double Riposte
|
||||||
if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance);
|
||||||
defender->Attack(this, MainPrimary, true);
|
defender->Attack(this, MainPrimary, true);
|
||||||
if (HasDied()) return;
|
if (HasDied()) return;
|
||||||
}
|
}
|
||||||
@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) {
|
|||||||
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
|
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
|
||||||
|
|
||||||
if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance);
|
||||||
|
|
||||||
if (defender->GetClass() == MONK)
|
if (defender->GetClass() == MONK)
|
||||||
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]);
|
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]);
|
||||||
@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){
|
|||||||
int dmgbonusmod = 0;
|
int dmgbonusmod = 0;
|
||||||
dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3;
|
dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3;
|
||||||
dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5;
|
dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100));
|
||||||
damage += (damage*dmgbonusmod/10000);
|
damage += (damage*dmgbonusmod/10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4467,7 +4467,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
|||||||
|
|
||||||
if (!on) {
|
if (!on) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
|
|||||||
|
|
||||||
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
||||||
BuffFadeBySlot(spellbonuses.Root[1]);
|
BuffFadeBySlot(spellbonuses.Root[1]);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible()
|
|||||||
{
|
{
|
||||||
//break invis when you attack
|
//break invis when you attack
|
||||||
if(invisible) {
|
if(invisible) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack.");
|
||||||
BuffFadeByEffect(SE_Invisibility);
|
BuffFadeByEffect(SE_Invisibility);
|
||||||
BuffFadeByEffect(SE_Invisibility2);
|
BuffFadeByEffect(SE_Invisibility2);
|
||||||
invisible = false;
|
invisible = false;
|
||||||
}
|
}
|
||||||
if(invisible_undead) {
|
if(invisible_undead) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||||
BuffFadeByEffect(SE_InvisVsUndead);
|
BuffFadeByEffect(SE_InvisVsUndead);
|
||||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||||
invisible_undead = false;
|
invisible_undead = false;
|
||||||
}
|
}
|
||||||
if(invisible_animals){
|
if(invisible_animals){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||||
invisible_animals = false;
|
invisible_animals = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,9 +77,9 @@ void Client::CalcBonuses()
|
|||||||
|
|
||||||
CalcSpellBonuses(&spellbonuses);
|
CalcSpellBonuses(&spellbonuses);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName());
|
||||||
CalcAABonuses(&aabonuses); //we're not quite ready for this
|
CalcAABonuses(&aabonuses); //we're not quite ready for this
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName());
|
||||||
|
|
||||||
RecalcWeight();
|
RecalcWeight();
|
||||||
|
|
||||||
@ -634,7 +634,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
|
|||||||
if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite)
|
if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName());
|
||||||
|
|
||||||
uint8 focus = IsFocusEffect(0, 0, true,effect);
|
uint8 focus = IsFocusEffect(0, 0, true,effect);
|
||||||
if (focus)
|
if (focus)
|
||||||
|
|||||||
116
zone/bot.cpp
116
zone/bot.cpp
@ -1225,7 +1225,7 @@ int32 Bot::acmod()
|
|||||||
return (65 + ((agility-300) / 21));
|
return (65 + ((agility-300) / 21));
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level);
|
Log.Log(EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1462,7 +1462,7 @@ void Bot::LoadAAs() {
|
|||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
|
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadAAs()");
|
Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadAAs()");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
|
|||||||
if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite)
|
if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName());
|
||||||
|
|
||||||
uint8 focus = IsFocusEffect(0, 0, true,effect);
|
uint8 focus = IsFocusEffect(0, 0, true,effect);
|
||||||
if (focus)
|
if (focus)
|
||||||
@ -2774,7 +2774,7 @@ void Bot::LoadStance() {
|
|||||||
std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID());
|
std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success() || results.RowCount() == 0) {
|
if(!results.Success() || results.RowCount() == 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadStance()");
|
Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadStance()");
|
||||||
SetDefaultBotStance();
|
SetDefaultBotStance();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2792,7 +2792,7 @@ void Bot::SaveStance() {
|
|||||||
"VALUES(%u, %u);", GetBotID(), GetBotStance());
|
"VALUES(%u, %u);", GetBotID(), GetBotStance());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Bot::SaveStance()");
|
Log.Log(EQEmuLogSys::Error, "Error in Bot::SaveStance()");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2807,7 +2807,7 @@ void Bot::LoadTimers() {
|
|||||||
GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel());
|
GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadTimers()");
|
Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadTimers()");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2847,7 +2847,7 @@ void Bot::SaveTimers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(hadError)
|
if(hadError)
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Bot::SaveTimers()");
|
Log.Log(EQEmuLogSys::Error, "Error in Bot::SaveTimers()");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
|||||||
//make sure the attack and ranged timers are up
|
//make sure the attack and ranged timers are up
|
||||||
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
//if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow
|
||||||
if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) {
|
if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||||
Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
|||||||
if(!RangeWeapon || !Ammo)
|
if(!RangeWeapon || !Ammo)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID);
|
||||||
|
|
||||||
if(!IsAttackAllowed(other) ||
|
if(!IsAttackAllowed(other) ||
|
||||||
IsCasting() ||
|
IsCasting() ||
|
||||||
@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) {
|
|||||||
|
|
||||||
//break invis when you attack
|
//break invis when you attack
|
||||||
if(invisible) {
|
if(invisible) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack.");
|
||||||
BuffFadeByEffect(SE_Invisibility);
|
BuffFadeByEffect(SE_Invisibility);
|
||||||
BuffFadeByEffect(SE_Invisibility2);
|
BuffFadeByEffect(SE_Invisibility2);
|
||||||
invisible = false;
|
invisible = false;
|
||||||
}
|
}
|
||||||
if(invisible_undead) {
|
if(invisible_undead) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||||
BuffFadeByEffect(SE_InvisVsUndead);
|
BuffFadeByEffect(SE_InvisVsUndead);
|
||||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||||
invisible_undead = false;
|
invisible_undead = false;
|
||||||
}
|
}
|
||||||
if(invisible_animals){
|
if(invisible_animals){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||||
invisible_animals = false;
|
invisible_animals = false;
|
||||||
}
|
}
|
||||||
@ -3362,7 +3362,7 @@ void Bot::AI_Process() {
|
|||||||
else if(!IsRooted()) {
|
else if(!IsRooted()) {
|
||||||
if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this)
|
if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned.");
|
||||||
CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed());
|
CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed());
|
||||||
SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY()));
|
SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY()));
|
||||||
return;
|
return;
|
||||||
@ -3689,7 +3689,7 @@ void Bot::AI_Process() {
|
|||||||
|
|
||||||
if (AImovement_timer->Check()) {
|
if (AImovement_timer->Check()) {
|
||||||
if(!IsRooted()) {
|
if(!IsRooted()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName());
|
||||||
CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed());
|
CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3972,7 +3972,7 @@ void Bot::PetAIProcess() {
|
|||||||
{
|
{
|
||||||
botPet->SetRunAnimSpeed(0);
|
botPet->SetRunAnimSpeed(0);
|
||||||
if(!botPet->IsRooted()) {
|
if(!botPet->IsRooted()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName());
|
||||||
botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed());
|
botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) {
|
|||||||
|
|
||||||
ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]);
|
ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]);
|
||||||
if (!inst) {
|
if (!inst) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id);
|
Log.Log(EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) {
|
|||||||
|
|
||||||
// Save ptr to item in inventory
|
// Save ptr to item in inventory
|
||||||
if (put_slot_id == INVALID_INDEX)
|
if (put_slot_id == INVALID_INDEX)
|
||||||
logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id);
|
Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_
|
|||||||
|
|
||||||
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
||||||
if(attacked_timer.Check()) {
|
if(attacked_timer.Check()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName());
|
||||||
parse->EventNPC(EVENT_ATTACK, this, from, "", 0);
|
parse->EventNPC(EVENT_ATTACK, this, from, "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_
|
|||||||
// if spell is lifetap add hp to the caster
|
// if spell is lifetap add hp to the caster
|
||||||
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) {
|
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) {
|
||||||
int healed = GetActSpellHealing(spell_id, damage);
|
int healed = GetActSpellHealing(spell_id, damage);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName());
|
||||||
HealDamage(healed);
|
HealDamage(healed);
|
||||||
entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() );
|
entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() );
|
||||||
}
|
}
|
||||||
@ -6017,14 +6017,14 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
{
|
{
|
||||||
if (!other) {
|
if (!other) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!GetTarget() || GetTarget() != other)
|
if(!GetTarget() || GetTarget() != other)
|
||||||
SetTarget(other);
|
SetTarget(other);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":"");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":"");
|
||||||
|
|
||||||
if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) ||
|
if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) ||
|
||||||
other == nullptr ||
|
other == nullptr ||
|
||||||
@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName());
|
entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName());
|
||||||
if(other) {
|
if(other) {
|
||||||
RemoveFromHateList(other);
|
RemoveFromHateList(other);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DivineAura()) {//cant attack while invulnerable
|
if(DivineAura()) {//cant attack while invulnerable
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
if(weapon != nullptr) {
|
if(weapon != nullptr) {
|
||||||
if (!weapon->IsWeapon()) {
|
if (!weapon->IsWeapon()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||||
// also send Packet to near clients
|
// also send Packet to near clients
|
||||||
SkillUseTypes skillinuse;
|
SkillUseTypes skillinuse;
|
||||||
AttackAnimation(skillinuse, Hand, weapon);
|
AttackAnimation(skillinuse, Hand, weapon);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse);
|
||||||
|
|
||||||
/// Now figure out damage
|
/// Now figure out damage
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
if(berserk && (GetClass() == BERSERKER)){
|
if(berserk && (GetClass() == BERSERKER)){
|
||||||
int bonus = 3 + GetLevel()/10; //unverified
|
int bonus = 3 + GetLevel()/10; //unverified
|
||||||
weapon_damage = weapon_damage * (100+bonus) / 100;
|
weapon_damage = weapon_damage * (100+bonus) / 100;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//try a finishing blow.. if successful end the attack
|
//try a finishing blow.. if successful end the attack
|
||||||
@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
else
|
else
|
||||||
damage = zone->random.Int(min_hit, max_hit);
|
damage = zone->random.Int(min_hit, max_hit);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)",
|
||||||
damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel());
|
damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel());
|
||||||
|
|
||||||
if(opts) {
|
if(opts) {
|
||||||
@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
//check to see if we hit..
|
//check to see if we hit..
|
||||||
if(!other->CheckHitChance(other, skillinuse, Hand)) {
|
if(!other->CheckHitChance(other, skillinuse, Hand)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0.");
|
||||||
damage = 0;
|
damage = 0;
|
||||||
other->AddToHateList(this, 0);
|
other->AddToHateList(this, 0);
|
||||||
} else { //we hit, try to avoid it
|
} else { //we hit, try to avoid it
|
||||||
@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
ApplyMeleeDamageBonus(skillinuse, damage);
|
ApplyMeleeDamageBonus(skillinuse, damage);
|
||||||
damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse);
|
damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse);
|
||||||
TryCriticalHit(other, skillinuse, damage, opts);
|
TryCriticalHit(other, skillinuse, damage, opts);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName());
|
||||||
// now add done damage to the hate list
|
// now add done damage to the hate list
|
||||||
//other->AddToHateList(this, hate);
|
//other->AddToHateList(this, hate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
other->AddToHateList(this, 0);
|
other->AddToHateList(this, 0);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//riposte
|
//riposte
|
||||||
@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
|||||||
|
|
||||||
//break invis when you attack
|
//break invis when you attack
|
||||||
if(invisible) {
|
if(invisible) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack.");
|
||||||
BuffFadeByEffect(SE_Invisibility);
|
BuffFadeByEffect(SE_Invisibility);
|
||||||
BuffFadeByEffect(SE_Invisibility2);
|
BuffFadeByEffect(SE_Invisibility2);
|
||||||
invisible = false;
|
invisible = false;
|
||||||
}
|
}
|
||||||
if(invisible_undead) {
|
if(invisible_undead) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||||
BuffFadeByEffect(SE_InvisVsUndead);
|
BuffFadeByEffect(SE_InvisVsUndead);
|
||||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||||
invisible_undead = false;
|
invisible_undead = false;
|
||||||
}
|
}
|
||||||
if(invisible_animals){
|
if(invisible_animals){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||||
invisible_animals = false;
|
invisible_animals = false;
|
||||||
}
|
}
|
||||||
@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]);
|
Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -7335,7 +7335,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
|||||||
//this spits up a lot of garbage when calculating spell focuses
|
//this spits up a lot of garbage when calculating spell focuses
|
||||||
//since they have all kinds of extra effects on them.
|
//since they have all kinds of extra effects on them.
|
||||||
default:
|
default:
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Check for spell skill limits.
|
//Check for spell skill limits.
|
||||||
@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
|||||||
ProcChance += ProcChance*ProcBonus / 100.0f;
|
ProcChance += ProcChance*ProcBonus / 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||||
return ProcChance;
|
return ProcChance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) {
|
if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) {
|
||||||
damage = -3;
|
damage = -3;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage);
|
||||||
|
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
return true;
|
return true;
|
||||||
@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
|
|||||||
uint16 levelreq = aabonuses.FinishingBlowLvl[0];
|
uint16 levelreq = aabonuses.FinishingBlowLvl[0];
|
||||||
|
|
||||||
if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){
|
if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
||||||
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
||||||
defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse);
|
defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Bot::DoRiposte(Mob* defender) {
|
void Bot::DoRiposte(Mob* defender) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte");
|
||||||
|
|
||||||
if (!defender)
|
if (!defender)
|
||||||
return;
|
return;
|
||||||
@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) {
|
|||||||
defender->GetItemBonuses().GiveDoubleRiposte[0];
|
defender->GetItemBonuses().GiveDoubleRiposte[0];
|
||||||
|
|
||||||
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||||
|
|
||||||
defender->Attack(this, MainPrimary, true);
|
defender->Attack(this, MainPrimary, true);
|
||||||
}
|
}
|
||||||
@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
|
|||||||
float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f);
|
float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f);
|
||||||
float DefenderChance = (float)zone->random.Real(0.00f, 1.00f);
|
float DefenderChance = (float)zone->random.Real(0.00f, 1.00f);
|
||||||
if(AttackerChance > DefenderChance) {
|
if(AttackerChance > DefenderChance) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance);
|
||||||
// WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW
|
// WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW
|
||||||
//entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
//entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName());
|
||||||
entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName());
|
entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName());
|
||||||
@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
|
|||||||
Result = true;
|
Result = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8441,11 +8441,11 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID());
|
// Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID());
|
||||||
|
|
||||||
SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER);
|
SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER);
|
||||||
|
|
||||||
//logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID();
|
//Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID();
|
||||||
|
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
||||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||||
@ -8548,7 +8548,7 @@ int32 Bot::CalcMaxMana() {
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||||
max_mana = 0;
|
max_mana = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t
|
|||||||
|
|
||||||
if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) {
|
if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) {
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d",
|
||||||
spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot);
|
spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot);
|
||||||
|
|
||||||
if(casting_spell_id == spell_id)
|
if(casting_spell_id == spell_id)
|
||||||
@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t
|
|||||||
|
|
||||||
if(GetClass() != BARD) {
|
if(GetClass() != BARD) {
|
||||||
if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) {
|
if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d",
|
||||||
IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() );
|
IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() );
|
||||||
if(IsSilenced() && !IsDiscipline(spell_id))
|
if(IsSilenced() && !IsDiscipline(spell_id))
|
||||||
Message_StringID(13, SILENCED_STRING);
|
Message_StringID(13, SILENCED_STRING);
|
||||||
@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t
|
|||||||
|
|
||||||
//cannot cast under deivne aura
|
//cannot cast under deivne aura
|
||||||
if(DivineAura()) {
|
if(DivineAura()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect.");
|
||||||
InterruptSpell(173, 0x121, false);
|
InterruptSpell(173, 0x121, false);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t
|
|||||||
InterruptSpell(fizzle_msg, 0x121, spell_id);
|
InterruptSpell(fizzle_msg, 0x121, spell_id);
|
||||||
|
|
||||||
uint32 use_mana = ((spells[spell_id].mana) / 4);
|
uint32 use_mana = ((spells[spell_id].mana) / 4);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana);
|
||||||
|
|
||||||
// fizzle 1/4 the mana away
|
// fizzle 1/4 the mana away
|
||||||
SetMana(GetMana() - use_mana);
|
SetMana(GetMana() - use_mana);
|
||||||
@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (HasActiveSong()) {
|
if (HasActiveSong()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong);
|
||||||
//Note: this does NOT tell the client
|
//Note: this does NOT tell the client
|
||||||
//_StopSong();
|
//_StopSong();
|
||||||
bardsong = 0;
|
bardsong = 0;
|
||||||
@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) {
|
|||||||
if(caster->IsBot()) {
|
if(caster->IsBot()) {
|
||||||
if(spells[spell_id].targettype == ST_Undead) {
|
if(spells[spell_id].targettype == ST_Undead) {
|
||||||
if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) {
|
if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) {
|
|||||||
&& (GetBodyType() != BT_Summoned2)
|
&& (GetBodyType() != BT_Summoned2)
|
||||||
&& (GetBodyType() != BT_Summoned3)
|
&& (GetBodyType() != BT_Summoned3)
|
||||||
) {
|
) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15454,7 +15454,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
|
|||||||
// according to Rogean, Live NPCs will just cast through walls/floors, no problem..
|
// according to Rogean, Live NPCs will just cast through walls/floors, no problem..
|
||||||
//
|
//
|
||||||
// This check was put in to address an idle-mob CPU issue
|
// This check was put in to address an idle-mob CPU issue
|
||||||
logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -950,7 +950,7 @@ bool Bot::AI_PursueCastCheck() {
|
|||||||
|
|
||||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
||||||
|
|
||||||
if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) {
|
if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) {
|
||||||
if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) {
|
if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) {
|
||||||
@ -1055,7 +1055,7 @@ bool Bot::AI_EngagedCastCheck() {
|
|||||||
BotStanceType botStance = GetBotStance();
|
BotStanceType botStance = GetBotStance();
|
||||||
bool mayGetAggro = HasOrMayGetAggro();
|
bool mayGetAggro = HasOrMayGetAggro();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells.");
|
||||||
|
|
||||||
if(botClass == CLERIC) {
|
if(botClass == CLERIC) {
|
||||||
if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||||
|
|||||||
@ -340,7 +340,7 @@ Client::~Client() {
|
|||||||
ToggleBuyerMode(false);
|
ToggleBuyerMode(false);
|
||||||
|
|
||||||
if(conn_state != ClientConnectFinished) {
|
if(conn_state != ClientConnectFinished) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName());
|
||||||
ReportConnectingState();
|
ReportConnectingState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,31 +438,31 @@ void Client::SendLogoutPackets() {
|
|||||||
void Client::ReportConnectingState() {
|
void Client::ReportConnectingState() {
|
||||||
switch(conn_state) {
|
switch(conn_state) {
|
||||||
case NoPacketsReceived: //havent gotten anything
|
case NoPacketsReceived: //havent gotten anything
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet.");
|
||||||
break;
|
break;
|
||||||
case ReceivedZoneEntry: //got the first packet, loading up PP
|
case ReceivedZoneEntry: //got the first packet, loading up PP
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database.");
|
||||||
break;
|
break;
|
||||||
case PlayerProfileLoaded: //our DB work is done, sending it
|
case PlayerProfileLoaded: //our DB work is done, sending it
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished.");
|
||||||
break;
|
break;
|
||||||
case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather
|
case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone.");
|
||||||
break;
|
break;
|
||||||
case NewZoneRequested: //received and sent new zone request
|
case NewZoneRequested: //received and sent new zone request
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request.");
|
||||||
break;
|
break;
|
||||||
case ClientSpawnRequested: //client sent ReqClientSpawn
|
case ClientSpawnRequested: //client sent ReqClientSpawn
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished.");
|
||||||
break;
|
break;
|
||||||
case ZoneContentsSent: //objects, doors, zone points
|
case ZoneContentsSent: //objects, doors, zone points
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification.");
|
||||||
break;
|
break;
|
||||||
case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc
|
case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect");
|
||||||
break;
|
break;
|
||||||
case ClientConnectFinished: //client finally moved to finished state, were done here
|
case ClientConnectFinished: //client finally moved to finished state, were done here
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected.");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected.");
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -650,7 +650,7 @@ bool Client::SendAllPackets() {
|
|||||||
if(eqs)
|
if(eqs)
|
||||||
eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req);
|
eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req);
|
||||||
iterator.RemoveCurrent();
|
iterator.RemoveCurrent();
|
||||||
logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet");
|
Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -698,7 +698,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
|||||||
char message[4096];
|
char message[4096];
|
||||||
strn0cpy(message, orig_message, sizeof(message));
|
strn0cpy(message, orig_message, sizeof(message));
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message);
|
||||||
|
|
||||||
if (targetname == nullptr) {
|
if (targetname == nullptr) {
|
||||||
targetname = (!GetTarget()) ? "" : GetTarget()->GetName();
|
targetname = (!GetTarget()) ? "" : GetTarget()->GetName();
|
||||||
@ -1506,7 +1506,7 @@ void Client::UpdateAdmin(bool iFromDB) {
|
|||||||
|
|
||||||
if(m_pp.gm)
|
if(m_pp.gm)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName());
|
Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName());
|
||||||
// no need for this, having it set in pp you already start as gm
|
// no need for this, having it set in pp you already start as gm
|
||||||
// and it's also set in your spawn packet so other people see it too
|
// and it's also set in your spawn packet so other people see it too
|
||||||
// SendAppearancePacket(AT_GM, 1, false);
|
// SendAppearancePacket(AT_GM, 1, false);
|
||||||
@ -1911,7 +1911,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
|
|||||||
|
|
||||||
if (booktxt2[0] != '\0') {
|
if (booktxt2[0] != '\0') {
|
||||||
#if EQDEBUG >= 6
|
#if EQDEBUG >= 6
|
||||||
logger.Log(EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str());
|
Log.Log(EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str());
|
||||||
#endif
|
#endif
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct));
|
||||||
|
|
||||||
@ -2105,7 +2105,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){
|
|||||||
|
|
||||||
SaveCurrency();
|
SaveCurrency();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::EVENT_ITEM_ScriptStopReturn(){
|
void Client::EVENT_ITEM_ScriptStopReturn(){
|
||||||
@ -2145,7 +2145,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat
|
|||||||
SaveCurrency();
|
SaveCurrency();
|
||||||
|
|
||||||
#if (EQDEBUG>=5)
|
#if (EQDEBUG>=5)
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i",
|
||||||
GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
|
GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2235,13 +2235,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha
|
|||||||
if(zone->random.Real(0, 99) < Chance)
|
if(zone->random.Real(0, 99) < Chance)
|
||||||
{
|
{
|
||||||
SetSkill(skillid, GetRawSkill(skillid) + 1);
|
SetSkill(skillid, GetRawSkill(skillid) + 1);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -2262,10 +2262,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) {
|
|||||||
|
|
||||||
if(zone->random.Real(0,100) < Chance) { // if they make the roll
|
if(zone->random.Real(0,100) < Chance) { // if they make the roll
|
||||||
IncreaseLanguageSkill(langid); // increase the language skill by 1
|
IncreaseLanguageSkill(langid); // increase the language skill by 1
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2364,7 +2364,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16
|
|||||||
|
|
||||||
Save();
|
Save();
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. "
|
Log.Log(EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. "
|
||||||
"Too many specializations skills were above 50.", GetCleanName());
|
"Too many specializations skills were above 50.", GetCleanName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4544,14 +4544,14 @@ void Client::HandleLDoNOpen(NPC *target)
|
|||||||
{
|
{
|
||||||
if(target->GetClass() != LDON_TREASURE)
|
if(target->GetClass() != LDON_TREASURE)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.",
|
||||||
GetName(), target->GetName(), target->GetName());
|
GetName(), target->GetName(), target->GetName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range",
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range",
|
||||||
GetName(), target->GetName(), target->GetName());
|
GetName(), target->GetName(), target->GetName());
|
||||||
Message(13, "Treasure chest out of range.");
|
Message(13, "Treasure chest out of range.");
|
||||||
return;
|
return;
|
||||||
@ -5294,7 +5294,7 @@ void Client::SendRewards()
|
|||||||
"ORDER BY reward_id", AccountID());
|
"ORDER BY reward_id", AccountID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5362,7 +5362,7 @@ bool Client::TryReward(uint32 claim_id) {
|
|||||||
AccountID(), claim_id);
|
AccountID(), claim_id);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5389,7 +5389,7 @@ bool Client::TryReward(uint32 claim_id) {
|
|||||||
AccountID(), claim_id);
|
AccountID(), claim_id);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
query = StringFormat("UPDATE account_rewards SET amount = (amount-1) "
|
query = StringFormat("UPDATE account_rewards SET amount = (amount-1) "
|
||||||
@ -5397,7 +5397,7 @@ bool Client::TryReward(uint32 claim_id) {
|
|||||||
AccountID(), claim_id);
|
AccountID(), claim_id);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
InternalVeteranReward ivr = (*iter);
|
InternalVeteranReward ivr = (*iter);
|
||||||
@ -6211,7 +6211,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
|||||||
PetRecord record;
|
PetRecord record;
|
||||||
if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
|
if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id);
|
Log.Log(EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id);
|
||||||
Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone);
|
Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6225,7 +6225,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
|||||||
|
|
||||||
const NPCType *npc_type = database.GetNPCType(pet.npc_id);
|
const NPCType *npc_type = database.GetNPCType(pet.npc_id);
|
||||||
if(npc_type == nullptr) {
|
if(npc_type == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id);
|
Log.Log(EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id);
|
||||||
Message(0,"Unable to find pet!");
|
Message(0,"Unable to find pet!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8149,7 +8149,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_
|
|||||||
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name);
|
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name);
|
||||||
|
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -8166,7 +8166,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_
|
|||||||
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name);
|
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name);
|
||||||
|
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8289,11 +8289,11 @@ std::string Client::TextLink::GenerateLink()
|
|||||||
if ((m_Link.length() == 0) || (m_Link.length() > 250)) {
|
if ((m_Link.length() == 0) || (m_Link.length() > 250)) {
|
||||||
m_Error = true;
|
m_Error = true;
|
||||||
m_Link = "<LINKER ERROR>";
|
m_Link = "<LINKER ERROR>";
|
||||||
logger.Log(EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})",
|
Log.Log(EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})",
|
||||||
m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length());
|
m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length());
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
logger.Log(EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str());
|
Log.Log(EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str());
|
||||||
logger.Log(EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str());
|
Log.Log(EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -826,7 +826,7 @@ int32 Client::acmod() {
|
|||||||
return (65 + ((agility-300) / 21));
|
return (65 + ((agility-300) / 21));
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level);
|
Log.Log(EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -935,7 +935,7 @@ int32 Client::CalcMaxMana()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||||
max_mana = 0;
|
max_mana = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -956,7 +956,7 @@ int32 Client::CalcMaxMana()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
||||||
#endif
|
#endif
|
||||||
return max_mana;
|
return max_mana;
|
||||||
}
|
}
|
||||||
@ -1046,14 +1046,14 @@ int32 Client::CalcBaseMana()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||||
max_m = 0;
|
max_m = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m);
|
||||||
#endif
|
#endif
|
||||||
return max_m;
|
return max_m;
|
||||||
}
|
}
|
||||||
@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
|||||||
if (effectmod > effectmodcap)
|
if (effectmod > effectmodcap)
|
||||||
effectmod = effectmodcap;
|
effectmod = effectmodcap;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n",
|
||||||
GetName(), spell_id, effectmod, effectmodcap);
|
GetName(), spell_id, effectmod, effectmodcap);
|
||||||
|
|
||||||
return effectmod;
|
return effectmod;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -799,7 +799,7 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
|||||||
Mob *Other = trade->With();
|
Mob *Other = trade->With();
|
||||||
if(Other)
|
if(Other)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items.");
|
||||||
FinishTrade(this);
|
FinishTrade(this);
|
||||||
|
|
||||||
if(Other->IsClient())
|
if(Other->IsClient())
|
||||||
@ -836,7 +836,7 @@ void Client::BulkSendInventoryItems() {
|
|||||||
if(inst) {
|
if(inst) {
|
||||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
|
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||||
PutItemInInventory(free_slot_id, *inst, false);
|
PutItemInInventory(free_slot_id, *inst, false);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
safe_delete(inst);
|
safe_delete(inst);
|
||||||
@ -1037,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
|||||||
// Account for merchant lists with gaps.
|
// Account for merchant lists with gaps.
|
||||||
if (ml.slot >= i) {
|
if (ml.slot >= i) {
|
||||||
if (ml.slot > i)
|
if (ml.slot > i)
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
|
||||||
i = ml.slot + 1;
|
i = ml.slot + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){
|
|||||||
Client* c = entity_list.GetClientByID(CustomerID);
|
Client* c = entity_list.GetClientByID(CustomerID);
|
||||||
|
|
||||||
if(!c) {
|
if(!c) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away.");
|
||||||
CustomerID = NewCustomer;
|
CustomerID = NewCustomer;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
|||||||
{
|
{
|
||||||
if(PendingRezzXP < 0) {
|
if(PendingRezzXP < 0) {
|
||||||
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer
|
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it.");
|
||||||
Message(13, "You have already been resurrected.\n");
|
Message(13, "You have already been resurrected.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
|||||||
// Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the
|
// Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the
|
||||||
// corpse is in has shutdown since the rez spell was cast.
|
// corpse is in has shutdown since the rez spell was cast.
|
||||||
database.MarkCorpseAsRezzed(PendingRezzDBID);
|
database.MarkCorpseAsRezzed(PendingRezzDBID);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||||
this->name, (uint16)spells[SpellID].base[0],
|
this->name, (uint16)spells[SpellID].base[0],
|
||||||
SpellID, ZoneID, InstanceID);
|
SpellID, ZoneID, InstanceID);
|
||||||
|
|
||||||
@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
|||||||
{
|
{
|
||||||
if(app->size != sizeof(MemorizeSpell_Struct))
|
if(app->size != sizeof(MemorizeSpell_Struct))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct));
|
Log.Log(EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct));
|
||||||
DumpPacket(app);
|
DumpPacket(app);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1723,12 +1723,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
|||||||
SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id;
|
SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id;
|
||||||
|
|
||||||
if(!CanHaveSkill(skill)) {
|
if(!CanHaveSkill(skill)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MaxSkill(skill) == 0) {
|
if(MaxSkill(skill) == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
|||||||
{
|
{
|
||||||
if (PendingRezzXP < 0 || PendingRezzSpellID == 0)
|
if (PendingRezzXP < 0 || PendingRezzSpellID == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SetHP(GetMaxHP() / 5);
|
SetHP(GetMaxHP() / 5);
|
||||||
@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
|||||||
|
|
||||||
if (corpse && corpse->IsCorpse())
|
if (corpse && corpse->IsCorpse())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s",
|
||||||
zone->GetShortName(), PendingRezzCorpseName.c_str());
|
zone->GetShortName(), PendingRezzCorpseName.c_str());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed.");
|
||||||
|
|
||||||
corpse->IsRezzed(true);
|
corpse->IsRezzed(true);
|
||||||
corpse->CompleteResurrection();
|
corpse->CompleteResurrection();
|
||||||
|
|||||||
@ -443,13 +443,13 @@ int command_init(void) {
|
|||||||
if ((itr=command_settings.find(cur->first))!=command_settings.end())
|
if ((itr=command_settings.find(cur->first))!=command_settings.end())
|
||||||
{
|
{
|
||||||
cur->second->access = itr->second;
|
cur->second->access = itr->second;
|
||||||
logger.Log(EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second);
|
Log.Log(EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef COMMANDS_WARNINGS
|
#ifdef COMMANDS_WARNINGS
|
||||||
if(cur->second->access == 0)
|
if(cur->second->access == 0)
|
||||||
logger.Log(EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str());
|
Log.Log(EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun
|
|||||||
std::string cstr(command_string);
|
std::string cstr(command_string);
|
||||||
|
|
||||||
if(commandlist.count(cstr) != 0) {
|
if(commandlist.count(cstr) != 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string);
|
Log.Log(EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,12 +568,12 @@ int command_realdispatch(Client *c, const char *message)
|
|||||||
|
|
||||||
#ifdef COMMANDS_LOGGING
|
#ifdef COMMANDS_LOGGING
|
||||||
if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) {
|
if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) {
|
||||||
logger.Log(EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE");
|
Log.Log(EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(cur->function == nullptr) {
|
if(cur->function == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str());
|
Log.Log(EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str());
|
||||||
return(-1);
|
return(-1);
|
||||||
} else {
|
} else {
|
||||||
//dispatch C++ command
|
//dispatch C++ command
|
||||||
@ -1292,7 +1292,7 @@ void command_viewpetition(Client *c, const Seperator *sep)
|
|||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) );
|
Log.Log(EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) );
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again.");
|
c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again.");
|
||||||
@ -1317,7 +1317,7 @@ void command_petitioninfo(Client *c, const Seperator *sep)
|
|||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
Log.Log(EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again.");
|
c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again.");
|
||||||
@ -1343,7 +1343,7 @@ void command_delpetition(Client *c, const Seperator *sep)
|
|||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
Log.Log(EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1566,7 +1566,7 @@ void command_permaclass(Client *c, const Seperator *sep)
|
|||||||
c->Message(0,"Target is not a client.");
|
c->Message(0,"Target is not a client.");
|
||||||
else {
|
else {
|
||||||
c->Message(0, "Setting %s's class...Sending to char select.", t->GetName());
|
c->Message(0, "Setting %s's class...Sending to char select.", t->GetName());
|
||||||
logger.Log(EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
Log.Log(EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
||||||
t->SetBaseClass(atoi(sep->arg[1]));
|
t->SetBaseClass(atoi(sep->arg[1]));
|
||||||
t->Save();
|
t->Save();
|
||||||
t->Kick();
|
t->Kick();
|
||||||
@ -1588,7 +1588,7 @@ void command_permarace(Client *c, const Seperator *sep)
|
|||||||
c->Message(0,"Target is not a client.");
|
c->Message(0,"Target is not a client.");
|
||||||
else {
|
else {
|
||||||
c->Message(0, "Setting %s's race - zone to take effect",t->GetName());
|
c->Message(0, "Setting %s's race - zone to take effect",t->GetName());
|
||||||
logger.Log(EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
Log.Log(EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
||||||
uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender());
|
uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender());
|
||||||
t->SetBaseRace(atoi(sep->arg[1]));
|
t->SetBaseRace(atoi(sep->arg[1]));
|
||||||
t->SetBaseGender(tmp);
|
t->SetBaseGender(tmp);
|
||||||
@ -1612,7 +1612,7 @@ void command_permagender(Client *c, const Seperator *sep)
|
|||||||
c->Message(0,"Target is not a client.");
|
c->Message(0,"Target is not a client.");
|
||||||
else {
|
else {
|
||||||
c->Message(0, "Setting %s's gender - zone to take effect",t->GetName());
|
c->Message(0, "Setting %s's gender - zone to take effect",t->GetName());
|
||||||
logger.Log(EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
Log.Log(EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
||||||
t->SetBaseGender(atoi(sep->arg[1]));
|
t->SetBaseGender(atoi(sep->arg[1]));
|
||||||
t->Save();
|
t->Save();
|
||||||
t->SendIllusionPacket(atoi(sep->arg[1]));
|
t->SendIllusionPacket(atoi(sep->arg[1]));
|
||||||
@ -1954,7 +1954,7 @@ void command_dbspawn2(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) {
|
if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) {
|
||||||
logger.Log(EQEmuLogSys::Normal, "Spawning database spawn");
|
Log.Log(EQEmuLogSys::Normal, "Spawning database spawn");
|
||||||
uint16 cond = 0;
|
uint16 cond = 0;
|
||||||
int16 cond_min = 0;
|
int16 cond_min = 0;
|
||||||
if(sep->IsNumber(4)) {
|
if(sep->IsNumber(4)) {
|
||||||
@ -2274,7 +2274,7 @@ void command_setlanguage(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) );
|
Log.Log(EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) );
|
||||||
uint8 langid = (uint8)atoi(sep->arg[1]);
|
uint8 langid = (uint8)atoi(sep->arg[1]);
|
||||||
uint8 value = (uint8)atoi(sep->arg[2]);
|
uint8 value = (uint8)atoi(sep->arg[2]);
|
||||||
c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value );
|
c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value );
|
||||||
@ -2299,7 +2299,7 @@ void command_setskill(Client *c, const Seperator *sep)
|
|||||||
c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL);
|
c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.Log(EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) );
|
Log.Log(EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) );
|
||||||
int skill_num = atoi(sep->arg[1]);
|
int skill_num = atoi(sep->arg[1]);
|
||||||
uint16 skill_value = atoi(sep->arg[2]);
|
uint16 skill_value = atoi(sep->arg[2]);
|
||||||
if(skill_num < HIGHEST_SKILL)
|
if(skill_num < HIGHEST_SKILL)
|
||||||
@ -2319,7 +2319,7 @@ void command_setskillall(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) {
|
if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) {
|
||||||
logger.Log(EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName());
|
Log.Log(EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName());
|
||||||
uint16 level = atoi(sep->arg[1]);
|
uint16 level = atoi(sep->arg[1]);
|
||||||
for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) {
|
for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) {
|
||||||
c->GetTarget()->CastToClient()->SetSkill(skill_num, level);
|
c->GetTarget()->CastToClient()->SetSkill(skill_num, level);
|
||||||
@ -2409,7 +2409,7 @@ void command_spawn(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.LogDebug(EQEmuLogSys::General,"#spawn Spawning:");
|
Log.LogDebug(EQEmuLogSys::General,"#spawn Spawning:");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c);
|
NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c);
|
||||||
@ -3114,7 +3114,7 @@ void command_listpetition(Client *c, const Seperator *sep)
|
|||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName());
|
Log.Log(EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName());
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
if (results.RowCount() == 0)
|
||||||
return;
|
return;
|
||||||
@ -3771,7 +3771,7 @@ void command_lastname(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if(c->GetTarget() && c->GetTarget()->IsClient())
|
if(c->GetTarget() && c->GetTarget()->IsClient())
|
||||||
t=c->GetTarget()->CastToClient();
|
t=c->GetTarget()->CastToClient();
|
||||||
logger.Log(EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName());
|
Log.Log(EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName());
|
||||||
|
|
||||||
if(strlen(sep->arg[1]) <= 70)
|
if(strlen(sep->arg[1]) <= 70)
|
||||||
t->ChangeLastName(sep->arg[1]);
|
t->ChangeLastName(sep->arg[1]);
|
||||||
@ -4394,7 +4394,7 @@ void command_time(Client *c, const Seperator *sep)
|
|||||||
);
|
);
|
||||||
c->Message(13, "It is now %s.", timeMessage);
|
c->Message(13, "It is now %s.", timeMessage);
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage);
|
Log.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4545,10 +4545,10 @@ void command_guild(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(guild_id == GUILD_NONE) {
|
if(guild_id == GUILD_NONE) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(),
|
||||||
sep->arg[2], charid);
|
sep->arg[2], charid);
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(),
|
||||||
sep->arg[2], charid,
|
sep->arg[2], charid,
|
||||||
guild_mgr.GetGuildName(guild_id), guild_id);
|
guild_mgr.GetGuildName(guild_id), guild_id);
|
||||||
}
|
}
|
||||||
@ -4597,7 +4597,7 @@ void command_guild(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(),
|
||||||
sep->arg[2], charid, rank);
|
sep->arg[2], charid, rank);
|
||||||
|
|
||||||
if(!guild_mgr.SetGuildRank(charid, rank))
|
if(!guild_mgr.SetGuildRank(charid, rank))
|
||||||
@ -4639,7 +4639,7 @@ void command_guild(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader);
|
uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(),
|
||||||
sep->argplus[3], leader, (unsigned long)id);
|
sep->argplus[3], leader, (unsigned long)id);
|
||||||
|
|
||||||
if (id == GUILD_NONE)
|
if (id == GUILD_NONE)
|
||||||
@ -4678,7 +4678,7 @@ void command_guild(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(),
|
||||||
guild_mgr.GetGuildName(id), id);
|
guild_mgr.GetGuildName(id), id);
|
||||||
|
|
||||||
if (!guild_mgr.DeleteGuild(id))
|
if (!guild_mgr.DeleteGuild(id))
|
||||||
@ -4712,7 +4712,7 @@ void command_guild(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(),
|
||||||
guild_mgr.GetGuildName(id), id, sep->argplus[3]);
|
guild_mgr.GetGuildName(id), id, sep->argplus[3]);
|
||||||
|
|
||||||
if (!guild_mgr.RenameGuild(id, sep->argplus[3]))
|
if (!guild_mgr.RenameGuild(id, sep->argplus[3]))
|
||||||
@ -4763,7 +4763,7 @@ void command_guild(Client *c, const Seperator *sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(),
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(),
|
||||||
guild_mgr.GetGuildName(id), id, leader);
|
guild_mgr.GetGuildName(id), id, leader);
|
||||||
|
|
||||||
if(!guild_mgr.SetGuildLeader(id, leader))
|
if(!guild_mgr.SetGuildLeader(id, leader))
|
||||||
@ -4869,7 +4869,7 @@ void command_manaburn(Client *c, const Seperator *sep)
|
|||||||
target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/);
|
target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/);
|
||||||
c->Message(4,"You unleash an enormous blast of magical energies.");
|
c->Message(4,"You unleash an enormous blast of magical energies.");
|
||||||
}
|
}
|
||||||
logger.Log(EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg);
|
Log.Log(EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5221,7 +5221,7 @@ void command_scribespells(Client *c, const Seperator *sep)
|
|||||||
t->Message(0, "Scribing spells to spellbook.");
|
t->Message(0, "Scribing spells to spellbook.");
|
||||||
if(t != c)
|
if(t != c)
|
||||||
c->Message(0, "Scribing spells for %s.", t->GetName());
|
c->Message(0, "Scribing spells for %s.", t->GetName());
|
||||||
logger.Log(EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level);
|
Log.Log(EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level);
|
||||||
|
|
||||||
for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot))
|
for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot))
|
||||||
{
|
{
|
||||||
@ -5278,7 +5278,7 @@ void command_scribespell(Client *c, const Seperator *sep) {
|
|||||||
if(t != c)
|
if(t != c)
|
||||||
c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName());
|
c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName());
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
Log.Log(EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
||||||
|
|
||||||
if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) {
|
if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) {
|
||||||
book_slot = t->GetNextAvailableSpellBookSlot();
|
book_slot = t->GetNextAvailableSpellBookSlot();
|
||||||
@ -5325,7 +5325,7 @@ void command_unscribespell(Client *c, const Seperator *sep) {
|
|||||||
if(t != c)
|
if(t != c)
|
||||||
c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName());
|
c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName());
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
Log.Log(EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id);
|
t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id);
|
||||||
@ -7862,7 +7862,7 @@ void command_traindisc(Client *c, const Seperator *sep)
|
|||||||
t->Message(0, "Training disciplines");
|
t->Message(0, "Training disciplines");
|
||||||
if(t != c)
|
if(t != c)
|
||||||
c->Message(0, "Training disciplines for %s.", t->GetName());
|
c->Message(0, "Training disciplines for %s.", t->GetName());
|
||||||
logger.Log(EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level);
|
Log.Log(EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level);
|
||||||
|
|
||||||
for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++)
|
for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++)
|
||||||
{
|
{
|
||||||
@ -10394,7 +10394,7 @@ void command_logtest(Client *c, const Seperator *sep){
|
|||||||
if (sep->IsNumber(1)){
|
if (sep->IsNumber(1)){
|
||||||
uint32 i = 0;
|
uint32 i = 0;
|
||||||
for (i = 0; i < atoi(sep->arg[1]); i++){
|
for (i = 0; i < atoi(sep->arg[1]); i++){
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -842,7 +842,7 @@ bool Corpse::Process() {
|
|||||||
spc->zone_id = zone->graveyard_zoneid();
|
spc->zone_id = zone->graveyard_zoneid();
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid()));
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid()));
|
||||||
corpse_db_id = 0;
|
corpse_db_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,10 +872,10 @@ bool Corpse::Process() {
|
|||||||
Save();
|
Save();
|
||||||
player_corpse_depop = true;
|
player_corpse_depop = true;
|
||||||
corpse_db_id = 0;
|
corpse_db_id = 0;
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName());
|
Log.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1083,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
|||||||
for(; cur != end; ++cur) {
|
for(; cur != end; ++cur) {
|
||||||
ServerLootItem_Struct* item_data = *cur;
|
ServerLootItem_Struct* item_data = *cur;
|
||||||
item = database.GetItem(item_data->item_id);
|
item = database.GetItem(item_data->item_id);
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner");
|
||||||
client->Message(0, "Inaccessable Corpse Item: %s", item->Name);
|
client->Message(0, "Inaccessable Corpse Item: %s", item->Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -145,9 +145,9 @@ bool Doors::Process()
|
|||||||
void Doors::HandleClick(Client* sender, uint8 trigger)
|
void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||||
{
|
{
|
||||||
//door debugging info dump
|
//door debugging info dump
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||||
|
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||||
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
||||||
@ -303,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
|||||||
sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1);
|
sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1);
|
||||||
|
|
||||||
#if EQDEBUG>=5
|
#if EQDEBUG>=5
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(GetLockpick() <= modskill)
|
if(GetLockpick() <= modskill)
|
||||||
@ -560,13 +560,13 @@ void Doors::ToggleState(Mob *sender)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Doors::DumpDoor(){
|
void Doors::DumpDoor(){
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,
|
||||||
"db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f",
|
"db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f",
|
||||||
db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading);
|
db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading);
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,
|
||||||
"opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s",
|
"opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s",
|
||||||
opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed");
|
opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed");
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,
|
||||||
"dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f",
|
"dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f",
|
||||||
dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
dest_zone, dest_x, dest_y, dest_z, dest_heading);
|
||||||
}
|
}
|
||||||
@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) {
|
bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) {
|
||||||
logger.Log(EQEmuLogSys::Status, "Loading Doors from database...");
|
Log.Log(EQEmuLogSys::Status, "Loading Doors from database...");
|
||||||
|
|
||||||
|
|
||||||
// Door tmpDoor;
|
// Door tmpDoor;
|
||||||
|
|||||||
@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
|||||||
const Item_Struct *item = database.GetItem(itemid);
|
const Item_Struct *item = database.GetItem(itemid);
|
||||||
if(item == nullptr) {
|
if(item == nullptr) {
|
||||||
Message(13, "Unable to find the tome you turned in!");
|
Message(13, "Unable to find the tome you turned in!");
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
|
Log.Log(EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() {
|
|||||||
perl = nullptr;
|
perl = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what());
|
Log.Log(EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what());
|
||||||
throw e.what();
|
throw e.what();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest)
|
|||||||
file[255] = '\0';
|
file[255] = '\0';
|
||||||
|
|
||||||
if(items != 1)
|
if(items != 1)
|
||||||
logger.Log(EQEmuLogSys::Error, "boot_quest does not take any arguments.");
|
Log.Log(EQEmuLogSys::Error, "boot_quest does not take any arguments.");
|
||||||
|
|
||||||
char buf[128]; //shouldent have any function names longer than this.
|
char buf[128]; //shouldent have any function names longer than this.
|
||||||
|
|
||||||
|
|||||||
@ -140,12 +140,12 @@ void Embperl::DoInit() {
|
|||||||
catch(const char *err)
|
catch(const char *err)
|
||||||
{
|
{
|
||||||
//remember... lasterr() is no good if we crap out here, in construction
|
//remember... lasterr() is no good if we crap out here, in construction
|
||||||
logger.Log(EQEmuLogSys::Quest, "perl error: %s", err);
|
Log.Log(EQEmuLogSys::Quest, "perl error: %s", err);
|
||||||
throw "failed to install eval_file hook";
|
throw "failed to install eval_file hook";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EMBPERL_IO_CAPTURE
|
#ifdef EMBPERL_IO_CAPTURE
|
||||||
logger.Log(EQEmuLogSys::Quest, "Tying perl output to eqemu logs");
|
Log.Log(EQEmuLogSys::Quest, "Tying perl output to eqemu logs");
|
||||||
//make a tieable class to capture IO and pass it into EQEMuLog
|
//make a tieable class to capture IO and pass it into EQEMuLog
|
||||||
eval_pv(
|
eval_pv(
|
||||||
"package EQEmuIO; "
|
"package EQEmuIO; "
|
||||||
@ -170,14 +170,14 @@ void Embperl::DoInit() {
|
|||||||
,FALSE
|
,FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Quest, "Loading perlemb plugins.");
|
Log.Log(EQEmuLogSys::Quest, "Loading perlemb plugins.");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE);
|
eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE);
|
||||||
}
|
}
|
||||||
catch(const char *err)
|
catch(const char *err)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Quest, "Warning - plugin.pl: %s", err);
|
Log.Log(EQEmuLogSys::Quest, "Warning - plugin.pl: %s", err);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -195,7 +195,7 @@ void Embperl::DoInit() {
|
|||||||
}
|
}
|
||||||
catch(const char *err)
|
catch(const char *err)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Quest, "Perl warning: %s", err);
|
Log.Log(EQEmuLogSys::Quest, "Perl warning: %s", err);
|
||||||
}
|
}
|
||||||
#endif //EMBPERL_PLUGIN
|
#endif //EMBPERL_PLUGIN
|
||||||
in_use = false;
|
in_use = false;
|
||||||
|
|||||||
@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc)
|
|||||||
file[255] = '\0';
|
file[255] = '\0';
|
||||||
|
|
||||||
if(items != 1)
|
if(items != 1)
|
||||||
logger.Log(EQEmuLogSys::Error, "boot_qc does not take any arguments.");
|
Log.Log(EQEmuLogSys::Error, "boot_qc does not take any arguments.");
|
||||||
|
|
||||||
char buf[128]; //shouldent have any function names longer than this.
|
char buf[128]; //shouldent have any function names longer than this.
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ XS(XS_EQEmuIO_PRINT)
|
|||||||
int len = 0;
|
int len = 0;
|
||||||
for(i = 0; *cur != '\0'; i++, cur++) {
|
for(i = 0; *cur != '\0'; i++, cur++) {
|
||||||
if(*cur == '\n') {
|
if(*cur == '\n') {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str);
|
||||||
len = 0;
|
len = 0;
|
||||||
pos = i+1;
|
pos = i+1;
|
||||||
} else {
|
} else {
|
||||||
@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(len > 0) {
|
if(len > 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline)
|
|||||||
{
|
{
|
||||||
if (*it == nullptr)
|
if (*it == nullptr)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline);
|
Log.Log(EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -520,12 +520,12 @@ void EntityList::MobProcess()
|
|||||||
zone->StartShutdownTimer();
|
zone->StartShutdownTimer();
|
||||||
Group *g = GetGroupByMob(mob);
|
Group *g = GetGroupByMob(mob);
|
||||||
if(g) {
|
if(g) {
|
||||||
logger.Log(EQEmuLogSys::Error, "About to delete a client still in a group.");
|
Log.Log(EQEmuLogSys::Error, "About to delete a client still in a group.");
|
||||||
g->DelMember(mob);
|
g->DelMember(mob);
|
||||||
}
|
}
|
||||||
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
|
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
|
||||||
if(r) {
|
if(r) {
|
||||||
logger.Log(EQEmuLogSys::Error, "About to delete a client still in a raid.");
|
Log.Log(EQEmuLogSys::Error, "About to delete a client still in a raid.");
|
||||||
r->MemberZoned(mob->CastToClient());
|
r->MemberZoned(mob->CastToClient());
|
||||||
}
|
}
|
||||||
entity_list.RemoveClient(id);
|
entity_list.RemoveClient(id);
|
||||||
@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group)
|
|||||||
|
|
||||||
uint32 gid = worldserver.NextGroupID();
|
uint32 gid = worldserver.NextGroupID();
|
||||||
if (gid == 0) {
|
if (gid == 0) {
|
||||||
logger.Log(EQEmuLogSys::Error,
|
Log.Log(EQEmuLogSys::Error,
|
||||||
"Unable to get new group ID from world server. group is going to be broken.");
|
"Unable to get new group ID from world server. group is going to be broken.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid)
|
|||||||
|
|
||||||
uint32 gid = worldserver.NextGroupID();
|
uint32 gid = worldserver.NextGroupID();
|
||||||
if (gid == 0) {
|
if (gid == 0) {
|
||||||
logger.Log(EQEmuLogSys::Error,
|
Log.Log(EQEmuLogSys::Error,
|
||||||
"Unable to get new group ID from world server. group is going to be broken.");
|
"Unable to get new group ID from world server. group is going to be broken.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name)
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.Log(EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name);
|
Log.Log(EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name);
|
||||||
char tmp[64] = "!";
|
char tmp[64] = "!";
|
||||||
strn0cpy(&tmp[1], name, sizeof(tmp) - 1);
|
strn0cpy(&tmp[1], name, sizeof(tmp) - 1);
|
||||||
strcpy(name, tmp);
|
strcpy(name, tmp);
|
||||||
@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID)
|
|||||||
// If we have been passed a TaskID, only reload the client state if they have
|
// If we have been passed a TaskID, only reload the client state if they have
|
||||||
// that Task active.
|
// that Task active.
|
||||||
if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) {
|
if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
||||||
client->RemoveClientTaskState();
|
client->RemoveClientTaskState();
|
||||||
client->LoadClientTaskState();
|
client->LoadClientTaskState();
|
||||||
taskmanager->SendActiveTasksToClient(client);
|
taskmanager->SendActiveTasksToClient(client);
|
||||||
|
|||||||
@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
|
||||||
//max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients
|
//max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients
|
||||||
max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2()
|
max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2()
|
||||||
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) {
|
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) {
|
||||||
@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
|||||||
|
|
||||||
//figure out how many AA points we get from the exp were setting
|
//figure out how many AA points we get from the exp were setting
|
||||||
m_pp.aapoints = set_aaxp / max_AAXP;
|
m_pp.aapoints = set_aaxp / max_AAXP;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP);
|
||||||
|
|
||||||
//get remainder exp points, set in PP below
|
//get remainder exp points, set in PP below
|
||||||
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);
|
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);
|
||||||
@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
|||||||
void Client::SetLevel(uint8 set_level, bool command)
|
void Client::SetLevel(uint8 set_level, bool command)
|
||||||
{
|
{
|
||||||
if (GetEXPForLevel(set_level) == 0xFFFFFFFF) {
|
if (GetEXPForLevel(set_level) == 0xFFFFFFFF) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level);
|
Log.Log(EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command)
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change
|
this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level);
|
Log.Log(EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level);
|
||||||
|
|
||||||
CalcBonuses();
|
CalcBonuses();
|
||||||
|
|
||||||
|
|||||||
@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint()
|
|||||||
fear_walkto_z = Loc.z;
|
fear_walkto_z = Loc.z;
|
||||||
curfp = true;
|
curfp = true;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection.");
|
||||||
}
|
}
|
||||||
|
|
||||||
int loop = 0;
|
int loop = 0;
|
||||||
|
|||||||
@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
|
|||||||
"LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT);
|
"LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
|
|||||||
|
|
||||||
item[index] = atoi(row[0]);
|
item[index] = atoi(row[0]);
|
||||||
chance[index] = atoi(row[1]) + chancepool;
|
chance[index] = atoi(row[1]) + chancepool;
|
||||||
logger.Log(EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]);
|
Log.Log(EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]);
|
||||||
chancepool = chance[index];
|
chancepool = chance[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) {
|
|||||||
const Item_Struct* food_item = database.GetItem(foragedfood);
|
const Item_Struct* food_item = database.GetItem(foragedfood);
|
||||||
|
|
||||||
if(!food_item) {
|
if(!food_item) {
|
||||||
logger.Log(EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem");
|
Log.Log(EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) {
|
|||||||
caster->SpellOnTarget(spell_id, members[z]->GetPet());
|
caster->SpellOnTarget(spell_id, members[z]->GetPet());
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) {
|
|||||||
members[z]->GetPet()->BardPulse(spell_id, caster);
|
members[z]->GetPet()->BardPulse(spell_id, caster);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1069,7 +1069,7 @@ bool Group::LearnMembers() {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1098,7 +1098,7 @@ void Group::VerifyGroup() {
|
|||||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||||
if (membername[i][0] == '\0') {
|
if (membername[i][0] == '\0') {
|
||||||
#if EQDEBUG >= 7
|
#if EQDEBUG >= 7
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i);
|
||||||
#endif
|
#endif
|
||||||
members[i] = nullptr;
|
members[i] = nullptr;
|
||||||
continue;
|
continue;
|
||||||
@ -1107,7 +1107,7 @@ void Group::VerifyGroup() {
|
|||||||
Mob *them = entity_list.GetMob(membername[i]);
|
Mob *them = entity_list.GetMob(membername[i]);
|
||||||
if(them == nullptr && members[i] != nullptr) { //they aren't in zone
|
if(them == nullptr && members[i] != nullptr) { //they aren't in zone
|
||||||
#if EQDEBUG >= 6
|
#if EQDEBUG >= 6
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]);
|
||||||
#endif
|
#endif
|
||||||
membername[i][0] = '\0';
|
membername[i][0] = '\0';
|
||||||
members[i] = nullptr;
|
members[i] = nullptr;
|
||||||
@ -1116,13 +1116,13 @@ void Group::VerifyGroup() {
|
|||||||
|
|
||||||
if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good.
|
if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good.
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]);
|
||||||
#endif
|
#endif
|
||||||
members[i] = them;
|
members[i] = them;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if EQDEBUG >= 8
|
#if EQDEBUG >= 8
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle)
|
|||||||
MainTankName.c_str(), GetID());
|
MainTankName.c_str(), GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle)
|
|||||||
MainAssistName.c_str(), GetID());
|
MainAssistName.c_str(), GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle)
|
|||||||
PullerName.c_str(), GetID());
|
PullerName.c_str(), GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle)
|
|||||||
std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID());
|
std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
if(!toggle) {
|
if(!toggle) {
|
||||||
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
|
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
|
||||||
@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle)
|
|||||||
std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID());
|
std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
if(!toggle)
|
if(!toggle)
|
||||||
{
|
{
|
||||||
@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle)
|
|||||||
std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID());
|
std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
if(!toggle) {
|
if(!toggle) {
|
||||||
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
|
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
|
||||||
@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name)
|
|||||||
mentoree_name.c_str(), mentor_percent, GetID());
|
mentoree_name.c_str(), mentor_percent, GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::ClearGroupMentor()
|
void Group::ClearGroupMentor()
|
||||||
@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor()
|
|||||||
std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID());
|
std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::NotifyAssistTarget(Client *c)
|
void Group::NotifyAssistTarget(Client *c)
|
||||||
@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName)
|
|||||||
NewNPCMarkerName, GetID());
|
NewNPCMarkerName, GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::NotifyMarkNPC(Client *c)
|
void Group::NotifyMarkNPC(Client *c)
|
||||||
@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName)
|
|||||||
std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID());
|
std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA()
|
|||||||
safe_delete_array(queryBuffer);
|
safe_delete_array(queryBuffer);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
}
|
}
|
||||||
@ -144,10 +144,10 @@ void Client::SendGuildSpawnAppearance() {
|
|||||||
if (!IsInAGuild()) {
|
if (!IsInAGuild()) {
|
||||||
// clear guildtag
|
// clear guildtag
|
||||||
SendAppearancePacket(AT_GuildID, GUILD_NONE);
|
SendAppearancePacket(AT_GuildID, GUILD_NONE);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag.");
|
||||||
} else {
|
} else {
|
||||||
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
|
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
|
||||||
SendAppearancePacket(AT_GuildID, GuildID());
|
SendAppearancePacket(AT_GuildID, GuildID());
|
||||||
if(GetClientVersion() >= EQClientRoF)
|
if(GetClientVersion() >= EQClientRoF)
|
||||||
{
|
{
|
||||||
@ -171,11 +171,11 @@ void Client::SendGuildList() {
|
|||||||
//ask the guild manager to build us a nice guild list packet
|
//ask the guild manager to build us a nice guild list packet
|
||||||
outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size);
|
outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size);
|
||||||
if(outapp->pBuffer == nullptr) {
|
if(outapp->pBuffer == nullptr) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size);
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ void Client::SendGuildMembers() {
|
|||||||
outapp->pBuffer = data;
|
outapp->pBuffer = data;
|
||||||
data = nullptr;
|
data = nullptr;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size);
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ void Client::RefreshGuildInfo()
|
|||||||
|
|
||||||
CharGuildInfo info;
|
CharGuildInfo info;
|
||||||
if(!guild_mgr.GetCharInfo(CharacterID(), info)) {
|
if(!guild_mgr.GetCharInfo(CharacterID(), info)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){
|
|||||||
outgj->rank = gj->rank;
|
outgj->rank = gj->rank;
|
||||||
outgj->zoneid = gj->zoneid;
|
outgj->zoneid = gj->zoneid;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size);
|
||||||
|
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon
|
|||||||
doorid-128, zone);
|
doorid-128, zone);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone)
|
|||||||
guild_id, doorid, zone);
|
guild_id, doorid, zone);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ extern WorldServer worldserver;
|
|||||||
extern volatile bool ZoneLoaded;
|
extern volatile bool ZoneLoaded;
|
||||||
|
|
||||||
void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
|
void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
|
ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
|
||||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||||
s->guild_id = guild_id;
|
s->guild_id = guild_id;
|
||||||
@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b
|
|||||||
|
|
||||||
void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
|
void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) {
|
||||||
if(guild_id == 0) {
|
if(guild_id == 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid);
|
||||||
|
|
||||||
CharGuildInfo gci;
|
CharGuildInfo gci;
|
||||||
if(!GetCharInfo(charid, gci)) {
|
if(!GetCharInfo(charid, gci)) {
|
||||||
@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id);
|
||||||
|
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
||||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||||
@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ZoneGuildManager::SendGuildDelete(uint32 guild_id) {
|
void ZoneGuildManager::SendGuildDelete(uint32 guild_id) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id);
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
||||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||||
s->guild_id = guild_id;
|
s->guild_id = guild_id;
|
||||||
@ -261,12 +261,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
switch(pack->opcode) {
|
switch(pack->opcode) {
|
||||||
case ServerOP_RefreshGuild: {
|
case ServerOP_RefreshGuild: {
|
||||||
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
|
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
Log.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change);
|
||||||
|
|
||||||
//reload all the guild details from the database.
|
//reload all the guild details from the database.
|
||||||
RefreshGuild(s->guild_id);
|
RefreshGuild(s->guild_id);
|
||||||
@ -295,12 +295,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
|
|
||||||
case ServerOP_GuildCharRefresh: {
|
case ServerOP_GuildCharRefresh: {
|
||||||
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
Log.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id);
|
||||||
|
|
||||||
Client *c = entity_list.GetClientByCharID(s->char_id);
|
Client *c = entity_list.GetClientByCharID(s->char_id);
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
{
|
{
|
||||||
if(pack->size != sizeof(ServerGuildRankUpdate_Struct))
|
if(pack->size != sizeof(ServerGuildRankUpdate_Struct))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d",
|
Log.Log(EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d",
|
||||||
pack->size, sizeof(ServerGuildRankUpdate_Struct));
|
pack->size, sizeof(ServerGuildRankUpdate_Struct));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -364,12 +364,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
|
|
||||||
case ServerOP_DeleteGuild: {
|
case ServerOP_DeleteGuild: {
|
||||||
if(pack->size != sizeof(ServerGuildID_Struct)) {
|
if(pack->size != sizeof(ServerGuildID_Struct)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
Log.Log(EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id);
|
||||||
|
|
||||||
//clear all the guild tags.
|
//clear all the guild tags.
|
||||||
entity_list.RefreshAllGuildInfo(s->guild_id);
|
entity_list.RefreshAllGuildInfo(s->guild_id);
|
||||||
@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
|
|
||||||
if (!c || !c->IsInAGuild())
|
if (!c || !c->IsInAGuild())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse");
|
||||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
|
||||||
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
|
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
|
||||||
char Name[64];
|
char Name[64];
|
||||||
@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
|||||||
VARSTRUCT_DECODE_STRING(Name, Buffer);
|
VARSTRUCT_DECODE_STRING(Name, Buffer);
|
||||||
strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName));
|
strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName));
|
||||||
gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID);
|
||||||
c->QueuePacket(outapp);
|
c->QueuePacket(outapp);
|
||||||
}
|
}
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID)
|
|||||||
"FROM `guild_bank` WHERE `guildid` = %i", guildID);
|
"FROM `guild_bank` WHERE `guildid` = %i", guildID);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
|||||||
|
|
||||||
if(Iterator == Banks.end())
|
if(Iterator == Banks.end())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID());
|
Log.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
|||||||
|
|
||||||
if(Iterator == Banks.end())
|
if(Iterator == Banks.end())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID);
|
Log.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
|||||||
|
|
||||||
if(Slot < 0)
|
if(Slot < 0)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "No space to add item to the guild bank.");
|
Log.Log(EQEmuLogSys::Error, "No space to add item to the guild bank.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
|||||||
GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor);
|
GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID)
|
|||||||
"LIMIT 1", mainSlot, guildID, slotID);
|
"LIMIT 1", mainSlot, guildID, slotID);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm
|
|||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success())
|
if(!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui
|
|||||||
guildID, area, slotID);
|
guildID, area, slotID);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui
|
|||||||
BankArea[slotID].Quantity - quantity, guildID, area, slotID);
|
BankArea[slotID].Quantity - quantity, guildID, area, slotID);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl
|
|||||||
quantity, guildID, area, slotID);
|
quantity, guildID, area, slotID);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if(!results.Success()) {
|
if(!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) {
|
|||||||
std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName);
|
std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() != 1) {
|
if (results.RowCount() != 1) {
|
||||||
logger.Log(EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName);
|
Log.Log(EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!Horse::IsHorseSpell(spell_id)) {
|
if(!Horse::IsHorseSpell(spell_id)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id);
|
Log.Log(EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
// make sure the item exists
|
// make sure the item exists
|
||||||
if(item == nullptr) {
|
if(item == nullptr) {
|
||||||
Message(13, "Item %u does not exist.", item_id);
|
Message(13, "Item %u does not exist.", item_id);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -215,7 +215,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
// check to make sure we are augmenting an augmentable item
|
// check to make sure we are augmenting an augmentable item
|
||||||
else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) {
|
else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) {
|
||||||
Message(13, "You can not augment an augment or a non-common class item.");
|
Message(13, "You can not augment an augment or a non-common class item.");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n",
|
||||||
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -229,7 +229,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
/*
|
/*
|
||||||
else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
|
else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
|
||||||
Message(13, "You are not a GM or do not have the status to summon this item.");
|
Message(13, "You are not a GM or do not have the status to summon this item.");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n",
|
||||||
GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
|
GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
if(augtest == nullptr) {
|
if(augtest == nullptr) {
|
||||||
if(augments[iter]) {
|
if(augments[iter]) {
|
||||||
Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1);
|
Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -269,7 +269,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
// check that augment is an actual augment
|
// check that augment is an actual augment
|
||||||
else if(augtest->AugType == 0) {
|
else if(augtest->AugType == 0) {
|
||||||
Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1);
|
Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
/*
|
/*
|
||||||
else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
|
else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
|
||||||
Message(13, "You are not a GM or do not have the status to summon this augment.");
|
Message(13, "You are not a GM or do not have the status to summon this augment.");
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n",
|
||||||
GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
|
GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
if(enforcewear) {
|
if(enforcewear) {
|
||||||
if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) {
|
if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) {
|
||||||
Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID);
|
Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
|
|
||||||
if(item->AugSlotVisible[iter] == 0) {
|
if(item->AugSlotVisible[iter] == 0) {
|
||||||
Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1);
|
Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
|
|
||||||
if(restrictfail) {
|
if(restrictfail) {
|
||||||
Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID);
|
Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
// check for class usability
|
// check for class usability
|
||||||
if(item->Classes && !(classes &= augtest->Classes)) {
|
if(item->Classes && !(classes &= augtest->Classes)) {
|
||||||
Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1));
|
Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
// check for race usability
|
// check for race usability
|
||||||
if(item->Races && !(races &= augtest->Races)) {
|
if(item->Races && !(races &= augtest->Races)) {
|
||||||
Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1));
|
Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
// check for slot usability
|
// check for slot usability
|
||||||
if(item->Slots && !(slots &= augtest->Slots)) {
|
if(item->Slots && !(slots &= augtest->Slots)) {
|
||||||
Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1));
|
Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
if(inst == nullptr) {
|
if(inst == nullptr) {
|
||||||
Message(13, "An unknown server error has occurred and your item was not created.");
|
Message(13, "An unknown server error has occurred and your item was not created.");
|
||||||
// this goes to logfile since this is a major error
|
// this goes to logfile since this is a major error
|
||||||
logger.Log(EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.Log(EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
|||||||
|
|
||||||
if(!(slots & ((uint32)1 << slottest))) {
|
if(!(slots & ((uint32)1 << slottest))) {
|
||||||
Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot);
|
Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
|
||||||
GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
|
||||||
|
|
||||||
to_slot = MainCursor;
|
to_slot = MainCursor;
|
||||||
@ -700,7 +700,7 @@ void Client::SendCursorBuffer() {
|
|||||||
// Remove item from inventory
|
// Remove item from inventory
|
||||||
void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) {
|
void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) {
|
||||||
#if (EQDEBUG >= 5)
|
#if (EQDEBUG >= 5)
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Added 'IsSlotValid(slot_id)' check to both segments of client packet processing.
|
// Added 'IsSlotValid(slot_id)' check to both segments of client packet processing.
|
||||||
@ -815,7 +815,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
|
|||||||
|
|
||||||
bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update)
|
bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID);
|
||||||
m_inv.PushCursor(inst);
|
m_inv.PushCursor(inst);
|
||||||
|
|
||||||
if (client_update) {
|
if (client_update) {
|
||||||
@ -831,7 +831,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update)
|
|||||||
// (Also saves changes back to the database: this may be optimized in the future)
|
// (Also saves changes back to the database: this may be optimized in the future)
|
||||||
// client_update: Sends packet to client
|
// client_update: Sends packet to client
|
||||||
bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) {
|
bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||||
|
|
||||||
if (slot_id == MainCursor)
|
if (slot_id == MainCursor)
|
||||||
return PushItemOnCursor(inst, client_update);
|
return PushItemOnCursor(inst, client_update);
|
||||||
@ -858,7 +858,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client
|
|||||||
|
|
||||||
void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data)
|
void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||||
m_inv.PutItem(slot_id, inst);
|
m_inv.PutItem(slot_id, inst);
|
||||||
|
|
||||||
SendLootItemInPacket(&inst, slot_id);
|
SendLootItemInPacket(&inst, slot_id);
|
||||||
@ -879,7 +879,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
|
|||||||
continue;
|
continue;
|
||||||
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned);
|
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned);
|
||||||
interior_slot = Inventory::CalcSlotId(slot_id, i);
|
interior_slot = Inventory::CalcSlotId(slot_id, i);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i);
|
||||||
PutLootInInventory(interior_slot, *bagitem);
|
PutLootInInventory(interior_slot, *bagitem);
|
||||||
safe_delete(bagitem);
|
safe_delete(bagitem);
|
||||||
}
|
}
|
||||||
@ -1313,7 +1313,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
// SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason.
|
// SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason.
|
||||||
if(src_slot_check < 2147483647)
|
if(src_slot_check < 2147483647)
|
||||||
Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1321,7 +1321,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
// SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason.
|
// SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason.
|
||||||
if(src_slot_check < 2147483647)
|
if(src_slot_check < 2147483647)
|
||||||
Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1334,7 +1334,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
|
|
||||||
if (move_in->to_slot == (uint32)INVALID_INDEX) {
|
if (move_in->to_slot == (uint32)INVALID_INDEX) {
|
||||||
if (move_in->from_slot == (uint32)MainCursor) {
|
if (move_in->from_slot == (uint32)MainCursor) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot);
|
||||||
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
||||||
|
|
||||||
ItemInst *inst = m_inv.GetItem(MainCursor);
|
ItemInst *inst = m_inv.GetItem(MainCursor);
|
||||||
@ -1348,7 +1348,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
return true; // Item destroyed by client
|
return true; // Item destroyed by client
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot);
|
||||||
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
||||||
DeleteItemInInventory(move_in->from_slot);
|
DeleteItemInInventory(move_in->from_slot);
|
||||||
return true; // Item deletion
|
return true; // Item deletion
|
||||||
@ -1388,7 +1388,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
ItemInst* src_inst = m_inv.GetItem(src_slot_id);
|
ItemInst* src_inst = m_inv.GetItem(src_slot_id);
|
||||||
ItemInst* dst_inst = m_inv.GetItem(dst_slot_id);
|
ItemInst* dst_inst = m_inv.GetItem(dst_slot_id);
|
||||||
if (src_inst){
|
if (src_inst){
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges());
|
||||||
srcitemid = src_inst->GetItem()->ID;
|
srcitemid = src_inst->GetItem()->ID;
|
||||||
//SetTint(dst_slot_id,src_inst->GetColor());
|
//SetTint(dst_slot_id,src_inst->GetColor());
|
||||||
if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize))
|
if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize))
|
||||||
@ -1398,7 +1398,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dst_inst) {
|
if (dst_inst) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges());
|
||||||
dstitemid = dst_inst->GetItem()->ID;
|
dstitemid = dst_inst->GetItem()->ID;
|
||||||
}
|
}
|
||||||
if (Trader && srcitemid>0){
|
if (Trader && srcitemid>0){
|
||||||
@ -1435,7 +1435,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
move_in->from_slot = dst_slot_check;
|
move_in->from_slot = dst_slot_check;
|
||||||
move_in->to_slot = src_slot_check;
|
move_in->to_slot = src_slot_check;
|
||||||
move_in->number_in_stack = dst_inst->GetCharges();
|
move_in->number_in_stack = dst_inst->GetCharges();
|
||||||
if(!SwapItem(move_in)) { logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); }
|
if(!SwapItem(move_in)) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
//verify shared bank transactions in the database
|
//verify shared bank transactions in the database
|
||||||
if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) {
|
if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) {
|
||||||
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
|
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
|
Log.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
|
||||||
DeleteItemInInventory(dst_slot_id,0,true);
|
DeleteItemInInventory(dst_slot_id,0,true);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
}
|
}
|
||||||
if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) {
|
if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) {
|
||||||
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
|
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
|
Log.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
|
||||||
DeleteItemInInventory(src_slot_id,0,true);
|
DeleteItemInInventory(src_slot_id,0,true);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@ -1577,7 +1577,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (with) {
|
if (with) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName());
|
||||||
// Fill Trade list with items from cursor
|
// Fill Trade list with items from cursor
|
||||||
if (!m_inv[MainCursor]) {
|
if (!m_inv[MainCursor]) {
|
||||||
Message(13, "Error: Cursor item not located on server!");
|
Message(13, "Error: Cursor item not located on server!");
|
||||||
@ -1610,18 +1610,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
if (move_in->number_in_stack > 0) {
|
if (move_in->number_in_stack > 0) {
|
||||||
// Determine if charged items can stack
|
// Determine if charged items can stack
|
||||||
if(src_inst && !src_inst->IsStackable()) {
|
if(src_inst && !src_inst->IsStackable()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst_inst) {
|
if (dst_inst) {
|
||||||
if(src_inst->GetID() != dst_inst->GetID()) {
|
if(src_inst->GetID() != dst_inst->GetID()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID());
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) {
|
if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) {
|
||||||
//we have a chance of stacking.
|
//we have a chance of stacking.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize);
|
||||||
// Charges can be emptied into dst
|
// Charges can be emptied into dst
|
||||||
uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges();
|
uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges();
|
||||||
if (usedcharges > move_in->number_in_stack)
|
if (usedcharges > move_in->number_in_stack)
|
||||||
@ -1633,15 +1633,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
// Depleted all charges?
|
// Depleted all charges?
|
||||||
if (src_inst->GetCharges() < 1)
|
if (src_inst->GetCharges() < 1)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges);
|
||||||
database.SaveInventory(CharacterID(),nullptr,src_slot_id);
|
database.SaveInventory(CharacterID(),nullptr,src_slot_id);
|
||||||
m_inv.DeleteItem(src_slot_id);
|
m_inv.DeleteItem(src_slot_id);
|
||||||
all_to_stack = true;
|
all_to_stack = true;
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1650,12 +1650,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) {
|
if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) {
|
||||||
// Move entire stack
|
// Move entire stack
|
||||||
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Split into two
|
// Split into two
|
||||||
src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack);
|
src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges());
|
||||||
ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack);
|
ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack);
|
||||||
m_inv.PutItem(dst_slot_id, *inst);
|
m_inv.PutItem(dst_slot_id, *inst);
|
||||||
safe_delete(inst);
|
safe_delete(inst);
|
||||||
@ -1680,7 +1680,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
|||||||
SetMaterial(dst_slot_id,src_inst->GetItem()->ID);
|
SetMaterial(dst_slot_id,src_inst->GetItem()->ID);
|
||||||
}
|
}
|
||||||
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
|
||||||
|
|
||||||
if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) {
|
if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) {
|
||||||
if(src_inst) {
|
if(src_inst) {
|
||||||
@ -1739,7 +1739,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
|
|||||||
|
|
||||||
// resync the 'from' and 'to' slots on an as-needed basis
|
// resync the 'from' and 'to' slots on an as-needed basis
|
||||||
// Not as effective as the full process, but less intrusive to gameplay -U
|
// Not as effective as the full process, but less intrusive to gameplay -U
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
|
||||||
Message(15, "Inventory Desyncronization detected: Resending slot data...");
|
Message(15, "Inventory Desyncronization detected: Resending slot data...");
|
||||||
|
|
||||||
if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) {
|
if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) {
|
||||||
@ -2071,7 +2071,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) {
|
for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if(inst && !inst->GetItem()->NoRent) {
|
if(inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, client_update);
|
DeleteItemInInventory(slot_id, 0, client_update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2080,7 +2080,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) {
|
for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if (inst && !inst->GetItem()->NoRent) {
|
if (inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, client_update);
|
DeleteItemInInventory(slot_id, 0, client_update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2089,7 +2089,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
if (m_inv[MainPowerSource]) {
|
if (m_inv[MainPowerSource]) {
|
||||||
const ItemInst* inst = m_inv[MainPowerSource];
|
const ItemInst* inst = m_inv[MainPowerSource];
|
||||||
if (inst && !inst->GetItem()->NoRent) {
|
if (inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource);
|
||||||
DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent
|
DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2098,7 +2098,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) {
|
for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if(inst && !inst->GetItem()->NoRent) {
|
if(inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, client_update);
|
DeleteItemInInventory(slot_id, 0, client_update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2107,7 +2107,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) {
|
for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if(inst && !inst->GetItem()->NoRent) {
|
if(inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots
|
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2116,7 +2116,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) {
|
for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if(inst && !inst->GetItem()->NoRent) {
|
if(inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots
|
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2125,7 +2125,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) {
|
for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if(inst && !inst->GetItem()->NoRent) {
|
if(inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots
|
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2134,7 +2134,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) {
|
for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) {
|
||||||
const ItemInst* inst = m_inv[slot_id];
|
const ItemInst* inst = m_inv[slot_id];
|
||||||
if(inst && !inst->GetItem()->NoRent) {
|
if(inst && !inst->GetItem()->NoRent) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots
|
DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2155,7 +2155,7 @@ void Client::RemoveNoRent(bool client_update) {
|
|||||||
inst = *iter;
|
inst = *iter;
|
||||||
// should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U
|
// should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U
|
||||||
if (!inst->GetItem()->NoRent)
|
if (!inst->GetItem()->NoRent)
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||||
else
|
else
|
||||||
m_inv.PushCursor(**iter);
|
m_inv.PushCursor(**iter);
|
||||||
|
|
||||||
@ -2178,7 +2178,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
if(CheckLoreConflict(inst->GetItem())) {
|
if(CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2193,7 +2193,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
if (inst) {
|
if (inst) {
|
||||||
if (CheckLoreConflict(inst->GetItem())) {
|
if (CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2208,7 +2208,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(MainPowerSource);
|
ItemInst* inst = m_inv.PopItem(MainPowerSource);
|
||||||
if (inst) {
|
if (inst) {
|
||||||
if (CheckLoreConflict(inst->GetItem())) {
|
if (CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
database.SaveInventory(character_id, nullptr, MainPowerSource);
|
database.SaveInventory(character_id, nullptr, MainPowerSource);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2223,7 +2223,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
if(CheckLoreConflict(inst->GetItem())) {
|
if(CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2238,7 +2238,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
if(CheckLoreConflict(inst->GetItem())) {
|
if(CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2253,7 +2253,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
if(inst) {
|
if(inst) {
|
||||||
if(CheckLoreConflict(inst->GetItem())) {
|
if(CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2281,7 +2281,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
inst = *iter;
|
inst = *iter;
|
||||||
// probably needs a valid pointer check -U
|
// probably needs a valid pointer check -U
|
||||||
if (CheckLoreConflict(inst->GetItem())) {
|
if (CheckLoreConflict(inst->GetItem())) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||||
safe_delete(*iter);
|
safe_delete(*iter);
|
||||||
iter = local.erase(iter);
|
iter = local.erase(iter);
|
||||||
}
|
}
|
||||||
@ -2300,7 +2300,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
|||||||
m_inv.PushCursor(**iter);
|
m_inv.PushCursor(**iter);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete(*iter);
|
safe_delete(*iter);
|
||||||
@ -2322,7 +2322,7 @@ void Client::MoveSlotNotAllowed(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
|
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||||
PutItemInInventory(free_slot_id, *inst, client_update);
|
PutItemInInventory(free_slot_id, *inst, client_update);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
safe_delete(inst);
|
safe_delete(inst);
|
||||||
@ -2335,7 +2335,7 @@ void Client::MoveSlotNotAllowed(bool client_update) {
|
|||||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
|
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||||
PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false);
|
PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false);
|
||||||
database.SaveInventory(character_id, nullptr, slot_id);
|
database.SaveInventory(character_id, nullptr, slot_id);
|
||||||
safe_delete(inst);
|
safe_delete(inst);
|
||||||
@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer;
|
BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name);
|
||||||
strcpy(m_pp.bandoliers[bs->number].name, bs->name);
|
strcpy(m_pp.bandoliers[bs->number].name, bs->name);
|
||||||
|
|
||||||
const ItemInst* InvItem = nullptr;
|
const ItemInst* InvItem = nullptr;
|
||||||
@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) {
|
|||||||
InvItem = GetInv()[WeaponSlot];
|
InvItem = GetInv()[WeaponSlot];
|
||||||
if(InvItem) {
|
if(InvItem) {
|
||||||
BaseItem = InvItem->GetItem();
|
BaseItem = InvItem->GetItem();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot);
|
||||||
m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID;
|
m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID;
|
||||||
m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon;
|
m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon;
|
||||||
database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name);
|
database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot);
|
||||||
m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0;
|
m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0;
|
||||||
m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0;
|
m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0;
|
||||||
}
|
}
|
||||||
@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) {
|
|||||||
|
|
||||||
void Client::RemoveBandolier(const EQApplicationPacket *app) {
|
void Client::RemoveBandolier(const EQApplicationPacket *app) {
|
||||||
BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer;
|
BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number);
|
||||||
memset(m_pp.bandoliers[bds->number].name, 0, 32);
|
memset(m_pp.bandoliers[bds->number].name, 0, 32);
|
||||||
for(int i = bandolierMainHand; i <= bandolierAmmo; i++) {
|
for(int i = bandolierMainHand; i <= bandolierAmmo; i++) {
|
||||||
m_pp.bandoliers[bds->number].items[i].item_id = 0;
|
m_pp.bandoliers[bds->number].items[i].item_id = 0;
|
||||||
@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) {
|
|||||||
// any items currently in the weapon slots to inventory.
|
// any items currently in the weapon slots to inventory.
|
||||||
|
|
||||||
BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer;
|
BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number);
|
||||||
int16 slot;
|
int16 slot;
|
||||||
int16 WeaponSlot;
|
int16 WeaponSlot;
|
||||||
ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory
|
ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory
|
||||||
@ -2585,16 +2585,16 @@ void Client::SetBandolier(const EQApplicationPacket *app) {
|
|||||||
else { // The player doesn't have the required weapon with them.
|
else { // The player doesn't have the required weapon with them.
|
||||||
BandolierItems[BandolierSlot] = 0;
|
BandolierItems[BandolierSlot] = 0;
|
||||||
if (slot == INVALID_INDEX) {
|
if (slot == INVALID_INDEX) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot);
|
||||||
ItemInst *InvItem = m_inv.PopItem(WeaponSlot);
|
ItemInst *InvItem = m_inv.PopItem(WeaponSlot);
|
||||||
if(InvItem) {
|
if(InvItem) {
|
||||||
// If there was an item in that weapon slot, put it in the inventory
|
// If there was an item in that weapon slot, put it in the inventory
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory",
|
||||||
InvItem->GetItem()->Name, WeaponSlot);
|
InvItem->GetItem()->Name, WeaponSlot);
|
||||||
if(MoveItemToInventory(InvItem))
|
if(MoveItemToInventory(InvItem))
|
||||||
database.SaveInventory(character_id, 0, WeaponSlot);
|
database.SaveInventory(character_id, 0, WeaponSlot);
|
||||||
else
|
else
|
||||||
logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(),
|
Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(),
|
||||||
InvItem->GetItem()->Name);
|
InvItem->GetItem()->Name);
|
||||||
safe_delete(InvItem);
|
safe_delete(InvItem);
|
||||||
}
|
}
|
||||||
@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) {
|
|||||||
if(InvItem) {
|
if(InvItem) {
|
||||||
// If there was already an item in that weapon slot that we replaced, find a place to put it
|
// If there was already an item in that weapon slot that we replaced, find a place to put it
|
||||||
if(!MoveItemToInventory(InvItem))
|
if(!MoveItemToInventory(InvItem))
|
||||||
logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(),
|
Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(),
|
||||||
InvItem->GetItem()->Name);
|
InvItem->GetItem()->Name);
|
||||||
safe_delete(InvItem);
|
safe_delete(InvItem);
|
||||||
}
|
}
|
||||||
@ -2640,13 +2640,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) {
|
|||||||
// put it in the player's inventory.
|
// put it in the player's inventory.
|
||||||
ItemInst *InvItem = m_inv.PopItem(WeaponSlot);
|
ItemInst *InvItem = m_inv.PopItem(WeaponSlot);
|
||||||
if(InvItem) {
|
if(InvItem) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory",
|
||||||
WeaponSlot, InvItem->GetItem()->Name);
|
WeaponSlot, InvItem->GetItem()->Name);
|
||||||
// If there was an item in that weapon slot, put it in the inventory
|
// If there was an item in that weapon slot, put it in the inventory
|
||||||
if(MoveItemToInventory(InvItem))
|
if(MoveItemToInventory(InvItem))
|
||||||
database.SaveInventory(character_id, 0, WeaponSlot);
|
database.SaveInventory(character_id, 0, WeaponSlot);
|
||||||
else
|
else
|
||||||
logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(),
|
Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(),
|
||||||
InvItem->GetItem()->Name);
|
InvItem->GetItem()->Name);
|
||||||
safe_delete(InvItem);
|
safe_delete(InvItem);
|
||||||
}
|
}
|
||||||
@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
|||||||
|
|
||||||
if(!ItemToReturn) return false;
|
if(!ItemToReturn) return false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name);
|
||||||
|
|
||||||
uint32 ItemID = ItemToReturn->GetItem()->ID;
|
uint32 ItemID = ItemToReturn->GetItem()->ID;
|
||||||
|
|
||||||
@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
|||||||
|
|
||||||
database.SaveInventory(character_id, m_inv.GetItem(i), i);
|
database.SaveInventory(character_id, m_inv.GetItem(i), i);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
|||||||
|
|
||||||
database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot);
|
database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) {
|
|||||||
|
|
||||||
// Store on the cursor
|
// Store on the cursor
|
||||||
//
|
//
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName());
|
||||||
|
|
||||||
PushItemOnCursor(*ItemToReturn, UpdateClient);
|
PushItemOnCursor(*ItemToReturn, UpdateClient);
|
||||||
|
|
||||||
@ -2865,8 +2865,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (log) {
|
if (log) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
Log.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End");
|
||||||
}
|
}
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||||
@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
|||||||
void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth)
|
void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth)
|
||||||
{
|
{
|
||||||
if (depth >= 10) {
|
if (depth >= 10) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
|
|||||||
else { e = ""; }
|
else { e = ""; }
|
||||||
|
|
||||||
if (log)
|
if (log)
|
||||||
logger.Log(EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s",
|
Log.Log(EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s",
|
||||||
head, depth, i.c_str(), p.c_str(), e.c_str());
|
head, depth, i.c_str(), p.c_str(), e.c_str());
|
||||||
if (!silent)
|
if (!silent)
|
||||||
requester->Message(1, "%i:%i - inst: %s - parent: %s%s",
|
requester->Message(1, "%i:%i - inst: %s - parent: %s%s",
|
||||||
|
|||||||
@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml
|
|||||||
drop_chance = zone->random.Real(0.0, 100.0);
|
drop_chance = zone->random.Real(0.0, 100.0);
|
||||||
|
|
||||||
#if EQDEBUG>=11
|
#if EQDEBUG>=11
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance);
|
||||||
#endif
|
#endif
|
||||||
if (thischance == 100.0 || drop_chance < thischance)
|
if (thischance == 100.0 || drop_chance < thischance)
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
|||||||
|
|
||||||
ServerLootItem_Struct* item = new ServerLootItem_Struct;
|
ServerLootItem_Struct* item = new ServerLootItem_Struct;
|
||||||
#if EQDEBUG>=11
|
#if EQDEBUG>=11
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EQApplicationPacket* outapp = nullptr;
|
EQApplicationPacket* outapp = nullptr;
|
||||||
|
|||||||
@ -885,7 +885,7 @@ int32 Merc::CalcMaxMana()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||||
max_mana = 0;
|
max_mana = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -906,7 +906,7 @@ int32 Merc::CalcMaxMana()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if EQDEBUG >= 11
|
#if EQDEBUG >= 11
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
||||||
#endif
|
#endif
|
||||||
return max_mana;
|
return max_mana;
|
||||||
}
|
}
|
||||||
@ -1647,7 +1647,7 @@ void Merc::AI_Process() {
|
|||||||
if (AImovement_timer->Check())
|
if (AImovement_timer->Check())
|
||||||
{
|
{
|
||||||
if(!IsRooted()) {
|
if(!IsRooted()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName());
|
||||||
CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed());
|
CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1766,7 +1766,7 @@ bool Merc::AI_EngagedCastCheck() {
|
|||||||
{
|
{
|
||||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS).");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS).");
|
||||||
|
|
||||||
int8 mercClass = GetClass();
|
int8 mercClass = GetClass();
|
||||||
|
|
||||||
@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance,
|
|||||||
// according to Rogean, Live NPCs will just cast through walls/floors, no problem..
|
// according to Rogean, Live NPCs will just cast through walls/floors, no problem..
|
||||||
//
|
//
|
||||||
// This check was put in to address an idle-mob CPU issue
|
// This check was put in to address an idle-mob CPU issue
|
||||||
logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo
|
|||||||
{
|
{
|
||||||
if (!other) {
|
if (!other) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!");
|
Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() {
|
|||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()");
|
Log.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6019,7 +6019,7 @@ void NPC::LoadMercs() {
|
|||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()");
|
Log.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1576,7 +1576,7 @@ void Mob::SendIllusionPacket(uint16 in_race, uint8 in_gender, uint8 in_texture,
|
|||||||
|
|
||||||
entity_list.QueueClients(this, outapp);
|
entity_list.QueueClients(this, outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f",
|
||||||
race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size);
|
race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3043,7 +3043,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) {
|
|||||||
if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function
|
if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function
|
||||||
if(IsClient()){
|
if(IsClient()){
|
||||||
Message(0, "Invalid spell proc %u", spell_id);
|
Message(0, "Invalid spell proc %u", spell_id);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) {
|
|||||||
if(lifetap_amt && damage > 0){
|
if(lifetap_amt && damage > 0){
|
||||||
|
|
||||||
lifetap_amt = damage * lifetap_amt / 100;
|
lifetap_amt = damage * lifetap_amt / 100;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage);
|
||||||
|
|
||||||
if (lifetap_amt > 0)
|
if (lifetap_amt > 0)
|
||||||
HealDamage(lifetap_amt); //Heal self for modified damage amount.
|
HealDamage(lifetap_amt); //Heal self for modified damage amount.
|
||||||
|
|||||||
@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float
|
|||||||
// according to Rogean, Live NPCs will just cast through walls/floors, no problem..
|
// according to Rogean, Live NPCs will just cast through walls/floors, no problem..
|
||||||
//
|
//
|
||||||
// This check was put in to address an idle-mob CPU issue
|
// This check was put in to address an idle-mob CPU issue
|
||||||
logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1404,7 +1404,7 @@ void Mob::AI_Process() {
|
|||||||
else if (AImovement_timer->Check())
|
else if (AImovement_timer->Check())
|
||||||
{
|
{
|
||||||
if(!IsRooted()) {
|
if(!IsRooted()) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName());
|
||||||
if(!RuleB(Pathing, Aggro) || !zone->pathing)
|
if(!RuleB(Pathing, Aggro) || !zone->pathing)
|
||||||
CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed());
|
CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed());
|
||||||
else
|
else
|
||||||
@ -1639,7 +1639,7 @@ void NPC::AI_DoMovement() {
|
|||||||
roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1);
|
roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)",
|
||||||
roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y);
|
roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y);
|
||||||
if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true))
|
if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true))
|
||||||
{
|
{
|
||||||
@ -1692,11 +1692,11 @@ void NPC::AI_DoMovement() {
|
|||||||
else {
|
else {
|
||||||
movetimercompleted=false;
|
movetimercompleted=false;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp);
|
||||||
|
|
||||||
//if we were under quest control (with no grid), we are done now..
|
//if we were under quest control (with no grid), we are done now..
|
||||||
if(cur_wp == -2) {
|
if(cur_wp == -2) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode.");
|
||||||
roamer = false;
|
roamer = false;
|
||||||
cur_wp = 0;
|
cur_wp = 0;
|
||||||
}
|
}
|
||||||
@ -1727,7 +1727,7 @@ void NPC::AI_DoMovement() {
|
|||||||
{ // currently moving
|
{ // currently moving
|
||||||
if (cur_wp_x == GetX() && cur_wp_y == GetY())
|
if (cur_wp_x == GetX() && cur_wp_y == GetY())
|
||||||
{ // are we there yet? then stop
|
{ // are we there yet? then stop
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid());
|
||||||
SetWaypointPause();
|
SetWaypointPause();
|
||||||
if(GetAppearance() != eaStanding)
|
if(GetAppearance() != eaStanding)
|
||||||
SetAppearance(eaStanding, false);
|
SetAppearance(eaStanding, false);
|
||||||
@ -1773,7 +1773,7 @@ void NPC::AI_DoMovement() {
|
|||||||
if (movetimercompleted==true)
|
if (movetimercompleted==true)
|
||||||
{ // time to pause has ended
|
{ // time to pause has ended
|
||||||
SetGrid( 0 - GetGrid()); // revert to AI control
|
SetGrid( 0 - GetGrid()); // revert to AI control
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid());
|
||||||
|
|
||||||
if(GetAppearance() != eaStanding)
|
if(GetAppearance() != eaStanding)
|
||||||
SetAppearance(eaStanding, false);
|
SetAppearance(eaStanding, false);
|
||||||
@ -1809,7 +1809,7 @@ void NPC::AI_DoMovement() {
|
|||||||
if (!CP2Moved)
|
if (!CP2Moved)
|
||||||
{
|
{
|
||||||
if(moved) {
|
if(moved) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z);
|
||||||
ClearFeignMemory();
|
ClearFeignMemory();
|
||||||
moved=false;
|
moved=false;
|
||||||
SetMoving(false);
|
SetMoving(false);
|
||||||
@ -1934,7 +1934,7 @@ bool NPC::AI_EngagedCastCheck() {
|
|||||||
if (AIautocastspell_timer->Check(false)) {
|
if (AIautocastspell_timer->Check(false)) {
|
||||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells.");
|
||||||
|
|
||||||
// try casting a heal or gate
|
// try casting a heal or gate
|
||||||
if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) {
|
if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) {
|
||||||
@ -1957,7 +1957,7 @@ bool NPC::AI_PursueCastCheck() {
|
|||||||
if (AIautocastspell_timer->Check(false)) {
|
if (AIautocastspell_timer->Check(false)) {
|
||||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
||||||
if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) {
|
if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) {
|
||||||
//no spell cast, try again soon.
|
//no spell cast, try again soon.
|
||||||
AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false);
|
AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false);
|
||||||
|
|||||||
116
zone/net.cpp
116
zone/net.cpp
@ -104,7 +104,7 @@ TitleManager title_manager;
|
|||||||
QueryServ *QServ = 0;
|
QueryServ *QServ = 0;
|
||||||
TaskManager *taskmanager = 0;
|
TaskManager *taskmanager = 0;
|
||||||
QuestParserCollection *parse = 0;
|
QuestParserCollection *parse = 0;
|
||||||
EQEmuLogSys logger;
|
EQEmuLogSys Log;
|
||||||
|
|
||||||
const SPDat_Spell_Struct* spells;
|
const SPDat_Spell_Struct* spells;
|
||||||
void LoadSpells(EQEmu::MemoryMappedFile **mmf);
|
void LoadSpells(EQEmu::MemoryMappedFile **mmf);
|
||||||
@ -148,35 +148,35 @@ int main(int argc, char** argv) {
|
|||||||
worldserver.SetLauncherName("NONE");
|
worldserver.SetLauncherName("NONE");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration..");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration..");
|
||||||
if (!ZoneConfig::LoadConfig()) {
|
if (!ZoneConfig::LoadConfig()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Loading server configuration failed.");
|
Log.Log(EQEmuLogSys::Error, "Loading server configuration failed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
const ZoneConfig *Config=ZoneConfig::get();
|
const ZoneConfig *Config=ZoneConfig::get();
|
||||||
|
|
||||||
if(!load_log_settings(Config->LogSettingsFile.c_str()))
|
if(!load_log_settings(Config->LogSettingsFile.c_str()))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str());
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str());
|
||||||
|
|
||||||
worldserver.SetPassword(Config->SharedKey.c_str());
|
worldserver.SetPassword(Config->SharedKey.c_str());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL...");
|
||||||
if (!database.Connect(
|
if (!database.Connect(
|
||||||
Config->DatabaseHost.c_str(),
|
Config->DatabaseHost.c_str(),
|
||||||
Config->DatabaseUsername.c_str(),
|
Config->DatabaseUsername.c_str(),
|
||||||
Config->DatabasePassword.c_str(),
|
Config->DatabasePassword.c_str(),
|
||||||
Config->DatabaseDB.c_str(),
|
Config->DatabaseDB.c_str(),
|
||||||
Config->DatabasePort)) {
|
Config->DatabasePort)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Cannot continue without a database connection.");
|
Log.Log(EQEmuLogSys::Error, "Cannot continue without a database connection.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register Log System and Settings */
|
/* Register Log System and Settings */
|
||||||
logger.LoadLogSettingsDefaults();
|
Log.LoadLogSettingsDefaults();
|
||||||
logger.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess);
|
Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess);
|
||||||
database.LoadLogSysSettings(logger.log_settings);
|
database.LoadLogSysSettings(Log.log_settings);
|
||||||
|
|
||||||
/* Guilds */
|
/* Guilds */
|
||||||
guild_mgr.SetDatabase(&database);
|
guild_mgr.SetDatabase(&database);
|
||||||
@ -186,121 +186,121 @@ int main(int argc, char** argv) {
|
|||||||
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup nice signal handlers
|
* Setup nice signal handlers
|
||||||
*/
|
*/
|
||||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Could not set signal handler");
|
Log.Log(EQEmuLogSys::Error, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Could not set signal handler");
|
Log.Log(EQEmuLogSys::Error, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Could not set signal handler");
|
Log.Log(EQEmuLogSys::Error, "Could not set signal handler");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *log_ini_file = "./log.ini";
|
const char *log_ini_file = "./log.ini";
|
||||||
if(!load_log_settings(log_ini_file))
|
if(!load_log_settings(log_ini_file))
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file);
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes");
|
||||||
MapOpcodes();
|
MapOpcodes();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables");
|
||||||
database.LoadVariables();
|
database.LoadVariables();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names");
|
||||||
database.LoadZoneNames();
|
database.LoadZoneNames();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items");
|
||||||
if (!database.LoadItems()) {
|
if (!database.LoadItems()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Loading items FAILED!");
|
Log.Log(EQEmuLogSys::Error, "Loading items FAILED!");
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on...");
|
Log.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on...");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists");
|
||||||
if (!database.LoadNPCFactionLists()) {
|
if (!database.LoadNPCFactionLists()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!");
|
Log.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!");
|
||||||
CheckEQEMuErrorAndPause();
|
CheckEQEMuErrorAndPause();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables");
|
||||||
if (!database.LoadLoot()) {
|
if (!database.LoadLoot()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Loading loot FAILED!");
|
Log.Log(EQEmuLogSys::Error, "Loading loot FAILED!");
|
||||||
CheckEQEMuErrorAndPause();
|
CheckEQEMuErrorAndPause();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps");
|
||||||
if (!database.LoadSkillCaps()) {
|
if (!database.LoadSkillCaps()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!");
|
Log.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!");
|
||||||
CheckEQEMuErrorAndPause();
|
CheckEQEMuErrorAndPause();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells");
|
||||||
EQEmu::MemoryMappedFile *mmf = nullptr;
|
EQEmu::MemoryMappedFile *mmf = nullptr;
|
||||||
LoadSpells(&mmf);
|
LoadSpells(&mmf);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data");
|
||||||
if (!database.LoadBaseData()) {
|
if (!database.LoadBaseData()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Loading base data FAILED!");
|
Log.Log(EQEmuLogSys::Error, "Loading base data FAILED!");
|
||||||
CheckEQEMuErrorAndPause();
|
CheckEQEMuErrorAndPause();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds");
|
||||||
guild_mgr.LoadGuilds();
|
guild_mgr.LoadGuilds();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions");
|
||||||
database.LoadFactionData();
|
database.LoadFactionData();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles");
|
||||||
title_manager.LoadTitles();
|
title_manager.LoadTitles();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects");
|
||||||
database.LoadAAEffects();
|
database.LoadAAEffects();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes");
|
||||||
database.LoadTributes();
|
database.LoadTributes();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers");
|
||||||
database.GetDecayTimes(npcCorpseDecayTimes);
|
database.GetDecayTimes(npcCorpseDecayTimes);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands");
|
||||||
int retval=command_init();
|
int retval=command_init();
|
||||||
if(retval<0)
|
if(retval<0)
|
||||||
logger.Log(EQEmuLogSys::Error, "Command loading FAILED");
|
Log.Log(EQEmuLogSys::Error, "Command loading FAILED");
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval);
|
||||||
|
|
||||||
//rules:
|
//rules:
|
||||||
{
|
{
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp);
|
||||||
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
Log.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules");
|
||||||
} else {
|
} else {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
if(RuleB(TaskSystem, EnableTaskSystem)) {
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks");
|
||||||
taskmanager = new TaskManager;
|
taskmanager = new TaskManager;
|
||||||
taskmanager->LoadTasks();
|
taskmanager->LoadTasks();
|
||||||
}
|
}
|
||||||
@ -317,11 +317,11 @@ int main(int argc, char** argv) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//now we have our parser, load the quests
|
//now we have our parser, load the quests
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests");
|
||||||
parse->ReloadQuests();
|
parse->ReloadQuests();
|
||||||
|
|
||||||
if (!worldserver.Connect()) {
|
if (!worldserver.Connect()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()");
|
Log.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()");
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
|
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
|
||||||
@ -332,9 +332,9 @@ int main(int argc, char** argv) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (!strlen(zone_name) || !strcmp(zone_name,".")) {
|
if (!strlen(zone_name) || !strcmp(zone_name,".")) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode");
|
||||||
} else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance
|
} else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance
|
||||||
logger.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup");
|
Log.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup");
|
||||||
zone = 0;
|
zone = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ int main(int argc, char** argv) {
|
|||||||
RegisterAllPatches(stream_identifier);
|
RegisterAllPatches(stream_identifier);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Timer quest_timers(100);
|
Timer quest_timers(100);
|
||||||
@ -365,13 +365,13 @@ int main(int argc, char** argv) {
|
|||||||
worldserver.Process();
|
worldserver.Process();
|
||||||
|
|
||||||
if (!eqsf.IsOpen() && Config->ZonePort!=0) {
|
if (!eqsf.IsOpen() && Config->ZonePort!=0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort);
|
||||||
|
|
||||||
// log_sys.CloseZoneLogs();
|
// log_sys.CloseZoneLogs();
|
||||||
// log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
|
// log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
|
||||||
|
|
||||||
if (!eqsf.Open(Config->ZonePort)) {
|
if (!eqsf.Open(Config->ZonePort)) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort);
|
Log.Log(EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort);
|
||||||
ZoneConfig::SetZonePort(0);
|
ZoneConfig::SetZonePort(0);
|
||||||
worldserver.Disconnect();
|
worldserver.Disconnect();
|
||||||
worldwasconnected = false;
|
worldwasconnected = false;
|
||||||
@ -385,7 +385,7 @@ int main(int argc, char** argv) {
|
|||||||
//structures and opcodes for that patch.
|
//structures and opcodes for that patch.
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = eqss->GetRemoteIP();
|
in.s_addr = eqss->GetRemoteIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort()));
|
||||||
stream_identifier.AddStream(eqss); //takes the stream
|
stream_identifier.AddStream(eqss); //takes the stream
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ int main(int argc, char** argv) {
|
|||||||
//now that we know what patch they are running, start up their client object
|
//now that we know what patch they are running, start up their client object
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
in.s_addr = eqsi->GetRemoteIP();
|
in.s_addr = eqsi->GetRemoteIP();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||||
Client* client = new Client(eqsi);
|
Client* client = new Client(eqsi);
|
||||||
entity_list.AddClient(client);
|
entity_list.AddClient(client);
|
||||||
}
|
}
|
||||||
@ -522,13 +522,13 @@ int main(int argc, char** argv) {
|
|||||||
command_deinit();
|
command_deinit();
|
||||||
safe_delete(parse);
|
safe_delete(parse);
|
||||||
CheckEQEMuErrorAndPause();
|
CheckEQEMuErrorAndPause();
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatchSignal(int sig_num) {
|
void CatchSignal(int sig_num) {
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num);
|
||||||
#endif
|
#endif
|
||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ void Shutdown()
|
|||||||
RunLoops = false;
|
RunLoops = false;
|
||||||
worldserver.Disconnect();
|
worldserver.Disconnect();
|
||||||
// safe_delete(worldserver);
|
// safe_delete(worldserver);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down...");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down...");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 NetConnection::GetIP()
|
uint32 NetConnection::GetIP()
|
||||||
@ -628,7 +628,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) {
|
|||||||
spells = reinterpret_cast<SPDat_Spell_Struct*>((*mmf)->Get());
|
spells = reinterpret_cast<SPDat_Spell_Struct*>((*mmf)->Get());
|
||||||
mutex.Unlock();
|
mutex.Unlock();
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error loading spells: %s", ex.what());
|
Log.Log(EQEmuLogSys::Error, "Error loading spells: %s", ex.what());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
zone/npc.cpp
20
zone/npc.cpp
@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to)
|
|||||||
for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
|
for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) {
|
||||||
const Item_Struct* item = database.GetItem((*cur)->item_id);
|
const Item_Struct* item = database.GetItem((*cur)->item_id);
|
||||||
if (item == nullptr) {
|
if (item == nullptr) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Database error, invalid item");
|
Log.Log(EQEmuLogSys::Error, "Database error, invalid item");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
|||||||
spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
|
spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
npc_type_id = results.LastInsertedID();
|
npc_type_id = results.LastInsertedID();
|
||||||
@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
|||||||
spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
|
spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
npc_type_id = results.LastInsertedID();
|
npc_type_id = results.LastInsertedID();
|
||||||
@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
|||||||
query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName());
|
query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
uint32 spawngroupid = results.LastInsertedID();
|
uint32 spawngroupid = results.LastInsertedID();
|
||||||
@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
|||||||
spawn->GetHeading(), spawngroupid);
|
spawn->GetHeading(), spawngroupid);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C
|
|||||||
spawngroupid, npc_type_id, 100);
|
spawngroupid, npc_type_id, 100);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
|
|||||||
zone, spawn->GetName(), Timer::GetCurrentTime());
|
zone, spawn->GetName(), Timer::GetCurrentTime());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
last_insert_id = results.LastInsertedID();
|
last_insert_id = results.LastInsertedID();
|
||||||
@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
|
|||||||
spawn->GetHeading(), last_insert_id);
|
spawn->GetHeading(), last_insert_id);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
spawnid = results.LastInsertedID();
|
spawnid = results.LastInsertedID();
|
||||||
@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve
|
|||||||
last_insert_id, spawn->GetNPCTypeID(), 100);
|
last_insert_id, spawn->GetNPCTypeID(), 100);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem
|
|||||||
{
|
{
|
||||||
if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse))
|
if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse);
|
Log.Log(EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) {
|
|||||||
void Object::PutItem(uint8 index, const ItemInst* inst)
|
void Object::PutItem(uint8 index, const ItemInst* inst)
|
||||||
{
|
{
|
||||||
if (index > 9) {
|
if (index > 9) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index);
|
Log.Log(EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob
|
|||||||
safe_delete_array(object_name);
|
safe_delete_array(object_name);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec
|
|||||||
safe_delete_array(object_name);
|
safe_delete_array(object_name);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id)
|
|||||||
std::string query = StringFormat("DELETE FROM object WHERE id = %i", id);
|
std::string query = StringFormat("DELETE FROM object WHERE id = %i", id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
146
zone/pathing.cpp
146
zone/pathing.cpp
@ -61,19 +61,19 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName)
|
|||||||
|
|
||||||
if(Ret->loadPaths(PathFile))
|
if(Ret->loadPaths(PathFile))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName);
|
Log.Log(EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName);
|
Log.Log(EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName);
|
||||||
safe_delete(Ret);
|
safe_delete(Ret);
|
||||||
}
|
}
|
||||||
fclose(PathFile);
|
fclose(PathFile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName);
|
Log.Log(EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
@ -103,18 +103,18 @@ bool PathManager::loadPaths(FILE *PathFile)
|
|||||||
|
|
||||||
if(strncmp(Magic, "EQEMUPATH", 9))
|
if(strncmp(Magic, "EQEMUPATH", 9))
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Bad Magic String in .path file.");
|
Log.Log(EQEmuLogSys::Error, "Bad Magic String in .path file.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(&Head, sizeof(Head), 1, PathFile);
|
fread(&Head, sizeof(Head), 1, PathFile);
|
||||||
|
|
||||||
logger.Log(EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld",
|
Log.Log(EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld",
|
||||||
(long)Head.version, (long)Head.PathNodeCount);
|
(long)Head.version, (long)Head.PathNodeCount);
|
||||||
|
|
||||||
if(Head.version != 2)
|
if(Head.version != 2)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Unsupported path file version.");
|
Log.Log(EQEmuLogSys::Error, "Unsupported path file version.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile)
|
|||||||
{
|
{
|
||||||
if(PathNodes[i].Neighbours[j].id > MaxNodeID)
|
if(PathNodes[i].Neighbours[j].id > MaxNodeID)
|
||||||
{
|
{
|
||||||
logger.Log(EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id);
|
Log.Log(EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id);
|
||||||
|
|
||||||
PathFileValid = false;
|
PathFileValid = false;
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ)
|
|||||||
|
|
||||||
std::deque<int> PathManager::FindRoute(int startID, int endID)
|
std::deque<int> PathManager::FindRoute(int startID, int endID)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID);
|
||||||
|
|
||||||
memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount);
|
memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount);
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ std::deque<int> PathManager::FindRoute(int startID, int endID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route.");
|
||||||
return Route;
|
return Route;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b)
|
|||||||
|
|
||||||
std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
|
std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z);
|
||||||
|
|
||||||
std::deque<int> noderoute;
|
std::deque<int> noderoute;
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
|
|||||||
|
|
||||||
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
|
||||||
|
|
||||||
if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
|
if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
|
||||||
{
|
{
|
||||||
@ -396,11 +396,11 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ClosestPathNodeToStart <0 ) {
|
if(ClosestPathNodeToStart <0 ) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range.");
|
||||||
return noderoute;
|
return noderoute;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart);
|
||||||
|
|
||||||
// Find the nearest PathNode the end point has LOS to
|
// Find the nearest PathNode the end point has LOS to
|
||||||
|
|
||||||
@ -424,8 +424,8 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
|
|||||||
|
|
||||||
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id);
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)",
|
||||||
End.x, End.y, End.z,
|
End.x, End.y, End.z,
|
||||||
PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z);
|
PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z);
|
||||||
|
|
||||||
@ -437,11 +437,11 @@ std::deque<int> PathManager::FindRoute(Map::Vertex Start, Map::Vertex End)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ClosestPathNodeToEnd < 0) {
|
if(ClosestPathNodeToEnd < 0) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range.");
|
||||||
return noderoute;
|
return noderoute;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd);
|
||||||
|
|
||||||
if(ClosestPathNodeToStart == ClosestPathNodeToEnd)
|
if(ClosestPathNodeToStart == ClosestPathNodeToEnd)
|
||||||
{
|
{
|
||||||
@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
if(To == From)
|
if(To == From)
|
||||||
return To;
|
return To;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z);
|
||||||
|
|
||||||
if(From == PathingLastPosition)
|
if(From == PathingLastPosition)
|
||||||
{
|
{
|
||||||
@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
if((PathingLoopCount > 5) && !IsRooted())
|
if((PathingLoopCount > 5) && !IsRooted())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName());
|
||||||
|
|
||||||
if(Route.size() == 0)
|
if(Route.size() == 0)
|
||||||
{
|
{
|
||||||
@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
// If we are already pathing, and the destination is the same as before ...
|
// If we are already pathing, and the destination is the same as before ...
|
||||||
if(SameDestination)
|
if(SameDestination)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination.");
|
||||||
|
|
||||||
// Get the coordinates of the first path node we are going to.
|
// Get the coordinates of the first path node we are going to.
|
||||||
NextNode = Route.front();
|
NextNode = Route.front();
|
||||||
@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
// We have reached the path node.
|
// We have reached the path node.
|
||||||
if(NodeLoc == From)
|
if(NodeLoc == From)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode);
|
||||||
|
|
||||||
NodeReached = true;
|
NodeReached = true;
|
||||||
|
|
||||||
@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
// target, and we may run past the target if we don't check LOS at this point.
|
// target, and we may run past the target if we don't check LOS at this point.
|
||||||
int RouteSize = Route.size();
|
int RouteSize = Route.size();
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize);
|
||||||
|
|
||||||
if((RouteSize == 2)
|
if((RouteSize == 2)
|
||||||
|| ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
|
|| ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck))
|
||||||
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
||||||
&& PathingLOSCheckTimer->Check()))
|
&& PathingLOSCheckTimer->Check()))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target.");
|
||||||
float Distance = VertexDistanceNoRoot(From, To);
|
float Distance = VertexDistanceNoRoot(From, To);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
||||||
|
|
||||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
||||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||||
@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
PathingLOSState = HaveLOS;
|
PathingLOSState = HaveLOS;
|
||||||
else
|
else
|
||||||
PathingLOSState = NoLOS;
|
PathingLOSState = NoLOS;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
||||||
|
|
||||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
|
||||||
Route.clear();
|
Route.clear();
|
||||||
|
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
if(Route.size() == 0)
|
if(Route.size() == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport.");
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
Teleport(NodeLoc);
|
Teleport(NodeLoc);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
|
||||||
|
|
||||||
Route.pop_front();
|
Route.pop_front();
|
||||||
|
|
||||||
@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
}
|
}
|
||||||
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
|
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode);
|
||||||
|
|
||||||
return zone->pathing->GetPathNodeCoordinates(NextNode);
|
return zone->pathing->GetPathNodeCoordinates(NextNode);
|
||||||
}
|
}
|
||||||
@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
{
|
{
|
||||||
// we have run all the nodes, all that is left is the direct path from the last node
|
// we have run all the nodes, all that is left is the direct path from the last node
|
||||||
// to the destination
|
// to the destination
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target.");
|
||||||
|
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
&& (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck))
|
||||||
&& PathingLOSCheckTimer->Check())
|
&& PathingLOSCheckTimer->Check())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target.");
|
||||||
|
|
||||||
float Distance = VertexDistanceNoRoot(From, To);
|
float Distance = VertexDistanceNoRoot(From, To);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
||||||
|
|
||||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
||||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||||
@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
PathingLOSState = HaveLOS;
|
PathingLOSState = HaveLOS;
|
||||||
else
|
else
|
||||||
PathingLOSState = NoLOS;
|
PathingLOSState = NoLOS;
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
||||||
|
|
||||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
|
||||||
Route.clear();
|
Route.clear();
|
||||||
|
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
{
|
{
|
||||||
// We get here if we were already pathing, but our destination has now changed.
|
// We get here if we were already pathing, but our destination has now changed.
|
||||||
//
|
//
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position.");
|
||||||
// Update our record of where we are going to.
|
// Update our record of where we are going to.
|
||||||
PathingDestination = To;
|
PathingDestination = To;
|
||||||
// Check if we now have LOS etc to the new destination.
|
// Check if we now have LOS etc to the new destination.
|
||||||
@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort))
|
||||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance);
|
||||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
||||||
PathingLOSState = HaveLOS;
|
PathingLOSState = HaveLOS;
|
||||||
else
|
else
|
||||||
PathingLOSState = NoLOS;
|
PathingLOSState = NoLOS;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
||||||
|
|
||||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target.");
|
||||||
Route.clear();
|
Route.clear();
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
{
|
{
|
||||||
if(!PathingRouteUpdateTimerShort->Check())
|
if(!PathingRouteUpdateTimerShort->Check())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired.");
|
||||||
return zone->pathing->GetPathNodeCoordinates(Route.front());
|
return zone->pathing->GetPathNodeCoordinates(Route.front());
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!PathingRouteUpdateTimerLong->Check())
|
if(!PathingRouteUpdateTimerLong->Check())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired.");
|
||||||
return zone->pathing->GetPathNodeCoordinates(Route.front());
|
return zone->pathing->GetPathNodeCoordinates(Route.front());
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are already pathing, destination changed, no LOS. Find the nearest node to our destination.
|
// We are already pathing, destination changed, no LOS. Find the nearest node to our destination.
|
||||||
@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
// Destination unreachable via pathing, return direct route.
|
// Destination unreachable via pathing, return direct route.
|
||||||
if(DestinationPathNode == -1)
|
if(DestinationPathNode == -1)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target.");
|
||||||
Route.clear();
|
Route.clear();
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
// one, we will carry on on our path.
|
// one, we will carry on on our path.
|
||||||
if(DestinationPathNode == Route.back())
|
if(DestinationPathNode == Route.back())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode);
|
||||||
|
|
||||||
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
|
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
|
||||||
|
|
||||||
@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
// Check if we have reached a path node.
|
// Check if we have reached a path node.
|
||||||
if(NodeLoc == From)
|
if(NodeLoc == From)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front());
|
||||||
|
|
||||||
NodeReached = true;
|
NodeReached = true;
|
||||||
|
|
||||||
@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
if(Route.size() == 0)
|
if(Route.size() == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport.");
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
Teleport(NodeLoc);
|
Teleport(NodeLoc);
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z);
|
||||||
|
|
||||||
Route.pop_front();
|
Route.pop_front();
|
||||||
|
|
||||||
@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
NextNode = Route.front();
|
NextNode = Route.front();
|
||||||
}
|
}
|
||||||
// Return the coords of our next path node on the route.
|
// Return the coords of our next path node on the route.
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode);
|
||||||
|
|
||||||
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
|
zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this);
|
||||||
|
|
||||||
@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target.");
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route.");
|
||||||
|
|
||||||
Route.clear();
|
Route.clear();
|
||||||
// We will now fall through to get a new route.
|
// We will now fall through to get a new route.
|
||||||
@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty.");
|
||||||
|
|
||||||
if((SameDestination) && !PathingLOSCheckTimer->Check())
|
if((SameDestination) && !PathingLOSCheckTimer->Check())
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To.");
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong))
|
if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong))
|
||||||
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
&& (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold)))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance);
|
||||||
|
|
||||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
||||||
PathingLOSState = HaveLOS;
|
PathingLOSState = HaveLOS;
|
||||||
else
|
else
|
||||||
PathingLOSState = NoLOS;
|
PathingLOSState = NoLOS;
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS");
|
||||||
|
|
||||||
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there.");
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target.");
|
||||||
|
|
||||||
Route = zone->pathing->FindRoute(From, To);
|
Route = zone->pathing->FindRoute(From, To);
|
||||||
|
|
||||||
@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
|
|
||||||
if(Route.size() == 0)
|
if(Route.size() == 0)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct.");
|
||||||
|
|
||||||
return To;
|
return To;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SameDestination && (Route.front() == PathingLastNodeVisited))
|
if(SameDestination && (Route.front() == PathingLastNodeVisited))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited.");
|
||||||
|
|
||||||
Route.clear();
|
Route.clear();
|
||||||
|
|
||||||
@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &
|
|||||||
}
|
}
|
||||||
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
|
NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front());
|
||||||
|
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front());
|
||||||
|
|
||||||
PathingLoopCount = 0;
|
PathingLoopCount = 0;
|
||||||
|
|
||||||
@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position)
|
|||||||
|
|
||||||
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id);
|
||||||
|
|
||||||
if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
|
if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr))
|
||||||
{
|
{
|
||||||
@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ClosestPathNodeToStart <0 ) {
|
if(ClosestPathNodeToStart <0 ) {
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range.");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return ClosestPathNodeToStart;
|
return ClosestPathNodeToStart;
|
||||||
@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To)
|
|||||||
|
|
||||||
if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold))
|
if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
|
||||||
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
|
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
|
||||||
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
|
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To)
|
|||||||
float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr);
|
float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr);
|
||||||
if (ABS(NewZ - last_z) > 5.0f)
|
if (ABS(NewZ - last_z) > 5.0f)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f",
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f",
|
||||||
From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z);
|
From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To)
|
|||||||
}
|
}
|
||||||
if (best_z2 == -999990)
|
if (best_z2 == -999990)
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold))
|
if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold))
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2));
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!");
|
||||||
}
|
}
|
||||||
|
|
||||||
curx += stepx;
|
curx += stepx;
|
||||||
@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho)
|
|||||||
|
|
||||||
if(d && !d->IsDoorOpen() )
|
if(d && !d->IsDoorOpen() )
|
||||||
{
|
{
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName());
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName());
|
||||||
|
|
||||||
d->ForceOpen(ForWho);
|
d->ForceOpen(ForWho);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (THIS->IsMerc())
|
if (THIS->IsMerc())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference");
|
||||||
else if (THIS->IsNPC())
|
else if (THIS->IsNPC())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference");
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
else if (THIS->IsBot())
|
else if (THIS->IsBot())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference");
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference");
|
||||||
|
|
||||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||||
}
|
}
|
||||||
@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (THIS->IsMerc())
|
if (THIS->IsMerc())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference");
|
||||||
else if (THIS->IsNPC())
|
else if (THIS->IsNPC())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference");
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
else if (THIS->IsBot())
|
else if (THIS->IsBot())
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference");
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference");
|
Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference");
|
||||||
|
|
||||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||||
|
|
||||||
|
|||||||
@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) {
|
|||||||
std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID());
|
std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) {
|
|||||||
wpet->CheckedOut() ? 1: 0, wpet->GetID());
|
wpet->CheckedOut() ? 1: 0, wpet->GetID());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,12 +254,12 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet)
|
|||||||
safe_delete_array(petitiontext);
|
safe_delete_array(petitiontext);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EQDEBUG >= 5
|
#if EQDEBUG >= 5
|
||||||
logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created");
|
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB()
|
|||||||
"FROM petitions ORDER BY petid";
|
"FROM petitions ORDER BY petid";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
logger.Log(EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
Log.Log(EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user