mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 12:41:30 +00:00
[Performance] Reworked how all log calls are made in the source, see changelog.txt for more details
This commit is contained in:
parent
93a6efa95f
commit
7aa1d243b0
@ -1,5 +1,22 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 4/1/2017 ==
|
||||
Akkadius: [Performance] Reworked how all log calls are made in the source
|
||||
- Before we used Log.Out, we will now use a macro Log(
|
||||
- Before: Log.Out(Logs::General, Logs::Status, "Importing Spells...");
|
||||
- After: Log(Logs::General, Logs::Status, "Importing Spells...");
|
||||
- The difference is
|
||||
1) It's 200-300x faster especially when log statements are inside very hot code paths. We already
|
||||
had most hot paths checked before we logged them, but this blankets all existing logging calls now and not just the
|
||||
select few we had picked out in the source.
|
||||
2) Strings don't get copied to the stack, popped and pushed constantly even when we hit a log statement that
|
||||
actually isn't going to log anything.
|
||||
- We do an 'if (LogSys.log_settings[log_category].is_category_enabled == 1)' before we call a log function
|
||||
in the log macro so the log function doesn't get called at all if we're not logging the category
|
||||
- This has increased binary executables roughly 15KB
|
||||
- The old extern for EQEmuLogSys is now named LogSys appropriately instead of Log (Ex: LogSys.StartFileLogs())
|
||||
- The result keeps logging footprint non-existent for when we're not logging that category
|
||||
|
||||
== 03/30/2017 ==
|
||||
Akkadius: [Performance] Fixed an overhead issue where many hot paths would trigger quest subroutines and beneath that the code would
|
||||
try to see if a quest existed perpetually (checking if file exists) even though it should have determined the quest
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
#include "../../common/rulesys.h"
|
||||
#include "../../common/string_util.h"
|
||||
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
|
||||
void ExportSpells(SharedDatabase *db);
|
||||
void ExportSkillCaps(SharedDatabase *db);
|
||||
@ -36,46 +36,46 @@ void ExportDBStrings(SharedDatabase *db);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RegisterExecutablePlatform(ExePlatformClientExport);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
set_exception_handler();
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Client Files Export Utility");
|
||||
Log(Logs::General, Logs::Status, "Client Files Export Utility");
|
||||
if(!EQEmuConfig::LoadConfig()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to load configuration file.");
|
||||
Log(Logs::General, Logs::Error, "Unable to load configuration file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto Config = EQEmuConfig::get();
|
||||
|
||||
SharedDatabase database;
|
||||
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
|
||||
Log(Logs::General, Logs::Status, "Connecting to database...");
|
||||
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
|
||||
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
|
||||
Log(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
|
||||
"database connection");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Register Log System and Settings */
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
Log.StartFileLogs();
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
ExportSpells(&database);
|
||||
ExportSkillCaps(&database);
|
||||
ExportBaseData(&database);
|
||||
ExportDBStrings(&database);
|
||||
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ExportSpells(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Exporting Spells...");
|
||||
Log(Logs::General, Logs::Status, "Exporting Spells...");
|
||||
|
||||
FILE *f = fopen("export/spells_us.txt", "w");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open export/spells_us.txt to write, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open export/spells_us.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -142,11 +142,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
|
||||
}
|
||||
|
||||
void ExportSkillCaps(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Exporting Skill Caps...");
|
||||
Log(Logs::General, Logs::Status, "Exporting Skill Caps...");
|
||||
|
||||
FILE *f = fopen("export/SkillCaps.txt", "w");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -171,11 +171,11 @@ void ExportSkillCaps(SharedDatabase *db) {
|
||||
}
|
||||
|
||||
void ExportBaseData(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Exporting Base Data...");
|
||||
Log(Logs::General, Logs::Status, "Exporting Base Data...");
|
||||
|
||||
FILE *f = fopen("export/BaseData.txt", "w");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open export/BaseData.txt to write, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open export/BaseData.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -202,11 +202,11 @@ void ExportBaseData(SharedDatabase *db) {
|
||||
}
|
||||
|
||||
void ExportDBStrings(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Exporting DB Strings...");
|
||||
Log(Logs::General, Logs::Status, "Exporting DB Strings...");
|
||||
|
||||
FILE *f = fopen("export/dbstr_us.txt", "w");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open export/dbstr_us.txt to write, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open export/dbstr_us.txt to write, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
#include "../../common/rulesys.h"
|
||||
#include "../../common/string_util.h"
|
||||
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
|
||||
void ImportSpells(SharedDatabase *db);
|
||||
void ImportSkillCaps(SharedDatabase *db);
|
||||
@ -34,35 +34,35 @@ void ImportDBStrings(SharedDatabase *db);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RegisterExecutablePlatform(ExePlatformClientImport);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
set_exception_handler();
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Client Files Import Utility");
|
||||
Log(Logs::General, Logs::Status, "Client Files Import Utility");
|
||||
if(!EQEmuConfig::LoadConfig()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to load configuration file.");
|
||||
Log(Logs::General, Logs::Error, "Unable to load configuration file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto Config = EQEmuConfig::get();
|
||||
|
||||
SharedDatabase database;
|
||||
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
|
||||
Log(Logs::General, Logs::Status, "Connecting to database...");
|
||||
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
|
||||
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
|
||||
Log(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
|
||||
"database connection");
|
||||
return 1;
|
||||
}
|
||||
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
Log.StartFileLogs();
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
ImportSpells(&database);
|
||||
ImportSkillCaps(&database);
|
||||
ImportBaseData(&database);
|
||||
ImportDBStrings(&database);
|
||||
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -97,10 +97,10 @@ bool IsStringField(int i) {
|
||||
}
|
||||
|
||||
void ImportSpells(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Importing Spells...");
|
||||
Log(Logs::General, Logs::Status, "Importing Spells...");
|
||||
FILE *f = fopen("import/spells_us.txt", "r");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open import/spells_us.txt to read, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open import/spells_us.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -173,23 +173,23 @@ void ImportSpells(SharedDatabase *db) {
|
||||
|
||||
spells_imported++;
|
||||
if(spells_imported % 1000 == 0) {
|
||||
Log.Out(Logs::General, Logs::Status, "%d spells imported.", spells_imported);
|
||||
Log(Logs::General, Logs::Status, "%d spells imported.", spells_imported);
|
||||
}
|
||||
}
|
||||
|
||||
if(spells_imported % 1000 != 0) {
|
||||
Log.Out(Logs::General, Logs::Status, "%d spells imported.", spells_imported);
|
||||
Log(Logs::General, Logs::Status, "%d spells imported.", spells_imported);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void ImportSkillCaps(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Importing Skill Caps...");
|
||||
Log(Logs::General, Logs::Status, "Importing Skill Caps...");
|
||||
|
||||
FILE *f = fopen("import/SkillCaps.txt", "r");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -220,11 +220,11 @@ void ImportSkillCaps(SharedDatabase *db) {
|
||||
}
|
||||
|
||||
void ImportBaseData(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Importing Base Data...");
|
||||
Log(Logs::General, Logs::Status, "Importing Base Data...");
|
||||
|
||||
FILE *f = fopen("import/BaseData.txt", "r");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open import/BaseData.txt to read, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open import/BaseData.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -265,11 +265,11 @@ void ImportBaseData(SharedDatabase *db) {
|
||||
}
|
||||
|
||||
void ImportDBStrings(SharedDatabase *db) {
|
||||
Log.Out(Logs::General, Logs::Status, "Importing DB Strings...");
|
||||
Log(Logs::General, Logs::Status, "Importing DB Strings...");
|
||||
|
||||
FILE *f = fopen("import/dbstr_us.txt", "r");
|
||||
if(!f) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to open import/dbstr_us.txt to read, skipping.");
|
||||
Log(Logs::General, Logs::Error, "Unable to open import/dbstr_us.txt to read, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Crash, buffer);
|
||||
Log(Logs::General, Logs::Crash, buffer);
|
||||
StackWalker::OnOutput(szText);
|
||||
}
|
||||
};
|
||||
@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo)
|
||||
switch(ExceptionInfo->ExceptionRecord->ExceptionCode)
|
||||
{
|
||||
case EXCEPTION_ACCESS_VIOLATION:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ACCESS_VIOLATION");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_ACCESS_VIOLATION");
|
||||
break;
|
||||
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED");
|
||||
break;
|
||||
case EXCEPTION_BREAKPOINT:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_BREAKPOINT");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_BREAKPOINT");
|
||||
break;
|
||||
case EXCEPTION_DATATYPE_MISALIGNMENT:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT");
|
||||
break;
|
||||
case EXCEPTION_FLT_DENORMAL_OPERAND:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND");
|
||||
break;
|
||||
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO");
|
||||
break;
|
||||
case EXCEPTION_FLT_INEXACT_RESULT:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_INEXACT_RESULT");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_INEXACT_RESULT");
|
||||
break;
|
||||
case EXCEPTION_FLT_INVALID_OPERATION:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_INVALID_OPERATION");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_INVALID_OPERATION");
|
||||
break;
|
||||
case EXCEPTION_FLT_OVERFLOW:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_OVERFLOW");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_OVERFLOW");
|
||||
break;
|
||||
case EXCEPTION_FLT_STACK_CHECK:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_STACK_CHECK");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_STACK_CHECK");
|
||||
break;
|
||||
case EXCEPTION_FLT_UNDERFLOW:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_UNDERFLOW");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_FLT_UNDERFLOW");
|
||||
break;
|
||||
case EXCEPTION_ILLEGAL_INSTRUCTION:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION");
|
||||
break;
|
||||
case EXCEPTION_IN_PAGE_ERROR:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_IN_PAGE_ERROR");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_IN_PAGE_ERROR");
|
||||
break;
|
||||
case EXCEPTION_INT_DIVIDE_BY_ZERO:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO");
|
||||
break;
|
||||
case EXCEPTION_INT_OVERFLOW:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INT_OVERFLOW");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_INT_OVERFLOW");
|
||||
break;
|
||||
case EXCEPTION_INVALID_DISPOSITION:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INVALID_DISPOSITION");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_INVALID_DISPOSITION");
|
||||
break;
|
||||
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION");
|
||||
break;
|
||||
case EXCEPTION_PRIV_INSTRUCTION:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_PRIV_INSTRUCTION");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_PRIV_INSTRUCTION");
|
||||
break;
|
||||
case EXCEPTION_SINGLE_STEP:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_SINGLE_STEP");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_SINGLE_STEP");
|
||||
break;
|
||||
case EXCEPTION_STACK_OVERFLOW:
|
||||
Log.Out(Logs::General, Logs::Crash, "EXCEPTION_STACK_OVERFLOW");
|
||||
Log(Logs::General, Logs::Crash, "EXCEPTION_STACK_OVERFLOW");
|
||||
break;
|
||||
default:
|
||||
Log.Out(Logs::General, Logs::Crash, "Unknown Exception");
|
||||
Log(Logs::General, Logs::Crash, "Unknown Exception");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -64,11 +64,11 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
|
||||
uint32 errnum= 0;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host,port);
|
||||
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host,port);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -208,7 +208,7 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta
|
||||
else
|
||||
query = StringFormat("INSERT INTO account SET name='%s', status=%i, lsaccount_id=%i, time_creation=UNIX_TIMESTAMP();",name, status, lsaccount_id);
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Account Attempting to be created: '%s' status: %i", name, status);
|
||||
Log(Logs::General, Logs::World_Server, "Account Attempting to be created: '%s' status: %i", name, status);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
@ -225,7 +225,7 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta
|
||||
|
||||
bool Database::DeleteAccount(const char* name) {
|
||||
std::string query = StringFormat("DELETE FROM account WHERE name='%s';",name);
|
||||
Log.Out(Logs::General, Logs::World_Server, "Account Attempting to be deleted:'%s'", name);
|
||||
Log(Logs::General, Logs::World_Server, "Account Attempting to be deleted:'%s'", name);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
@ -272,7 +272,7 @@ bool Database::ReserveName(uint32 account_id, char* name) {
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (row[0] && atoi(row[0]) > 0){
|
||||
Log.Out(Logs::General, Logs::World_Server, "Account: %i tried to request name: %s, but it is already taken...", account_id, name);
|
||||
Log(Logs::General, Logs::World_Server, "Account: %i tried to request name: %s, but it is already taken...", account_id, name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -290,17 +290,17 @@ bool Database::ReserveName(uint32 account_id, char* name) {
|
||||
bool Database::DeleteCharacter(char *name) {
|
||||
uint32 charid = 0;
|
||||
if(!name || !strlen(name)) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "DeleteCharacter: request to delete without a name (empty char slot)");
|
||||
Log(Logs::General, Logs::World_Server, "DeleteCharacter: request to delete without a name (empty char slot)");
|
||||
return false;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::World_Server, "Database::DeleteCharacter name : '%s'", name);
|
||||
Log(Logs::General, Logs::World_Server, "Database::DeleteCharacter name : '%s'", name);
|
||||
|
||||
/* Get id from character_data before deleting record so we can clean up the rest of the tables */
|
||||
std::string query = StringFormat("SELECT `id` from `character_data` WHERE `name` = '%s'", name);
|
||||
auto results = QueryDatabase(query);
|
||||
for (auto row = results.begin(); row != results.end(); ++row) { charid = atoi(row[0]); }
|
||||
if (charid <= 0){
|
||||
Log.Out(Logs::General, Logs::Error, "Database::DeleteCharacter :: Character (%s) not found, stopping delete...", name);
|
||||
Log(Logs::General, Logs::Error, "Database::DeleteCharacter :: Character (%s) not found, stopping delete...", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -687,7 +687,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, EQEmu
|
||||
charid = GetCharacterID(pp->name);
|
||||
|
||||
if(!charid) {
|
||||
Log.Out(Logs::General, Logs::Error, "StoreCharacter: no character id");
|
||||
Log(Logs::General, Logs::Error, "StoreCharacter: no character id");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1500,7 +1500,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1543,7 +1543,7 @@ uint32 Database::GetGroupID(const char* name){
|
||||
if (results.RowCount() == 0)
|
||||
{
|
||||
// Commenting this out until logging levels can prevent this from going to console
|
||||
//Log.Out(Logs::General, Logs::None,, "Character not in a group: %s", name);
|
||||
//Log(Logs::General, Logs::None,, "Character not in a group: %s", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1590,7 +1590,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
||||
result = QueryDatabase(query);
|
||||
|
||||
if(!result.Success()) {
|
||||
Log.Out(Logs::General, Logs::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1787,7 +1787,7 @@ const char* Database::GetRaidLeaderName(uint32 raid_id)
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Debug, "Unable to get Raid Leader Name for Raid ID: %u", raid_id);
|
||||
Log(Logs::General, Logs::Debug, "Unable to get Raid Leader Name for Raid ID: %u", raid_id);
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
@ -2071,7 +2071,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
int log_category = 0;
|
||||
Log.file_logs_enabled = false;
|
||||
LogSys.file_logs_enabled = false;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
log_category = atoi(row[0]);
|
||||
@ -2097,7 +2097,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings)
|
||||
If we go through this whole loop and nothing is set to any debug level, there is no point to create a file or keep anything open
|
||||
*/
|
||||
if (log_settings[log_category].log_to_file > 0){
|
||||
Log.file_logs_enabled = true;
|
||||
LogSys.file_logs_enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2119,7 +2119,7 @@ struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success() || results.RowCount() == 0){
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Loading EQ time of day failed. Using defaults.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Loading EQ time of day failed. Using defaults.");
|
||||
eqTime.minute = 0;
|
||||
eqTime.hour = 9;
|
||||
eqTime.day = 1;
|
||||
|
||||
@ -110,8 +110,8 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
|
||||
|
||||
/* Implement Logging at the Root */
|
||||
if (mysql_errno(&mysql) > 0 && strlen(query) > 0){
|
||||
if (Log.log_settings[Logs::MySQLError].is_category_enabled == 1)
|
||||
Log.Out(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query);
|
||||
if (LogSys.log_settings[Logs::MySQLError].is_category_enabled == 1)
|
||||
Log(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query);
|
||||
}
|
||||
|
||||
return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql),errorBuffer);
|
||||
@ -127,12 +127,14 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
|
||||
|
||||
MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql));
|
||||
|
||||
if (Log.log_settings[Logs::MySQLQuery].is_category_enabled == 1)
|
||||
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1)
|
||||
{
|
||||
if ((strncasecmp(query, "select", 6) == 0))
|
||||
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u row%s returned)", query, requestResult.RowCount(), requestResult.RowCount() == 1 ? "" : "s");
|
||||
else
|
||||
Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u row%s affected)", query, requestResult.RowsAffected(), requestResult.RowsAffected() == 1 ? "" : "s");
|
||||
if ((strncasecmp(query, "select", 6) == 0)) {
|
||||
Log(Logs::General, Logs::MySQLQuery, "%s (%u row%s returned)", query, requestResult.RowCount(), requestResult.RowCount() == 1 ? "" : "s");
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::MySQLQuery, "%s (%u row%s affected)", query, requestResult.RowsAffected(), requestResult.RowsAffected() == 1 ? "" : "s");
|
||||
}
|
||||
}
|
||||
|
||||
return requestResult;
|
||||
|
||||
@ -84,14 +84,14 @@ void EQStream::init(bool resetSession) {
|
||||
|
||||
OpMgr = nullptr;
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
}
|
||||
|
||||
EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
|
||||
{
|
||||
EQRawApplicationPacket *ap=nullptr;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, p->size);
|
||||
// _raw(NET__APP_CREATE_HEX, 0xFFFF, p);
|
||||
ap = p->MakeAppPacket();
|
||||
return ap;
|
||||
@ -100,7 +100,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p)
|
||||
EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len)
|
||||
{
|
||||
EQRawApplicationPacket *ap=nullptr;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len);
|
||||
ap = new EQRawApplicationPacket(buf, len);
|
||||
return ap;
|
||||
}
|
||||
@ -130,7 +130,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
}
|
||||
|
||||
if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Session not initialized, packet ignored" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Session not initialized, packet ignored" __L);
|
||||
// _raw(NET__DEBUG, 0xFFFF, p);
|
||||
return;
|
||||
}
|
||||
@ -141,7 +141,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
while(processed < p->size) {
|
||||
subpacket_length=*(p->pBuffer+processed);
|
||||
EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length);
|
||||
// _raw(NET__NET_CREATE_HEX, 0xFFFF, subp);
|
||||
subp->copyInfo(p);
|
||||
ProcessPacket(subp);
|
||||
@ -156,12 +156,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
while(processed<p->size) {
|
||||
EQRawApplicationPacket *ap=nullptr;
|
||||
if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
||||
ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length);
|
||||
processed+=subpacket_length+1;
|
||||
} else {
|
||||
subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1));
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length);
|
||||
ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length);
|
||||
processed+=subpacket_length+3;
|
||||
}
|
||||
@ -176,29 +176,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
case OP_Packet: {
|
||||
if(!p->pBuffer || (p->Size() < 4))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Packet that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_Packet that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
SeqOrder check=CompareSequence(NextInSeq,seq);
|
||||
if (check == SeqFuture) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
// _raw(NET__DEBUG, seq, p);
|
||||
|
||||
PacketQueue[seq]=p->Copy();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||
|
||||
//SendOutOfOrderAck(seq);
|
||||
|
||||
} else if (check == SeqPast) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
// _raw(NET__DEBUG, seq, p);
|
||||
SendOutOfOrderAck(seq); //we already got this packet but it was out of order
|
||||
} else {
|
||||
// In case we did queue one before as well.
|
||||
EQProtocolPacket *qp=RemoveQueue(seq);
|
||||
if (qp) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq);
|
||||
Log(Logs::General, Logs::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq);
|
||||
delete qp;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
// Check for an embedded OP_AppCombinded (protocol level 0x19)
|
||||
if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) {
|
||||
EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size);
|
||||
// _raw(NET__NET_CREATE_HEX, seq, subp);
|
||||
subp->copyInfo(p);
|
||||
ProcessPacket(subp);
|
||||
@ -226,29 +226,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
case OP_Fragment: {
|
||||
if(!p->pBuffer || (p->Size() < 4))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Fragment that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_Fragment that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
SeqOrder check=CompareSequence(NextInSeq,seq);
|
||||
if (check == SeqFuture) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
// _raw(NET__DEBUG, seq, p);
|
||||
|
||||
PacketQueue[seq]=p->Copy();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size());
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size());
|
||||
|
||||
//SendOutOfOrderAck(seq);
|
||||
|
||||
} else if (check == SeqPast) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq);
|
||||
// _raw(NET__DEBUG, seq, p);
|
||||
SendOutOfOrderAck(seq);
|
||||
} else {
|
||||
// In case we did queue one before as well.
|
||||
EQProtocolPacket *qp=RemoveQueue(seq);
|
||||
if (qp) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq);
|
||||
Log(Logs::General, Logs::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq);
|
||||
delete qp;
|
||||
}
|
||||
SetNextAckToSend(seq);
|
||||
@ -256,18 +256,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
if (oversize_buffer) {
|
||||
memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2);
|
||||
oversize_offset+=p->size-2;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length);
|
||||
Log(Logs::Detail, Logs::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 (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) {
|
||||
EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size);
|
||||
//// _raw(NET__NET_CREATE_HEX, subp);
|
||||
subp->copyInfo(p);
|
||||
ProcessPacket(subp);
|
||||
delete subp;
|
||||
} else {
|
||||
EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size);
|
||||
if (ap) {
|
||||
ap->copyInfo(p);
|
||||
InboundQueuePush(ap);
|
||||
@ -282,20 +282,20 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
oversize_buffer=new unsigned char[oversize_length];
|
||||
memcpy(oversize_buffer,p->pBuffer+6,p->size-6);
|
||||
oversize_offset=p->size-6;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OP_KeepAlive: {
|
||||
NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size));
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received and queued reply to keep alive" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received and queued reply to keep alive" __L);
|
||||
}
|
||||
break;
|
||||
case OP_Ack: {
|
||||
if(!p->pBuffer || (p->Size() < 4))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Ack that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_Ack that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
@ -309,11 +309,11 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
case OP_SessionRequest: {
|
||||
if(p->Size() < sizeof(SessionRequest))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
if (GetState()==ESTABLISHED) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts);
|
||||
Log(Logs::Detail, Logs::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
|
||||
// streamactive means we identified the opcode for the stream, we cannot re-establish this connection
|
||||
@ -331,7 +331,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
SessionRequest *Request=(SessionRequest *)p->pBuffer;
|
||||
Session=ntohl(Request->Session);
|
||||
SetMaxLen(ntohl(Request->MaxLength));
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen);
|
||||
SetState(ESTABLISHED);
|
||||
Key=0x11223344;
|
||||
SendSessionResponse();
|
||||
@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
case OP_SessionResponse: {
|
||||
if(p->Size() < sizeof(SessionResponse))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
compressed=(Response->Format&FLAG_COMPRESSED);
|
||||
encoded=(Response->Format&FLAG_ENCODED);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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
|
||||
if (StreamType==UnknownStream) {
|
||||
@ -379,17 +379,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
EQStreamState state = GetState();
|
||||
if(state == ESTABLISHED) {
|
||||
//client initiated disconnect?
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L);
|
||||
_SendDisconnect();
|
||||
SetState(CLOSED);
|
||||
} else if(state == CLOSING) {
|
||||
//we were waiting for this anyways, ignore pending messages, send the reply and be closed.
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L);
|
||||
_SendDisconnect();
|
||||
SetState(CLOSED);
|
||||
} else {
|
||||
//we are expecting this (or have already gotten it, but dont care either way)
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L);
|
||||
SetState(CLOSED);
|
||||
}
|
||||
}
|
||||
@ -397,24 +397,24 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
case OP_OutOfOrderAck: {
|
||||
if(!p->pBuffer || (p->Size() < 4))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
uint16 seq=ntohs(*(uint16 *)(p->pBuffer));
|
||||
MOutboundQueue.lock();
|
||||
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
//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) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L,
|
||||
Log(Logs::Detail, Logs::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+SequencedQueue.size());
|
||||
|
||||
uint16 sqsize = SequencedQueue.size();
|
||||
uint16 index = seq - SequencedBase;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize);
|
||||
if (index < sqsize) {
|
||||
SequencedQueue[index]->acked = true;
|
||||
// flag packets for a resend
|
||||
@ -423,7 +423,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
for (auto sitr = SequencedQueue.begin(); sitr != SequencedQueue.end() && count < index; ++sitr, ++count) {
|
||||
if (!(*sitr)->acked && (*sitr)->sent_time > 0 && (((*sitr)->sent_time + timeout) < Timer::GetCurrentTime())) {
|
||||
(*sitr)->sent_time = 0;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck Flagging packet %d for retransmission" __L, SequencedBase + count);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck Flagging packet %d for retransmission" __L, SequencedBase + count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -432,11 +432,11 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
retransmittimer = Timer::GetCurrentTime();
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq);
|
||||
}
|
||||
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
MOutboundQueue.unlock();
|
||||
@ -445,11 +445,11 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
case OP_SessionStatRequest: {
|
||||
if(p->Size() < sizeof(ClientSessionStats))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L);
|
||||
break;
|
||||
}
|
||||
ClientSessionStats *ClientStats=(ClientSessionStats *)p->pBuffer;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L,
|
||||
(unsigned long)ntohl(ClientStats->packets_received), (unsigned long)ntohl(ClientStats->packets_sent), (unsigned long)ntohl(ClientStats->last_local_delta),
|
||||
(unsigned long)ntohl(ClientStats->low_delta), (unsigned long)ntohl(ClientStats->average_delta),
|
||||
(unsigned long)ntohl(ClientStats->high_delta), (unsigned long)ntohl(ClientStats->last_remote_delta));
|
||||
@ -468,7 +468,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
retransmittimeout += 300;
|
||||
if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX)
|
||||
retransmittimeout = RETRANSMIT_TIMEOUT_MAX;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,11 +485,11 @@ void EQStream::ProcessPacket(EQProtocolPacket *p)
|
||||
}
|
||||
break;
|
||||
case OP_SessionStatResponse: {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L);
|
||||
}
|
||||
break;
|
||||
case OP_OutOfSession: {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfSession. Ignoring." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfSession. Ignoring." __L);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -520,7 +520,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
|
||||
return;
|
||||
|
||||
if(OpMgr == nullptr || *OpMgr == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L);
|
||||
delete pack;
|
||||
return;
|
||||
}
|
||||
@ -545,32 +545,32 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
||||
uint32 chunksize, used;
|
||||
uint32 length;
|
||||
|
||||
if (Log.log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
|
||||
if (LogSys.log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
|
||||
if (p->GetOpcode() != OP_SpecialMesg){
|
||||
Log.Out(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
|
||||
Log(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
|
||||
}
|
||||
}
|
||||
|
||||
if (Log.log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
|
||||
if (LogSys.log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
|
||||
if (p->GetOpcode() != OP_SpecialMesg){
|
||||
Log.Out(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
||||
Log(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// Convert the EQApplicationPacket to 1 or more EQProtocolPackets
|
||||
if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2)
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->Size());
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->Size());
|
||||
|
||||
auto tmpbuff = new unsigned char[p->size + 3];
|
||||
length=p->serialize(opcode, tmpbuff);
|
||||
if (length != p->Size())
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Packet adjustment, len %d to %d" __L, p->Size(), length);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Packet adjustment, len %d to %d" __L, p->Size(), length);
|
||||
|
||||
auto out = new EQProtocolPacket(OP_Fragment, nullptr, MaxLen - 4);
|
||||
*(uint32 *)(out->pBuffer+2)=htonl(length);
|
||||
used=MaxLen-10;
|
||||
memcpy(out->pBuffer+6,tmpbuff,used);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "First fragment: used %d/%d. Payload size %d in the packet" __L, used, length, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "First fragment: used %d/%d. Payload size %d in the packet" __L, used, length, p->size);
|
||||
SequencedPush(out);
|
||||
|
||||
|
||||
@ -581,7 +581,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
||||
out->size=chunksize+2;
|
||||
SequencedPush(out);
|
||||
used+=chunksize;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, length);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, length);
|
||||
}
|
||||
delete p;
|
||||
delete[] tmpbuff;
|
||||
@ -602,18 +602,18 @@ void EQStream::SequencedPush(EQProtocolPacket *p)
|
||||
{
|
||||
MOutboundQueue.lock();
|
||||
if (uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L,
|
||||
SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L,
|
||||
NextOutSeq, p->size, SequencedBase);
|
||||
*(uint16 *)(p->pBuffer) = htons(NextOutSeq);
|
||||
SequencedQueue.push_back(p);
|
||||
NextOutSeq++;
|
||||
|
||||
if (uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L,
|
||||
SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
|
||||
@ -623,7 +623,7 @@ void EQStream::SequencedPush(EQProtocolPacket *p)
|
||||
void EQStream::NonSequencedPush(EQProtocolPacket *p)
|
||||
{
|
||||
MOutboundQueue.lock();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size);
|
||||
NonSequencedQueue.push(p);
|
||||
MOutboundQueue.unlock();
|
||||
}
|
||||
@ -631,14 +631,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p)
|
||||
void EQStream::SendAck(uint16 seq)
|
||||
{
|
||||
uint16 Seq=htons(seq);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending ack with sequence %d" __L, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Sending ack with sequence %d" __L, seq);
|
||||
SetLastAckSent(seq);
|
||||
NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16)));
|
||||
}
|
||||
|
||||
void EQStream::SendOutOfOrderAck(uint16 seq)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending out of order ack with sequence %d" __L, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Sending out of order ack with sequence %d" __L, seq);
|
||||
uint16 Seq=htons(seq);
|
||||
NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16)));
|
||||
}
|
||||
@ -688,24 +688,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
|
||||
// And remove it form the queue
|
||||
p = NonSequencedQueue.front();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size);
|
||||
NonSequencedQueue.pop();
|
||||
} else if (!p->combine(NonSequencedQueue.front())) {
|
||||
// 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)
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten+=p->size;
|
||||
p=nullptr;
|
||||
|
||||
if (BytesWritten > threshold) {
|
||||
// Sent enough this round, lets stop to be fair
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Combine worked, so just remove this packet and it's spot in the queue
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size);
|
||||
delete NonSequencedQueue.front();
|
||||
NonSequencedQueue.pop();
|
||||
}
|
||||
@ -718,7 +718,7 @@ void EQStream::Write(int eq_fd)
|
||||
uint16 seq_send = SequencedBase + count; //just for logging...
|
||||
|
||||
if(SequencedQueue.empty()) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq);
|
||||
SeqEmpty=true;
|
||||
continue;
|
||||
}
|
||||
@ -728,35 +728,35 @@ void EQStream::Write(int eq_fd)
|
||||
++sitr;
|
||||
++count;
|
||||
if (p) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten += p->size;
|
||||
p = nullptr;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send);
|
||||
} else if (!p) {
|
||||
// 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
|
||||
p=(*sitr)->Copy();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
(*sitr)->sent_time = Timer::GetCurrentTime();
|
||||
++sitr;
|
||||
++count;
|
||||
} else if (!p->combine(*sitr)) {
|
||||
// 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)
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send + 1, (*sitr)->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send + 1, (*sitr)->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten+=p->size;
|
||||
p=nullptr;
|
||||
if ((*sitr)->opcode != OP_Fragment && BytesWritten > threshold) {
|
||||
// Sent enough this round, lets stop to be fair
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Combine worked
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
(*sitr)->sent_time = Timer::GetCurrentTime();
|
||||
++sitr;
|
||||
++count;
|
||||
@ -766,7 +766,7 @@ void EQStream::Write(int eq_fd)
|
||||
++sitr;
|
||||
++count;
|
||||
if (p) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten += p->size;
|
||||
p = nullptr;
|
||||
@ -776,25 +776,25 @@ void EQStream::Write(int eq_fd)
|
||||
// Copy it first as it will still live until it is acked
|
||||
p=(*sitr)->Copy();
|
||||
(*sitr)->sent_time = Timer::GetCurrentTime();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size);
|
||||
++sitr;
|
||||
++count;
|
||||
} else if (!p->combine(*sitr)) {
|
||||
// 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)
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size);
|
||||
Log(Logs::Detail, Logs::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);
|
||||
BytesWritten+=p->size;
|
||||
p=nullptr;
|
||||
|
||||
if (BytesWritten > threshold) {
|
||||
// Sent enough this round, lets stop to be fair
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Combine worked
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yielding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yielding %d combined." __L, seq_send, (*sitr)->size, p->size);
|
||||
(*sitr)->sent_time = Timer::GetCurrentTime();
|
||||
++sitr;
|
||||
++count;
|
||||
@ -802,7 +802,7 @@ void EQStream::Write(int eq_fd)
|
||||
}
|
||||
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
} else {
|
||||
// No more sequenced packets
|
||||
@ -814,7 +814,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
|
||||
if (p) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size);
|
||||
ReadyToSend.push(p);
|
||||
BytesWritten+=p->size;
|
||||
}
|
||||
@ -831,7 +831,7 @@ void EQStream::Write(int eq_fd)
|
||||
if(SeqEmpty && NonSeqEmpty) {
|
||||
//no more data to send
|
||||
if(CheckState(CLOSING)) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "All outgoing data flushed, closing stream." __L );
|
||||
Log(Logs::Detail, Logs::Netcode, _L "All outgoing data flushed, closing stream." __L );
|
||||
//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().
|
||||
_SendDisconnect();
|
||||
@ -896,7 +896,7 @@ void EQStream::SendSessionResponse()
|
||||
|
||||
out->size=sizeof(SessionResponse);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L,
|
||||
Log(Logs::Detail, Logs::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");
|
||||
|
||||
NonSequencedPush(out);
|
||||
@ -910,7 +910,7 @@ void EQStream::SendSessionRequest()
|
||||
Request->Session=htonl(time(nullptr));
|
||||
Request->MaxLength=htonl(512);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
|
||||
|
||||
NonSequencedPush(out);
|
||||
}
|
||||
@ -924,7 +924,7 @@ void EQStream::_SendDisconnect()
|
||||
*(uint32 *)out->pBuffer=htonl(Session);
|
||||
NonSequencedPush(out);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session);
|
||||
}
|
||||
|
||||
void EQStream::InboundQueuePush(EQRawApplicationPacket *p)
|
||||
@ -950,7 +950,7 @@ EQRawApplicationPacket *p=nullptr;
|
||||
if (OpMgr != nullptr && *OpMgr != nullptr) {
|
||||
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
||||
if (emu_op == OP_Unknown) {
|
||||
// Log.Out(Logs::General, Logs::Client_Server_Packet_Unhandled, "Unknown :: [%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->opcode, p->Size(), DumpPacketToString(p).c_str());
|
||||
// Log(Logs::General, Logs::Client_Server_Packet_Unhandled, "Unknown :: [%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->opcode, p->Size(), DumpPacketToString(p).c_str());
|
||||
}
|
||||
p->SetOpcode(emu_op);
|
||||
}
|
||||
@ -976,7 +976,7 @@ EQRawApplicationPacket *p=nullptr;
|
||||
if(OpMgr != nullptr && *OpMgr != nullptr) {
|
||||
EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode);
|
||||
if(emu_op == OP_Unknown) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
||||
Log(Logs::General, Logs::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode);
|
||||
}
|
||||
|
||||
p->SetOpcode(emu_op);
|
||||
@ -1004,7 +1004,7 @@ void EQStream::InboundQueueClear()
|
||||
{
|
||||
EQApplicationPacket *p=nullptr;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing inbound queue" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Clearing inbound queue" __L);
|
||||
|
||||
MInboundQueue.lock();
|
||||
if (!InboundQueue.empty()) {
|
||||
@ -1047,7 +1047,7 @@ void EQStream::OutboundQueueClear()
|
||||
{
|
||||
EQProtocolPacket *p=nullptr;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing outbound queue" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Clearing outbound queue" __L);
|
||||
|
||||
MOutboundQueue.lock();
|
||||
while(!NonSequencedQueue.empty()) {
|
||||
@ -1069,7 +1069,7 @@ void EQStream::PacketQueueClear()
|
||||
{
|
||||
EQProtocolPacket *p=nullptr;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing future packet queue" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Clearing future packet queue" __L);
|
||||
|
||||
if(!PacketQueue.empty()) {
|
||||
std::map<unsigned short,EQProtocolPacket *>::iterator itr;
|
||||
@ -1101,7 +1101,7 @@ void EQStream::Process(const unsigned char *buffer, const uint32 length)
|
||||
delete p;
|
||||
ProcessQueue();
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Incoming packet failed checksum" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Incoming packet failed checksum" __L);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1132,23 +1132,23 @@ std::deque<EQProtocolPacket *>::iterator itr, tmp;
|
||||
SeqOrder ord = CompareSequence(SequencedBase, seq);
|
||||
if(ord == SeqInOrder) {
|
||||
//they are not acking anything new...
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq);
|
||||
} else if(ord == SeqPast) {
|
||||
//they are nacking blocks going back before our buffer, wtf?
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase);
|
||||
Log(Logs::Detail, Logs::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.
|
||||
seq++; //we stop at the block right after their ack, counting on the wrap of both numbers.
|
||||
while(SequencedBase != seq) {
|
||||
if(SequencedQueue.empty()) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, SequencedQueue.size());
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, SequencedQueue.size());
|
||||
SequencedBase = NextOutSeq;
|
||||
break;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Removing acked packet with sequence %lu." __L, (unsigned long)SequencedBase);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Removing acked packet with sequence %lu." __L, (unsigned long)SequencedBase);
|
||||
//clean out the acked packet
|
||||
delete SequencedQueue.front();
|
||||
SequencedQueue.pop_front();
|
||||
@ -1156,7 +1156,7 @@ std::deque<EQProtocolPacket *>::iterator itr, tmp;
|
||||
SequencedBase++;
|
||||
}
|
||||
if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1166,7 +1166,7 @@ std::deque<EQProtocolPacket *>::iterator itr, tmp;
|
||||
void EQStream::SetNextAckToSend(uint32 seq)
|
||||
{
|
||||
MAcks.lock();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq);
|
||||
NextAckToSend=seq;
|
||||
MAcks.unlock();
|
||||
}
|
||||
@ -1174,7 +1174,7 @@ void EQStream::SetNextAckToSend(uint32 seq)
|
||||
void EQStream::SetLastAckSent(uint32 seq)
|
||||
{
|
||||
MAcks.lock();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq);
|
||||
LastAckSent=seq;
|
||||
MAcks.unlock();
|
||||
}
|
||||
@ -1187,10 +1187,10 @@ void EQStream::ProcessQueue()
|
||||
|
||||
EQProtocolPacket *qp=nullptr;
|
||||
while((qp=RemoveQueue(NextInSeq))!=nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq);
|
||||
ProcessPacket(qp);
|
||||
delete qp;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1201,21 +1201,21 @@ EQProtocolPacket *qp=nullptr;
|
||||
if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) {
|
||||
qp=itr->second;
|
||||
PacketQueue.erase(itr);
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||
Log(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size());
|
||||
}
|
||||
return qp;
|
||||
}
|
||||
|
||||
void EQStream::SetStreamType(EQStreamType type)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type));
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type));
|
||||
StreamType=type;
|
||||
switch (StreamType) {
|
||||
case LoginStream:
|
||||
app_opcode_size=1;
|
||||
compressed=false;
|
||||
encoded=false;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size);
|
||||
break;
|
||||
case ChatOrMailStream:
|
||||
case ChatStream:
|
||||
@ -1223,7 +1223,7 @@ void EQStream::SetStreamType(EQStreamType type)
|
||||
app_opcode_size=1;
|
||||
compressed=false;
|
||||
encoded=true;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size);
|
||||
break;
|
||||
case ZoneStream:
|
||||
case WorldStream:
|
||||
@ -1231,7 +1231,7 @@ void EQStream::SetStreamType(EQStreamType type)
|
||||
app_opcode_size=2;
|
||||
compressed=true;
|
||||
encoded=false;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1281,7 +1281,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq)
|
||||
|
||||
void EQStream::SetState(EQStreamState state) {
|
||||
MState.lock();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Changing state from %d to %d" __L, State, state);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Changing state from %d to %d" __L, State, state);
|
||||
State=state;
|
||||
MState.unlock();
|
||||
}
|
||||
@ -1293,29 +1293,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) {
|
||||
|
||||
EQStreamState orig_state = GetState();
|
||||
if (orig_state == CLOSING && !outgoing_data) {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Out of data in closing state, disconnecting." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Out of data in closing state, disconnecting." __L);
|
||||
_SendDisconnect();
|
||||
SetState(DISCONNECTING);
|
||||
} else if (LastPacket && (now-LastPacket) > timeout) {
|
||||
switch(orig_state) {
|
||||
case CLOSING:
|
||||
//if we time out in the closing state, they are not acking us, just give up
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L);
|
||||
_SendDisconnect();
|
||||
SetState(CLOSED);
|
||||
break;
|
||||
case DISCONNECTING:
|
||||
//we timed out waiting for them to send us the disconnect reply, just give up.
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L);
|
||||
SetState(CLOSED);
|
||||
break;
|
||||
case CLOSED:
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in closed state??" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Timeout expired in closed state??" __L);
|
||||
break;
|
||||
case ESTABLISHED:
|
||||
//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.
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in established state. Closing connection." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Timeout expired in established state. Closing connection." __L);
|
||||
_SendDisconnect();
|
||||
SetState(DISCONNECTING);
|
||||
break;
|
||||
@ -1342,7 +1342,7 @@ void EQStream::Decay()
|
||||
for (auto sitr = SequencedQueue.begin(); sitr != SequencedQueue.end(); ++sitr, count++) {
|
||||
if (!(*sitr)->acked && (*sitr)->sent_time > 0 && ((*sitr)->sent_time + retransmittimeout) < Timer::GetCurrentTime()) {
|
||||
(*sitr)->sent_time = 0;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout exceeded for seq %d. Flagging packet for retransmission" __L, SequencedBase + count);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Timeout exceeded for seq %d. Flagging packet for retransmission" __L, SequencedBase + count);
|
||||
}
|
||||
}
|
||||
MOutboundQueue.unlock();
|
||||
@ -1359,11 +1359,11 @@ void EQStream::AdjustRates(uint32 average_delta)
|
||||
DecayRate=DECAYBASE/average_delta;
|
||||
if (BytesWritten > RateThreshold)
|
||||
BytesWritten = RateThreshold + DecayRate;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||
RateThreshold, DecayRate, average_delta);
|
||||
MRate.unlock();
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L,
|
||||
average_delta, AVERAGE_DELTA_MAX);
|
||||
AverageDelta = AVERAGE_DELTA_MAX;
|
||||
}
|
||||
@ -1374,7 +1374,7 @@ void EQStream::AdjustRates(uint32 average_delta)
|
||||
BytesWritten = 0;
|
||||
RateThreshold=RATEBASE/average_delta;
|
||||
DecayRate=DECAYBASE/average_delta;
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L,
|
||||
RateThreshold, DecayRate, average_delta);
|
||||
MRate.unlock();
|
||||
}
|
||||
@ -1384,12 +1384,12 @@ void EQStream::AdjustRates(uint32 average_delta)
|
||||
void EQStream::Close() {
|
||||
if(HasOutgoingData()) {
|
||||
//there is pending data, wait for it to go out.
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L);
|
||||
SetState(CLOSING);
|
||||
} else {
|
||||
//otherwise, we are done, we can drop immediately.
|
||||
_SendDisconnect();
|
||||
Log.Out(Logs::Detail, Logs::Netcode, _L "Stream closing immediate due to Close()" __L);
|
||||
Log(Logs::Detail, Logs::Netcode, _L "Stream closing immediate due to Close()" __L);
|
||||
SetState(DISCONNECTING);
|
||||
}
|
||||
}
|
||||
@ -1417,19 +1417,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) {
|
||||
} else if(p->opcode == sig->first_eq_opcode) {
|
||||
//opcode matches, check length..
|
||||
if(p->size == sig->first_length) {
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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;
|
||||
} else if(sig->first_length == 0) {
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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;
|
||||
} else {
|
||||
//opcode matched but length did not.
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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;
|
||||
}
|
||||
} else {
|
||||
//first opcode did not match..
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ void EQStreamIdentifier::Process() {
|
||||
//first see if this stream has expired
|
||||
if(r.expire.Check(false)) {
|
||||
//this stream has failed to match any pattern in our timeframe.
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
||||
r.stream->ReleaseFromUse();
|
||||
cur = m_streams.erase(cur);
|
||||
continue;
|
||||
@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() {
|
||||
}
|
||||
if(r.stream->GetState() != ESTABLISHED) {
|
||||
//the stream closed before it was identified.
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
||||
Log(Logs::General, Logs::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())
|
||||
{
|
||||
case ESTABLISHED:
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Established");
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Established");
|
||||
break;
|
||||
case CLOSING:
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closing");
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closing");
|
||||
break;
|
||||
case DISCONNECTING:
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Disconnecting");
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Disconnecting");
|
||||
break;
|
||||
case CLOSED:
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closed");
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closed");
|
||||
break;
|
||||
default:
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown");
|
||||
break;
|
||||
}
|
||||
r.stream->ReleaseFromUse();
|
||||
@ -108,7 +108,7 @@ void EQStreamIdentifier::Process() {
|
||||
case EQStream::MatchSuccessful: {
|
||||
//yay, a match.
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()), p->name.c_str());
|
||||
Log(Logs::General, Logs::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
|
||||
r.stream->SetActive(true);
|
||||
@ -122,7 +122,7 @@ void EQStreamIdentifier::Process() {
|
||||
}
|
||||
case EQStream::MatchFailed:
|
||||
//do nothing...
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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;
|
||||
}
|
||||
}
|
||||
@ -130,7 +130,7 @@ void EQStreamIdentifier::Process() {
|
||||
//if we checked all patches and did not find a match.
|
||||
if(all_ready && !found_one) {
|
||||
//the stream cannot be identified.
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r.stream->GetRemoteIP()).c_str(), ntohs(r.stream->GetRemotePort()));
|
||||
Log(Logs::General, Logs::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();
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
@ -38,103 +39,108 @@ namespace Logs {
|
||||
NOTE: Only add to the bottom of the enum because that is the type ID assignment
|
||||
*/
|
||||
|
||||
enum LogCategory {
|
||||
None = 0,
|
||||
AA,
|
||||
AI,
|
||||
Aggro,
|
||||
Attack,
|
||||
Client_Server_Packet,
|
||||
Combat,
|
||||
Commands,
|
||||
Crash,
|
||||
Debug,
|
||||
Doors,
|
||||
Error,
|
||||
Guilds,
|
||||
Inventory,
|
||||
Launcher,
|
||||
Netcode,
|
||||
Normal,
|
||||
Object,
|
||||
Pathing,
|
||||
QS_Server,
|
||||
Quests,
|
||||
Rules,
|
||||
Skills,
|
||||
Spawns,
|
||||
Spells,
|
||||
Status,
|
||||
TCP_Connection,
|
||||
Tasks,
|
||||
Tradeskills,
|
||||
Trading,
|
||||
Tribute,
|
||||
UCS_Server,
|
||||
WebInterface_Server,
|
||||
World_Server,
|
||||
Zone_Server,
|
||||
MySQLError,
|
||||
MySQLQuery,
|
||||
Mercenaries,
|
||||
QuestDebug,
|
||||
Server_Client_Packet,
|
||||
Client_Server_Packet_Unhandled,
|
||||
Server_Client_Packet_With_Dump,
|
||||
Client_Server_Packet_With_Dump,
|
||||
Login_Server,
|
||||
Client_Login,
|
||||
MaxCategoryID /* Don't Remove this*/
|
||||
};
|
||||
enum LogCategory {
|
||||
None = 0,
|
||||
AA,
|
||||
AI,
|
||||
Aggro,
|
||||
Attack,
|
||||
Client_Server_Packet,
|
||||
Combat,
|
||||
Commands,
|
||||
Crash,
|
||||
Debug,
|
||||
Doors,
|
||||
Error,
|
||||
Guilds,
|
||||
Inventory,
|
||||
Launcher,
|
||||
Netcode,
|
||||
Normal,
|
||||
Object,
|
||||
Pathing,
|
||||
QS_Server,
|
||||
Quests,
|
||||
Rules,
|
||||
Skills,
|
||||
Spawns,
|
||||
Spells,
|
||||
Status,
|
||||
TCP_Connection,
|
||||
Tasks,
|
||||
Tradeskills,
|
||||
Trading,
|
||||
Tribute,
|
||||
UCS_Server,
|
||||
WebInterface_Server,
|
||||
World_Server,
|
||||
Zone_Server,
|
||||
MySQLError,
|
||||
MySQLQuery,
|
||||
Mercenaries,
|
||||
QuestDebug,
|
||||
Server_Client_Packet,
|
||||
Client_Server_Packet_Unhandled,
|
||||
Server_Client_Packet_With_Dump,
|
||||
Client_Server_Packet_With_Dump,
|
||||
Login_Server,
|
||||
Client_Login,
|
||||
MaxCategoryID /* Don't Remove this*/
|
||||
};
|
||||
|
||||
/* If you add to this, make sure you update LogCategory */
|
||||
static const char* LogCategoryName[LogCategory::MaxCategoryID] = {
|
||||
"",
|
||||
"AA",
|
||||
"AI",
|
||||
"Aggro",
|
||||
"Attack",
|
||||
"Packet :: Client -> Server",
|
||||
"Combat",
|
||||
"Commands",
|
||||
"Crash",
|
||||
"Debug",
|
||||
"Doors",
|
||||
"Error",
|
||||
"Guilds",
|
||||
"Inventory",
|
||||
"Launcher",
|
||||
"Netcode",
|
||||
"Normal",
|
||||
"Object",
|
||||
"Pathing",
|
||||
"QS Server",
|
||||
"Quests",
|
||||
"Rules",
|
||||
"Skills",
|
||||
"Spawns",
|
||||
"Spells",
|
||||
"Status",
|
||||
"TCP Connection",
|
||||
"Tasks",
|
||||
"Tradeskills",
|
||||
"Trading",
|
||||
"Tribute",
|
||||
"UCS Server",
|
||||
"WebInterface Server",
|
||||
"World Server",
|
||||
"Zone Server",
|
||||
"MySQL Error",
|
||||
"MySQL Query",
|
||||
"Mercenaries",
|
||||
"Quest Debug",
|
||||
"Packet :: Server -> Client",
|
||||
"Packet :: Client -> Server Unhandled",
|
||||
"Packet :: Server -> Client (Dump)",
|
||||
"Packet :: Client -> Server (Dump)",
|
||||
"Login Server",
|
||||
"Client Login"
|
||||
};
|
||||
/* If you add to this, make sure you update LogCategory */
|
||||
static const char* LogCategoryName[LogCategory::MaxCategoryID] = {
|
||||
"",
|
||||
"AA",
|
||||
"AI",
|
||||
"Aggro",
|
||||
"Attack",
|
||||
"Packet :: Client -> Server",
|
||||
"Combat",
|
||||
"Commands",
|
||||
"Crash",
|
||||
"Debug",
|
||||
"Doors",
|
||||
"Error",
|
||||
"Guilds",
|
||||
"Inventory",
|
||||
"Launcher",
|
||||
"Netcode",
|
||||
"Normal",
|
||||
"Object",
|
||||
"Pathing",
|
||||
"QS Server",
|
||||
"Quests",
|
||||
"Rules",
|
||||
"Skills",
|
||||
"Spawns",
|
||||
"Spells",
|
||||
"Status",
|
||||
"TCP Connection",
|
||||
"Tasks",
|
||||
"Tradeskills",
|
||||
"Trading",
|
||||
"Tribute",
|
||||
"UCS Server",
|
||||
"WebInterface Server",
|
||||
"World Server",
|
||||
"Zone Server",
|
||||
"MySQL Error",
|
||||
"MySQL Query",
|
||||
"Mercenaries",
|
||||
"Quest Debug",
|
||||
"Packet :: Server -> Client",
|
||||
"Packet :: Client -> Server Unhandled",
|
||||
"Packet :: Server -> Client (Dump)",
|
||||
"Packet :: Client -> Server (Dump)",
|
||||
"Login Server",
|
||||
"Client Login"
|
||||
};
|
||||
}
|
||||
|
||||
#define Log(debug_level, log_category, message, ...){\
|
||||
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
||||
LogSys.Out(debug_level, log_category, message, ##__VA_ARGS__);\
|
||||
}
|
||||
|
||||
class EQEmuLogSys {
|
||||
@ -203,6 +209,6 @@ private:
|
||||
void ProcessLogWrite(uint16 debug_level, uint16 log_category, const std::string &message); /* ProcessLogWrite called via Log.Out */
|
||||
};
|
||||
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
|
||||
#endif
|
||||
|
||||
@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() {
|
||||
ClearGuilds();
|
||||
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to load guilds when we have no database object.");
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to load guilds when we have no database object.");
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -77,13 +77,13 @@ bool BaseGuildManager::LoadGuilds() {
|
||||
uint8 rankn = atoi(row[1]);
|
||||
|
||||
if(rankn > GUILD_MAX_RANK) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ bool BaseGuildManager::LoadGuilds() {
|
||||
|
||||
bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unable to find guild %d in the database.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Unable to find guild %d in the database.", guild_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
uint8 rankn = atoi(row[1]);
|
||||
|
||||
if(rankn > GUILD_MAX_RANK) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
||||
rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Successfully refreshed guild %d from the database.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Successfully refreshed guild %d from the database.", guild_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -214,14 +214,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con
|
||||
|
||||
bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to store guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to store guild %d when we have no database object.", guild_id);
|
||||
return(false);
|
||||
}
|
||||
|
||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to store non-existent guild %d", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to store non-existent guild %d", guild_id);
|
||||
return(false);
|
||||
}
|
||||
GuildInfo *info = res->second;
|
||||
@ -289,14 +289,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
||||
safe_delete_array(title_esc);
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Stored guild %d in the database", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Stored guild %d in the database", guild_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 BaseGuildManager::_GetFreeGuildID() {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested find a free guild ID when we have no database object.");
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested find a free guild ID when we have no database object.");
|
||||
return(GUILD_NONE);
|
||||
}
|
||||
|
||||
@ -330,12 +330,12 @@ uint32 BaseGuildManager::_GetFreeGuildID() {
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Located free guild ID %d in the database", index);
|
||||
Log(Logs::Detail, Logs::Guilds, "Located free guild ID %d in the database", index);
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unable to find a free guild ID when requested.");
|
||||
Log(Logs::Detail, Logs::Guilds, "Unable to find a free guild ID when requested.");
|
||||
return GUILD_NONE;
|
||||
}
|
||||
|
||||
@ -505,11 +505,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) {
|
||||
|
||||
//now store the resulting guild setup into the DB.
|
||||
if(!_StoreGuildDB(new_id)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Error storing new guild. It may have been partially created which may need manual removal.");
|
||||
Log(Logs::Detail, Logs::Guilds, "Error storing new guild. It may have been partially created which may need manual removal.");
|
||||
return(GUILD_NONE);
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Created guild %d in the database.", new_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Created guild %d in the database.", new_id);
|
||||
|
||||
return(new_id);
|
||||
}
|
||||
@ -525,7 +525,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
|
||||
}
|
||||
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to delete guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to delete guild %d when we have no database object.", guild_id);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -545,14 +545,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) {
|
||||
query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id);
|
||||
QueryWithLogging(query, "deleting guild bank");
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Deleted guild %d from the database.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Deleted guild %d from the database.", guild_id);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to rename guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to rename guild %d when we have no database object.", guild_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -573,13 +573,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
||||
|
||||
if (!results.Success())
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success());
|
||||
Log(Logs::Detail, Logs::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success());
|
||||
safe_delete_array(esc);
|
||||
return false;
|
||||
}
|
||||
safe_delete_array(esc);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name);
|
||||
Log(Logs::Detail, Logs::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name);
|
||||
|
||||
info->name = name; //update our local record.
|
||||
|
||||
@ -588,7 +588,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) {
|
||||
|
||||
bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -614,7 +614,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
||||
if(!DBSetGuildRank(leader, GUILD_LEADER))
|
||||
return false;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader);
|
||||
Log(Logs::Detail, Logs::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader);
|
||||
|
||||
info->leader_char_id = leader; //update our local record.
|
||||
|
||||
@ -623,7 +623,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) {
|
||||
|
||||
bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c
|
||||
safe_delete_array(esc);
|
||||
safe_delete_array(esc_set);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Set MOTD for guild %d in the database", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Set MOTD for guild %d in the database", guild_id);
|
||||
|
||||
info->motd = motd; //update our local record.
|
||||
info->motd_setter = setter; //update our local record.
|
||||
@ -688,7 +688,7 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL)
|
||||
}
|
||||
safe_delete_array(esc);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Set URL for guild %d in the database", GuildID);
|
||||
Log(Logs::Detail, Logs::Guilds, "Set URL for guild %d in the database", GuildID);
|
||||
|
||||
info->url = URL; //update our local record.
|
||||
|
||||
@ -722,7 +722,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
|
||||
}
|
||||
safe_delete_array(esc);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Set Channel for guild %d in the database", GuildID);
|
||||
Log(Logs::Detail, Logs::Guilds, "Set Channel for guild %d in the database", GuildID);
|
||||
|
||||
info->channel = Channel; //update our local record.
|
||||
|
||||
@ -731,7 +731,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel)
|
||||
|
||||
bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank);
|
||||
Log(Logs::Detail, Logs::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -845,7 +845,7 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Set public not for char %d", charid);
|
||||
Log(Logs::Detail, Logs::Guilds, "Set public not for char %d", charid);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -924,14 +924,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vector<CharGuildInfo
|
||||
members.push_back(ci);
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Retreived entire guild member list for guild %d from the database", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Retreived entire guild member list for guild %d from the database", guild_id);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested char info on %s when we have no database object.", char_name);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested char info on %s when we have no database object.", char_name);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -953,7 +953,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
||||
|
||||
auto row = results.begin();
|
||||
ProcessGuildMember(row, into);
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %s from the database", char_name);
|
||||
Log(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %s from the database", char_name);
|
||||
|
||||
return true;
|
||||
|
||||
@ -962,7 +962,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) {
|
||||
|
||||
bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
||||
if(m_db == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Requested char info on %d when we have no database object.", char_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Requested char info on %d when we have no database object.", char_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -983,7 +983,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) {
|
||||
|
||||
auto row = results.begin();
|
||||
ProcessGuildMember(row, into);
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %d", char_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %d", char_id);
|
||||
|
||||
return true;
|
||||
|
||||
@ -1098,16 +1098,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const {
|
||||
|
||||
bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const {
|
||||
if(guild_id == GUILD_NONE) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check leader for char %d: not a guild.", char_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Check leader for char %d: not a guild.", char_id);
|
||||
return(false);
|
||||
}
|
||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check leader for char %d: invalid guild.", char_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Check leader for char %d: invalid guild.", char_id);
|
||||
return(false); //invalid guild
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id);
|
||||
Log(Logs::Detail, Logs::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);
|
||||
}
|
||||
|
||||
@ -1137,20 +1137,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha
|
||||
|
||||
bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
|
||||
if(status >= 250) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status);
|
||||
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status);
|
||||
return(true); //250+ as allowed anything
|
||||
}
|
||||
|
||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status);
|
||||
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status);
|
||||
return(false); //invalid guild
|
||||
}
|
||||
|
||||
bool granted = (res->second->minstatus <= status);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s",
|
||||
Log(Logs::Detail, Logs::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");
|
||||
|
||||
return(granted);
|
||||
@ -1158,21 +1158,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const {
|
||||
|
||||
bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const {
|
||||
if(rank > GUILD_MAX_RANK) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.",
|
||||
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.",
|
||||
guild_id, rank, GuildActionNames[act], act);
|
||||
return(false); //invalid rank
|
||||
}
|
||||
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||
res = m_guilds.find(guild_id);
|
||||
if(res == m_guilds.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.",
|
||||
Log(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.",
|
||||
guild_id, rank, GuildActionNames[act], act);
|
||||
return(false); //invalid guild
|
||||
}
|
||||
|
||||
bool granted = res->second->ranks[rank].permissions[act];
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s",
|
||||
Log(Logs::Detail, Logs::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->ranks[rank].name.c_str(), rank,
|
||||
GuildActionNames[act], act,
|
||||
|
||||
@ -1173,7 +1173,7 @@ int16 EQEmu::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
}
|
||||
|
||||
if (result == INVALID_INDEX) {
|
||||
Log.Out(Logs::General, Logs::Error, "InventoryProfile::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
|
||||
Log(Logs::General, Logs::Error, "InventoryProfile::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot);
|
||||
InventoryProfile::MarkDirty(inst); // Slot not found, clean up
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
#define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \
|
||||
if(Packet->size != sizeof(StructName)) \
|
||||
{ \
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \
|
||||
Log(Logs::Detail, Logs::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \
|
||||
DumpPacket(Packet); \
|
||||
return; \
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ namespace RoF
|
||||
//TODO: figure out how to support shared memory with multiple patches...
|
||||
opcodes = new RegularOpcodeManager();
|
||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ namespace RoF
|
||||
signature.first_length = sizeof(structs::ClientZoneEntry_Struct);
|
||||
signature.first_eq_opcode = opcodes->EmuToEQ(OP_ZoneEntry);
|
||||
into.RegisterPatch(signature, pname.c_str(), &opcodes, &struct_strategy);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
}
|
||||
|
||||
void Reload()
|
||||
@ -123,10 +123,10 @@ namespace RoF
|
||||
opfile += name;
|
||||
opfile += ".conf";
|
||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ namespace RoF
|
||||
|
||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -569,7 +569,7 @@ namespace RoF
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
@ -586,7 +586,7 @@ namespace RoF
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -1512,7 +1512,7 @@ namespace RoF
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
if (ob.tellp() == last_pos) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2690,7 +2690,7 @@ namespace RoF
|
||||
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||
|
||||
auto NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
||||
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
||||
@ -3550,7 +3550,7 @@ namespace RoF
|
||||
|
||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -3898,7 +3898,7 @@ namespace RoF
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -4146,7 +4146,7 @@ namespace RoF
|
||||
Buffer += 29;
|
||||
if (Buffer != (BufferStart + PacketSize))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
||||
}
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size);
|
||||
//Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size);
|
||||
@ -4715,7 +4715,7 @@ namespace RoF
|
||||
return;
|
||||
}
|
||||
default:
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Unhandled OP_GuildBank action");
|
||||
Log(Logs::Detail, Logs::Netcode, "Unhandled OP_GuildBank action");
|
||||
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */
|
||||
return;
|
||||
}
|
||||
@ -4861,7 +4861,7 @@ namespace RoF
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[RoF] 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.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
Log(Logs::General, Logs::Netcode, "[RoF] 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.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
emu->from_slot = RoFToServerSlot(eq->from_slot);
|
||||
emu->to_slot = RoFToServerSlot(eq->to_slot);
|
||||
IN(number_in_stack);
|
||||
@ -5721,7 +5721,7 @@ namespace RoF
|
||||
RoFSlot.Slot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Type, RoFSlot.Unknown02, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
|
||||
|
||||
return RoFSlot;
|
||||
}
|
||||
@ -5762,7 +5762,7 @@ namespace RoF
|
||||
RoFSlot.SubIndex = TempSlot - ((RoFSlot.Slot + 2) * EQEmu::inventory::ContainerCount);
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoFSlot.Slot, RoFSlot.SubIndex, RoFSlot.AugIndex, RoFSlot.Unknown01);
|
||||
|
||||
return RoFSlot;
|
||||
}
|
||||
@ -5867,7 +5867,7 @@ namespace RoF
|
||||
ServerSlot = INVALID_INDEX;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Type, rofSlot.Unknown02, rofSlot.Slot, rofSlot.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
@ -5902,7 +5902,7 @@ namespace RoF
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Slot, rofSlot.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rofSlot.Slot, rofSlot.SubIndex, rofSlot.AugIndex, rofSlot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ namespace RoF2
|
||||
//TODO: figure out how to support shared memory with multiple patches...
|
||||
opcodes = new RegularOpcodeManager();
|
||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ namespace RoF2
|
||||
|
||||
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
}
|
||||
|
||||
void Reload()
|
||||
@ -126,10 +126,10 @@ namespace RoF2
|
||||
opfile += name;
|
||||
opfile += ".conf";
|
||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -416,7 +416,7 @@ namespace RoF2
|
||||
|
||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -637,7 +637,7 @@ namespace RoF2
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
@ -654,7 +654,7 @@ namespace RoF2
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0, ItemPacketCharInventory);
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -1581,7 +1581,7 @@ namespace RoF2
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType);
|
||||
if (ob.tellp() == last_pos) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2779,7 +2779,7 @@ namespace RoF2
|
||||
// Think we need 1 byte of padding at the end
|
||||
outapp->WriteUInt8(0); // Unknown
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition());
|
||||
|
||||
auto NewBuffer = new unsigned char[outapp->GetWritePosition()];
|
||||
memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition());
|
||||
@ -3620,7 +3620,7 @@ namespace RoF2
|
||||
|
||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -3730,7 +3730,7 @@ namespace RoF2
|
||||
|
||||
OUT(TraderID);
|
||||
snprintf(eq->SerialNumber, sizeof(eq->SerialNumber), "%016d", emu->ItemID);
|
||||
Log.Out(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderDelItem): TraderID %d, SerialNumber: %d", emu->TraderID, emu->ItemID);
|
||||
Log(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderDelItem): TraderID %d, SerialNumber: %d", emu->TraderID, emu->ItemID);
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
@ -3761,7 +3761,7 @@ namespace RoF2
|
||||
eq->Traders2 = emu->Traders;
|
||||
eq->Items2 = emu->Items;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderShop): BazaarWelcome_Struct Code %d, Traders %d, Items %d",
|
||||
Log(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderShop): BazaarWelcome_Struct Code %d, Traders %d, Items %d",
|
||||
eq->Code, eq->Traders, eq->Items);
|
||||
|
||||
FINISH_ENCODE();
|
||||
@ -3784,14 +3784,14 @@ namespace RoF2
|
||||
OUT(Quantity);
|
||||
snprintf(eq->SerialNumber, sizeof(eq->SerialNumber), "%016d", emu->ItemID);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderShop): Buy Action %d, Price %d, Trader %d, ItemID %d, Quantity %d, ItemName, %s",
|
||||
Log(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderShop): Buy Action %d, Price %d, Trader %d, ItemID %d, Quantity %d, ItemName, %s",
|
||||
eq->Action, eq->Price, eq->TraderID, eq->ItemID, eq->Quantity, emu->ItemName);
|
||||
|
||||
FINISH_ENCODE();
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderShop): Encode Size Unknown (%d)", psize);
|
||||
Log(Logs::Detail, Logs::Trading, "ENCODE(OP_TraderShop): Encode Size Unknown (%d)", psize);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4043,7 +4043,7 @@ namespace RoF2
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -4364,7 +4364,7 @@ namespace RoF2
|
||||
Buffer += 29;
|
||||
if (Buffer != (BufferStart + PacketSize))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize));
|
||||
}
|
||||
//Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size);
|
||||
//Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size);
|
||||
@ -4945,7 +4945,7 @@ namespace RoF2
|
||||
return;
|
||||
}
|
||||
default:
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Unhandled OP_GuildBank action");
|
||||
Log(Logs::Detail, Logs::Netcode, "Unhandled OP_GuildBank action");
|
||||
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */
|
||||
return;
|
||||
}
|
||||
@ -5090,7 +5090,7 @@ namespace RoF2
|
||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[RoF2] 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.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
Log(Logs::General, Logs::Netcode, "[RoF2] 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.Type, eq->to_slot.Type, eq->from_slot.Slot, eq->to_slot.Slot, eq->from_slot.SubIndex, eq->to_slot.SubIndex, eq->from_slot.AugIndex, eq->to_slot.AugIndex, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack);
|
||||
emu->from_slot = RoF2ToServerSlot(eq->from_slot);
|
||||
emu->to_slot = RoF2ToServerSlot(eq->to_slot);
|
||||
IN(number_in_stack);
|
||||
@ -5326,7 +5326,7 @@ namespace RoF2
|
||||
IN(Code);
|
||||
IN(TraderID);
|
||||
IN(Approval);
|
||||
Log.Out(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): TraderClick_Struct Code %d, TraderID %d, Approval %d",
|
||||
Log(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): TraderClick_Struct Code %d, TraderID %d, Approval %d",
|
||||
eq->Code, eq->TraderID, eq->Approval);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@ -5340,7 +5340,7 @@ namespace RoF2
|
||||
emu->Beginning.Action = eq->Code;
|
||||
IN(Traders);
|
||||
IN(Items);
|
||||
Log.Out(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): BazaarWelcome_Struct Code %d, Traders %d, Items %d",
|
||||
Log(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): BazaarWelcome_Struct Code %d, Traders %d, Items %d",
|
||||
eq->Code, eq->Traders, eq->Items);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
@ -5357,20 +5357,20 @@ namespace RoF2
|
||||
memcpy(emu->ItemName, eq->ItemName, sizeof(emu->ItemName));
|
||||
IN(ItemID);
|
||||
IN(Quantity);
|
||||
Log.Out(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): TraderBuy_Struct (Unknowns) Unknown004 %d, Unknown008 %d, Unknown012 %d, Unknown076 %d, Unknown276 %d",
|
||||
Log(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): TraderBuy_Struct (Unknowns) Unknown004 %d, Unknown008 %d, Unknown012 %d, Unknown076 %d, Unknown276 %d",
|
||||
eq->Unknown004, eq->Unknown008, eq->Unknown012, eq->Unknown076, eq->Unknown276);
|
||||
Log.Out(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): TraderBuy_Struct Buy Action %d, Price %d, Trader %d, ItemID %d, Quantity %d, ItemName, %s",
|
||||
Log(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): TraderBuy_Struct Buy Action %d, Price %d, Trader %d, ItemID %d, Quantity %d, ItemName, %s",
|
||||
eq->Action, eq->Price, eq->TraderID, eq->ItemID, eq->Quantity, eq->ItemName);
|
||||
|
||||
FINISH_DIRECT_DECODE();
|
||||
}
|
||||
else if (psize == 4)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): Forwarding packet as-is with size 4");
|
||||
Log(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): Forwarding packet as-is with size 4");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): Decode Size Unknown (%d)", psize);
|
||||
Log(Logs::Detail, Logs::Trading, "DECODE(OP_TraderShop): Decode Size Unknown (%d)", psize);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6024,7 +6024,7 @@ namespace RoF2
|
||||
RoF2Slot.Slot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Type, RoF2Slot.Unknown02, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
|
||||
|
||||
return RoF2Slot;
|
||||
}
|
||||
@ -6065,7 +6065,7 @@ namespace RoF2
|
||||
RoF2Slot.SubIndex = TempSlot - ((RoF2Slot.Slot + 2) * EQEmu::inventory::ContainerCount);
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", serverSlot, RoF2Slot.Slot, RoF2Slot.SubIndex, RoF2Slot.AugIndex, RoF2Slot.Unknown01);
|
||||
|
||||
return RoF2Slot;
|
||||
}
|
||||
@ -6174,7 +6174,7 @@ namespace RoF2
|
||||
ServerSlot = rof2Slot.Slot + EQEmu::legacy::CORPSE_BEGIN;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Type, rof2Slot.Unknown02, rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
@ -6209,7 +6209,7 @@ namespace RoF2
|
||||
ServerSlot = TempSlot;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
|
||||
Log(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", rof2Slot.Slot, rof2Slot.SubIndex, rof2Slot.AugIndex, rof2Slot.Unknown01, ServerSlot);
|
||||
|
||||
return ServerSlot;
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ namespace SoD
|
||||
//TODO: figure out how to support shared memory with multiple patches...
|
||||
opcodes = new RegularOpcodeManager();
|
||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ namespace SoD
|
||||
|
||||
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
}
|
||||
|
||||
void Reload()
|
||||
@ -122,10 +122,10 @@ namespace SoD
|
||||
opfile += name;
|
||||
opfile += ".conf";
|
||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ namespace SoD
|
||||
|
||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -384,7 +384,7 @@ namespace SoD
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
@ -401,7 +401,7 @@ namespace SoD
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -1065,7 +1065,7 @@ namespace SoD
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
if (ob.tellp() == last_pos) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2285,7 +2285,7 @@ namespace SoD
|
||||
|
||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2522,7 +2522,7 @@ namespace SoD
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -3275,7 +3275,7 @@ namespace SoD
|
||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[SoD] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
Log(Logs::General, Logs::Netcode, "[SoD] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
|
||||
emu->from_slot = SoDToServerSlot(eq->from_slot);
|
||||
emu->to_slot = SoDToServerSlot(eq->to_slot);
|
||||
|
||||
@ -79,7 +79,7 @@ namespace SoF
|
||||
//TODO: figure out how to support shared memory with multiple patches...
|
||||
opcodes = new RegularOpcodeManager();
|
||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ namespace SoF
|
||||
|
||||
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
}
|
||||
|
||||
void Reload()
|
||||
@ -122,10 +122,10 @@ namespace SoF
|
||||
opfile += name;
|
||||
opfile += ".conf";
|
||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ namespace SoF
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
delete in;
|
||||
return;
|
||||
@ -366,7 +366,7 @@ namespace SoF
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
@ -383,7 +383,7 @@ namespace SoF
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -862,7 +862,7 @@ namespace SoF
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
if (ob.tellp() == last_pos) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -1916,7 +1916,7 @@ namespace SoF
|
||||
|
||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2078,7 +2078,7 @@ namespace SoF
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2659,7 +2659,7 @@ namespace SoF
|
||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[SoF] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
Log(Logs::General, Logs::Netcode, "[SoF] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
|
||||
emu->from_slot = SoFToServerSlot(eq->from_slot);
|
||||
emu->to_slot = SoFToServerSlot(eq->to_slot);
|
||||
|
||||
@ -87,14 +87,14 @@
|
||||
//check length of packet before decoding. Call before setup.
|
||||
#define ENCODE_LENGTH_EXACT(struct_) \
|
||||
if((*p)->size != sizeof(struct_)) { \
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
||||
Log(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
||||
delete *p; \
|
||||
*p = nullptr; \
|
||||
return; \
|
||||
}
|
||||
#define ENCODE_LENGTH_ATLEAST(struct_) \
|
||||
if((*p)->size < sizeof(struct_)) { \
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
||||
Log(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \
|
||||
delete *p; \
|
||||
*p = nullptr; \
|
||||
return; \
|
||||
@ -153,13 +153,13 @@
|
||||
//check length of packet before decoding. Call before setup.
|
||||
#define DECODE_LENGTH_EXACT(struct_) \
|
||||
if(__packet->size != sizeof(struct_)) { \
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
||||
Log(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
||||
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \
|
||||
return; \
|
||||
}
|
||||
#define DECODE_LENGTH_ATLEAST(struct_) \
|
||||
if(__packet->size < sizeof(struct_)) { \
|
||||
Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
||||
Log(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \
|
||||
__packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \
|
||||
return; \
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ namespace Titanium
|
||||
//TODO: figure out how to support shared memory with multiple patches...
|
||||
opcodes = new RegularOpcodeManager();
|
||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ namespace Titanium
|
||||
|
||||
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
}
|
||||
|
||||
void Reload()
|
||||
@ -121,10 +121,10 @@ namespace Titanium
|
||||
opfile += name;
|
||||
opfile += ".conf";
|
||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ namespace Titanium
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(BazaarSearchResults_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
delete in;
|
||||
return;
|
||||
@ -319,7 +319,7 @@ namespace Titanium
|
||||
|
||||
int itemcount = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (itemcount == 0 || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
delete in;
|
||||
return;
|
||||
@ -334,7 +334,7 @@ namespace Titanium
|
||||
for (int r = 0; r < itemcount; r++, eq++) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -820,7 +820,7 @@ namespace Titanium
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
if (ob.tellp() == last_pos) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -1492,7 +1492,7 @@ namespace Titanium
|
||||
|
||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -1610,7 +1610,7 @@ namespace Titanium
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2014,7 +2014,7 @@ namespace Titanium
|
||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[Titanium] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
Log(Logs::General, Logs::Netcode, "[Titanium] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
|
||||
emu->from_slot = TitaniumToServerSlot(eq->from_slot);
|
||||
emu->to_slot = TitaniumToServerSlot(eq->to_slot);
|
||||
|
||||
@ -79,7 +79,7 @@ namespace UF
|
||||
//TODO: figure out how to support shared memory with multiple patches...
|
||||
opcodes = new RegularOpcodeManager();
|
||||
if (!opcodes->LoadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ namespace UF
|
||||
|
||||
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name);
|
||||
}
|
||||
|
||||
void Reload()
|
||||
@ -122,10 +122,10 @@ namespace UF
|
||||
opfile += name;
|
||||
opfile += ".conf";
|
||||
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name);
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
Log(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ namespace UF
|
||||
|
||||
if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -512,7 +512,7 @@ namespace UF
|
||||
|
||||
int item_count = in->size / sizeof(EQEmu::InternalSerializedItem_Struct);
|
||||
if (!item_count || (in->size % sizeof(EQEmu::InternalSerializedItem_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d",
|
||||
opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(EQEmu::InternalSerializedItem_Struct));
|
||||
|
||||
delete in;
|
||||
@ -529,7 +529,7 @@ namespace UF
|
||||
for (int index = 0; index < item_count; ++index, ++eq) {
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)eq->inst, eq->slot_id, 0);
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -1281,7 +1281,7 @@ namespace UF
|
||||
|
||||
SerializeItem(ob, (const EQEmu::ItemInstance*)int_struct->inst, int_struct->slot_id, 0);
|
||||
if (ob.tellp() == last_pos) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id);
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2572,7 +2572,7 @@ namespace UF
|
||||
|
||||
if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -2804,7 +2804,7 @@ namespace UF
|
||||
//determine and verify length
|
||||
int entrycount = in->size / sizeof(Spawn_Struct);
|
||||
if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct));
|
||||
delete in;
|
||||
return;
|
||||
}
|
||||
@ -3624,7 +3624,7 @@ namespace UF
|
||||
DECODE_LENGTH_EXACT(structs::MoveItem_Struct);
|
||||
SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct);
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[UF] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
Log(Logs::General, Logs::Netcode, "[UF] Moved item from %u to %u", eq->from_slot, eq->to_slot);
|
||||
|
||||
emu->from_slot = UFToServerSlot(eq->from_slot);
|
||||
emu->to_slot = UFToServerSlot(eq->to_slot);
|
||||
|
||||
@ -134,7 +134,7 @@ bool PersistentTimer::Load(Database *db) {
|
||||
(unsigned long)_char_id, _type);
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ bool PersistentTimer::Store(Database *db) {
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
#if EQDEBUG > 5
|
||||
Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@ -186,7 +186,7 @@ bool PersistentTimer::Clear(Database *db) {
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
#if EQDEBUG > 5
|
||||
Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@ -198,7 +198,7 @@ bool PersistentTimer::Clear(Database *db) {
|
||||
/* This function checks if the timer triggered */
|
||||
bool PersistentTimer::Expired(Database *db, bool iReset) {
|
||||
if (this == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Null timer during ->Check()!?\n");
|
||||
Log(Logs::General, Logs::Error, "Null timer during ->Check()!?\n");
|
||||
return(true);
|
||||
}
|
||||
uint32 current_time = get_current_time();
|
||||
@ -290,7 +290,7 @@ bool PTimerList::Load(Database *db) {
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
#if EQDEBUG > 5
|
||||
Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@ -349,7 +349,7 @@ bool PTimerList::Clear(Database *db) {
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
#if EQDEBUG > 5
|
||||
Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@ -441,7 +441,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) {
|
||||
auto results = db->QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
#if EQDEBUG > 5
|
||||
Log.Out(Logs::General, Logs::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str());
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ bool RuleManager::ListRules(const char *catname, std::vector<const char *> &into
|
||||
if (catname != nullptr) {
|
||||
cat = FindCategory(catname);
|
||||
if (cat == InvalidCategory) {
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Unable to find category '%s'", catname);
|
||||
Log(Logs::Detail, Logs::Rules, "Unable to find category '%s'", catname);
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
@ -138,11 +138,11 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas
|
||||
switch(type) {
|
||||
case IntRule:
|
||||
m_RuleIntValues[index] = atoi(rule_value);
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]);
|
||||
Log(Logs::Detail, Logs::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]);
|
||||
break;
|
||||
case RealRule:
|
||||
m_RuleRealValues[index] = atof(rule_value);
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]);
|
||||
Log(Logs::Detail, Logs::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]);
|
||||
break;
|
||||
case BoolRule:
|
||||
uint32 val = 0;
|
||||
@ -150,7 +150,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas
|
||||
val = 1;
|
||||
|
||||
m_RuleBoolValues[index] = val;
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ? "true" : "false");
|
||||
Log(Logs::Detail, Logs::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ? "true" : "false");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas
|
||||
}
|
||||
|
||||
void RuleManager::ResetRules() {
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Resetting running rules to default values");
|
||||
Log(Logs::Detail, Logs::Rules, "Resetting running rules to default values");
|
||||
#define RULE_INT(cat, rule, default_value) \
|
||||
m_RuleIntValues[ Int__##rule ] = default_value;
|
||||
#define RULE_REAL(cat, rule, default_value) \
|
||||
@ -185,7 +185,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 &
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Unable to find rule '%s'", rule_name);
|
||||
Log(Logs::Detail, Logs::Rules, "Unable to find rule '%s'", rule_name);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -212,15 +212,15 @@ void RuleManager::SaveRules(Database *database, const char *ruleset_name) {
|
||||
|
||||
m_activeRuleset = _FindOrCreateRuleset(database, ruleset_name);
|
||||
if (m_activeRuleset == -1) {
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Unable to find or create rule set %s", ruleset_name);
|
||||
Log(Logs::Detail, Logs::Rules, "Unable to find or create rule set %s", ruleset_name);
|
||||
return;
|
||||
}
|
||||
m_activeName = ruleset_name;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Saving running rules into rule set %s (%d)", ruleset_name, m_activeRuleset);
|
||||
Log(Logs::Detail, Logs::Rules, "Saving running rules into rule set %s (%d)", ruleset_name, m_activeRuleset);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset);
|
||||
Log(Logs::Detail, Logs::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset);
|
||||
}
|
||||
|
||||
int i;
|
||||
@ -239,11 +239,11 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name) {
|
||||
|
||||
int ruleset_id = GetRulesetID(database, ruleset_name);
|
||||
if (ruleset_id < 0) {
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset_name);
|
||||
Log(Logs::Detail, Logs::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset_name);
|
||||
return(false);
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", ruleset_name, ruleset_id);
|
||||
Log(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", ruleset_name, ruleset_id);
|
||||
|
||||
m_activeRuleset = ruleset_id;
|
||||
m_activeName = ruleset_name;
|
||||
@ -253,10 +253,10 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name) {
|
||||
std::string default_ruleset_name = "default";
|
||||
int default_ruleset_id = GetRulesetID(database, default_ruleset_name.c_str());
|
||||
if (default_ruleset_id < 0) {
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Failed to find default ruleset '%s' for load operation. Canceling.", default_ruleset_name.c_str());
|
||||
Log(Logs::Detail, Logs::Rules, "Failed to find default ruleset '%s' for load operation. Canceling.", default_ruleset_name.c_str());
|
||||
return(false);
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", default_ruleset_name.c_str(), default_ruleset_id);
|
||||
Log(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", default_ruleset_name.c_str(), default_ruleset_id);
|
||||
|
||||
std::string query = StringFormat("SELECT rule_name, rule_value FROM rule_values WHERE ruleset_id = %d", default_ruleset_id);
|
||||
auto results = database->QueryDatabase(query);
|
||||
@ -265,7 +265,7 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name) {
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
if (!SetRule(row[0], row[1], nullptr, false))
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]);
|
||||
Log(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]);
|
||||
}
|
||||
|
||||
std::string query = StringFormat("SELECT rule_name, rule_value FROM rule_values WHERE ruleset_id=%d", ruleset_id);
|
||||
@ -275,7 +275,7 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name) {
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
if (!SetRule(row[0], row[1], nullptr, false))
|
||||
Log.Out(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]);
|
||||
Log(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -98,10 +98,10 @@ std::string EQEmu::SayLinkEngine::GenerateLink()
|
||||
if ((m_Link.length() == 0) || (m_Link.length() > 250)) {
|
||||
m_Error = true;
|
||||
m_Link = "<LINKER ERROR>";
|
||||
Log.Out(Logs::General, Logs::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})",
|
||||
Log(Logs::General, Logs::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());
|
||||
Log.Out(Logs::General, Logs::Error, ">> LinkBody: %s", m_LinkBody.c_str());
|
||||
Log.Out(Logs::General, Logs::Error, ">> LinkText: %s", m_LinkText.c_str());
|
||||
Log(Logs::General, Logs::Error, ">> LinkBody: %s", m_LinkBody.c_str());
|
||||
Log(Logs::General, Logs::Error, ">> LinkText: %s", m_LinkText.c_str());
|
||||
}
|
||||
|
||||
return m_Link;
|
||||
|
||||
@ -429,7 +429,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
||||
id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Database::GetSharedBank(uint32 account_id): %s",
|
||||
Log(Logs::General, Logs::Error, "Database::GetSharedBank(uint32 account_id): %s",
|
||||
results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
@ -450,7 +450,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
||||
const EQEmu::ItemData *item = GetItem(item_id);
|
||||
|
||||
if (!item) {
|
||||
Log.Out(Logs::General, Logs::Error,
|
||||
Log(Logs::General, Logs::Error,
|
||||
"Warning: %s %i has an invalid item_id %i in inventory slot %i",
|
||||
((is_charid == true) ? "charid" : "acctid"), id, item_id, slot_id);
|
||||
continue;
|
||||
@ -499,7 +499,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, EQEmu::InventoryProfile *inv, bool
|
||||
if (put_slot_id != INVALID_INDEX)
|
||||
continue;
|
||||
|
||||
Log.Out(Logs::General, Logs::Error,
|
||||
Log(Logs::General, Logs::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);
|
||||
|
||||
@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "If you got an error related to the 'instnodrop' field, run the "
|
||||
Log(Logs::General, Logs::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;
|
||||
@ -553,7 +553,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
const EQEmu::ItemData *item = GetItem(item_id);
|
||||
|
||||
if (!item) {
|
||||
Log.Out(Logs::General, Logs::Error,
|
||||
Log(Logs::General, Logs::Error,
|
||||
"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id,
|
||||
slot_id);
|
||||
continue;
|
||||
@ -630,7 +630,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
put_slot_id = inv->PushCursor(*inst);
|
||||
} else if (slot_id >= 3111 && slot_id <= 3179) {
|
||||
// Admins: please report any occurrences of this error
|
||||
Log.Out(Logs::General, Logs::Error, "Warning: Defunct location for item in inventory: "
|
||||
Log(Logs::General, Logs::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);
|
||||
@ -642,7 +642,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQEmu::InventoryProfile *inv)
|
||||
|
||||
// Save ptr to item in inventory
|
||||
if (put_slot_id == INVALID_INDEX) {
|
||||
Log.Out(Logs::General, Logs::Error,
|
||||
Log(Logs::General, Logs::Error,
|
||||
"Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",
|
||||
char_id, item_id, slot_id);
|
||||
}
|
||||
@ -665,7 +665,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
||||
name, account_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "If you got an error related to the 'instnodrop' field, run the "
|
||||
Log(Logs::General, Logs::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;
|
||||
@ -753,7 +753,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char *name, EQEmu::Inventor
|
||||
|
||||
// Save ptr to item in inventory
|
||||
if (put_slot_id == INVALID_INDEX)
|
||||
Log.Out(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in inventory: name=%s, "
|
||||
Log(Logs::General, Logs::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);
|
||||
}
|
||||
@ -830,7 +830,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
|
||||
items_hash = std::unique_ptr<EQEmu::FixedMemoryHashSet<EQEmu::ItemData>>(new EQEmu::FixedMemoryHashSet<EQEmu::ItemData>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size()));
|
||||
mutex.Unlock();
|
||||
} catch(std::exception& ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1091,7 +1091,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
try {
|
||||
hash.insert(item.ID, item);
|
||||
} catch (std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Database::LoadItems: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Database::LoadItems: %s", ex.what());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1150,7 +1150,7 @@ std::string SharedDatabase::GetBook(const char *txtfile, int16 *language)
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "No book to send, (%s)", txtfile);
|
||||
Log(Logs::General, Logs::Error, "No book to send, (%s)", txtfile);
|
||||
txtout.assign(" ",1);
|
||||
return txtout;
|
||||
}
|
||||
@ -1255,7 +1255,7 @@ bool SharedDatabase::LoadNPCFactionLists(const std::string &prefix) {
|
||||
faction_hash = std::unique_ptr<EQEmu::FixedMemoryHashSet<NPCFactionList>>(new EQEmu::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), faction_mmf->Size()));
|
||||
mutex.Unlock();
|
||||
} catch(std::exception& ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading npc factions: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Error Loading npc factions: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1273,8 +1273,8 @@ EQEmu::ItemInstance* SharedDatabase::CreateItem(uint32 item_id, int16 charges, u
|
||||
inst = CreateBaseItem(item, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||
Log.Out(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
Log(Logs::General, Logs::Error, "Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||
Log(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1299,8 +1299,8 @@ EQEmu::ItemInstance* SharedDatabase::CreateItem(const EQEmu::ItemData* item, int
|
||||
inst = CreateBaseItem(item, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||
Log.Out(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
Log(Logs::General, Logs::Error, "Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateItem()");
|
||||
Log(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1330,8 +1330,8 @@ EQEmu::ItemInstance* SharedDatabase::CreateBaseItem(const EQEmu::ItemData* item,
|
||||
inst = new EQEmu::ItemInstance(item, charges);
|
||||
|
||||
if (inst == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateBaseItem()");
|
||||
Log.Out(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
Log(Logs::General, Logs::Error, "Error: valid item data returned a null reference for EQEmu::ItemInstance creation in SharedDatabase::CreateBaseItem()");
|
||||
Log(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -1406,7 +1406,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
|
||||
skill_caps_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
||||
mutex.Unlock();
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error loading skill caps: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Error loading skill caps: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1422,7 +1422,7 @@ void SharedDatabase::LoadSkillCaps(void *data) {
|
||||
const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1566,7 +1566,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
|
||||
mutex.Unlock();
|
||||
}
|
||||
catch(std::exception& ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading Spells: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Error Loading Spells: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -1583,7 +1583,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
}
|
||||
|
||||
if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT);
|
||||
Log(Logs::Detail, Logs::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1593,7 +1593,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) {
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
tempid = atoi(row[0]);
|
||||
if(tempid >= max_spells) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Non fatal error: spell.id >= max_spells, ignoring.");
|
||||
Log(Logs::Detail, Logs::Spells, "Non fatal error: spell.id >= max_spells, ignoring.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1769,7 +1769,7 @@ bool SharedDatabase::LoadBaseData(const std::string &prefix) {
|
||||
base_data_mmf = std::unique_ptr<EQEmu::MemoryMappedFile>(new EQEmu::MemoryMappedFile(file_name));
|
||||
mutex.Unlock();
|
||||
} catch(std::exception& ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error Loading Base Data: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Error Loading Base Data: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1793,22 +1793,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) {
|
||||
cl = atoi(row[1]);
|
||||
|
||||
if(lvl <= 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.level <= 0, ignoring.");
|
||||
Log(Logs::General, Logs::Error, "Non fatal error: base_data.level <= 0, ignoring.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(lvl >= max_level) {
|
||||
Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.level >= max_level, ignoring.");
|
||||
Log(Logs::General, Logs::Error, "Non fatal error: base_data.level >= max_level, ignoring.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(cl <= 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.cl <= 0, ignoring.");
|
||||
Log(Logs::General, Logs::Error, "Non fatal error: base_data.cl <= 0, ignoring.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(cl > 16) {
|
||||
Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.class > 16, ignoring.");
|
||||
Log(Logs::General, Logs::Error, "Non fatal error: base_data.class > 16, ignoring.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2016,7 +2016,7 @@ bool SharedDatabase::LoadLoot(const std::string &prefix) {
|
||||
loot_drop_mmf->Size()));
|
||||
mutex.Unlock();
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error loading loot: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Error loading loot: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2032,7 +2032,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) {
|
||||
return &loot_table_hash->at(loottable_id);
|
||||
}
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Could not get loot table: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Could not get loot table: %s", ex.what());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -2046,7 +2046,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) {
|
||||
return &loot_drop_hash->at(lootdrop_id);
|
||||
}
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "Could not get loot drop: %s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "Could not get loot drop: %s", ex.what());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -851,7 +851,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType)
|
||||
// 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
|
||||
if (IsValidSpell(spell_id)) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id,
|
||||
Log(Logs::Detail, Logs::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id,
|
||||
spells[spell_id].name, spells[spell_id].DamageShieldType);
|
||||
|
||||
if (spells[spell_id].DamageShieldType)
|
||||
|
||||
@ -40,13 +40,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, std::shared_ptr<EQ
|
||||
EQApplicationPacket *p = *in_p;
|
||||
*in_p = nullptr;
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode()));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode()));
|
||||
|
||||
delete p;
|
||||
}
|
||||
|
||||
void StructStrategy::ErrorDecoder(EQApplicationPacket *p) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode()));
|
||||
Log(Logs::General, Logs::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode()));
|
||||
p->SetOpcode(OP_Unknown);
|
||||
}
|
||||
|
||||
|
||||
@ -899,7 +899,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) {
|
||||
}
|
||||
TCPConnection* tcpc = (TCPConnection*) tmp;
|
||||
#ifndef WIN32
|
||||
Log.Out(Logs::Detail, Logs::TCP_Connection, "%s Starting TCPConnectionLoop with thread ID %d", __FUNCTION__, pthread_self());
|
||||
Log(Logs::Detail, Logs::TCP_Connection, "%s Starting TCPConnectionLoop with thread ID %d", __FUNCTION__, pthread_self());
|
||||
#endif
|
||||
tcpc->MLoopRunning.lock();
|
||||
while (tcpc->RunLoop()) {
|
||||
@ -926,7 +926,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) {
|
||||
tcpc->MLoopRunning.unlock();
|
||||
|
||||
#ifndef WIN32
|
||||
Log.Out(Logs::Detail, Logs::TCP_Connection, "%s Ending TCPConnectionLoop with thread ID %d", __FUNCTION__, pthread_self());
|
||||
Log(Logs::Detail, Logs::TCP_Connection, "%s Ending TCPConnectionLoop with thread ID %d", __FUNCTION__, pthread_self());
|
||||
#endif
|
||||
|
||||
THREAD_RETURN(nullptr);
|
||||
|
||||
@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
|
||||
BaseTCPServer* tcps = (BaseTCPServer*) tmp;
|
||||
|
||||
#ifndef WIN32
|
||||
Log.Out(Logs::Detail, Logs::None, "Starting TCPServerLoop with thread ID %d", pthread_self());
|
||||
Log(Logs::Detail, Logs::None, "Starting TCPServerLoop with thread ID %d", pthread_self());
|
||||
#endif
|
||||
|
||||
tcps->MLoopRunning.lock();
|
||||
@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) {
|
||||
tcps->MLoopRunning.unlock();
|
||||
|
||||
#ifndef WIN32
|
||||
Log.Out(Logs::Detail, Logs::None, "Ending TCPServerLoop with thread ID %d", pthread_self());
|
||||
Log(Logs::Detail, Logs::None, "Ending TCPServerLoop with thread ID %d", pthread_self());
|
||||
#endif
|
||||
|
||||
THREAD_RETURN(nullptr);
|
||||
|
||||
@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() {
|
||||
Timeoutable *it = *cur;
|
||||
if(it->next_check.Check()) {
|
||||
#ifdef TIMEOUT_DEBUG
|
||||
Log.Out(Logs::General, Logs::None,, "Checking timeout on 0x%x\n", it);
|
||||
Log(Logs::General, Logs::None,, "Checking timeout on 0x%x\n", it);
|
||||
#endif
|
||||
it->CheckTimeout();
|
||||
}
|
||||
@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) {
|
||||
DeleteMember(who); //just in case... prolly not needed.
|
||||
members.push_back(who);
|
||||
#ifdef TIMEOUT_DEBUG
|
||||
Log.Out(Logs::General, Logs::None,, "Adding timeoutable 0x%x\n", who);
|
||||
Log(Logs::General, Logs::None,, "Adding timeoutable 0x%x\n", who);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TimeoutManager::DeleteMember(Timeoutable *who) {
|
||||
#ifdef TIMEOUT_DEBUG
|
||||
Log.Out(Logs::General, Logs::None,, "Removing timeoutable 0x%x\n", who);
|
||||
Log(Logs::General, Logs::None,, "Removing timeoutable 0x%x\n", who);
|
||||
#endif
|
||||
std::vector<Timeoutable *>::iterator cur,end;
|
||||
cur = members.begin();
|
||||
|
||||
@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) {
|
||||
|
||||
void WorldConnection::OnConnected() {
|
||||
const EQEmuConfig *Config=EQEmuConfig::get();
|
||||
Log.Out(Logs::General, Logs::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort);
|
||||
Log(Logs::General, Logs::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort);
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuth, 16);
|
||||
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)) {
|
||||
return true;
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf);
|
||||
Log(Logs::General, Logs::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
|
||||
bool RunLoops = false;
|
||||
|
||||
@ -39,7 +39,7 @@ void CatchSignal(int sig_num);
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
RegisterExecutablePlatform(ExePlatformLaunch);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
set_exception_handler();
|
||||
|
||||
std::string launcher_name;
|
||||
@ -47,13 +47,13 @@ int main(int argc, char *argv[]) {
|
||||
launcher_name = argv[1];
|
||||
}
|
||||
if(launcher_name.length() < 1) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "You must specfify a launcher name as the first argument to this program.");
|
||||
Log(Logs::Detail, Logs::Launcher, "You must specfify a launcher name as the first argument to this program.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Loading server configuration..");
|
||||
Log(Logs::Detail, Logs::Launcher, "Loading server configuration..");
|
||||
if (!EQEmuConfig::LoadConfig()) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Loading server configuration failed.");
|
||||
Log(Logs::Detail, Logs::Launcher, "Loading server configuration failed.");
|
||||
return 1;
|
||||
}
|
||||
auto Config = EQEmuConfig::get();
|
||||
@ -62,16 +62,16 @@ int main(int argc, char *argv[]) {
|
||||
* Setup nice signal handlers
|
||||
*/
|
||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
#ifndef WIN32
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||
Log(Logs::Detail, Logs::Launcher, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
|
||||
std::map<std::string, ZoneLaunch *> zones;
|
||||
WorldServer world(zones, launcher_name.c_str(), Config);
|
||||
if (!world.Connect()) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "worldserver.Connect() FAILED! Will retry.");
|
||||
Log(Logs::Detail, Logs::Launcher, "worldserver.Connect() FAILED! Will retry.");
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Starting main loop...");
|
||||
Log(Logs::Detail, Logs::Launcher, "Starting main loop...");
|
||||
|
||||
ProcLauncher *launch = ProcLauncher::get();
|
||||
RunLoops = true;
|
||||
@ -175,14 +175,14 @@ int main(int argc, char *argv[]) {
|
||||
delete zone->second;
|
||||
}
|
||||
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void CatchSignal(int sig_num) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Caught signal %d", sig_num);
|
||||
Log(Logs::Detail, Logs::Launcher, "Caught signal %d", sig_num);
|
||||
RunLoops = false;
|
||||
}
|
||||
|
||||
|
||||
@ -74,14 +74,14 @@ void WorldServer::Process() {
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZAAuthFailed: {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World server responded 'Not Authorized', disabling reconnect");
|
||||
Log(Logs::Detail, Logs::Launcher, "World server responded 'Not Authorized', disabling reconnect");
|
||||
pTryReconnect = false;
|
||||
Disconnect();
|
||||
break;
|
||||
}
|
||||
case ServerOP_LauncherZoneRequest: {
|
||||
if(pack->size != sizeof(LauncherZoneRequest)) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size);
|
||||
Log(Logs::Detail, Logs::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size);
|
||||
break;
|
||||
}
|
||||
const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer;
|
||||
@ -89,9 +89,9 @@ void WorldServer::Process() {
|
||||
switch(ZoneRequestCommands(lzr->command)) {
|
||||
case ZR_Start: {
|
||||
if(m_zones.find(lzr->short_name) != m_zones.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name);
|
||||
Log(Logs::Detail, Logs::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World told us to start zone %s.", lzr->short_name);
|
||||
Log(Logs::Detail, Logs::Launcher, "World told us to start zone %s.", lzr->short_name);
|
||||
auto l = new ZoneLaunch(this, m_name, lzr->short_name, lzr->port, m_config);
|
||||
m_zones[lzr->short_name] = l;
|
||||
}
|
||||
@ -100,9 +100,9 @@ void WorldServer::Process() {
|
||||
case ZR_Restart: {
|
||||
auto res = m_zones.find(lzr->short_name);
|
||||
if(res == m_zones.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name);
|
||||
Log(Logs::Detail, Logs::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World told us to restart zone %s.", lzr->short_name);
|
||||
Log(Logs::Detail, Logs::Launcher, "World told us to restart zone %s.", lzr->short_name);
|
||||
res->second->Restart();
|
||||
}
|
||||
break;
|
||||
@ -110,9 +110,9 @@ void WorldServer::Process() {
|
||||
case ZR_Stop: {
|
||||
auto res = m_zones.find(lzr->short_name);
|
||||
if(res == m_zones.end()) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name);
|
||||
Log(Logs::Detail, Logs::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "World told us to stop zone %s.", lzr->short_name);
|
||||
Log(Logs::Detail, Logs::Launcher, "World told us to stop zone %s.", lzr->short_name);
|
||||
res->second->Stop();
|
||||
}
|
||||
break;
|
||||
@ -126,7 +126,7 @@ void WorldServer::Process() {
|
||||
}
|
||||
|
||||
default: {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size);
|
||||
Log(Logs::Detail, Logs::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ void ZoneLaunch::Start() {
|
||||
//spec is consumed, even on failure
|
||||
m_ref = ProcLauncher::get()->Launch(spec);
|
||||
if(m_ref == ProcLauncher::ProcError) {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName);
|
||||
Log(Logs::Detail, Logs::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName);
|
||||
m_timer.Start(m_config->RestartWait);
|
||||
return;
|
||||
}
|
||||
@ -89,17 +89,17 @@ void ZoneLaunch::Start() {
|
||||
|
||||
SendStatus();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has been started.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s has been started.", m_zone.c_str());
|
||||
}
|
||||
|
||||
void ZoneLaunch::Restart() {
|
||||
switch(m_state) {
|
||||
case StateRestartPending:
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str());
|
||||
break;
|
||||
case StateStartPending:
|
||||
//we havent started yet, do nothing
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str());
|
||||
break;
|
||||
case StateStarted:
|
||||
//process is running along, kill it off..
|
||||
@ -107,20 +107,20 @@ void ZoneLaunch::Restart() {
|
||||
break; //we have no proc ref... cannot stop..
|
||||
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.
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
||||
m_state = StateStopped;
|
||||
break;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
||||
m_timer.Start(m_config->TerminateWait);
|
||||
m_state = StateRestartPending;
|
||||
break;
|
||||
case StateStopPending:
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str());
|
||||
break;
|
||||
case StateStopped:
|
||||
//process is already stopped... nothing to do..
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -129,7 +129,7 @@ void ZoneLaunch::Stop(bool graceful) {
|
||||
switch(m_state) {
|
||||
case StateStartPending:
|
||||
//we havent started yet, transition directly to stopped.
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Stopping zone %s before it has started.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Stopping zone %s before it has started.", m_zone.c_str());
|
||||
m_state = StateStopped;
|
||||
break;
|
||||
case StateStarted:
|
||||
@ -139,17 +139,17 @@ void ZoneLaunch::Stop(bool graceful) {
|
||||
break; //we have no proc ref... cannot stop..
|
||||
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.
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str());
|
||||
m_state = StateStopped;
|
||||
break;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Termination signal sent to zone %s.", m_zone.c_str());
|
||||
m_timer.Start(m_config->TerminateWait);
|
||||
m_state = StateStopPending;
|
||||
break;
|
||||
case StateStopped:
|
||||
//process is already stopped... nothing to do..
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -169,17 +169,17 @@ bool ZoneLaunch::Process() {
|
||||
m_timer.Disable();
|
||||
|
||||
//actually start up the program
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Starting zone %s", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Starting zone %s", m_zone.c_str());
|
||||
Start();
|
||||
|
||||
//now update the shared timer to reflect the proper start interval.
|
||||
if(s_running == 1) {
|
||||
//we are the first zone started. wait that interval.
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait);
|
||||
Log(Logs::Detail, Logs::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait);
|
||||
s_startTimer.Start(m_config->InitialBootWait);
|
||||
} else {
|
||||
//just some follow on zone, use that interval.
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval);
|
||||
Log(Logs::Detail, Logs::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval);
|
||||
s_startTimer.Start(m_config->ZoneBootInterval);
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ bool ZoneLaunch::Process() {
|
||||
//waiting for notification that our child has died..
|
||||
if(m_timer.Check()) {
|
||||
//we have timed out, try to kill the child again
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
||||
Restart();
|
||||
}
|
||||
break;
|
||||
@ -202,12 +202,12 @@ bool ZoneLaunch::Process() {
|
||||
//we have timed out, try to kill the child again
|
||||
m_killFails++;
|
||||
if(m_killFails > 5) { //should get this number from somewhere..
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str());
|
||||
m_state = StateStopped;
|
||||
s_running--;
|
||||
SendStatus();
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str());
|
||||
Stop(false);
|
||||
}
|
||||
}
|
||||
@ -226,29 +226,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche
|
||||
|
||||
switch(m_state) {
|
||||
case StateStartPending:
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str());
|
||||
m_state = StateStartPending;
|
||||
m_timer.Start(m_config->RestartWait);
|
||||
break;
|
||||
case StateStarted:
|
||||
//something happened to our happy process...
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str());
|
||||
m_state = StateStartPending;
|
||||
m_timer.Start(m_config->RestartWait);
|
||||
break;
|
||||
case StateRestartPending:
|
||||
//it finally died, start it on up again
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str());
|
||||
m_state = StateStartPending;
|
||||
break;
|
||||
case StateStopPending:
|
||||
//it finally died, transition to close.
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str());
|
||||
m_state = StateStopped;
|
||||
break;
|
||||
case StateStopped:
|
||||
//we already thought it was stopped... dont care...
|
||||
Log.Out(Logs::Detail, Logs::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str());
|
||||
Log(Logs::Detail, Logs::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "../common/misc_functions.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
extern LoginServer server;
|
||||
|
||||
Client::Client(std::shared_ptr<EQStream> c, LSClientVersion v)
|
||||
@ -41,7 +41,7 @@ bool Client::Process()
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Application packet received from client (size %u)", app->Size());
|
||||
Log(Logs::General, Logs::Login_Server, "Application packet received from client (size %u)", app->Size());
|
||||
}
|
||||
|
||||
if(server.options.IsDumpInPacketsOn())
|
||||
@ -55,7 +55,7 @@ bool Client::Process()
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Session ready received from client.");
|
||||
Log(Logs::General, Logs::Login_Server, "Session ready received from client.");
|
||||
}
|
||||
Handle_SessionReady((const char*)app->pBuffer, app->Size());
|
||||
break;
|
||||
@ -64,13 +64,13 @@ bool Client::Process()
|
||||
{
|
||||
if(app->Size() < 20)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Login received but it is too small, discarding.");
|
||||
Log(Logs::General, Logs::Error, "Login received but it is too small, discarding.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Login received from client.");
|
||||
Log(Logs::General, Logs::Login_Server, "Login received from client.");
|
||||
}
|
||||
|
||||
Handle_Login((const char*)app->pBuffer, app->Size());
|
||||
@ -80,7 +80,7 @@ bool Client::Process()
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server list request received from client.");
|
||||
Log(Logs::General, Logs::Login_Server, "Server list request received from client.");
|
||||
}
|
||||
|
||||
SendServerListPacket();
|
||||
@ -90,7 +90,7 @@ bool Client::Process()
|
||||
{
|
||||
if(app->Size() < sizeof(PlayEverquestRequest_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Play received but it is too small, discarding.");
|
||||
Log(Logs::General, Logs::Error, "Play received but it is too small, discarding.");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -99,10 +99,10 @@ bool Client::Process()
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (Log.log_settings[Logs::Client_Server_Packet_Unhandled].is_category_enabled == 1) {
|
||||
if (LogSys.log_settings[Logs::Client_Server_Packet_Unhandled].is_category_enabled == 1) {
|
||||
char dump[64];
|
||||
app->build_header_dump(dump);
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved unhandled application packet from the client: %s.", dump);
|
||||
Log(Logs::General, Logs::Error, "Recieved unhandled application packet from the client: %s.", dump);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -118,20 +118,20 @@ void Client::Handle_SessionReady(const char* data, unsigned int size)
|
||||
{
|
||||
if(status != cs_not_sent_session_ready)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Session ready received again after already being received.");
|
||||
Log(Logs::General, Logs::Error, "Session ready received again after already being received.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(size < sizeof(unsigned int))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Session ready was too small.");
|
||||
Log(Logs::General, Logs::Error, "Session ready was too small.");
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int mode = *((unsigned int*)data);
|
||||
if(mode == (unsigned int)lm_from_world)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Session ready indicated logged in from world(unsupported feature), disconnecting.");
|
||||
Log(Logs::General, Logs::Login_Server, "Session ready indicated logged in from world(unsupported feature), disconnecting.");
|
||||
connection->Close();
|
||||
return;
|
||||
}
|
||||
@ -178,12 +178,12 @@ void Client::Handle_SessionReady(const char* data, unsigned int size)
|
||||
void Client::Handle_Login(const char* data, unsigned int size)
|
||||
{
|
||||
if(status != cs_waiting_for_login) {
|
||||
Log.Out(Logs::General, Logs::Error, "Login received after already having logged in.");
|
||||
Log(Logs::General, Logs::Error, "Login received after already having logged in.");
|
||||
return;
|
||||
}
|
||||
|
||||
if((size - 12) % 8 != 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "Login received packet of size: %u, this would cause a block corruption, discarding.", size);
|
||||
Log(Logs::General, Logs::Error, "Login received packet of size: %u, this would cause a block corruption, discarding.", size);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -205,8 +205,8 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
entered_username.assign((login_packet_buffer + login_packet_buffer_length + 1), strlen(login_packet_buffer + login_packet_buffer_length + 1));
|
||||
|
||||
if(server.options.IsTraceOn()) {
|
||||
Log.Out(Logs::General, Logs::Debug, "User: %s", entered_username.c_str());
|
||||
Log.Out(Logs::General, Logs::Debug, "Hash: %s", entered_password_hash_result.c_str());
|
||||
Log(Logs::General, Logs::Debug, "User: %s", entered_username.c_str());
|
||||
Log(Logs::General, Logs::Debug, "Hash: %s", entered_password_hash_result.c_str());
|
||||
}
|
||||
|
||||
server.eq_crypto->DeleteHeap(login_packet_buffer);
|
||||
@ -218,8 +218,8 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
entered_username.assign((login_packet_buffer + login_packet_buffer_length + 1), strlen(login_packet_buffer + login_packet_buffer_length + 1));
|
||||
|
||||
if(server.options.IsTraceOn()) {
|
||||
Log.Out(Logs::General, Logs::Debug, "User: %s", entered_username.c_str());
|
||||
Log.Out(Logs::General, Logs::Debug, "Hash: %s", entered_password_hash_result.c_str());
|
||||
Log(Logs::General, Logs::Debug, "User: %s", entered_username.c_str());
|
||||
Log(Logs::General, Logs::Debug, "Hash: %s", entered_password_hash_result.c_str());
|
||||
}
|
||||
|
||||
_HeapDeleteCharBuffer(login_packet_buffer);
|
||||
@ -232,11 +232,11 @@ void Client::Handle_Login(const char* data, unsigned int size)
|
||||
server.config->GetVariable("options", "auto_create_accounts").compare("TRUE") == 0 &&
|
||||
server.db->CreateLoginData(entered_username, entered_password_hash_result, db_account_id) == true
|
||||
){
|
||||
Log.Out(Logs::General, Logs::Error, "User %s does not exist in the database, so we created it...", entered_username.c_str());
|
||||
Log(Logs::General, Logs::Error, "User %s does not exist in the database, so we created it...", entered_username.c_str());
|
||||
result = true;
|
||||
}
|
||||
else{
|
||||
Log.Out(Logs::General, Logs::Error, "Error logging in, user %s does not exist in the database.", entered_username.c_str());
|
||||
Log(Logs::General, Logs::Error, "Error logging in, user %s does not exist in the database.", entered_username.c_str());
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
@ -338,7 +338,7 @@ void Client::Handle_Play(const char* data)
|
||||
{
|
||||
if(status != cs_logged_in)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Client sent a play request when they either were not logged in, discarding.");
|
||||
Log(Logs::General, Logs::Error, "Client sent a play request when they either were not logged in, discarding.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ void Client::Handle_Play(const char* data)
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Play received from client, server number %u sequence %u.", server_id_in, sequence_in);
|
||||
Log(Logs::General, Logs::Login_Server, "Play received from client, server number %u sequence %u.", server_id_in, sequence_in);
|
||||
}
|
||||
|
||||
this->play_server_id = (unsigned int)play->ServerNumber;
|
||||
@ -374,7 +374,7 @@ void Client::SendPlayResponse(EQApplicationPacket *outapp)
|
||||
{
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "Sending play response for %s.", GetAccountName().c_str());
|
||||
Log(Logs::General, Logs::Netcode, "Sending play response for %s.", GetAccountName().c_str());
|
||||
// server_log->LogPacket(log_network_trace, (const char*)outapp->pBuffer, outapp->size);
|
||||
}
|
||||
connection->QueuePacket(outapp);
|
||||
|
||||
@ -22,7 +22,7 @@ extern LoginServer server;
|
||||
extern bool run_server;
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
|
||||
ClientManager::ClientManager()
|
||||
{
|
||||
@ -31,18 +31,18 @@ ClientManager::ClientManager()
|
||||
titanium_ops = new RegularOpcodeManager;
|
||||
if(!titanium_ops->LoadOpcodes(server.config->GetVariable("Titanium", "opcodes").c_str()))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for Titanium file %s.",
|
||||
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for Titanium file %s.",
|
||||
server.config->GetVariable("Titanium", "opcodes").c_str());
|
||||
run_server = false;
|
||||
}
|
||||
|
||||
if(titanium_stream->Open())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "ClientManager listening on Titanium stream.");
|
||||
Log(Logs::General, Logs::Login_Server, "ClientManager listening on Titanium stream.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open Titanium stream.");
|
||||
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open Titanium stream.");
|
||||
run_server = false;
|
||||
}
|
||||
|
||||
@ -51,18 +51,18 @@ ClientManager::ClientManager()
|
||||
sod_ops = new RegularOpcodeManager;
|
||||
if(!sod_ops->LoadOpcodes(server.config->GetVariable("SoD", "opcodes").c_str()))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for SoD file %s.",
|
||||
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't load opcodes for SoD file %s.",
|
||||
server.config->GetVariable("SoD", "opcodes").c_str());
|
||||
run_server = false;
|
||||
}
|
||||
|
||||
if(sod_stream->Open())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "ClientManager listening on SoD stream.");
|
||||
Log(Logs::General, Logs::Login_Server, "ClientManager listening on SoD stream.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open SoD stream.");
|
||||
Log(Logs::General, Logs::Error, "ClientManager fatal error: couldn't open SoD stream.");
|
||||
run_server = false;
|
||||
}
|
||||
}
|
||||
@ -100,7 +100,7 @@ void ClientManager::Process()
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = cur->GetRemoteIP();
|
||||
Log.Out(Logs::General, Logs::Login_Server, "New Titanium client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
|
||||
Log(Logs::General, Logs::Login_Server, "New Titanium client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
|
||||
|
||||
cur->SetOpcodeManager(&titanium_ops);
|
||||
Client *c = new Client(cur, cv_titanium);
|
||||
@ -113,7 +113,7 @@ void ClientManager::Process()
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = cur->GetRemoteIP();
|
||||
Log.Out(Logs::General, Logs::Login_Server, "New SoD client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
|
||||
Log(Logs::General, Logs::Login_Server, "New SoD client connection from %s:%d", inet_ntoa(in), ntohs(cur->GetRemotePort()));
|
||||
|
||||
cur->SetOpcodeManager(&sod_ops);
|
||||
Client *c = new Client(cur, cv_sod);
|
||||
@ -126,7 +126,7 @@ void ClientManager::Process()
|
||||
{
|
||||
if((*iter)->Process() == false)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Debug, "Client had a fatal error and had to be removed from the login.");
|
||||
Log(Logs::General, Logs::Debug, "Client had a fatal error and had to be removed from the login.");
|
||||
delete (*iter);
|
||||
iter = clients.erase(iter);
|
||||
}
|
||||
@ -145,7 +145,7 @@ void ClientManager::ProcessDisconnect()
|
||||
std::shared_ptr<EQStream> c = (*iter)->GetConnection();
|
||||
if(c->CheckClosed())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Client disconnected from the server, removing client.");
|
||||
Log(Logs::General, Logs::Login_Server, "Client disconnected from the server, removing client.");
|
||||
delete (*iter);
|
||||
iter = clients.erase(iter);
|
||||
}
|
||||
@ -173,7 +173,7 @@ void ClientManager::RemoveExistingClient(unsigned int account_id)
|
||||
{
|
||||
if((*iter)->GetAccountID() == account_id)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Client attempting to log in and existing client already logged in, removing existing client.");
|
||||
Log(Logs::General, Logs::Login_Server, "Client attempting to log in and existing client already logged in, removing existing client.");
|
||||
delete (*iter);
|
||||
iter = clients.erase(iter);
|
||||
}
|
||||
@ -201,7 +201,7 @@ Client *ClientManager::GetClient(unsigned int account_id)
|
||||
|
||||
if(count > 1)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "More than one client with a given account_id existed in the client list.");
|
||||
Log(Logs::General, Logs::Error, "More than one client with a given account_id existed in the client list.");
|
||||
}
|
||||
return cur;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "config.h"
|
||||
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
/**
|
||||
* Retrieves the variable we want from our title or theme
|
||||
* First gets the map from the title
|
||||
@ -48,7 +48,7 @@ void Config::Parse(const char *file_name)
|
||||
{
|
||||
if(file_name == nullptr)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Config::Parse(), file_name passed was null.");
|
||||
Log(Logs::General, Logs::Error, "Config::Parse(), file_name passed was null.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ void Config::Parse(const char *file_name)
|
||||
++iter;
|
||||
if(iter == tokens.end())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Config::Parse(), EOF before title done parsing.");
|
||||
Log(Logs::General, Logs::Error, "Config::Parse(), EOF before title done parsing.");
|
||||
fclose(input);
|
||||
vars.clear();
|
||||
return;
|
||||
@ -104,7 +104,7 @@ void Config::Parse(const char *file_name)
|
||||
mode++;
|
||||
if((*iter).compare("=") != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Config::Parse(), invalid parse token where = should be.");
|
||||
Log(Logs::General, Logs::Error, "Config::Parse(), invalid parse token where = should be.");
|
||||
fclose(input);
|
||||
vars.clear();
|
||||
return;
|
||||
@ -133,7 +133,7 @@ void Config::Parse(const char *file_name)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Config::Parse(), file was unable to be opened for parsing.");
|
||||
Log(Logs::General, Logs::Error, "Config::Parse(), file was unable to be opened for parsing.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "login_server.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
extern LoginServer server;
|
||||
|
||||
DatabaseMySQL::DatabaseMySQL(string user, string pass, string host, string port, string name)
|
||||
@ -41,13 +41,13 @@ DatabaseMySQL::DatabaseMySQL(string user, string pass, string host, string port,
|
||||
if(!mysql_real_connect(database, host.c_str(), user.c_str(), pass.c_str(), name.c_str(), atoi(port.c_str()), nullptr, 0))
|
||||
{
|
||||
mysql_close(database);
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to MySQL database. Error: %s", mysql_error(database));
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to MySQL database. Error: %s", mysql_error(database));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to create db object in MySQL database.");
|
||||
Log(Logs::General, Logs::Error, "Failed to create db object in MySQL database.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ bool DatabaseMySQL::GetLoginDataFromAccountName(string name, string &password, u
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ bool DatabaseMySQL::GetLoginDataFromAccountName(string name, string &password, u
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ bool DatabaseMySQL::CreateLoginData(string name, string &password, unsigned int
|
||||
query << " VALUES('" << name << "', '" << password << "', 'local_creation', NOW(), '127.0.0.1'); ";
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
@ -119,7 +119,7 @@ bool DatabaseMySQL::CreateLoginData(string name, string &password, unsigned int
|
||||
return true;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ bool DatabaseMySQL::GetWorldRegistration(string long_name, string short_name, un
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ bool DatabaseMySQL::GetWorldRegistration(string long_name, string short_name, un
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -188,14 +188,14 @@ bool DatabaseMySQL::GetWorldRegistration(string long_name, string short_name, un
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query returned no result: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ void DatabaseMySQL::UpdateLSAccountData(unsigned int id, string ip_address)
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ void DatabaseMySQL::UpdateLSAccountInfo(unsigned int id, string name, string pas
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,7 +258,7 @@ void DatabaseMySQL::UpdateWorldRegistration(unsigned int id, string long_name, s
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ bool DatabaseMySQL::CreateWorldRegistration(string long_name, string short_name,
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -302,13 +302,13 @@ bool DatabaseMySQL::CreateWorldRegistration(string long_name, string short_name,
|
||||
|
||||
if (mysql_query(database, query.str().c_str()) != 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
Log(Logs::General, Logs::Error, "Mysql query failed: %s", query.str().c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Error, "World registration did not exist in the database for %s %s", long_name.c_str(), short_name.c_str());
|
||||
Log(Logs::General, Logs::Error, "World registration did not exist in the database for %s %s", long_name.c_str(), short_name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -34,12 +34,12 @@ DatabasePostgreSQL::DatabasePostgreSQL(string user, string pass, string host, st
|
||||
db = PQsetdbLogin(host.c_str(), port.c_str(), nullptr, nullptr, name.c_str(), user.c_str(), pass.c_str());
|
||||
if(!db)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to PostgreSQL Database.");
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to PostgreSQL Database.");
|
||||
}
|
||||
|
||||
if(PQstatus(db) != CONNECTION_OK)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to PostgreSQL Database.");
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to PostgreSQL Database.");
|
||||
PQfinish(db);
|
||||
db = nullptr;
|
||||
}
|
||||
@ -83,7 +83,7 @@ bool DatabasePostgreSQL::GetLoginDataFromAccountName(string name, string &passwo
|
||||
char *error = PQresultErrorMessage(res);
|
||||
if(strlen(error) > 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetLoginDataFromAccountName(): %s", error);
|
||||
Log(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetLoginDataFromAccountName(): %s", error);
|
||||
PQclear(res);
|
||||
return false;
|
||||
}
|
||||
@ -135,7 +135,7 @@ bool DatabasePostgreSQL::GetWorldRegistration(string long_name, string short_nam
|
||||
char *error = PQresultErrorMessage(res);
|
||||
if(strlen(error) > 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetWorldRegistration(): %s", error);
|
||||
Log(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetWorldRegistration(): %s", error);
|
||||
PQclear(res);
|
||||
return false;
|
||||
}
|
||||
@ -188,7 +188,7 @@ void DatabasePostgreSQL::UpdateLSAccountData(unsigned int id, string ip_address)
|
||||
char *error = PQresultErrorMessage(res);
|
||||
if(strlen(error) > 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetLoginDataFromAccountName(): %s", error);
|
||||
Log(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetLoginDataFromAccountName(): %s", error);
|
||||
}
|
||||
PQclear(res);
|
||||
}
|
||||
@ -225,7 +225,7 @@ void DatabasePostgreSQL::UpdateWorldRegistration(unsigned int id, string long_na
|
||||
char *error = PQresultErrorMessage(res);
|
||||
if(strlen(error) > 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetLoginDataFromAccountName(): %s", error);
|
||||
Log(Logs::General, Logs::Error, "Database error in DatabasePostgreSQL::GetLoginDataFromAccountName(): %s", error);
|
||||
}
|
||||
PQclear(res);
|
||||
}
|
||||
|
||||
@ -20,13 +20,13 @@
|
||||
#include <string>
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
|
||||
bool Encryption::LoadCrypto(std::string name)
|
||||
{
|
||||
if(!Load(name.c_str()))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to load %s from the operating system.", name.c_str());
|
||||
Log(Logs::General, Logs::Error, "Failed to load %s from the operating system.", name.c_str());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@ -34,21 +34,21 @@ bool Encryption::LoadCrypto(std::string name)
|
||||
encrypt_func = (DLLFUNC_Encrypt)GetSym("Encrypt");
|
||||
if(encrypt_func == NULL)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to attach Encrypt.");
|
||||
Log(Logs::General, Logs::Error, "Failed to attach Encrypt.");
|
||||
Unload();
|
||||
return false;
|
||||
}
|
||||
decrypt_func = (DLLFUNC_DecryptUsernamePassword)GetSym("DecryptUsernamePassword");
|
||||
if(decrypt_func == NULL)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to attach DecryptUsernamePassword.");
|
||||
Log(Logs::General, Logs::Error, "Failed to attach DecryptUsernamePassword.");
|
||||
Unload();
|
||||
return false;
|
||||
}
|
||||
delete_func = (DLLFUNC_HeapDelete)GetSym("_HeapDeleteCharBuffer");
|
||||
if(delete_func == NULL)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to attach _HeapDeleteCharBuffer.");
|
||||
Log(Logs::General, Logs::Error, "Failed to attach _HeapDeleteCharBuffer.");
|
||||
Unload();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
TimeoutManager timeout_manager;
|
||||
LoginServer server;
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
bool run_server = true;
|
||||
|
||||
void CatchSignal(int sig_num)
|
||||
@ -42,15 +42,15 @@ int main()
|
||||
{
|
||||
RegisterExecutablePlatform(ExePlatformLogin);
|
||||
set_exception_handler();
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
|
||||
Log.log_settings[Logs::Error].log_to_console = Logs::General;
|
||||
LogSys.log_settings[Logs::Error].log_to_console = Logs::General;
|
||||
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Logging System Init.");
|
||||
Log(Logs::General, Logs::Login_Server, "Logging System Init.");
|
||||
|
||||
/* Parse out login.ini */
|
||||
server.config = new Config();
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Config System Init.");
|
||||
Log(Logs::General, Logs::Login_Server, "Config System Init.");
|
||||
server.config->Parse("login.ini");
|
||||
|
||||
if (server.config->GetVariable("options", "unregistered_allowed").compare("FALSE") == 0)
|
||||
@ -98,7 +98,7 @@ int main()
|
||||
/* Create database connection */
|
||||
if (server.config->GetVariable("database", "subsystem").compare("MySQL") == 0) {
|
||||
#ifdef EQEMU_MYSQL_ENABLED
|
||||
Log.Out(Logs::General, Logs::Login_Server, "MySQL Database Init.");
|
||||
Log(Logs::General, Logs::Login_Server, "MySQL Database Init.");
|
||||
server.db = (Database*)new DatabaseMySQL(
|
||||
server.config->GetVariable("database", "user"),
|
||||
server.config->GetVariable("database", "password"),
|
||||
@ -109,7 +109,7 @@ int main()
|
||||
}
|
||||
else if (server.config->GetVariable("database", "subsystem").compare("PostgreSQL") == 0) {
|
||||
#ifdef EQEMU_POSTGRESQL_ENABLED
|
||||
Log.Out(Logs::General, Logs::Login_Server, "PostgreSQL Database Init.");
|
||||
Log(Logs::General, Logs::Login_Server, "PostgreSQL Database Init.");
|
||||
server.db = (Database*)new DatabasePostgreSQL(
|
||||
server.config->GetVariable("database", "user"),
|
||||
server.config->GetVariable("database", "password"),
|
||||
@ -121,67 +121,67 @@ int main()
|
||||
|
||||
/* Make sure our database got created okay, otherwise cleanup and exit. */
|
||||
if (!server.db) {
|
||||
Log.Out(Logs::General, Logs::Error, "Database Initialization Failure.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
Log(Logs::General, Logs::Error, "Database Initialization Failure.");
|
||||
Log(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
delete server.config;
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Log System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Log System Shutdown.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if WIN32
|
||||
//initialize our encryption.
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Encryption Initialize.");
|
||||
Log(Logs::General, Logs::Login_Server, "Encryption Initialize.");
|
||||
server.eq_crypto = new Encryption();
|
||||
if (server.eq_crypto->LoadCrypto(server.config->GetVariable("security", "plugin"))) {
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Encryption Loaded Successfully.");
|
||||
Log(Logs::General, Logs::Login_Server, "Encryption Loaded Successfully.");
|
||||
}
|
||||
else {
|
||||
//We can't run without encryption, cleanup and exit.
|
||||
Log.Out(Logs::General, Logs::Error, "Encryption Failed to Load.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
Log(Logs::General, Logs::Error, "Encryption Failed to Load.");
|
||||
Log(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
delete server.db;
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
delete server.config;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
//create our server manager.
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server Manager Initialize.");
|
||||
Log(Logs::General, Logs::Login_Server, "Server Manager Initialize.");
|
||||
server.server_manager = new ServerManager();
|
||||
if (!server.server_manager) {
|
||||
//We can't run without a server manager, cleanup and exit.
|
||||
Log.Out(Logs::General, Logs::Error, "Server Manager Failed to Start.");
|
||||
Log(Logs::General, Logs::Error, "Server Manager Failed to Start.");
|
||||
|
||||
#ifdef WIN32
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
|
||||
delete server.eq_crypto;
|
||||
#endif
|
||||
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
delete server.db;
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
delete server.config;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//create our client manager.
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Client Manager Initialize.");
|
||||
Log(Logs::General, Logs::Login_Server, "Client Manager Initialize.");
|
||||
server.client_manager = new ClientManager();
|
||||
if (!server.client_manager) {
|
||||
//We can't run without a client manager, cleanup and exit.
|
||||
Log.Out(Logs::General, Logs::Error, "Client Manager Failed to Start.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server Manager Shutdown.");
|
||||
Log(Logs::General, Logs::Error, "Client Manager Failed to Start.");
|
||||
Log(Logs::General, Logs::Login_Server, "Server Manager Shutdown.");
|
||||
delete server.server_manager;
|
||||
|
||||
#ifdef WIN32
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
|
||||
delete server.eq_crypto;
|
||||
#endif
|
||||
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
delete server.db;
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
delete server.config;
|
||||
return 1;
|
||||
}
|
||||
@ -194,7 +194,7 @@ int main()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server Started.");
|
||||
Log(Logs::General, Logs::Login_Server, "Server Started.");
|
||||
while (run_server) {
|
||||
Timer::SetCurrentTime();
|
||||
server.client_manager->Process();
|
||||
@ -203,20 +203,20 @@ int main()
|
||||
Sleep(100);
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server Shutdown.");
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Client Manager Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Server Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Client Manager Shutdown.");
|
||||
delete server.client_manager;
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Server Manager Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Server Manager Shutdown.");
|
||||
delete server.server_manager;
|
||||
|
||||
#ifdef WIN32
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
|
||||
delete server.eq_crypto;
|
||||
#endif
|
||||
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Database System Shutdown.");
|
||||
delete server.db;
|
||||
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
Log(Logs::General, Logs::Login_Server, "Config System Shutdown.");
|
||||
delete server.config;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
extern LoginServer server;
|
||||
extern bool run_server;
|
||||
|
||||
@ -33,10 +33,10 @@ ServerManager::ServerManager()
|
||||
int listen_port = atoi(server.config->GetVariable("options", "listen_port").c_str());
|
||||
tcps = new EmuTCPServer(listen_port, true);
|
||||
if(tcps->Open(listen_port, error_buffer)) {
|
||||
Log.Out(Logs::General, Logs::Login_Server, "ServerManager listening on port %u", listen_port);
|
||||
Log(Logs::General, Logs::Login_Server, "ServerManager listening on port %u", listen_port);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Error, "ServerManager fatal error opening port on %u: %s", listen_port, error_buffer);
|
||||
Log(Logs::General, Logs::Error, "ServerManager fatal error opening port on %u: %s", listen_port, error_buffer);
|
||||
run_server = false;
|
||||
}
|
||||
}
|
||||
@ -56,11 +56,11 @@ void ServerManager::Process()
|
||||
while (tcp_c = tcps->NewQueuePop()) {
|
||||
in_addr tmp;
|
||||
tmp.s_addr = tcp_c->GetrIP();
|
||||
Log.Out(Logs::General, Logs::Login_Server, "New world server connection from %s:%d", inet_ntoa(tmp), tcp_c->GetrPort());
|
||||
Log(Logs::General, Logs::Login_Server, "New world server connection from %s:%d", inet_ntoa(tmp), tcp_c->GetrPort());
|
||||
|
||||
WorldServer *server_entity = GetServerByAddress(tcp_c->GetrIP());
|
||||
if (server_entity) {
|
||||
Log.Out(Logs::General, Logs::Login_Server, "World server already existed for %s, removing existing connection and updating current.", inet_ntoa(tmp));
|
||||
Log(Logs::General, Logs::Login_Server, "World server already existed for %s, removing existing connection and updating current.", inet_ntoa(tmp));
|
||||
server_entity->GetConnection()->Free();
|
||||
server_entity->SetConnection(tcp_c);
|
||||
server_entity->Reset();
|
||||
@ -74,7 +74,7 @@ void ServerManager::Process()
|
||||
list<WorldServer*>::iterator iter = world_servers.begin();
|
||||
while (iter != world_servers.end()) {
|
||||
if ((*iter)->Process() == false) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "World server %s had a fatal error and had to be removed from the login.", (*iter)->GetLongName().c_str());
|
||||
Log(Logs::General, Logs::World_Server, "World server %s had a fatal error and had to be removed from the login.", (*iter)->GetLongName().c_str());
|
||||
delete (*iter);
|
||||
iter = world_servers.erase(iter);
|
||||
}
|
||||
@ -92,7 +92,7 @@ void ServerManager::ProcessDisconnect()
|
||||
if (!connection->Connected()) {
|
||||
in_addr tmp;
|
||||
tmp.s_addr = connection->GetrIP();
|
||||
Log.Out(Logs::General, Logs::Login_Server, "World server disconnected from the server, removing server and freeing connection.");
|
||||
Log(Logs::General, Logs::Login_Server, "World server disconnected from the server, removing server and freeing connection.");
|
||||
connection->Free();
|
||||
delete (*iter);
|
||||
iter = world_servers.erase(iter);
|
||||
@ -259,7 +259,7 @@ void ServerManager::SendUserToWorldRequest(unsigned int server_id, unsigned int
|
||||
}
|
||||
|
||||
if (!found && server.options.IsTraceOn()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Client requested a user to world but supplied an invalid id of %u.", server_id);
|
||||
Log(Logs::General, Logs::Error, "Client requested a user to world but supplied an invalid id of %u.", server_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#include "../common/eqemu_logsys.h"
|
||||
|
||||
extern EQEmuLogSys Log;
|
||||
extern EQEmuLogSys LogSys;
|
||||
extern LoginServer server;
|
||||
|
||||
WorldServer::WorldServer(EmuTCPConnection *c)
|
||||
@ -65,7 +65,7 @@ bool WorldServer::Process()
|
||||
{
|
||||
if(server.options.IsWorldTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "Application packet received from server: 0x%.4X, (size %u)", app->opcode, app->size);
|
||||
Log(Logs::General, Logs::Netcode, "Application packet received from server: 0x%.4X, (size %u)", app->opcode, app->size);
|
||||
}
|
||||
|
||||
if(server.options.IsDumpInPacketsOn())
|
||||
@ -79,14 +79,14 @@ bool WorldServer::Process()
|
||||
{
|
||||
if(app->size < sizeof(ServerNewLSInfo_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Received application packet from server that had opcode ServerOP_NewLSInfo, "
|
||||
Log(Logs::General, Logs::Error, "Received application packet from server that had opcode ServerOP_NewLSInfo, "
|
||||
"but was too small. Discarded to avoid buffer overrun.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(server.options.IsWorldTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "New Login Info Recieved.");
|
||||
Log(Logs::General, Logs::Netcode, "New Login Info Recieved.");
|
||||
}
|
||||
|
||||
ServerNewLSInfo_Struct *info = (ServerNewLSInfo_Struct*)app->pBuffer;
|
||||
@ -97,14 +97,14 @@ bool WorldServer::Process()
|
||||
{
|
||||
if(app->size < sizeof(ServerLSStatus_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved application packet from server that had opcode ServerOP_LSStatus, "
|
||||
Log(Logs::General, Logs::Error, "Recieved application packet from server that had opcode ServerOP_LSStatus, "
|
||||
"but was too small. Discarded to avoid buffer overrun.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(server.options.IsWorldTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "World Server Status Recieved.");
|
||||
Log(Logs::General, Logs::Netcode, "World Server Status Recieved.");
|
||||
}
|
||||
|
||||
ServerLSStatus_Struct *ls_status = (ServerLSStatus_Struct*)app->pBuffer;
|
||||
@ -128,7 +128,7 @@ bool WorldServer::Process()
|
||||
{
|
||||
if(app->size < sizeof(UsertoWorldResponse_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved application packet from server that had opcode ServerOP_UsertoWorldResp, "
|
||||
Log(Logs::General, Logs::Error, "Recieved application packet from server that had opcode ServerOP_UsertoWorldResp, "
|
||||
"but was too small. Discarded to avoid buffer overrun.");
|
||||
break;
|
||||
}
|
||||
@ -138,22 +138,22 @@ bool WorldServer::Process()
|
||||
//While keeping world server spam with multiple servers connected almost impossible.
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "User-To-World Response received.");
|
||||
Log(Logs::General, Logs::Netcode, "User-To-World Response received.");
|
||||
}
|
||||
|
||||
UsertoWorldResponse_Struct *utwr = (UsertoWorldResponse_Struct*)app->pBuffer;
|
||||
Log.Out(Logs::General, Logs::Debug, "Trying to find client with user id of %u.", utwr->lsaccountid);
|
||||
Log(Logs::General, Logs::Debug, "Trying to find client with user id of %u.", utwr->lsaccountid);
|
||||
Client *c = server.client_manager->GetClient(utwr->lsaccountid);
|
||||
if(c)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Debug, "Found client with user id of %u and account name of %s.", utwr->lsaccountid, c->GetAccountName().c_str());
|
||||
Log(Logs::General, Logs::Debug, "Found client with user id of %u and account name of %s.", utwr->lsaccountid, c->GetAccountName().c_str());
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_PlayEverquestResponse, sizeof(PlayEverquestResponse_Struct));
|
||||
PlayEverquestResponse_Struct *per = (PlayEverquestResponse_Struct*)outapp->pBuffer;
|
||||
per->Sequence = c->GetPlaySequence();
|
||||
per->ServerNumber = c->GetPlayServerID();
|
||||
Log.Out(Logs::General, Logs::Debug, "Found sequence and play of %u %u", c->GetPlaySequence(), c->GetPlayServerID());
|
||||
Log(Logs::General, Logs::Debug, "Found sequence and play of %u %u", c->GetPlaySequence(), c->GetPlayServerID());
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "[Size: %u] %s", outapp->size, DumpPacketToString(outapp).c_str());
|
||||
Log(Logs::General, Logs::Netcode, "[Size: %u] %s", outapp->size, DumpPacketToString(outapp).c_str());
|
||||
|
||||
if(utwr->response > 0)
|
||||
{
|
||||
@ -182,9 +182,9 @@ bool WorldServer::Process()
|
||||
|
||||
if(server.options.IsTraceOn())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "Sending play response with following data, allowed %u, sequence %u, server number %u, message %u",
|
||||
Log(Logs::General, Logs::Netcode, "Sending play response with following data, allowed %u, sequence %u, server number %u, message %u",
|
||||
per->Allowed, per->Sequence, per->ServerNumber, per->Message);
|
||||
Log.Out(Logs::General, Logs::Netcode, "[Size: %u] %s", outapp->size, DumpPacketToString(outapp).c_str());
|
||||
Log(Logs::General, Logs::Netcode, "[Size: %u] %s", outapp->size, DumpPacketToString(outapp).c_str());
|
||||
}
|
||||
|
||||
if(server.options.IsDumpOutPacketsOn())
|
||||
@ -197,7 +197,7 @@ bool WorldServer::Process()
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved User-To-World Response for %u but could not find the client referenced!.", utwr->lsaccountid);
|
||||
Log(Logs::General, Logs::Error, "Recieved User-To-World Response for %u but could not find the client referenced!.", utwr->lsaccountid);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -205,16 +205,16 @@ bool WorldServer::Process()
|
||||
{
|
||||
if(app->size < sizeof(ServerLSAccountUpdate_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved application packet from server that had opcode ServerLSAccountUpdate_Struct, "
|
||||
Log(Logs::General, Logs::Error, "Recieved application packet from server that had opcode ServerLSAccountUpdate_Struct, "
|
||||
"but was too small. Discarded to avoid buffer overrun.");
|
||||
break;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate packet received from: %s", short_name.c_str());
|
||||
Log(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate packet received from: %s", short_name.c_str());
|
||||
ServerLSAccountUpdate_Struct *lsau = (ServerLSAccountUpdate_Struct*)app->pBuffer;
|
||||
if(is_server_trusted)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate update processed for: %s", lsau->useraccount);
|
||||
Log(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate update processed for: %s", lsau->useraccount);
|
||||
string name;
|
||||
string password;
|
||||
string email;
|
||||
@ -227,7 +227,7 @@ bool WorldServer::Process()
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Recieved application packet from server that had an unknown operation code 0x%.4X.", app->opcode);
|
||||
Log(Logs::General, Logs::Error, "Recieved application packet from server that had an unknown operation code 0x%.4X.", app->opcode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
{
|
||||
if(is_server_logged_in)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "WorldServer::Handle_NewLSInfo called but the login server was already marked as logged in, aborting.");
|
||||
Log(Logs::General, Logs::Error, "WorldServer::Handle_NewLSInfo called but the login server was already marked as logged in, aborting.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, account name was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, account name was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, account password was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, account password was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, long name was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, long name was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, short name was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, short name was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
{
|
||||
if(strlen(i->local_address) == 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, local address was null, defaulting to localhost");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, local address was null, defaulting to localhost");
|
||||
local_ip = "127.0.0.1";
|
||||
}
|
||||
else
|
||||
@ -299,7 +299,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, local address was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, local address was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
in_addr in;
|
||||
in.s_addr = GetConnection()->GetrIP();
|
||||
remote_ip = inet_ntoa(in);
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, remote address was null, defaulting to stream address %s.", remote_ip.c_str());
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, remote address was null, defaulting to stream address %s.", remote_ip.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -322,7 +322,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
in_addr in;
|
||||
in.s_addr = GetConnection()->GetrIP();
|
||||
remote_ip = inet_ntoa(in);
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, remote address was too long, defaulting to stream address %s.", remote_ip.c_str());
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, remote address was too long, defaulting to stream address %s.", remote_ip.c_str());
|
||||
}
|
||||
|
||||
if(strlen(i->serverversion) <= 64)
|
||||
@ -331,7 +331,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, server version was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, server version was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Handle_NewLSInfo error, protocol version was too long.");
|
||||
Log(Logs::General, Logs::Error, "Handle_NewLSInfo error, protocol version was too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
{
|
||||
if(server.server_manager->ServerExists(long_name, short_name, this))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "World tried to login but there already exists a server that has that name.");
|
||||
Log(Logs::General, Logs::Error, "World tried to login but there already exists a server that has that name.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -360,7 +360,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
{
|
||||
if(server.server_manager->ServerExists(long_name, short_name, this))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "World tried to login but there already exists a server that has that name.");
|
||||
Log(Logs::General, Logs::Error, "World tried to login but there already exists a server that has that name.");
|
||||
server.server_manager->DestroyServerByName(long_name, short_name, this);
|
||||
}
|
||||
}
|
||||
@ -380,7 +380,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
{
|
||||
if(s_acct_name.size() == 0 || s_acct_pass.size() == 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) successfully logged into account that had no user/password requirement.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) successfully logged into account that had no user/password requirement.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
is_server_authorized = true;
|
||||
SetRuntimeID(s_id);
|
||||
@ -389,33 +389,33 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else if(s_acct_name.compare(account_name) == 0 && s_acct_pass.compare(account_password) == 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) successfully logged in.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) successfully logged in.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
is_server_authorized = true;
|
||||
SetRuntimeID(s_id);
|
||||
server_list_id = s_list_type;
|
||||
desc = s_desc;
|
||||
if(s_trusted) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate sent to world");
|
||||
Log(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate sent to world");
|
||||
is_server_trusted = true;
|
||||
ServerPacket *outapp = new ServerPacket(ServerOP_LSAccountUpdate, 0);
|
||||
connection->SendPacket(outapp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but account and password did not match the entry in the database, and only"
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but account and password did not match the entry in the database, and only"
|
||||
" registered servers are allowed.", long_name.c_str(), short_name.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but database couldn't find an entry and only registered servers are allowed.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but database couldn't find an entry and only registered servers are allowed.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) did not attempt to log in but only registered servers are allowed.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) did not attempt to log in but only registered servers are allowed.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
return;
|
||||
}
|
||||
@ -444,7 +444,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
|
||||
if(account_name.size() > 0 && account_password.size() > 0) {
|
||||
if(server_account_name.compare(account_name) == 0 && server_account_password.compare(account_password) == 0) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) successfully logged in.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) successfully logged in.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
is_server_authorized = true;
|
||||
SetRuntimeID(server_id);
|
||||
@ -452,7 +452,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
desc = server_description;
|
||||
|
||||
if(is_server_trusted) {
|
||||
Log.Out(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate sent to world");
|
||||
Log(Logs::General, Logs::Netcode, "ServerOP_LSAccountUpdate sent to world");
|
||||
is_server_trusted = true;
|
||||
ServerPacket *outapp = new ServerPacket(ServerOP_LSAccountUpdate, 0);
|
||||
connection->SendPacket(outapp);
|
||||
@ -460,18 +460,18 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else {
|
||||
// this is the first of two cases where we should deny access even if unregistered is allowed
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but account and password did not match the entry in the database.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but account and password did not match the entry in the database.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(server_account_name.size() > 0 || server_account_password.size() > 0) {
|
||||
// this is the second of two cases where we should deny access even if unregistered is allowed
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) did not attempt to log in but this server requires a password.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) did not attempt to log in but this server requires a password.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) did not attempt to log in but unregistered servers are allowed.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) did not attempt to log in but unregistered servers are allowed.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
is_server_authorized = true;
|
||||
SetRuntimeID(server_id);
|
||||
@ -481,7 +481,7 @@ void WorldServer::Handle_NewLSInfo(ServerNewLSInfo_Struct* i)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but database couldn't find an entry but unregistered servers are allowed.",
|
||||
Log(Logs::General, Logs::World_Server, "Server %s(%s) attempted to log in but database couldn't find an entry but unregistered servers are allowed.",
|
||||
long_name.c_str(), short_name.c_str());
|
||||
if(server.db->CreateWorldRegistration(long_name, short_name, server_id)) {
|
||||
is_server_authorized = true;
|
||||
|
||||
@ -69,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||
HandleMysqlError(errnum);
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message,
|
||||
safe_delete_array(escapedMessage);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::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);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
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);
|
||||
results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount)
|
||||
QS->npc_count);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
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_5);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::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);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
if(members == 0)
|
||||
@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){
|
||||
lastIndex, QS->Chars[i].char_id);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::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);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
if(items == 0)
|
||||
@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) {
|
||||
QS->items[i].aug_5);
|
||||
results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) {
|
||||
QS->char_count, QS->postaction);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
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);
|
||||
results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3
|
||||
QS->char_money.copper, QS->char_count);
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
if(items == 0)
|
||||
@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3
|
||||
QS->items[i].aug_5);
|
||||
results = QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) {
|
||||
std::string query(queryBuffer);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::QS_Server, "%s", query.c_str());
|
||||
}
|
||||
|
||||
safe_delete(pack);
|
||||
@ -378,7 +378,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
int log_category = 0;
|
||||
Log.file_logs_enabled = false;
|
||||
LogSys.file_logs_enabled = false;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
log_category = atoi(row[0]);
|
||||
@ -401,7 +401,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){
|
||||
If we go through this whole loop and nothing is set to any debug level, there is no point to create a file or keep anything open
|
||||
*/
|
||||
if (log_settings[log_category].log_to_file > 0){
|
||||
Log.file_logs_enabled = true;
|
||||
LogSys.file_logs_enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ LFGuildManager lfguildmanager;
|
||||
std::string WorldShortName;
|
||||
const queryservconfig *Config;
|
||||
WorldServer *worldserver = 0;
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
|
||||
void CatchSignal(int sig_num) {
|
||||
RunLoops = false;
|
||||
@ -50,7 +50,7 @@ void CatchSignal(int sig_num) {
|
||||
|
||||
int main() {
|
||||
RegisterExecutablePlatform(ExePlatformQueryServ);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
set_exception_handler();
|
||||
Timer LFGuildExpireTimer(60000);
|
||||
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
||||
@ -65,16 +65,16 @@ int main() {
|
||||
</qsdatabase>
|
||||
*/
|
||||
|
||||
Log.Out(Logs::General, Logs::QS_Server, "Starting EQEmu QueryServ.");
|
||||
Log(Logs::General, Logs::QS_Server, "Starting EQEmu QueryServ.");
|
||||
if (!queryservconfig::LoadConfig()) {
|
||||
Log.Out(Logs::General, Logs::QS_Server, "Loading server configuration failed.");
|
||||
Log(Logs::General, Logs::QS_Server, "Loading server configuration failed.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Config = queryservconfig::get();
|
||||
WorldShortName = Config->ShortName;
|
||||
|
||||
Log.Out(Logs::General, Logs::QS_Server, "Connecting to MySQL...");
|
||||
Log(Logs::General, Logs::QS_Server, "Connecting to MySQL...");
|
||||
|
||||
/* MySQL Connection */
|
||||
if (!database.Connect(
|
||||
@ -83,20 +83,20 @@ int main() {
|
||||
Config->QSDatabasePassword.c_str(),
|
||||
Config->QSDatabaseDB.c_str(),
|
||||
Config->QSDatabasePort)) {
|
||||
Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection.");
|
||||
Log(Logs::General, Logs::QS_Server, "Cannot continue without a database connection.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Register Log System and Settings */
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
Log.StartFileLogs();
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::QS_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::QS_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ int main() {
|
||||
timeout_manager.CheckTimeouts();
|
||||
Sleep(100);
|
||||
}
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
}
|
||||
|
||||
void UpdateWindowTitle(char* iNewTitle) {
|
||||
|
||||
@ -53,7 +53,7 @@ WorldServer::~WorldServer()
|
||||
|
||||
void WorldServer::OnConnected()
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Connected to World.");
|
||||
Log(Logs::Detail, Logs::QS_Server, "Connected to World.");
|
||||
WorldConnection::OnConnected();
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ void WorldServer::Process()
|
||||
ServerPacket *pack = 0;
|
||||
while((pack = tcpc.PopPacket()))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Received Opcode: %4X", pack->opcode);
|
||||
Log(Logs::Detail, Logs::QS_Server, "Received Opcode: %4X", pack->opcode);
|
||||
switch(pack->opcode) {
|
||||
case 0: {
|
||||
break;
|
||||
@ -148,7 +148,7 @@ void WorldServer::Process()
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type);
|
||||
Log(Logs::Detail, Logs::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "spells.h"
|
||||
#include "base_data.h"
|
||||
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <direct.h>
|
||||
@ -71,33 +71,33 @@ inline bool MakeDirectory(const std::string &directory_name)
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RegisterExecutablePlatform(ExePlatformSharedMemory);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
set_exception_handler();
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Shared Memory Loader Program");
|
||||
Log(Logs::General, Logs::Status, "Shared Memory Loader Program");
|
||||
if(!EQEmuConfig::LoadConfig()) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to load configuration file.");
|
||||
Log(Logs::General, Logs::Error, "Unable to load configuration file.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto Config = EQEmuConfig::get();
|
||||
|
||||
SharedDatabase database;
|
||||
Log.Out(Logs::General, Logs::Status, "Connecting to database...");
|
||||
Log(Logs::General, Logs::Status, "Connecting to database...");
|
||||
if(!database.Connect(Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(),
|
||||
Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
|
||||
Log(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a "
|
||||
"database connection");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Register Log System and Settings */
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
Log.StartFileLogs();
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
std::string shared_mem_directory = Config->SharedMemDir;
|
||||
if (MakeDirectory(shared_mem_directory)) {
|
||||
Log.Out(Logs::General, Logs::Status, "Shared Memory folder doesn't exist, so we created it... '%s'", shared_mem_directory.c_str());
|
||||
Log(Logs::General, Logs::Status, "Shared Memory folder doesn't exist, so we created it... '%s'", shared_mem_directory.c_str());
|
||||
}
|
||||
|
||||
database.LoadVariables();
|
||||
@ -106,7 +106,7 @@ int main(int argc, char **argv) {
|
||||
std::string db_hotfix_name;
|
||||
if (database.GetVariable("hotfix_name", db_hotfix_name)) {
|
||||
if (!db_hotfix_name.empty() && strcasecmp("hotfix_", db_hotfix_name.c_str()) == 0) {
|
||||
Log.Out(Logs::General, Logs::Status, "Current hotfix in variables is the default %s, clearing out variable", db_hotfix_name.c_str());
|
||||
Log(Logs::General, Logs::Status, "Current hotfix in variables is the default %s, clearing out variable", db_hotfix_name.c_str());
|
||||
std::string query = StringFormat("UPDATE `variables` SET `value`='' WHERE (`varname`='hotfix_name')");
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
@ -177,69 +177,69 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if(hotfix_name.length() > 0) {
|
||||
Log.Out(Logs::General, Logs::Status, "Writing data for hotfix '%s'", hotfix_name.c_str());
|
||||
Log(Logs::General, Logs::Status, "Writing data for hotfix '%s'", hotfix_name.c_str());
|
||||
}
|
||||
|
||||
if(load_all || load_items) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading items...");
|
||||
Log(Logs::General, Logs::Status, "Loading items...");
|
||||
try {
|
||||
LoadItems(&database, hotfix_name);
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "%s", ex.what());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(load_all || load_factions) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading factions...");
|
||||
Log(Logs::General, Logs::Status, "Loading factions...");
|
||||
try {
|
||||
LoadFactions(&database, hotfix_name);
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "%s", ex.what());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(load_all || load_loot) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading loot...");
|
||||
Log(Logs::General, Logs::Status, "Loading loot...");
|
||||
try {
|
||||
LoadLoot(&database, hotfix_name);
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "%s", ex.what());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(load_all || load_skill_caps) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading skill caps...");
|
||||
Log(Logs::General, Logs::Status, "Loading skill caps...");
|
||||
try {
|
||||
LoadSkillCaps(&database, hotfix_name);
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "%s", ex.what());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(load_all || load_spells) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading spells...");
|
||||
Log(Logs::General, Logs::Status, "Loading spells...");
|
||||
try {
|
||||
LoadSpells(&database, hotfix_name);
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "%s", ex.what());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(load_all || load_bd) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading base data...");
|
||||
Log(Logs::General, Logs::Status, "Loading base data...");
|
||||
try {
|
||||
LoadBaseData(&database, hotfix_name);
|
||||
} catch(std::exception &ex) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s", ex.what());
|
||||
Log(Logs::General, Logs::Error, "%s", ex.what());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in
|
||||
|
||||
Moderated = false;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
|
||||
Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus);
|
||||
|
||||
}
|
||||
@ -150,7 +150,7 @@ void ChatChannelList::SendAllChannels(Client *c) {
|
||||
|
||||
void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str());
|
||||
|
||||
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
|
||||
|
||||
@ -171,7 +171,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
|
||||
|
||||
void ChatChannelList::RemoveAllChannels() {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "RemoveAllChannels");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "RemoveAllChannels");
|
||||
|
||||
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
|
||||
|
||||
@ -229,7 +229,7 @@ void ChatChannel::AddClient(Client *c) {
|
||||
|
||||
if(IsClientInChannel(c)) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@ -238,7 +238,7 @@ void ChatChannel::AddClient(Client *c) {
|
||||
|
||||
int AccountStatus = c->GetAccountStatus();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
|
||||
|
||||
LinkedListIterator<Client*> iterator(ClientsInChannel);
|
||||
|
||||
@ -263,7 +263,7 @@ bool ChatChannel::RemoveClient(Client *c) {
|
||||
|
||||
if(!c) return false;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
|
||||
|
||||
bool HideMe = c->GetHideMe();
|
||||
|
||||
@ -300,7 +300,7 @@ bool ChatChannel::RemoveClient(Client *c) {
|
||||
if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0))
|
||||
return false;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str());
|
||||
|
||||
DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000);
|
||||
}
|
||||
@ -396,7 +396,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) {
|
||||
|
||||
if(ChannelClient)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Sending message to %s from %s",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Sending message to %s from %s",
|
||||
ChannelClient->GetName().c_str(), Sender->GetName().c_str());
|
||||
ChannelClient->SendChannelMessage(Name, Message, Sender);
|
||||
}
|
||||
@ -478,7 +478,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
|
||||
|
||||
ChatChannel *RequiredChannel = FindChannel(NormalisedName);
|
||||
|
||||
@ -554,7 +554,7 @@ void ChatChannelList::Process() {
|
||||
|
||||
if(CurrentChannel && CurrentChannel->ReadyToDelete()) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Empty temporary password protected channel %s being destroyed.",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Empty temporary password protected channel %s being destroyed.",
|
||||
CurrentChannel->GetName().c_str());
|
||||
|
||||
RemoveChannel(CurrentChannel);
|
||||
@ -570,7 +570,7 @@ void ChatChannel::AddInvitee(const std::string &Invitee)
|
||||
if (!IsInvitee(Invitee)) {
|
||||
Invitees.push_back(Invitee);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -581,7 +581,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee)
|
||||
|
||||
if(it != std::end(Invitees)) {
|
||||
Invitees.erase(it);
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ void ChatChannel::AddModerator(const std::string &Moderator)
|
||||
if (!IsModerator(Moderator)) {
|
||||
Moderators.push_back(Moderator);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -606,7 +606,7 @@ void ChatChannel::RemoveModerator(const std::string &Moderator)
|
||||
|
||||
if (it != std::end(Moderators)) {
|
||||
Moderators.erase(it);
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -620,7 +620,7 @@ void ChatChannel::AddVoice(const std::string &inVoiced)
|
||||
if (!HasVoice(inVoiced)) {
|
||||
Voiced.push_back(inVoiced);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ void ChatChannel::RemoveVoice(const std::string &inVoiced)
|
||||
if (it != std::end(Voiced)) {
|
||||
Voiced.erase(it);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -236,7 +236,7 @@ std::vector<std::string> ParseRecipients(std::string RecipientString) {
|
||||
|
||||
static void ProcessMailTo(Client *c, std::string MailMessage) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str());
|
||||
|
||||
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)) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(),
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(),
|
||||
c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str());
|
||||
|
||||
int PacketLength = 10 + Recipient.length() + Subject.length();
|
||||
@ -398,7 +398,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) {
|
||||
|
||||
static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str());
|
||||
c->GeneralChannelMessage("Buddy list modified");
|
||||
|
||||
uint8 SubAction = 1;
|
||||
@ -427,7 +427,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) {
|
||||
|
||||
static void ProcessCommandIgnore(Client *c, std::string Ignoree) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str());
|
||||
c->GeneralChannelMessage("Ignore list modified");
|
||||
|
||||
uint8 SubAction = 0;
|
||||
@ -476,10 +476,11 @@ Clientlist::Clientlist(int ChatPort) {
|
||||
if(!ChatOpMgr->LoadOpcodes("mail_opcodes.conf"))
|
||||
exit(1);
|
||||
|
||||
if (chatsf->Open())
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort);
|
||||
if (chatsf->Open()) {
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client (UDP) Chat listener started on port %i.", ChatPort);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort);
|
||||
Log(Logs::Detail, Logs::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
@ -556,13 +557,13 @@ void Clientlist::CheckForStaleConnections(Client *c) {
|
||||
if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName())
|
||||
&& (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Removing old connection for %s", c->GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removing old connection for %s", c->GetName().c_str());
|
||||
|
||||
struct in_addr in;
|
||||
|
||||
in.s_addr = (*Iterator)->ClientStream->GetRemoteIP();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
ntohs((*Iterator)->ClientStream->GetRemotePort()));
|
||||
|
||||
safe_delete((*Iterator));
|
||||
@ -580,7 +581,7 @@ void Clientlist::Process()
|
||||
struct in_addr in;
|
||||
in.s_addr = eqs->GetRemoteIP();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in),
|
||||
Log(Logs::Detail, Logs::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in),
|
||||
ntohs(eqs->GetRemotePort()));
|
||||
|
||||
eqs->SetOpcodeManager(&ChatOpMgr);
|
||||
@ -596,7 +597,7 @@ void Clientlist::Process()
|
||||
struct in_addr in;
|
||||
in.s_addr = (*it)->ClientStream->GetRemoteIP();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in),
|
||||
ntohs((*it)->ClientStream->GetRemotePort()));
|
||||
|
||||
safe_delete((*it));
|
||||
@ -622,7 +623,7 @@ void Clientlist::Process()
|
||||
VARSTRUCT_DECODE_STRING(MailBox, PacketBuffer);
|
||||
|
||||
if (strlen(PacketBuffer) != 9) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server,
|
||||
Log(Logs::Detail, Logs::UCS_Server,
|
||||
"Mail key is the wrong size. Version of world incompatible with UCS.");
|
||||
KeyValid = false;
|
||||
break;
|
||||
@ -644,11 +645,11 @@ void Clientlist::Process()
|
||||
else
|
||||
CharacterName = MailBoxString.substr(LastPeriod + 1);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Received login for user %s with key %s",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received login for user %s with key %s",
|
||||
MailBox, Key);
|
||||
|
||||
if (!database.VerifyMailKey(CharacterName, (*it)->ClientStream->GetRemoteIP(), Key)) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server,
|
||||
Log(Logs::Detail, Logs::UCS_Server,
|
||||
"Chat Key for %s does not match, closing connection.", MailBox);
|
||||
KeyValid = false;
|
||||
break;
|
||||
@ -674,7 +675,7 @@ void Clientlist::Process()
|
||||
}
|
||||
|
||||
default: {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Unhandled chat opcode %8X", opcode);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Unhandled chat opcode %8X", opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -684,7 +685,7 @@ void Clientlist::Process()
|
||||
struct in_addr in;
|
||||
in.s_addr = (*it)->ClientStream->GetRemoteIP();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server,
|
||||
Log(Logs::Detail, Logs::UCS_Server,
|
||||
"Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i",
|
||||
inet_ntoa(in), ntohs((*it)->ClientStream->GetRemotePort()), KeyValid,
|
||||
(*it)->GetForceDisconnect());
|
||||
@ -826,7 +827,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString)
|
||||
break;
|
||||
|
||||
case CommandSetMessageStatus:
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str());
|
||||
ProcessSetMessageStatus(Parameters);
|
||||
break;
|
||||
|
||||
@ -851,7 +852,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString)
|
||||
|
||||
default:
|
||||
c->SendHelp();
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -862,7 +863,7 @@ void Clientlist::CloseAllConnections() {
|
||||
|
||||
for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str());
|
||||
|
||||
(*Iterator)->CloseConnection();
|
||||
}
|
||||
@ -871,7 +872,7 @@ void Clientlist::CloseAllConnections() {
|
||||
void Client::AddCharacter(int CharID, const char *CharacterName, int Level) {
|
||||
|
||||
if(!CharacterName) return;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str());
|
||||
CharacterEntry NewCharacter;
|
||||
NewCharacter.CharID = CharID;
|
||||
NewCharacter.Name = CharacterName;
|
||||
@ -936,7 +937,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) {
|
||||
for(int i = 0; i < MAX_JOINED_CHANNELS; i++)
|
||||
if(JoinedChannels[i] == nullptr) {
|
||||
JoinedChannels[i] = JoinedChannel;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -977,7 +978,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
|
||||
int NumberOfChannels = ChannelCount();
|
||||
|
||||
@ -1076,7 +1077,7 @@ void Client::JoinChannels(std::string ChannelNameList) {
|
||||
|
||||
void Client::LeaveChannels(std::string ChannelNameList) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str());
|
||||
|
||||
std::string::size_type CurrentPos = 0;
|
||||
|
||||
@ -1252,7 +1253,7 @@ void Client::SendChannelMessage(std::string Message)
|
||||
|
||||
std::string ChannelName = Message.substr(1, MessageStart-1);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str());
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@ -1395,7 +1396,7 @@ void Client::SendChannelMessageByNumber(std::string Message) {
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(),
|
||||
Log(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(),
|
||||
Message.substr(MessageStart + 1).c_str());
|
||||
|
||||
if(RuleB(Chat, EnableAntiSpam))
|
||||
@ -1603,7 +1604,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) {
|
||||
else
|
||||
Message = "Password change on channel " + ChannelName;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str());
|
||||
Log(Logs::Detail, Logs::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);
|
||||
|
||||
@ -1658,7 +1659,7 @@ void Client::SetChannelOwner(std::string CommandString) {
|
||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str());
|
||||
|
||||
ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName);
|
||||
|
||||
@ -1746,7 +1747,7 @@ void Client::ChannelInvite(std::string CommandString) {
|
||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Invitee);
|
||||
|
||||
@ -1874,7 +1875,7 @@ void Client::ChannelGrantModerator(std::string CommandString) {
|
||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Moderator);
|
||||
|
||||
@ -1955,7 +1956,7 @@ void Client::ChannelGrantVoice(std::string CommandString) {
|
||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Voicee);
|
||||
|
||||
@ -2043,7 +2044,7 @@ void Client::ChannelKick(std::string CommandString) {
|
||||
if((ChannelName.length() > 0) && isdigit(ChannelName[0]))
|
||||
ChannelName = ChannelSlotName(atoi(ChannelName.c_str()));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str());
|
||||
|
||||
Client *RequiredClient = g_Clientlist->FindCharacter(Kickee);
|
||||
|
||||
@ -2152,32 +2153,32 @@ void Client::SetConnectionType(char c) {
|
||||
case 'S':
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (SoF/SoD)");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (SoF/SoD)");
|
||||
break;
|
||||
}
|
||||
case 'U':
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeCombined;
|
||||
UnderfootOrLater = true;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (Underfoot+)");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (Underfoot+)");
|
||||
break;
|
||||
}
|
||||
case 'M':
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeMail;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Mail (6.2 or Titanium client)");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Mail (6.2 or Titanium client)");
|
||||
break;
|
||||
}
|
||||
case 'C':
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeChat;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Chat (6.2 or Titanium client)");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is Chat (6.2 or Titanium client)");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
TypeOfConnection = ConnectionTypeUnknown;
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is unknown.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connection type is unknown.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2254,12 +2255,12 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin
|
||||
|
||||
void Client::ChangeMailBox(int NewMailBox)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox);
|
||||
|
||||
SetMailBox(NewMailBox);
|
||||
auto id = std::to_string(NewMailBox);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "New mailbox is %s", MailBoxName().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "New mailbox is %s", MailBoxName().c_str());
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_MailboxChange, id.length() + 1);
|
||||
|
||||
@ -2328,13 +2329,13 @@ std::string Client::MailBoxName() {
|
||||
|
||||
if((Characters.empty()) || (CurrentMailBox > (Characters.size() - 1)))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
CurrentMailBox, Characters.size());
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i",
|
||||
CurrentMailBox, Characters.size());
|
||||
|
||||
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];
|
||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf);
|
||||
HandleMysqlError(errnum);
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||
Log(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) {
|
||||
client->GetAccountID());
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "GetAccountStatus Query: %s", query.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "GetAccountStatus Query: %s", query.c_str());
|
||||
|
||||
if(results.RowCount() != 1)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Error in GetAccountStatus");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Error in GetAccountStatus");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) {
|
||||
client->SetKarma(atoi(row[2]));
|
||||
client->SetRevoked((atoi(row[3])==1?true:false));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "FindAccount for character %s", characterName);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "FindAccount for character %s", characterName);
|
||||
|
||||
|
||||
client->ClearCharacters();
|
||||
@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) {
|
||||
characterName);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "FindAccount query failed: %s", query.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "FindAccount query failed: %s", query.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (results.RowCount() != 1) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Bad result from query");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Bad result from query");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) {
|
||||
|
||||
int accountID = atoi(row[1]);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Account ID for %s is %i", characterName, accountID);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Account ID for %s is %i", characterName, accountID);
|
||||
|
||||
query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` "
|
||||
"WHERE `account_id` = %i AND `name` != '%s'",
|
||||
@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri
|
||||
characterName.c_str());
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri
|
||||
else
|
||||
sprintf(combinedKey, "%s", MailKey.c_str());
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "DB key is [%s], Client key is [%s]", (row[0] ? row[0] : ""), combinedKey);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "DB key is [%s], Client key is [%s]", (row[0] ? row[0] : ""), combinedKey);
|
||||
|
||||
return !strcmp(row[0], combinedKey);
|
||||
}
|
||||
@ -213,7 +213,7 @@ int Database::FindCharacter(const char *characterName)
|
||||
safe_delete_array(safeCharName);
|
||||
|
||||
if (results.RowCount() != 1) {
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Bad result from FindCharacter query for character %s",
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Bad result from FindCharacter query for character %s",
|
||||
characterName);
|
||||
return -1;
|
||||
}
|
||||
@ -245,7 +245,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_
|
||||
|
||||
bool Database::LoadChatChannels() {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Loading chat channels from the database.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Loading chat channels from the database.");
|
||||
|
||||
const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`";
|
||||
auto results = QueryDatabase(query);
|
||||
@ -266,7 +266,7 @@ bool Database::LoadChatChannels() {
|
||||
|
||||
void Database::SetChannelPassword(std::string channelName, std::string password) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str());
|
||||
|
||||
std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'",
|
||||
password.c_str(), channelName.c_str());
|
||||
@ -275,7 +275,7 @@ void Database::SetChannelPassword(std::string channelName, std::string password)
|
||||
|
||||
void Database::SetChannelOwner(std::string channelName, std::string owner) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str());
|
||||
|
||||
std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'",
|
||||
owner.c_str(), channelName.c_str());
|
||||
@ -288,7 +288,7 @@ void Database::SendHeaders(Client *client) {
|
||||
int unknownField3 = 1;
|
||||
int characterID = FindCharacter(client->MailBoxName().c_str());
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID);
|
||||
|
||||
if(characterID <= 0)
|
||||
return;
|
||||
@ -373,7 +373,7 @@ void Database::SendBody(Client *client, int messageNumber) {
|
||||
|
||||
int characterID = FindCharacter(client->MailBoxName().c_str());
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID);
|
||||
|
||||
if(characterID <= 0)
|
||||
return;
|
||||
@ -390,7 +390,7 @@ void Database::SendBody(Client *client, int messageNumber) {
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1]));
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1]));
|
||||
|
||||
int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]);
|
||||
|
||||
@ -435,7 +435,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub
|
||||
|
||||
characterID = FindCharacter(characterName.c_str());
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID);
|
||||
|
||||
if(characterID <= 0)
|
||||
return false;
|
||||
@ -460,7 +460,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str());
|
||||
|
||||
|
||||
Client *client = g_Clientlist->IsCharacterOnline(characterName);
|
||||
@ -477,7 +477,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub
|
||||
|
||||
void Database::SetMessageStatus(int messageNumber, int status) {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "SetMessageStatus %i %i", messageNumber, status);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "SetMessageStatus %i %i", messageNumber, status);
|
||||
|
||||
if(status == 0) {
|
||||
std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber);
|
||||
@ -491,7 +491,7 @@ void Database::SetMessageStatus(int messageNumber, int status) {
|
||||
|
||||
void Database::ExpireMail() {
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Expiring mail...");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Expiring mail...");
|
||||
|
||||
std::string query = "SELECT COUNT(*) FROM `mail`";
|
||||
auto results = QueryDatabase(query);
|
||||
@ -501,7 +501,7 @@ void Database::ExpireMail() {
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "There are %s messages in the database.", row[0]);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "There are %s messages in the database.", row[0]);
|
||||
|
||||
// Expire Trash
|
||||
if(RuleI(Mail, ExpireTrash) >= 0) {
|
||||
@ -509,7 +509,7 @@ void Database::ExpireMail() {
|
||||
time(nullptr) - RuleI(Mail, ExpireTrash));
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success())
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i trash messages.", results.RowsAffected());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Expired %i trash messages.", results.RowsAffected());
|
||||
}
|
||||
|
||||
// Expire Read
|
||||
@ -518,7 +518,7 @@ void Database::ExpireMail() {
|
||||
time(nullptr) - RuleI(Mail, ExpireRead));
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success())
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i read messages.", results.RowsAffected());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Expired %i read messages.", results.RowsAffected());
|
||||
}
|
||||
|
||||
// Expire Unread
|
||||
@ -527,7 +527,7 @@ void Database::ExpireMail() {
|
||||
time(nullptr) - RuleI(Mail, ExpireUnread));
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success())
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i unread messages.", results.RowsAffected());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Expired %i unread messages.", results.RowsAffected());
|
||||
}
|
||||
}
|
||||
|
||||
@ -538,7 +538,7 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) {
|
||||
charID, type, CapitaliseName(name).c_str());
|
||||
auto results = QueryDatabase(query);
|
||||
if(results.Success())
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str());
|
||||
|
||||
}
|
||||
|
||||
@ -548,11 +548,12 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) {
|
||||
"AND `type` = %i AND `name` = '%s'",
|
||||
charID, type, CapitaliseName(name).c_str());
|
||||
auto results = QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str());
|
||||
else
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str());
|
||||
|
||||
if (!results.Success()) {
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str());
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void Database::GetFriendsAndIgnore(int charID, std::vector<std::string> &friends, std::vector<std::string> &ignorees) {
|
||||
@ -570,12 +571,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector<std::string> &friends
|
||||
if(atoi(row[0]) == 0)
|
||||
{
|
||||
ignorees.push_back(name);
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Added Ignoree from DB %s", name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added Ignoree from DB %s", name.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
friends.push_back(name);
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Added Friend from DB %s", name.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Added Friend from DB %s", name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@ -594,7 +595,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
int log_category = 0;
|
||||
Log.file_logs_enabled = false;
|
||||
LogSys.file_logs_enabled = false;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
log_category = atoi(row[0]);
|
||||
@ -617,7 +618,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){
|
||||
If we go through this whole loop and nothing is set to any debug level, there is no point to create a file or keep anything open
|
||||
*/
|
||||
if (log_settings[log_category].log_to_file > 0){
|
||||
Log.file_logs_enabled = true;
|
||||
LogSys.file_logs_enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
32
ucs/ucs.cpp
32
ucs/ucs.cpp
@ -35,7 +35,7 @@
|
||||
|
||||
ChatChannelList *ChannelList;
|
||||
Clientlist *g_Clientlist;
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
TimeoutManager timeout_manager;
|
||||
Database database;
|
||||
WorldServer *worldserver = nullptr;
|
||||
@ -65,7 +65,7 @@ std::string GetMailPrefix() {
|
||||
|
||||
int main() {
|
||||
RegisterExecutablePlatform(ExePlatformUCS);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
set_exception_handler();
|
||||
|
||||
// Check every minute for unused channels we can delete
|
||||
@ -74,10 +74,10 @@ int main() {
|
||||
|
||||
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
||||
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Starting EQEmu Universal Chat Server.");
|
||||
Log(Logs::General, Logs::UCS_Server, "Starting EQEmu Universal Chat Server.");
|
||||
|
||||
if (!ucsconfig::LoadConfig()) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Loading server configuration failed.");
|
||||
Log(Logs::General, Logs::UCS_Server, "Loading server configuration failed.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ int main() {
|
||||
|
||||
WorldShortName = Config->ShortName;
|
||||
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Connecting to MySQL...");
|
||||
Log(Logs::General, Logs::UCS_Server, "Connecting to MySQL...");
|
||||
|
||||
if (!database.Connect(
|
||||
Config->DatabaseHost.c_str(),
|
||||
@ -93,26 +93,26 @@ int main() {
|
||||
Config->DatabasePassword.c_str(),
|
||||
Config->DatabaseDB.c_str(),
|
||||
Config->DatabasePort)) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Cannot continue without a database connection.");
|
||||
Log(Logs::General, Logs::UCS_Server, "Cannot continue without a database connection.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Register Log System and Settings */
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
Log.StartFileLogs();
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
char tmp[64];
|
||||
|
||||
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Loading rule set '%s'", tmp);
|
||||
Log(Logs::General, Logs::UCS_Server, "Loading rule set '%s'", tmp);
|
||||
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
||||
Log(Logs::General, Logs::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp);
|
||||
}
|
||||
} else {
|
||||
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "No rule set configured, using default rules");
|
||||
Log(Logs::General, Logs::UCS_Server, "No rule set configured, using default rules");
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Loaded default rule set 'default'", tmp);
|
||||
Log(Logs::General, Logs::UCS_Server, "Loaded default rule set 'default'", tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ int main() {
|
||||
|
||||
if(Config->ChatPort != Config->MailPort)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS.");
|
||||
Log(Logs::General, Logs::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -131,11 +131,11 @@ int main() {
|
||||
database.LoadChatChannels();
|
||||
|
||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::UCS_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::UCS_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::UCS_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ int main() {
|
||||
|
||||
g_Clientlist->CloseAllConnections();
|
||||
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ WorldServer::~WorldServer()
|
||||
|
||||
void WorldServer::OnConnected()
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Connected to World.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Connected to World.");
|
||||
WorldConnection::OnConnected();
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ void WorldServer::Process()
|
||||
|
||||
while((pack = tcpc.PopPacket()))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Received Opcode: %4X", pack->opcode);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Received Opcode: %4X", pack->opcode);
|
||||
|
||||
switch(pack->opcode)
|
||||
{
|
||||
@ -88,7 +88,7 @@ void WorldServer::Process()
|
||||
|
||||
std::string Message = Buffer;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str());
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str());
|
||||
|
||||
Client *c = g_Clientlist->FindCharacter(From);
|
||||
|
||||
@ -99,7 +99,7 @@ void WorldServer::Process()
|
||||
|
||||
if(!c)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Client not found.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Client not found.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
174
world/client.cpp
174
world/client.cpp
@ -157,7 +157,7 @@ void Client::SendEnterWorld(std::string name)
|
||||
eqs->Close();
|
||||
return;
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Telling client to continue session.");
|
||||
Log(Logs::Detail, Logs::World_Server,"Telling client to continue session.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ void Client::SendCharInfo() {
|
||||
QueuePacket(outapp);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "[Error] Database did not return an OP_SendCharInfo packet for account %u", GetAccountID());
|
||||
Log(Logs::General, Logs::World_Server, "[Error] Database did not return an OP_SendCharInfo packet for account %u", GetAccountID());
|
||||
}
|
||||
safe_delete(outapp);
|
||||
}
|
||||
@ -407,7 +407,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
||||
|
||||
if (strlen(password) <= 1) {
|
||||
// TODO: Find out how to tell the client wrong username/password
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Login without a password");
|
||||
Log(Logs::Detail, Logs::World_Server,"Login without a password");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -437,18 +437,20 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
||||
if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password)))
|
||||
#else
|
||||
if (loginserverlist.Connected() == false && !is_player_zoning) {
|
||||
Log.Out(Logs::General, Logs::World_Server,"Error: Login server login while not connected to login server.");
|
||||
Log(Logs::General, Logs::World_Server,"Error: Login server login while not connected to login server.");
|
||||
return false;
|
||||
}
|
||||
if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password))))
|
||||
#endif
|
||||
{
|
||||
if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) {
|
||||
Log.Out(Logs::General, Logs::World_Server,"ID is 0. Is this server connected to minilogin?");
|
||||
if(!minilogin)
|
||||
Log.Out(Logs::General, Logs::World_Server,"If so you forget the minilogin variable...");
|
||||
else
|
||||
Log.Out(Logs::General, Logs::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table.");
|
||||
Log(Logs::General, Logs::World_Server,"ID is 0. Is this server connected to minilogin?");
|
||||
if (!minilogin) {
|
||||
Log(Logs::General, Logs::World_Server, "If so you forget the minilogin variable...");
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::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;
|
||||
}
|
||||
|
||||
@ -456,11 +458,11 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
||||
|
||||
if(minilogin){
|
||||
WorldConfig::DisableStats();
|
||||
Log.Out(Logs::General, Logs::World_Server, "MiniLogin Account #%d",cle->AccountID());
|
||||
Log(Logs::General, Logs::World_Server, "MiniLogin Account #%d",cle->AccountID());
|
||||
}
|
||||
else {
|
||||
if (!is_player_zoning) {
|
||||
Log.Out(Logs::General, Logs::World_Server,
|
||||
Log(Logs::General, Logs::World_Server,
|
||||
"Account (%s) Logging in :: LSID: %d ", cle->AccountName(), cle->LSID());
|
||||
}
|
||||
}
|
||||
@ -496,7 +498,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
||||
}
|
||||
else {
|
||||
// TODO: Find out how to tell the client wrong username/password
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Bad/Expired session key '%s'",name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Bad/Expired session key '%s'",name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -510,7 +512,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) {
|
||||
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
||||
{
|
||||
if (GetAccountID() == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Name approval request with no logged in account");
|
||||
Log(Logs::Detail, Logs::World_Server,"Name approval request with no logged in account");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -518,7 +520,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
||||
uchar race = app->pBuffer[64];
|
||||
uchar clas = app->pBuffer[68];
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceIDName(race), GetClassIDName(clas));
|
||||
Log(Logs::Detail, Logs::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceIDName(race), GetClassIDName(clas));
|
||||
|
||||
EQApplicationPacket *outapp;
|
||||
outapp = new EQApplicationPacket;
|
||||
@ -679,11 +681,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app)
|
||||
|
||||
bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
||||
if (GetAccountID() == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Account ID not set; unable to create character.");
|
||||
Log(Logs::Detail, Logs::World_Server,"Account ID not set; unable to create character.");
|
||||
return false;
|
||||
}
|
||||
else if (app->size != sizeof(CharCreate_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct));
|
||||
DumpPacket(app);
|
||||
// the previous behavior was essentially returning true here
|
||||
// but that seems a bit odd to me.
|
||||
@ -710,14 +712,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
||||
|
||||
bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
if (GetAccountID() == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Enter world with no logged in account");
|
||||
Log(Logs::Detail, Logs::World_Server,"Enter world with no logged in account");
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(GetAdmin() < 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Account banned or suspended.");
|
||||
Log(Logs::Detail, Logs::World_Server,"Account banned or suspended.");
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
@ -733,14 +735,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
uint32 tmpaccid = 0;
|
||||
charid = database.GetCharacterInfo(char_name, &tmpaccid, &zone_id, &instance_id);
|
||||
if (charid == 0 || tmpaccid != GetAccountID()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Could not get CharInfo for '%s'",char_name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Could not get CharInfo for '%s'",char_name);
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make sure this account owns this character
|
||||
if (tmpaccid != GetAccountID()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"This account does not own the character named '%s'",char_name);
|
||||
Log(Logs::Detail, Logs::World_Server,"This account does not own the character named '%s'",char_name);
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
@ -782,7 +784,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
zone_id = database.MoveCharacterToBind(charid, 4);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "'%s' is trying to go home before they're able...", char_name);
|
||||
Log(Logs::Detail, Logs::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.");
|
||||
eqs->Close();
|
||||
return true;
|
||||
@ -806,7 +808,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
database.MoveCharacterToZone(charid, database.GetZoneName(zone_id));
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "'%s' is trying to go to tutorial but are not allowed...", char_name);
|
||||
Log(Logs::Detail, Logs::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.");
|
||||
eqs->Close();
|
||||
return true;
|
||||
@ -817,7 +819,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
if (zone_id == 0 || !database.GetZoneName(zone_id)) {
|
||||
// This is to save people in an invalid zone, once it's removed from the DB
|
||||
database.MoveCharacterToZone(charid, "arena");
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zone_id, char_name);
|
||||
Log(Logs::Detail, Logs::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zone_id, char_name);
|
||||
}
|
||||
|
||||
if(instance_id > 0)
|
||||
@ -931,7 +933,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) {
|
||||
|
||||
uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer);
|
||||
if(char_acct_id == GetAccountID()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Delete character: %s",app->pBuffer);
|
||||
Log(Logs::Detail, Logs::World_Server,"Delete character: %s",app->pBuffer);
|
||||
database.DeleteCharacter((char *)app->pBuffer);
|
||||
SendCharInfo();
|
||||
}
|
||||
@ -952,24 +954,24 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
||||
|
||||
EmuOpcode opcode = app->GetOpcode();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Recevied EQApplicationPacket");
|
||||
Log(Logs::Detail, Logs::World_Server,"Recevied EQApplicationPacket");
|
||||
|
||||
if (!eqs->CheckState(ESTABLISHED)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Client disconnected (net inactive on send)");
|
||||
Log(Logs::Detail, Logs::World_Server,"Client disconnected (net inactive on send)");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses
|
||||
if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
|
||||
if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
||||
Log(Logs::Detail, Logs::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
||||
eqs->Close();
|
||||
}
|
||||
}
|
||||
|
||||
if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) {
|
||||
// Got a packet other than OP_SendLoginInfo when not logged in
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
||||
Log(Logs::Detail, Logs::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
||||
return false;
|
||||
}
|
||||
else if (opcode == OP_AckPacket) {
|
||||
@ -1047,7 +1049,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Received unknown EQApplicationPacket");
|
||||
Log(Logs::Detail, Logs::World_Server,"Received unknown EQApplicationPacket");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1065,7 +1067,7 @@ bool Client::Process() {
|
||||
to.sin_addr.s_addr = ip;
|
||||
|
||||
if (autobootup_timeout.Check()) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Zone bootup timer expired, bootup failed or too slow.");
|
||||
Log(Logs::General, Logs::World_Server, "Zone bootup timer expired, bootup failed or too slow.");
|
||||
TellClientZoneUnavailable();
|
||||
}
|
||||
if(connect.Check()){
|
||||
@ -1099,7 +1101,7 @@ bool Client::Process() {
|
||||
loginserverlist.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Client disconnected (not active in process)");
|
||||
Log(Logs::Detail, Logs::World_Server,"Client disconnected (not active in process)");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1148,17 +1150,17 @@ void Client::EnterWorld(bool TryBootup) {
|
||||
}
|
||||
else {
|
||||
if (TryBootup) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Attempting autobootup of %s (%d:%d)", zone_name, zone_id, instance_id);
|
||||
Log(Logs::General, Logs::World_Server, "Attempting autobootup of %s (%d:%d)", zone_name, zone_id, instance_id);
|
||||
autobootup_timeout.Start();
|
||||
zone_waiting_for_bootup = zoneserver_list.TriggerBootup(zone_id, instance_id);
|
||||
if (zone_waiting_for_bootup == 0) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "No zoneserver available to boot up.");
|
||||
Log(Logs::General, Logs::World_Server, "No zoneserver available to boot up.");
|
||||
TellClientZoneUnavailable();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Requested zone %s is not running.", zone_name);
|
||||
Log(Logs::General, Logs::World_Server, "Requested zone %s is not running.", zone_name);
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
@ -1172,7 +1174,7 @@ void Client::EnterWorld(bool TryBootup) {
|
||||
cle->SetChar(charid, char_name);
|
||||
database.UpdateLiveChar(char_name, GetAccountID());
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server,
|
||||
Log(Logs::General, Logs::World_Server,
|
||||
"(%s) %s %s (Zone ID %d: Instance ID: %d) ",
|
||||
char_name,
|
||||
(seen_character_select ? "Zoning from character select" : "Zoning to"),
|
||||
@ -1183,7 +1185,7 @@ void Client::EnterWorld(bool TryBootup) {
|
||||
|
||||
if (seen_character_select) {
|
||||
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
|
||||
Log(Logs::General, Logs::World_Server, "Enter world failed. Zone is locked.");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
@ -1221,9 +1223,9 @@ void Client::Clearance(int8 response)
|
||||
{
|
||||
if (zs == 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Unable to find zoneserver in Client::Clearance!!");
|
||||
Log(Logs::Detail, Logs::World_Server,"Unable to find zoneserver in Client::Clearance!!");
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Invalid response %d in Client::Clearance", response);
|
||||
Log(Logs::Detail, Logs::World_Server, "Invalid response %d in Client::Clearance", response);
|
||||
}
|
||||
|
||||
TellClientZoneUnavailable();
|
||||
@ -1233,20 +1235,20 @@ void Client::Clearance(int8 response)
|
||||
EQApplicationPacket* outapp;
|
||||
|
||||
if (zs->GetCAddress() == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!");
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
|
||||
if (zone_id == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "zoneID is nullptr in Client::Clearance!!");
|
||||
Log(Logs::Detail, Logs::World_Server, "zoneID is nullptr in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
|
||||
const char* zonename = database.GetZoneName(zone_id);
|
||||
if (zonename == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "zonename is nullptr in Client::Clearance!!");
|
||||
Log(Logs::Detail, Logs::World_Server, "zonename is nullptr in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
@ -1268,10 +1270,10 @@ void Client::Clearance(int8 response)
|
||||
|
||||
if(strcmp(zs_addr, "127.0.0.1") == 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str());
|
||||
zs_addr = WorldConfig::get()->LocalAddress.c_str();
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Local zone address %s", zs_addr);
|
||||
Log(Logs::Detail, Logs::World_Server, "Local zone address %s", zs_addr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1286,7 +1288,7 @@ void Client::Clearance(int8 response)
|
||||
|
||||
strcpy(zsi->ip, zs_addr);
|
||||
zsi->port =zs->GetCPort();
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zone_id,instance_id,zsi->ip,zsi->port);
|
||||
Log(Logs::Detail, Logs::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zone_id,instance_id,zsi->ip,zsi->port);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
@ -1317,7 +1319,7 @@ bool Client::GenPassKey(char* key) {
|
||||
}
|
||||
|
||||
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode());
|
||||
Log(Logs::Detail, Logs::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode());
|
||||
|
||||
ack_req = true; // It's broke right now, dont delete this line till fix it. =P
|
||||
eqs->QueuePacket(app, ack_req);
|
||||
@ -1415,27 +1417,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
||||
|
||||
in.s_addr = GetIP();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Name: %s", name);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s",
|
||||
Log(Logs::Detail, Logs::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server, "Name: %s", name);
|
||||
Log(Logs::Detail, Logs::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");
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "STR STA AGI DEX WIS INT CHA Total");
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d",
|
||||
Log(Logs::Detail, Logs::World_Server, "STR STA AGI DEX WIS INT CHA Total");
|
||||
Log(Logs::Detail, Logs::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d",
|
||||
cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA,
|
||||
stats_sum);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor);
|
||||
Log(Logs::Detail, Logs::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2);
|
||||
Log(Logs::Detail, Logs::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor);
|
||||
Log(Logs::Detail, Logs::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor);
|
||||
|
||||
/* Validate the char creation struct */
|
||||
if (m_ClientVersionBit & EQEmu::versions::bit_SoFAndLater) {
|
||||
if (!CheckCharCreateInfoSoF(cc)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
Log(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!CheckCharCreateInfoTitanium(cc)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
Log(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1500,14 +1502,14 @@ 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 (m_ClientVersionBit & EQEmu::versions::bit_SoFAndLater) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID));
|
||||
Log(Logs::Detail, Logs::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID));
|
||||
if (RuleI(World, SoFStartZoneID) > 0) {
|
||||
pp.zone_id = RuleI(World, SoFStartZoneID);
|
||||
cc->start_zone = pp.zone_id;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Found 'TitaniumStartZoneID' rule setting: %i", RuleI(World, TitaniumStartZoneID));
|
||||
Log(Logs::General, Logs::World_Server, "Found 'TitaniumStartZoneID' rule setting: %i", RuleI(World, TitaniumStartZoneID));
|
||||
if (RuleI(World, TitaniumStartZoneID) > 0) { /* if there's a startzone variable put them in there */
|
||||
|
||||
pp.zone_id = RuleI(World, TitaniumStartZoneID);
|
||||
@ -1567,11 +1569,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
||||
pp.binds[0].heading = pp.heading;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f",
|
||||
Log(Logs::Detail, Logs::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);
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f",
|
||||
Log(Logs::Detail, Logs::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);
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f",
|
||||
Log(Logs::Detail, Logs::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);
|
||||
|
||||
/* Starting Items inventory */
|
||||
@ -1580,10 +1582,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
||||
// now we give the pp and the inv we made to StoreCharacter
|
||||
// to see if we can store it
|
||||
if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Character creation failed: %s", pp.name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Character creation failed: %s", pp.name);
|
||||
return false;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Character creation successful: %s", pp.name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Character creation successful: %s", pp.name);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1593,7 +1595,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
if (!cc)
|
||||
return false;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Validating char creation info...");
|
||||
Log(Logs::Detail, Logs::World_Server, "Validating char creation info...");
|
||||
|
||||
RaceClassCombos class_combo;
|
||||
bool found = false;
|
||||
@ -1610,7 +1612,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Could not find class/race/deity/start_zone combination");
|
||||
Log(Logs::Detail, Logs::World_Server, "Could not find class/race/deity/start_zone combination");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1627,7 +1629,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Could not find starting stats for selected character combo, cannot verify stats");
|
||||
Log(Logs::Detail, Logs::World_Server, "Could not find starting stats for selected character combo, cannot verify stats");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1640,37 +1642,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
allocation.DefaultPointAllocation[6];
|
||||
|
||||
if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Strength out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Strength out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Dexterity out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Dexterity out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Agility out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Agility out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Stamina out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Stamina out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Intelligence out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Intelligence out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Wisdom out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Wisdom out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Charisma out of range");
|
||||
Log(Logs::Detail, Logs::World_Server, "Charisma out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1683,7 +1685,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
current_stats += cc->WIS - allocation.BaseStats[5];
|
||||
current_stats += cc->CHA - allocation.BaseStats[6];
|
||||
if (current_stats > max_stats) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Current Stats > Maximum Stats");
|
||||
Log(Logs::Detail, Logs::World_Server, "Current Stats > Maximum Stats");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1764,7 +1766,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
if (!cc)
|
||||
return false;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Validating char creation info...");
|
||||
Log(Logs::Detail, Logs::World_Server,"Validating char creation info...");
|
||||
|
||||
classtemp = cc->class_ - 1;
|
||||
racetemp = cc->race - 1;
|
||||
@ -1777,16 +1779,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
// if out of range looking it up in the table would crash stuff
|
||||
// so we return from these
|
||||
if (classtemp >= PLAYER_CLASS_COUNT) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," class is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," class is out of range");
|
||||
return false;
|
||||
}
|
||||
if (racetemp >= _TABLE_RACES) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," race is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," race is out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs?
|
||||
Log.Out(Logs::Detail, Logs::World_Server," invalid race/class combination");
|
||||
Log(Logs::Detail, Logs::World_Server," invalid race/class combination");
|
||||
// we return from this one, since if it's an invalid combination our table
|
||||
// doesn't have meaningful values for the stats
|
||||
return false;
|
||||
@ -1814,43 +1816,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
// that are messed up not just the first hit
|
||||
|
||||
if (bTOTAL + stat_points != cTOTAL) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL);
|
||||
Log(Logs::Detail, Logs::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL);
|
||||
Charerrors++;
|
||||
}
|
||||
|
||||
if (cc->STR > bSTR + stat_points || cc->STR < bSTR) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat STR is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat STR is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->STA > bSTA + stat_points || cc->STA < bSTA) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat STA is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat STA is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat AGI is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat AGI is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat DEX is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat DEX is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat WIS is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat WIS is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->INT > bINT + stat_points || cc->INT < bINT) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat INT is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat INT is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server," stat CHA is out of range");
|
||||
Log(Logs::Detail, Logs::World_Server," stat CHA is out of range");
|
||||
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)
|
||||
I am NOT writing those tables - kathgar*/
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Found %d errors in character creation request", Charerrors);
|
||||
Log(Logs::Detail, Logs::World_Server,"Found %d errors in character creation request", Charerrors);
|
||||
|
||||
return Charerrors == 0;
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) {
|
||||
int16 tmpStatus = WorldConfig::get()->DefaultStatus;
|
||||
paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID());
|
||||
if (!paccountid) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname);
|
||||
Log(Logs::Detail, Logs::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname);
|
||||
return false;
|
||||
}
|
||||
strn0cpy(paccountname, plsname, sizeof(paccountname));
|
||||
|
||||
@ -58,7 +58,7 @@ void ClientList::Process() {
|
||||
if (!iterator.GetData()->Process()) {
|
||||
struct in_addr in;
|
||||
in.s_addr = iterator.GetData()->GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort());
|
||||
//the client destructor should take care of this.
|
||||
// iterator.GetData()->Free();
|
||||
iterator.RemoveCurrent();
|
||||
@ -153,16 +153,16 @@ void ClientList::GetCLEIP(uint32 iIP) {
|
||||
countCLEIPs = iterator.GetData();
|
||||
if ((countCLEIPs->GetIP() == iIP) && ((countCLEIPs->Admin() < (RuleI(World, ExemptMaxClientsStatus))) || (RuleI(World, ExemptMaxClientsStatus) < 0))) { // If the IP matches, and the connection admin status is below the exempt status, or exempt status is less than 0 (no-one is exempt)
|
||||
IPInstances++; // Increment the occurences of this IP address
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Account ID: %i Account Name: %s IP: %s.", countCLEIPs->LSID(), countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Account ID: %i Account Name: %s IP: %s.", countCLEIPs->LSID(), countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
if (RuleB(World, EnableIPExemptions)) {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Account ID: %i Account Name: %s IP: %s IP Instances: %i Max IP Instances: %i", countCLEIPs->LSID(), countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str(), IPInstances, database.GetIPExemption(long2ip(countCLEIPs->GetIP()).c_str()));
|
||||
Log(Logs::General, Logs::Client_Login, "Account ID: %i Account Name: %s IP: %s IP Instances: %i Max IP Instances: %i", countCLEIPs->LSID(), countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str(), IPInstances, database.GetIPExemption(long2ip(countCLEIPs->GetIP()).c_str()));
|
||||
if (IPInstances > database.GetIPExemption(long2ip(countCLEIPs->GetIP()).c_str())) {
|
||||
if(RuleB(World, IPLimitDisconnectAll)) {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
DisconnectByIP(iIP);
|
||||
return;
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
countCLEIPs->SetOnline(CLE_Status_Offline);
|
||||
iterator.RemoveCurrent();
|
||||
continue;
|
||||
@ -171,14 +171,14 @@ void ClientList::GetCLEIP(uint32 iIP) {
|
||||
} else {
|
||||
if (IPInstances > (RuleI(World, MaxClientsPerIP))) { // If the number of connections exceeds the lower limit
|
||||
if (RuleB(World, MaxClientsSetByStatus)) { // If MaxClientsSetByStatus is set to True, override other IP Limit Rules
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Account ID: %i Account Name: %s IP: %s IP Instances: %i Max IP Instances: %i", countCLEIPs->LSID(), countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str(), IPInstances, countCLEIPs->Admin());
|
||||
Log(Logs::General, Logs::Client_Login, "Account ID: %i Account Name: %s IP: %s IP Instances: %i Max IP Instances: %i", countCLEIPs->LSID(), countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str(), IPInstances, countCLEIPs->Admin());
|
||||
if (IPInstances > countCLEIPs->Admin()) { // The IP Limit is set by the status of the account if status > MaxClientsPerIP
|
||||
if(RuleB(World, IPLimitDisconnectAll)) {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
DisconnectByIP(iIP);
|
||||
return;
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
countCLEIPs->SetOnline(CLE_Status_Offline); // Remove the connection
|
||||
iterator.RemoveCurrent();
|
||||
continue;
|
||||
@ -186,22 +186,22 @@ void ClientList::GetCLEIP(uint32 iIP) {
|
||||
}
|
||||
} else if ((countCLEIPs->Admin() < RuleI(World, AddMaxClientsStatus)) || (RuleI(World, AddMaxClientsStatus) < 0)) { // Else if the Admin status of the connection is not eligible for the higher limit, or there is no higher limit (AddMaxClientStatus < 0)
|
||||
if(RuleB(World, IPLimitDisconnectAll)) {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
DisconnectByIP(iIP);
|
||||
return;
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
countCLEIPs->SetOnline(CLE_Status_Offline); // Remove the connection
|
||||
iterator.RemoveCurrent();
|
||||
continue;
|
||||
}
|
||||
} else if (IPInstances > RuleI(World, AddMaxClientsPerIP)) { // else they are eligible for the higher limit, but if they exceed that
|
||||
if(RuleB(World, IPLimitDisconnectAll)) {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: All accounts on IP %s", long2ip(countCLEIPs->GetIP()).c_str());
|
||||
DisconnectByIP(iIP);
|
||||
return;
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
Log(Logs::General, Logs::Client_Login, "Disconnect: Account %s on IP %s.", countCLEIPs->LSName(), long2ip(countCLEIPs->GetIP()).c_str());
|
||||
countCLEIPs->SetOnline(CLE_Status_Offline); // Remove the connection
|
||||
iterator.RemoveCurrent();
|
||||
continue;
|
||||
@ -463,7 +463,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
||||
|
||||
if(!from)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID);
|
||||
Log(Logs::Detail, Logs::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -767,7 +767,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
safe_delete_array(output);
|
||||
}
|
||||
catch(...){
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring...");
|
||||
Log(Logs::Detail, Logs::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -911,7 +911,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
||||
safe_delete(pack2);
|
||||
}
|
||||
catch(...){
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring...");
|
||||
Log(Logs::Detail, Logs::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1146,7 +1146,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) {
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData());
|
||||
Log(Logs::Detail, Logs::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData());
|
||||
if (iterator.GetData()->GetAccountID() == account_id) {
|
||||
Client* tmp = iterator.GetData();
|
||||
return tmp;
|
||||
@ -1161,7 +1161,7 @@ Client* ClientList::FindByName(char* charname) {
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData());
|
||||
Log(Logs::Detail, Logs::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData());
|
||||
if (iterator.GetData()->GetCharName() == charname) {
|
||||
Client* tmp = iterator.GetData();
|
||||
return tmp;
|
||||
|
||||
@ -88,7 +88,7 @@ void Console::Die() {
|
||||
state = CONSOLE_STATE_CLOSED;
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort());
|
||||
tcpc->Disconnect();
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ bool Console::Process() {
|
||||
if (!tcpc->Connected()) {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort());
|
||||
return false;
|
||||
}
|
||||
//if we have not gotten the special markers after this timer, send login prompt
|
||||
@ -252,7 +252,7 @@ bool Console::Process() {
|
||||
SendMessage(1, "Timeout, disconnecting...");
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -261,29 +261,29 @@ bool Console::Process() {
|
||||
in.s_addr = GetIP();
|
||||
if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) {
|
||||
auto zs = new ZoneServer(tcpc);
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort());
|
||||
zoneserver_list.Add(zs);
|
||||
numzones++;
|
||||
tcpc = 0;
|
||||
} else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort());
|
||||
launcher_list.Add(tcpc);
|
||||
tcpc = 0;
|
||||
}
|
||||
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort());
|
||||
UCSLink.SetConnection(tcpc);
|
||||
tcpc = 0;
|
||||
}
|
||||
else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort());
|
||||
QSLink.SetConnection(tcpc);
|
||||
tcpc = 0;
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -440,7 +440,7 @@ void Console::ProcessCommand(const char* command) {
|
||||
state = CONSOLE_STATE_CLOSED;
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin);
|
||||
Log(Logs::Detail, Logs::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin);
|
||||
SendMessage(1, 0);
|
||||
SendMessage(2, "Login accepted.");
|
||||
state = CONSOLE_STATE_CONNECTED;
|
||||
@ -449,7 +449,7 @@ void Console::ProcessCommand(const char* command) {
|
||||
break;
|
||||
}
|
||||
case CONSOLE_STATE_CONNECTED: {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"TCP command: %s: \"%s\"",paccountname ,command);
|
||||
Log(Logs::Detail, Logs::World_Server,"TCP command: %s: \"%s\"",paccountname ,command);
|
||||
Seperator sep(command);
|
||||
if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) {
|
||||
SendMessage(1, " whoami");
|
||||
@ -737,7 +737,7 @@ void Console::ProcessCommand(const char* command) {
|
||||
tmpname[0] = '*';
|
||||
strcpy(&tmpname[1], paccountname);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]);
|
||||
Log(Logs::Detail, Logs::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));
|
||||
}
|
||||
}
|
||||
@ -821,7 +821,7 @@ void Console::ProcessCommand(const char* command) {
|
||||
#endif
|
||||
RunLoops = true;
|
||||
SendMessage(1, " Login Server Reconnect manually restarted by Console");
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Console");
|
||||
Log(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Console");
|
||||
}
|
||||
else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) {
|
||||
if (strcasecmp(sep.arg[1], "list") == 0) {
|
||||
|
||||
@ -41,8 +41,9 @@ void EQLConfig::LoadSettings() {
|
||||
|
||||
std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
||||
if (!results.Success()) {
|
||||
Log(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
||||
}
|
||||
else {
|
||||
auto row = results.begin();
|
||||
m_dynamics = atoi(row[0]);
|
||||
@ -51,7 +52,7 @@ void EQLConfig::LoadSettings() {
|
||||
query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -198,7 +199,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
|
||||
res = m_zones.find(short_name);
|
||||
if(res == m_zones.end()) {
|
||||
//not found.
|
||||
Log.Out(Logs::General, Logs::Error, "Update for unknown zone %s", short_name);
|
||||
Log(Logs::General, Logs::Error, "Update for unknown zone %s", short_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -234,7 +235,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
|
||||
res = m_zones.find(short_name);
|
||||
if(res == m_zones.end()) {
|
||||
//not found.
|
||||
Log.Out(Logs::General, Logs::Error, "Update for unknown zone %s", short_name);
|
||||
Log(Logs::General, Logs::Error, "Update for unknown zone %s", short_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -269,7 +269,7 @@ void EQW::LSReconnect() {
|
||||
pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr);
|
||||
#endif
|
||||
RunLoops = true;
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Web Tool");
|
||||
Log(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Web Tool");
|
||||
}
|
||||
|
||||
/*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) {
|
||||
|
||||
@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const {
|
||||
int16 status = 0;
|
||||
uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status);
|
||||
if(acctid == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str());
|
||||
return(false);
|
||||
}
|
||||
if(status < httpLoginStatus) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Login of %s failed: status too low.", m_username.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Login of %s failed: status too low.", m_username.c_str());
|
||||
return(false);
|
||||
}
|
||||
|
||||
@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP
|
||||
}
|
||||
|
||||
void EQWHTTPServer::Stop() {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Requesting that HTTP Service stop.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Requesting that HTTP Service stop.");
|
||||
m_running = false;
|
||||
Close();
|
||||
}
|
||||
|
||||
bool EQWHTTPServer::Start(uint16 port, const char *mime_file) {
|
||||
if(m_running) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "HTTP Service is already running on port %d", m_port);
|
||||
Log(Logs::Detail, Logs::World_Server, "HTTP Service is already running on port %d", m_port);
|
||||
return(false);
|
||||
}
|
||||
|
||||
//load up our nice mime types
|
||||
if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Failed to load mime types from '%s'", mime_file);
|
||||
Log(Logs::Detail, Logs::World_Server, "Failed to load mime types from '%s'", mime_file);
|
||||
return(false);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Loaded mime types from %s", mime_file);
|
||||
Log(Logs::Detail, Logs::World_Server, "Loaded mime types from %s", mime_file);
|
||||
}
|
||||
|
||||
//fire up the server thread
|
||||
char errbuf[TCPServer_ErrorBufferSize];
|
||||
if(!Open(port, errbuf)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
@ -64,10 +64,12 @@ EQWParser::EQWParser() {
|
||||
//setup perl...
|
||||
my_perl = perl_alloc();
|
||||
_empty_sv = newSV(0);
|
||||
if(!my_perl)
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Error: perl_alloc failed!");
|
||||
else
|
||||
if (!my_perl) {
|
||||
Log(Logs::Detail, Logs::World_Server, "Error: perl_alloc failed!");
|
||||
}
|
||||
else {
|
||||
DoInit();
|
||||
}
|
||||
}
|
||||
|
||||
void EQWParser::DoInit() {
|
||||
@ -182,10 +184,10 @@ void EQWParser::DoInit() {
|
||||
|
||||
|
||||
#ifdef EMBPERL_PLUGIN
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Loading worldui perl plugins.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Loading worldui perl plugins.");
|
||||
std::string err;
|
||||
if(!eval_file("world", "worldui.pl", err)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Warning - world.pl: %s", err.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Warning - world.pl: %s", err.c_str());
|
||||
}
|
||||
|
||||
eval_pv(
|
||||
|
||||
@ -78,7 +78,7 @@ bool LauncherLink::Process() {
|
||||
else {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Launcher authorization failed.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Launcher authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
@ -89,7 +89,7 @@ bool LauncherLink::Process() {
|
||||
else {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Launcher authorization failed.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Launcher authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
@ -99,7 +99,7 @@ bool LauncherLink::Process() {
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
}
|
||||
delete pack;
|
||||
@ -113,25 +113,25 @@ bool LauncherLink::Process() {
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZAAuth: {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str());
|
||||
break;
|
||||
}
|
||||
case ServerOP_LauncherConnectInfo: {
|
||||
const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer;
|
||||
if(HasName()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name);
|
||||
Log(Logs::Detail, Logs::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name);
|
||||
break;
|
||||
}
|
||||
m_name = it->name;
|
||||
|
||||
EQLConfig *config = launcher_list.GetConfig(m_name.c_str());
|
||||
if(config == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name);
|
||||
Disconnect();
|
||||
break;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name);
|
||||
Log(Logs::Detail, Logs::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name);
|
||||
|
||||
std::vector<LauncherZone> result;
|
||||
//database.GetLauncherZones(it->name, result);
|
||||
@ -145,7 +145,7 @@ bool LauncherLink::Process() {
|
||||
zs.port = cur->port;
|
||||
zs.up = false;
|
||||
zs.starts = 0;
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port);
|
||||
Log(Logs::Detail, Logs::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port);
|
||||
m_states[cur->name] = zs;
|
||||
}
|
||||
|
||||
@ -161,17 +161,17 @@ bool LauncherLink::Process() {
|
||||
std::map<std::string, ZoneState>::iterator res;
|
||||
res = m_states.find(it->short_name);
|
||||
if(res == m_states.end()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name);
|
||||
Log(Logs::Detail, Logs::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name);
|
||||
break;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count);
|
||||
Log(Logs::Detail, Logs::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.starts = it->start_count;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
@ -191,7 +191,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) {
|
||||
zs.port = port;
|
||||
zs.up = false;
|
||||
zs.starts = 0;
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port);
|
||||
Log(Logs::Detail, Logs::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port);
|
||||
m_states[short_name] = zs;
|
||||
|
||||
StartZone(short_name, port);
|
||||
|
||||
@ -59,7 +59,7 @@ void LauncherList::Process() {
|
||||
LauncherLink *l = *cur;
|
||||
if(!l->Process()) {
|
||||
//launcher has died before it identified itself.
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Removing pending launcher %d", l->GetID());
|
||||
Log(Logs::Detail, Logs::World_Server, "Removing pending launcher %d", l->GetID());
|
||||
cur = m_pendingLaunchers.erase(cur);
|
||||
delete l;
|
||||
} else if(l->HasName()) {
|
||||
@ -71,10 +71,10 @@ void LauncherList::Process() {
|
||||
std::map<std::string, LauncherLink *>::iterator res;
|
||||
res = m_launchers.find(name);
|
||||
if(res != m_launchers.end()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Ghosting launcher %s", name.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Ghosting launcher %s", name.c_str());
|
||||
delete res->second;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
||||
//put the launcher in the list.
|
||||
m_launchers[name] = l;
|
||||
} else {
|
||||
@ -89,7 +89,7 @@ void LauncherList::Process() {
|
||||
LauncherLink *l = curl->second;
|
||||
if(!l->Process()) {
|
||||
//launcher has died before it identified itself.
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID());
|
||||
Log(Logs::Detail, Logs::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID());
|
||||
curl = m_launchers.erase(curl);
|
||||
delete l;
|
||||
} else {
|
||||
@ -129,7 +129,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) {
|
||||
|
||||
void LauncherList::Add(EmuTCPConnection *conn) {
|
||||
auto it = new LauncherLink(nextID++, conn);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Adding pending launcher %d", it->GetID());
|
||||
Log(Logs::Detail, Logs::World_Server, "Adding pending launcher %d", it->GetID());
|
||||
m_pendingLaunchers.push_back(it);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ bool LoginServer::Process() {
|
||||
ServerPacket *pack = 0;
|
||||
while((pack = tcpc->PopPacket()))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode);
|
||||
Log(Logs::Detail, Logs::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode);
|
||||
|
||||
switch(pack->opcode) {
|
||||
case 0:
|
||||
@ -174,12 +174,12 @@ bool LoginServer::Process() {
|
||||
case ServerOP_LSFatalError: {
|
||||
#ifndef IGNORE_LS_FATAL_ERROR
|
||||
WorldConfig::DisableLoginserver();
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Login server responded with FatalError. Disabling reconnect.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Login server responded with FatalError. Disabling reconnect.");
|
||||
#else
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Login server responded with FatalError.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Login server responded with FatalError.");
|
||||
#endif
|
||||
if (pack->size > 1) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, " %s",pack->pBuffer);
|
||||
Log(Logs::Detail, Logs::World_Server, " %s",pack->pBuffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -191,18 +191,18 @@ bool LoginServer::Process() {
|
||||
case ServerOP_LSRemoteAddr: {
|
||||
if (!Config->WorldAddress.length()) {
|
||||
WorldConfig::SetWorldAddress((char *)pack->pBuffer);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Loginserver provided %s as world address",pack->pBuffer);
|
||||
Log(Logs::Detail, Logs::World_Server, "Loginserver provided %s as world address",pack->pBuffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_LSAccountUpdate: {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver");
|
||||
Log(Logs::Detail, Logs::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver");
|
||||
CanAccountUpdate = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
@ -216,10 +216,10 @@ bool LoginServer::Process() {
|
||||
bool LoginServer::InitLoginServer() {
|
||||
if(Connected() == false) {
|
||||
if(ConnectReady()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
Log(Logs::Detail, Logs::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
Connect();
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Not connected but not ready to connect, this is bad: %s:%d",
|
||||
Log(Logs::Detail, Logs::World_Server, "Not connected but not ready to connect, this is bad: %s:%d",
|
||||
LoginServerAddress,LoginServerPort);
|
||||
}
|
||||
}
|
||||
@ -230,29 +230,29 @@ bool LoginServer::Connect() {
|
||||
std::string tmp;
|
||||
if(database.GetVariable("loginType", tmp) && strcasecmp(tmp.c_str(), "MinILogin") == 0) {
|
||||
minilogin = true;
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Setting World to MiniLogin Server type");
|
||||
Log(Logs::Detail, Logs::World_Server, "Setting World to MiniLogin Server type");
|
||||
}
|
||||
else
|
||||
minilogin = false;
|
||||
|
||||
if (minilogin && WorldConfig::get()->WorldAddress.length()==0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "**** For minilogin to work, you need to set the <address> element in the <world> section.");
|
||||
Log(Logs::Detail, Logs::World_Server, "**** For minilogin to work, you need to set the <address> element in the <world> section.");
|
||||
return false;
|
||||
}
|
||||
|
||||
char errbuf[TCPConnection_ErrorBufferSize];
|
||||
if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (LoginServerIP == 0 || LoginServerPort == 0) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
Log(Logs::Detail, Logs::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
Log(Logs::Detail, Logs::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
if (minilogin)
|
||||
SendInfo();
|
||||
else
|
||||
@ -262,7 +262,7 @@ bool LoginServer::Connect() {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf);
|
||||
Log(Logs::Detail, Logs::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -338,7 +338,7 @@ void LoginServer::SendStatus() {
|
||||
void LoginServer::SendAccountUpdate(ServerPacket* pack) {
|
||||
ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer;
|
||||
if(CanUpdate()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
Log(Logs::Detail, Logs::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort);
|
||||
strn0cpy(s->worldaccount, LoginAccount, 30);
|
||||
strn0cpy(s->worldpassword, LoginPassword, 30);
|
||||
SendPacket(pack);
|
||||
|
||||
@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) {
|
||||
bool LoginServerList::SendAccountUpdate(ServerPacket* pack) {
|
||||
LinkedListIterator<LoginServer*> iterator(list);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers");
|
||||
Log(Logs::Detail, Logs::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers");
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()){
|
||||
if(iterator.GetData()->CanUpdate()) {
|
||||
|
||||
140
world/net.cpp
140
world/net.cpp
@ -105,7 +105,7 @@ uint32 numclients = 0;
|
||||
uint32 numzones = 0;
|
||||
bool holdzones = false;
|
||||
const WorldConfig *Config;
|
||||
EQEmuLogSys Log;
|
||||
EQEmuLogSys LogSys;
|
||||
|
||||
extern ConsoleList console_list;
|
||||
|
||||
@ -113,7 +113,7 @@ void CatchSignal(int sig_num);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
RegisterExecutablePlatform(ExePlatformWorld);
|
||||
Log.LoadLogSettingsDefaults();
|
||||
LogSys.LoadLogSettingsDefaults();
|
||||
|
||||
|
||||
|
||||
@ -130,30 +130,30 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
// Load server configuration
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading server configuration..");
|
||||
Log(Logs::General, Logs::World_Server, "Loading server configuration..");
|
||||
if (!WorldConfig::LoadConfig()) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading server configuration failed.");
|
||||
Log(Logs::General, Logs::World_Server, "Loading server configuration failed.");
|
||||
return 1;
|
||||
}
|
||||
Config=WorldConfig::get();
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||
Log(Logs::General, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||
|
||||
#ifdef _DEBUG
|
||||
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
#ifndef WIN32
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||
Log(Logs::General, Logs::World_Server, "Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@ -162,7 +162,7 @@ int main(int argc, char** argv) {
|
||||
if (Config->LoginCount == 0) {
|
||||
if (Config->LoginHost.length()) {
|
||||
loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str());
|
||||
Log.Out(Logs::General, Logs::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort);
|
||||
Log(Logs::General, Logs::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort);
|
||||
}
|
||||
} else {
|
||||
LinkedList<LoginConfig*> loginlist=Config->loginlist;
|
||||
@ -170,26 +170,26 @@ int main(int argc, char** argv) {
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str());
|
||||
Log.Out(Logs::General, Logs::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
|
||||
Log(Logs::General, Logs::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Connecting to MySQL...");
|
||||
Log(Logs::General, Logs::World_Server, "Connecting to MySQL...");
|
||||
if (!database.Connect(
|
||||
Config->DatabaseHost.c_str(),
|
||||
Config->DatabaseUsername.c_str(),
|
||||
Config->DatabasePassword.c_str(),
|
||||
Config->DatabaseDB.c_str(),
|
||||
Config->DatabasePort)) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Cannot continue without a database connection.");
|
||||
Log(Logs::General, Logs::World_Server, "Cannot continue without a database connection.");
|
||||
return 1;
|
||||
}
|
||||
guild_mgr.SetDatabase(&database);
|
||||
|
||||
/* Register Log System and Settings */
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
Log.StartFileLogs();
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
LogSys.StartFileLogs();
|
||||
|
||||
bool ignore_db = false;
|
||||
if (argc >= 2) {
|
||||
@ -286,65 +286,65 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if(Config->WorldHTTPEnabled) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Starting HTTP world service...");
|
||||
Log(Logs::General, Logs::World_Server, "Starting HTTP world service...");
|
||||
http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str());
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "HTTP world service disabled.");
|
||||
Log(Logs::General, Logs::World_Server, "HTTP world service disabled.");
|
||||
}
|
||||
|
||||
if(!ignore_db) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Checking Database Conversions..");
|
||||
Log(Logs::General, Logs::World_Server, "Checking Database Conversions..");
|
||||
database.CheckDatabaseConversions();
|
||||
}
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading variables..");
|
||||
Log(Logs::General, Logs::World_Server, "Loading variables..");
|
||||
database.LoadVariables();
|
||||
|
||||
std::string hotfix_name;
|
||||
if(database.GetVariable("hotfix_name", hotfix_name)) {
|
||||
if (!hotfix_name.empty()) {
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Current hotfix in use: '%s'", hotfix_name.c_str());
|
||||
Log(Logs::General, Logs::Zone_Server, "Current hotfix in use: '%s'", hotfix_name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading zones..");
|
||||
Log(Logs::General, Logs::World_Server, "Loading zones..");
|
||||
database.LoadZoneNames();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Clearing groups..");
|
||||
Log(Logs::General, Logs::World_Server, "Clearing groups..");
|
||||
database.ClearGroup();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Clearing raids..");
|
||||
Log(Logs::General, Logs::World_Server, "Clearing raids..");
|
||||
database.ClearRaid();
|
||||
database.ClearRaidDetails();
|
||||
database.ClearRaidLeader();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Clearing inventory snapshots..");
|
||||
Log(Logs::General, Logs::World_Server, "Clearing inventory snapshots..");
|
||||
database.ClearInvSnapshots();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading items..");
|
||||
Log(Logs::General, Logs::World_Server, "Loading items..");
|
||||
if(!database.LoadItems(hotfix_name))
|
||||
Log.Out(Logs::General, Logs::World_Server, "Error: Could not load item data. But ignoring");
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading skill caps..");
|
||||
Log(Logs::General, Logs::World_Server, "Error: Could not load item data. But ignoring");
|
||||
Log(Logs::General, Logs::World_Server, "Loading skill caps..");
|
||||
if(!database.LoadSkillCaps(std::string(hotfix_name)))
|
||||
Log.Out(Logs::General, Logs::World_Server, "Error: Could not load skill cap data. But ignoring");
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading guilds..");
|
||||
Log(Logs::General, Logs::World_Server, "Error: Could not load skill cap data. But ignoring");
|
||||
Log(Logs::General, Logs::World_Server, "Loading guilds..");
|
||||
guild_mgr.LoadGuilds();
|
||||
//rules:
|
||||
{
|
||||
std::string tmp;
|
||||
if (database.GetVariable("RuleSet", tmp)) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading rule set '%s'", tmp.c_str());
|
||||
Log(Logs::General, Logs::World_Server, "Loading rule set '%s'", tmp.c_str());
|
||||
if(!RuleManager::Instance()->LoadRules(&database, tmp.c_str())) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp.c_str());
|
||||
Log(Logs::General, Logs::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp.c_str());
|
||||
}
|
||||
} else {
|
||||
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "No rule set configured, using default rules");
|
||||
Log(Logs::General, Logs::World_Server, "No rule set configured, using default rules");
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loaded default rule set 'default'", tmp.c_str());
|
||||
Log(Logs::General, Logs::World_Server, "Loaded default rule set 'default'", tmp.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(RuleB(World, ClearTempMerchantlist)){
|
||||
Log.Out(Logs::General, Logs::World_Server, "Clearing temporary merchant lists..");
|
||||
Log(Logs::General, Logs::World_Server, "Clearing temporary merchant lists..");
|
||||
database.ClearMerchantTemp();
|
||||
}
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading EQ time of day..");
|
||||
Log(Logs::General, Logs::World_Server, "Loading EQ time of day..");
|
||||
TimeOfDay_Struct eqTime;
|
||||
time_t realtime;
|
||||
eqTime = database.LoadTime(realtime);
|
||||
@ -352,7 +352,7 @@ int main(int argc, char** argv) {
|
||||
Timer EQTimeTimer(600000);
|
||||
EQTimeTimer.Start(600000);
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading launcher list..");
|
||||
Log(Logs::General, Logs::World_Server, "Loading launcher list..");
|
||||
launcher_list.LoadList();
|
||||
|
||||
std::string tmp;
|
||||
@ -360,45 +360,45 @@ int main(int argc, char** argv) {
|
||||
if (tmp.length() == 1 && tmp[0] == '1') {
|
||||
holdzones = true;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF");
|
||||
Log(Logs::General, Logs::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF");
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses());
|
||||
Log(Logs::General, Logs::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses());
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading adventures...");
|
||||
Log(Logs::General, Logs::World_Server, "Loading adventures...");
|
||||
if(!adventure_manager.LoadAdventureTemplates())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::World_Server, "Unable to load adventure templates.");
|
||||
Log(Logs::General, Logs::World_Server, "Unable to load adventure templates.");
|
||||
}
|
||||
|
||||
if(!adventure_manager.LoadAdventureEntries())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::World_Server, "Unable to load adventure templates.");
|
||||
Log(Logs::General, Logs::World_Server, "Unable to load adventure templates.");
|
||||
}
|
||||
|
||||
adventure_manager.Load();
|
||||
adventure_manager.LoadLeaderboardInfo();
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Purging expired instances");
|
||||
Log(Logs::General, Logs::World_Server, "Purging expired instances");
|
||||
database.PurgeExpiredInstances();
|
||||
Timer PurgeInstanceTimer(450000);
|
||||
PurgeInstanceTimer.Start(450000);
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading char create info...");
|
||||
Log(Logs::General, Logs::World_Server, "Loading char create info...");
|
||||
database.LoadCharacterCreateAllocations();
|
||||
database.LoadCharacterCreateCombos();
|
||||
|
||||
char errbuf[TCPConnection_ErrorBufferSize];
|
||||
if (tcps.Open(Config->WorldTCPPort, errbuf)) {
|
||||
Log.Out(Logs::General, Logs::World_Server,"Zone (TCP) listener started.");
|
||||
Log(Logs::General, Logs::World_Server,"Zone (TCP) listener started.");
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort);
|
||||
Log.Out(Logs::General, Logs::World_Server," %s",errbuf);
|
||||
Log(Logs::General, Logs::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort);
|
||||
Log(Logs::General, Logs::World_Server," %s",errbuf);
|
||||
return 1;
|
||||
}
|
||||
if (eqsf.Open()) {
|
||||
Log.Out(Logs::General, Logs::World_Server,"Client (UDP) listener started.");
|
||||
Log(Logs::General, Logs::World_Server,"Client (UDP) listener started.");
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::World_Server,"Failed to start client (UDP) listener (port 9000)");
|
||||
Log(Logs::General, Logs::World_Server,"Failed to start client (UDP) listener (port 9000)");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ int main(int argc, char** argv) {
|
||||
//structures and opcodes for that patch.
|
||||
struct in_addr in;
|
||||
in.s_addr = eqs->GetRemoteIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "New connection from IP %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort()));
|
||||
Log(Logs::Detail, Logs::World_Server, "New connection from IP %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort()));
|
||||
stream_identifier.AddStream(eqs); //takes the stream
|
||||
}
|
||||
|
||||
@ -441,19 +441,19 @@ int main(int argc, char** argv) {
|
||||
struct in_addr in;
|
||||
in.s_addr = eqsi->GetRemoteIP();
|
||||
if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs.
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
|
||||
Log(Logs::Detail, Logs::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.
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
|
||||
Log(Logs::Detail, Logs::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
|
||||
auto client = new Client(eqsi);
|
||||
// @merth: client->zoneattempt=0;
|
||||
client_list.Add(client);
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
|
||||
Log(Logs::General, Logs::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.
|
||||
}
|
||||
}
|
||||
if (!RuleB(World, UseBannedIPsTable)){
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||
Log(Logs::Detail, Logs::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||
auto client = new Client(eqsi);
|
||||
// @merth: client->zoneattempt=0;
|
||||
client_list.Add(client);
|
||||
@ -469,19 +469,19 @@ int main(int argc, char** argv) {
|
||||
/* World - Tell what is being connected */
|
||||
if (tcpc->GetMode() == EmuTCPConnection::modePacket) {
|
||||
if (tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "New Zone Server from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
Log(Logs::General, Logs::World_Server, "New Zone Server from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
}
|
||||
else if (tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "New Launcher from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
Log(Logs::General, Logs::World_Server, "New Launcher from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
}
|
||||
else if (tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "New UCS Connection from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
Log(Logs::General, Logs::World_Server, "New UCS Connection from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
}
|
||||
else if (tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "New QS Connection from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
Log(Logs::General, Logs::World_Server, "New QS Connection from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Unsupported packet mode from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
Log(Logs::General, Logs::World_Server, "Unsupported packet mode from %s:%d", inet_ntoa(in), tcpc->GetrPort());
|
||||
}
|
||||
}
|
||||
|
||||
@ -497,10 +497,12 @@ int main(int argc, char** argv) {
|
||||
{
|
||||
TimeOfDay_Struct tod;
|
||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(0), &tod);
|
||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year))
|
||||
Log.Out(Logs::General, Logs::World_Server, "Failed to save eqtime.");
|
||||
else
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "EQTime successfully saved.");
|
||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year)) {
|
||||
Log(Logs::General, Logs::World_Server, "Failed to save eqtime.");
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::World_Server, "EQTime successfully saved.");
|
||||
}
|
||||
}
|
||||
|
||||
//check for timeouts in other threads
|
||||
@ -534,24 +536,24 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
Sleep(20);
|
||||
}
|
||||
Log.Out(Logs::General, Logs::World_Server, "World main loop completed.");
|
||||
Log.Out(Logs::General, Logs::World_Server, "Shutting down console connections (if any).");
|
||||
Log(Logs::General, Logs::World_Server, "World main loop completed.");
|
||||
Log(Logs::General, Logs::World_Server, "Shutting down console connections (if any).");
|
||||
console_list.KillAll();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Shutting down zone connections (if any).");
|
||||
Log(Logs::General, Logs::World_Server, "Shutting down zone connections (if any).");
|
||||
zoneserver_list.KillAll();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Zone (TCP) listener stopped.");
|
||||
Log(Logs::General, Logs::World_Server, "Zone (TCP) listener stopped.");
|
||||
tcps.Close();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Client (UDP) listener stopped.");
|
||||
Log(Logs::General, Logs::World_Server, "Client (UDP) listener stopped.");
|
||||
eqsf.Close();
|
||||
Log.Out(Logs::General, Logs::World_Server, "Signaling HTTP service to stop...");
|
||||
Log(Logs::General, Logs::World_Server, "Signaling HTTP service to stop...");
|
||||
http_server.Stop();
|
||||
Log.CloseFileLogs();
|
||||
LogSys.CloseFileLogs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CatchSignal(int sig_num) {
|
||||
Log.Out(Logs::General, Logs::World_Server,"Caught signal %d",sig_num);
|
||||
Log(Logs::General, Logs::World_Server,"Caught signal %d",sig_num);
|
||||
RunLoops = false;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream)
|
||||
{
|
||||
if(Stream)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ.");
|
||||
Log(Logs::Detail, Logs::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ.");
|
||||
Stream->Disconnect();
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ bool QueryServConnection::Process()
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "QueryServ authorization failed.");
|
||||
Log(Logs::Detail, Logs::QS_Server, "QueryServ authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
@ -69,7 +69,7 @@ bool QueryServConnection::Process()
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "QueryServ authorization failed.");
|
||||
Log(Logs::Detail, Logs::QS_Server, "QueryServ authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
@ -79,7 +79,7 @@ bool QueryServConnection::Process()
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
}
|
||||
delete pack;
|
||||
@ -97,7 +97,7 @@ bool QueryServConnection::Process()
|
||||
}
|
||||
case ServerOP_ZAAuth:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Got authentication from QueryServ when they are already authenticated.");
|
||||
Log(Logs::Detail, Logs::QS_Server, "Got authentication from QueryServ when they are already authenticated.");
|
||||
break;
|
||||
}
|
||||
case ServerOP_QueryServGeneric:
|
||||
@ -114,7 +114,7 @@ bool QueryServConnection::Process()
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size);
|
||||
Log(Logs::Detail, Logs::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream)
|
||||
{
|
||||
if(Stream)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS.");
|
||||
Stream->Disconnect();
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ bool UCSConnection::Process()
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "UCS authorization failed.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "UCS authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
@ -64,7 +64,7 @@ bool UCSConnection::Process()
|
||||
{
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "UCS authorization failed.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "UCS authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
delete pack;
|
||||
@ -74,7 +74,7 @@ bool UCSConnection::Process()
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
}
|
||||
delete pack;
|
||||
@ -92,12 +92,12 @@ bool UCSConnection::Process()
|
||||
}
|
||||
case ServerOP_ZAAuth:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Got authentication from UCS when they are already authenticated.");
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Got authentication from UCS when they are already authenticated.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size);
|
||||
Log(Logs::Detail, Logs::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ WorldGuildManager guild_mgr;
|
||||
|
||||
|
||||
void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
||||
Log(Logs::Detail, Logs::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));
|
||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||
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) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id);
|
||||
auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||
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) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Broadcasting guild delete for guild %d to world", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Broadcasting guild delete for guild %d to world", guild_id);
|
||||
auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||
s->guild_id = guild_id;
|
||||
@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
||||
|
||||
case ServerOP_RefreshGuild: {
|
||||
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
||||
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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.
|
||||
zoneserver_list.SendPacket(pack);
|
||||
|
||||
//preform a local refresh.
|
||||
if(!RefreshGuild(s->guild_id)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unable to preform local refresh on guild %d", s->guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Unable to preform local refresh on guild %d", s->guild_id);
|
||||
//can we do anything?
|
||||
}
|
||||
|
||||
@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
||||
|
||||
case ServerOP_GuildCharRefresh: {
|
||||
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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
|
||||
client_list.UpdateClientGuild(s->char_id, s->guild_id);
|
||||
@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
||||
|
||||
case ServerOP_DeleteGuild: {
|
||||
if(pack->size != sizeof(ServerGuildID_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
||||
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id);
|
||||
|
||||
//broadcast this packet to all zones.
|
||||
zoneserver_list.SendPacket(pack);
|
||||
|
||||
//preform a local refresh.
|
||||
if(!LocalDeleteGuild(s->guild_id)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unable to preform local delete on guild %d", s->guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Unable to preform local delete on guild %d", s->guild_id);
|
||||
//can we do anything?
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
||||
case ServerOP_GuildMemberUpdate: {
|
||||
if(pack->size != sizeof(ServerGuildMemberUpdate_Struct))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct));
|
||||
Log(Logs::Detail, Logs::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) {
|
||||
}
|
||||
|
||||
default:
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode);
|
||||
Log(Logs::Detail, Logs::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -361,14 +361,14 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct*
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "SoF Start zone query: %s\n", query.c_str());
|
||||
Log(Logs::General, Logs::Status, "SoF Start zone query: %s\n", query.c_str());
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
printf("No start_zones entry in database, using defaults\n");
|
||||
isTitanium ? SetTitaniumDefaultStartZone(in_pp, in_cc) : SetSoFDefaultStartZone(in_pp, in_cc);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Status, "Found starting location in start_zones");
|
||||
Log(Logs::General, Logs::Status, "Found starting location in start_zones");
|
||||
auto row = results.begin();
|
||||
in_pp->x = atof(row[0]);
|
||||
in_pp->y = atof(row[1]);
|
||||
@ -507,7 +507,7 @@ void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
|
||||
const std::string query = "SELECT name FROM launcher";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -529,7 +529,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey)
|
||||
MailKeyString, CharID);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@ -538,7 +538,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level)
|
||||
std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ void ZSList::KillAll() {
|
||||
void ZSList::Process() {
|
||||
|
||||
if(shutdowntimer && shutdowntimer->Check()){
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)");
|
||||
Log(Logs::Detail, Logs::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)");
|
||||
auto pack2 = new ServerPacket;
|
||||
pack2->opcode = ServerOP_ShutdownAll;
|
||||
pack2->size=0;
|
||||
@ -99,10 +99,10 @@ void ZSList::Process() {
|
||||
ZoneServer* zs = iterator.GetData();
|
||||
struct in_addr in;
|
||||
in.s_addr = zs->GetIP();
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort());
|
||||
Log(Logs::Detail, Logs::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort());
|
||||
zs->LSShutDownUpdate(zs->GetZoneID());
|
||||
if (holdzones){
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Hold Zones mode is ON - rebooting lost zone");
|
||||
Log(Logs::Detail, Logs::World_Server,"Hold Zones mode is ON - rebooting lost zone");
|
||||
if(!zs->IsStaticZone())
|
||||
RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID());
|
||||
else
|
||||
@ -610,7 +610,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip
|
||||
s->port = port;
|
||||
s->zoneid = zoneid;
|
||||
if(zoneid != 0)
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Rebooting static zone with the ID of: %i",zoneid);
|
||||
Log(Logs::Detail, Logs::World_Server,"Rebooting static zone with the ID of: %i",zoneid);
|
||||
tmp[z]->SendPacket(pack);
|
||||
delete pack;
|
||||
safe_delete_array(tmp);
|
||||
|
||||
@ -82,7 +82,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
|
||||
char* longname;
|
||||
|
||||
if (iZoneID)
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID,
|
||||
Log(Logs::Detail, Logs::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID,
|
||||
iStaticZone ? " (Static)" : "");
|
||||
|
||||
zone_server_zone_id = iZoneID;
|
||||
@ -189,12 +189,12 @@ bool ZoneServer::Process() {
|
||||
MD5::Generate((const uchar*) WorldConfig::get()->SharedKey.c_str(), WorldConfig::get()->SharedKey.length(), tmppass);
|
||||
if (memcmp(pack->pBuffer, tmppass, 16) == 0) {
|
||||
is_authenticated = true;
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Zone process connected.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Zone process connected.");
|
||||
}
|
||||
else {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::General, Logs::Error, "Zone authorization failed.");
|
||||
Log(Logs::General, Logs::Error, "Zone authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
@ -205,7 +205,7 @@ bool ZoneServer::Process() {
|
||||
else {
|
||||
struct in_addr in;
|
||||
in.s_addr = GetIP();
|
||||
Log.Out(Logs::General, Logs::Error, "Zone authorization failed.");
|
||||
Log(Logs::General, Logs::Error, "Zone authorization failed.");
|
||||
auto pack = new ServerPacket(ServerOP_ZAAuthFailed);
|
||||
SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
@ -215,7 +215,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "**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(Logs::General, Logs::Error, "**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.");
|
||||
is_authenticated = true;
|
||||
}
|
||||
}
|
||||
@ -547,10 +547,10 @@ bool ZoneServer::Process() {
|
||||
|
||||
RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer;
|
||||
if (zoneserver_list.SendPacket(pack)){
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -595,20 +595,20 @@ bool ZoneServer::Process() {
|
||||
ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer;
|
||||
sci->port = client_port;
|
||||
SendPacket(&p);
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Auto zone port configuration. Telling zone to use port %d",client_port);
|
||||
Log(Logs::Detail, Logs::World_Server,"Auto zone port configuration. Telling zone to use port %d",client_port);
|
||||
} else {
|
||||
client_port = sci->port;
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Zone specified port %d.",client_port);
|
||||
Log(Logs::Detail, Logs::World_Server,"Zone specified port %d.",client_port);
|
||||
}
|
||||
|
||||
if(sci->address[0]) {
|
||||
strn0cpy(client_address, sci->address, 250);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Zone specified address %s.", sci->address);
|
||||
Log(Logs::Detail, Logs::World_Server, "Zone specified address %s.", sci->address);
|
||||
}
|
||||
|
||||
if(sci->local_address[0]) {
|
||||
strn0cpy(client_local_address, sci->local_address, 250);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Zone specified local address %s.", sci->address);
|
||||
Log(Logs::Detail, Logs::World_Server, "Zone specified local address %s.", sci->address);
|
||||
}
|
||||
|
||||
if (sci->process_id){
|
||||
@ -622,7 +622,7 @@ bool ZoneServer::Process() {
|
||||
const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer;
|
||||
launcher_name = ln->launcher_name;
|
||||
launched_name = ln->zone_name;
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str());
|
||||
break;
|
||||
}
|
||||
case ServerOP_ShutdownAll: {
|
||||
@ -705,12 +705,12 @@ bool ZoneServer::Process() {
|
||||
if(WorldConfig::get()->UpdateStats)
|
||||
client = client_list.FindCharacter(ztz->name);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n",
|
||||
Log(Logs::Detail, Logs::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n",
|
||||
ztz->name, ztz->current_zone_id, ztz->requested_zone_id);
|
||||
|
||||
/* This is a request from the egress zone */
|
||||
if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name);
|
||||
Log(Logs::Detail, Logs::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)) {
|
||||
ztz->response = 0;
|
||||
@ -728,20 +728,20 @@ bool ZoneServer::Process() {
|
||||
|
||||
/* Zone was already running*/
|
||||
if(ingress_server) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Found a zone already booted for %s\n", ztz->name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Found a zone already booted for %s\n", ztz->name);
|
||||
ztz->response = 1;
|
||||
}
|
||||
/* Boot the Zone*/
|
||||
else {
|
||||
int server_id;
|
||||
if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Successfully booted a zone for %s\n", ztz->name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Successfully booted a zone for %s\n", ztz->name);
|
||||
// bootup successful, ready to rock
|
||||
ztz->response = 1;
|
||||
ingress_server = zoneserver_list.FindByID(server_id);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"FAILED to boot a zone for %s\n", ztz->name);
|
||||
Log(Logs::Detail, Logs::World_Server,"FAILED to boot a zone for %s\n", ztz->name);
|
||||
// bootup failed, send back error code 0
|
||||
ztz->response = 0;
|
||||
}
|
||||
@ -756,7 +756,7 @@ bool ZoneServer::Process() {
|
||||
/* Response from Ingress server, route back to egress */
|
||||
else{
|
||||
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name);
|
||||
Log(Logs::Detail, Logs::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name);
|
||||
ZoneServer *egress_server = nullptr;
|
||||
if(ztz->current_instance_id > 0) {
|
||||
egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id);
|
||||
@ -774,7 +774,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_ClientList: {
|
||||
if (pack->size != sizeof(ServerClientList_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct));
|
||||
break;
|
||||
}
|
||||
client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer);
|
||||
@ -783,7 +783,7 @@ bool ZoneServer::Process() {
|
||||
case ServerOP_ClientListKA: {
|
||||
ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer;
|
||||
if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates)));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates)));
|
||||
break;
|
||||
}
|
||||
client_list.CLEKeepAlive(sclka->numupdates, sclka->wid);
|
||||
@ -815,7 +815,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_ReloadLogs: {
|
||||
zoneserver_list.SendPacket(pack);
|
||||
database.LoadLogSettings(Log.log_settings);
|
||||
database.LoadLogSettings(LogSys.log_settings);
|
||||
break;
|
||||
}
|
||||
case ServerOP_ReloadRules: {
|
||||
@ -898,7 +898,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_GMGoto: {
|
||||
if (pack->size != sizeof(ServerGMGoto_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct));
|
||||
break;
|
||||
}
|
||||
ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer;
|
||||
@ -918,7 +918,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_Lock: {
|
||||
if (pack->size != sizeof(ServerLock_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct));
|
||||
break;
|
||||
}
|
||||
ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer;
|
||||
@ -943,7 +943,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_Motd: {
|
||||
if (pack->size != sizeof(ServerMotd_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct));
|
||||
break;
|
||||
}
|
||||
ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer;
|
||||
@ -954,7 +954,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_Uptime: {
|
||||
if (pack->size != sizeof(ServerUptime_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct));
|
||||
break;
|
||||
}
|
||||
ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer;
|
||||
@ -973,7 +973,7 @@ bool ZoneServer::Process() {
|
||||
break;
|
||||
}
|
||||
case ServerOP_GetWorldTime: {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Broadcasting a world time update");
|
||||
Log(Logs::Detail, Logs::World_Server,"Broadcasting a world time update");
|
||||
auto pack = new ServerPacket;
|
||||
|
||||
pack->opcode = ServerOP_SyncWorldTime;
|
||||
@ -988,17 +988,17 @@ bool ZoneServer::Process() {
|
||||
break;
|
||||
}
|
||||
case ServerOP_SetWorldTime: {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Received SetWorldTime");
|
||||
Log(Logs::Detail, Logs::World_Server,"Received SetWorldTime");
|
||||
eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer;
|
||||
zoneserver_list.worldclock.SetCurrentEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
database.SaveTime((int)newtime->start_eqtime.minute, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.day, newtime->start_eqtime.month, newtime->start_eqtime.year);
|
||||
zoneserver_list.SendTimeSync();
|
||||
break;
|
||||
}
|
||||
case ServerOP_IPLookup: {
|
||||
if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct));
|
||||
break;
|
||||
}
|
||||
ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer;
|
||||
@ -1010,7 +1010,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
case ServerOP_LockZone: {
|
||||
if (pack->size < sizeof(ServerLockZone_Struct)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct));
|
||||
Log(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct));
|
||||
break;
|
||||
}
|
||||
ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer;
|
||||
@ -1055,10 +1055,10 @@ bool ZoneServer::Process() {
|
||||
ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||
if(zs) {
|
||||
if (zs->SendPacket(pack)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
||||
Log(Logs::Detail, Logs::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
||||
Log(Logs::Detail, Logs::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1077,10 +1077,10 @@ bool ZoneServer::Process() {
|
||||
zs = zoneserver_list.FindByInstanceID(cle->instance());
|
||||
if(zs) {
|
||||
if(zs->SendPacket(pack)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance());
|
||||
Log(Logs::Detail, Logs::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1096,10 +1096,10 @@ bool ZoneServer::Process() {
|
||||
zs = zoneserver_list.FindByInstanceID(s->instance_id);
|
||||
if(zs) {
|
||||
if(!zs->SendPacket(pack))
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||
}
|
||||
safe_delete(pack);
|
||||
}
|
||||
@ -1109,10 +1109,10 @@ bool ZoneServer::Process() {
|
||||
zs = zoneserver_list.FindByZoneID(cle->zone());
|
||||
if(zs) {
|
||||
if(zs->SendPacket(pack)) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone());
|
||||
Log(Logs::Detail, Logs::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -1127,10 +1127,10 @@ bool ZoneServer::Process() {
|
||||
zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||
if(zs) {
|
||||
if(!zs->SendPacket(pack))
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
}
|
||||
safe_delete(pack);
|
||||
}
|
||||
@ -1148,10 +1148,10 @@ bool ZoneServer::Process() {
|
||||
zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||
if(zs) {
|
||||
if(!zs->SendPacket(pack))
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
}
|
||||
safe_delete(pack);
|
||||
}
|
||||
@ -1168,10 +1168,10 @@ bool ZoneServer::Process() {
|
||||
ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id);
|
||||
if(zs) {
|
||||
if(!zs->SendPacket(pack))
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1179,10 +1179,10 @@ bool ZoneServer::Process() {
|
||||
ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id);
|
||||
if(zs) {
|
||||
if(!zs->SendPacket(pack))
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1284,7 +1284,7 @@ bool ZoneServer::Process() {
|
||||
|
||||
case ServerOP_LSAccountUpdate:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Received ServerOP_LSAccountUpdate packet from zone");
|
||||
Log(Logs::Detail, Logs::World_Server, "Received ServerOP_LSAccountUpdate packet from zone");
|
||||
loginserverlist.SendAccountUpdate(pack);
|
||||
break;
|
||||
}
|
||||
@ -1327,14 +1327,14 @@ bool ZoneServer::Process() {
|
||||
case ServerOP_ChangeSharedMem: {
|
||||
std::string hotfix_name = std::string((char*)pack->pBuffer);
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading items...");
|
||||
Log(Logs::General, Logs::World_Server, "Loading items...");
|
||||
if(!database.LoadItems(hotfix_name)) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Error: Could not load item data. But ignoring");
|
||||
Log(Logs::General, Logs::World_Server, "Error: Could not load item data. But ignoring");
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::World_Server, "Loading skill caps...");
|
||||
Log(Logs::General, Logs::World_Server, "Loading skill caps...");
|
||||
if(!database.LoadSkillCaps(hotfix_name)) {
|
||||
Log.Out(Logs::General, Logs::World_Server, "Error: Could not load skill cap data. But ignoring");
|
||||
Log(Logs::General, Logs::World_Server, "Error: Could not load skill cap data. But ignoring");
|
||||
}
|
||||
|
||||
zoneserver_list.SendPacket(pack);
|
||||
@ -1353,7 +1353,7 @@ bool ZoneServer::Process() {
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Unknown ServerOPcode from zone 0x%04x, size %d", pack->opcode, pack->size);
|
||||
Log(Logs::Detail, Logs::World_Server, "Unknown ServerOPcode from zone 0x%04x, size %d", pack->opcode, pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
@ -1362,7 +1362,7 @@ bool ZoneServer::Process() {
|
||||
safe_delete(pack);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Zoneserver process attempted to delete pack when pack does not exist.");
|
||||
Log(Logs::Detail, Logs::World_Server, "Zoneserver process attempted to delete pack when pack does not exist.");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
38
zone/aa.cpp
38
zone/aa.cpp
@ -49,7 +49,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
||||
PetRecord record;
|
||||
if (!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id);
|
||||
Log(Logs::General, Logs::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);
|
||||
return;
|
||||
}
|
||||
@ -76,7 +76,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
||||
const NPCType *npc_type = database.LoadNPCTypesData(pet.npc_id);
|
||||
if (npc_type == nullptr) {
|
||||
//log write
|
||||
Log.Out(Logs::General, Logs::Error, "Unknown npc type for swarm pet spell id: %d", spell_id);
|
||||
Log(Logs::General, Logs::Error, "Unknown npc type for swarm pet spell id: %d", spell_id);
|
||||
Message(0, "Unable to find pet!");
|
||||
return;
|
||||
}
|
||||
@ -175,7 +175,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid
|
||||
const NPCType *npc_type = database.LoadNPCTypesData(typesid);
|
||||
if(npc_type == nullptr) {
|
||||
//log write
|
||||
Log.Out(Logs::General, Logs::Error, "Unknown npc type for swarm pet type id: %d", typesid);
|
||||
Log(Logs::General, Logs::Error, "Unknown npc type for swarm pet type id: %d", typesid);
|
||||
Message(0,"Unable to find pet!");
|
||||
return;
|
||||
}
|
||||
@ -1537,17 +1537,17 @@ bool Mob::CanPurchaseAlternateAdvancementRank(AA::Rank *rank, bool check_price,
|
||||
}
|
||||
|
||||
void Zone::LoadAlternateAdvancement() {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Alternate Advancement Data...");
|
||||
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Data...");
|
||||
if(!database.LoadAlternateAdvancementAbilities(aa_abilities,
|
||||
aa_ranks))
|
||||
{
|
||||
aa_abilities.clear();
|
||||
aa_ranks.clear();
|
||||
Log.Out(Logs::General, Logs::Status, "Failed to load Alternate Advancement Data");
|
||||
Log(Logs::General, Logs::Status, "Failed to load Alternate Advancement Data");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Processing Alternate Advancement Data...");
|
||||
Log(Logs::General, Logs::Status, "Processing Alternate Advancement Data...");
|
||||
for(const auto &ability : aa_abilities) {
|
||||
ability.second->first = GetAlternateAdvancementRank(ability.second->first_rank_id);
|
||||
|
||||
@ -1598,13 +1598,13 @@ void Zone::LoadAlternateAdvancement() {
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loaded Alternate Advancement Data");
|
||||
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Data");
|
||||
}
|
||||
|
||||
bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std::unique_ptr<AA::Ability>> &abilities,
|
||||
std::unordered_map<int, std::unique_ptr<AA::Rank>> &ranks)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Alternate Advancement Abilities...");
|
||||
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Abilities...");
|
||||
abilities.clear();
|
||||
std::string query = "SELECT id, name, category, classes, races, deities, drakkin_heritage, status, type, charges, "
|
||||
"grant_only, first_rank_id FROM aa_ability WHERE enabled = 1";
|
||||
@ -1630,13 +1630,13 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
abilities[ability->id] = std::unique_ptr<AA::Ability>(ability);
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to load Alternate Advancement Abilities");
|
||||
Log(Logs::General, Logs::Error, "Failed to load Alternate Advancement Abilities");
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loaded %d Alternate Advancement Abilities", (int)abilities.size());
|
||||
Log(Logs::General, Logs::Status, "Loaded %d Alternate Advancement Abilities", (int)abilities.size());
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Ranks...");
|
||||
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Ranks...");
|
||||
ranks.clear();
|
||||
query = "SELECT id, upper_hotkey_sid, lower_hotkey_sid, title_sid, desc_sid, cost, level_req, spell, spell_type, recast_time, "
|
||||
"next_id, expansion FROM aa_ranks";
|
||||
@ -1665,13 +1665,13 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
ranks[rank->id] = std::unique_ptr<AA::Rank>(rank);
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to load Alternate Advancement Ability Ranks");
|
||||
Log(Logs::General, Logs::Error, "Failed to load Alternate Advancement Ability Ranks");
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loaded %d Alternate Advancement Ability Ranks", (int)ranks.size());
|
||||
Log(Logs::General, Logs::Status, "Loaded %d Alternate Advancement Ability Ranks", (int)ranks.size());
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Rank Effects...");
|
||||
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Rank Effects...");
|
||||
query = "SELECT rank_id, slot, effect_id, base1, base2 FROM aa_rank_effects";
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
@ -1692,13 +1692,13 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to load Alternate Advancement Ability Rank Effects");
|
||||
Log(Logs::General, Logs::Error, "Failed to load Alternate Advancement Ability Rank Effects");
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Effects");
|
||||
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Effects");
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Rank Prereqs...");
|
||||
Log(Logs::General, Logs::Status, "Loading Alternate Advancement Ability Rank Prereqs...");
|
||||
query = "SELECT rank_id, aa_id, points FROM aa_rank_prereqs";
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
@ -1717,11 +1717,11 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to load Alternate Advancement Ability Rank Prereqs");
|
||||
Log(Logs::General, Logs::Error, "Failed to load Alternate Advancement Ability Rank Prereqs");
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Prereqs");
|
||||
Log(Logs::General, Logs::Status, "Loaded Alternate Advancement Ability Rank Prereqs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
|
||||
// Don't aggro new clients if we are already engaged unless PROX_AGGRO is set
|
||||
if (IsEngaged() && (!GetSpecialAbility(PROX_AGGRO) || (GetSpecialAbility(PROX_AGGRO) && !CombatRange(mob)))) {
|
||||
Log.Out(Logs::Moderate, Logs::Aggro,
|
||||
Log(Logs::Moderate, Logs::Aggro,
|
||||
"%s is in combat, and does not have prox_aggro, or does and is out of combat range with %s",
|
||||
GetName(), mob->GetName());
|
||||
return false;
|
||||
@ -360,7 +360,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
{
|
||||
//FatherNiwtit: make sure we can see them. last since it is very expensive
|
||||
if(CheckLosFN(mob)) {
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
|
||||
Log(Logs::Detail, Logs::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
|
||||
return( mod_will_aggro(mob, this) );
|
||||
}
|
||||
}
|
||||
@ -392,18 +392,18 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
||||
{
|
||||
//FatherNiwtit: make sure we can see them. last since it is very expensive
|
||||
if(CheckLosFN(mob)) {
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
|
||||
Log(Logs::Detail, Logs::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName());
|
||||
return( mod_will_aggro(mob, this) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Is In zone?:%d\n", mob->InZone());
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Dist^2: %f\n", dist2);
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Range^2: %f\n", iAggroRange2);
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Faction: %d\n", fv);
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Int: %d\n", GetINT());
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel()));
|
||||
Log(Logs::Detail, Logs::Aggro, "Is In zone?:%d\n", mob->InZone());
|
||||
Log(Logs::Detail, Logs::Aggro, "Dist^2: %f\n", dist2);
|
||||
Log(Logs::Detail, Logs::Aggro, "Range^2: %f\n", iAggroRange2);
|
||||
Log(Logs::Detail, Logs::Aggro, "Faction: %d\n", fv);
|
||||
Log(Logs::Detail, Logs::Aggro, "Int: %d\n", GetINT());
|
||||
Log(Logs::Detail, Logs::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel()));
|
||||
|
||||
return(false);
|
||||
}
|
||||
@ -526,7 +526,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) {
|
||||
//Father Nitwit: make sure we can see them.
|
||||
if(mob->CheckLosFN(sender)) {
|
||||
#if (EQDEBUG>=5)
|
||||
Log.Out(Logs::General, Logs::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
|
||||
Log(Logs::General, Logs::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f",
|
||||
sender->GetName(), attacker->GetName(), mob->GetName(),
|
||||
attacker->GetName(), DistanceSquared(mob->GetPosition(),
|
||||
sender->GetPosition()), fabs(sender->GetZ()+mob->GetZ()));
|
||||
@ -756,7 +756,7 @@ type', in which case, the answer is yes.
|
||||
}
|
||||
while( reverse++ == 0 );
|
||||
|
||||
Log.Out(Logs::General, Logs::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName());
|
||||
Log(Logs::General, Logs::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -896,7 +896,7 @@ bool Mob::IsBeneficialAllowed(Mob *target)
|
||||
}
|
||||
while( reverse++ == 0 );
|
||||
|
||||
Log.Out(Logs::General, Logs::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName());
|
||||
Log(Logs::General, Logs::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1008,7 +1008,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;
|
||||
|
||||
#if LOSDEBUG>=5
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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
|
||||
return zone->zonemap->CheckLoS(myloc, oloc);
|
||||
}
|
||||
|
||||
142
zone/attack.cpp
142
zone/attack.cpp
@ -58,7 +58,7 @@ bool Mob::AttackAnimation(EQEmu::skills::SkillType &skillinuse, int Hand, const
|
||||
if (weapon && weapon->IsClassCommon()) {
|
||||
const EQEmu::ItemData* item = weapon->GetItem();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Attack, "Weapon skill : %i", item->ItemType);
|
||||
Log(Logs::Detail, Logs::Attack, "Weapon skill : %i", item->ItemType);
|
||||
|
||||
switch (item->ItemType) {
|
||||
case EQEmu::item::ItemType1HSlash: // 1H Slashing
|
||||
@ -271,7 +271,7 @@ bool Mob::CheckHitChance(Mob* other, DamageHitInfo &hit)
|
||||
{
|
||||
Mob *attacker = other;
|
||||
Mob *defender = this;
|
||||
Log.Out(Logs::Detail, Logs::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
||||
Log(Logs::Detail, Logs::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
||||
|
||||
if (defender->IsClient() && defender->CastToClient()->IsSitting())
|
||||
return true;
|
||||
@ -289,7 +289,7 @@ bool Mob::CheckHitChance(Mob* other, DamageHitInfo &hit)
|
||||
// Then your chance to simply avoid the attack is checked (defender's avoidance roll beat the attacker's accuracy roll.)
|
||||
int tohit_roll = zone->random.Roll0(accuracy);
|
||||
int avoid_roll = zone->random.Roll0(avoidance);
|
||||
Log.Out(Logs::Detail, Logs::Attack, "CheckHitChance accuracy(%d => %d) avoidance(%d => %d)", accuracy, tohit_roll, avoidance, avoid_roll);
|
||||
Log(Logs::Detail, Logs::Attack, "CheckHitChance accuracy(%d => %d) avoidance(%d => %d)", accuracy, tohit_roll, avoidance, avoid_roll);
|
||||
|
||||
// tie breaker? Don't want to be biased any one way
|
||||
if (tohit_roll == avoid_roll)
|
||||
@ -363,7 +363,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
|
||||
if (hit.hand != EQEmu::inventory::slotRange && (CanThisClassRiposte() || IsEnraged()) && InFront && !ImmuneRipo) {
|
||||
if (IsEnraged()) {
|
||||
hit.damage_done = DMG_RIPOSTED;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack.");
|
||||
return true;
|
||||
}
|
||||
if (IsClient())
|
||||
@ -803,9 +803,9 @@ int Mob::ACSum()
|
||||
auto over_cap = ac - softcap;
|
||||
ac = softcap + (over_cap * returns);
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Combat, "ACSum ac %d softcap %d returns %f", ac, softcap, returns);
|
||||
Log(Logs::Detail, Logs::Combat, "ACSum ac %d softcap %d returns %f", ac, softcap, returns);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "ACSum ac %d", ac);
|
||||
Log(Logs::Detail, Logs::Combat, "ACSum ac %d", ac);
|
||||
}
|
||||
return ac;
|
||||
}
|
||||
@ -869,7 +869,7 @@ void Mob::MeleeMitigation(Mob *attacker, DamageHitInfo &hit, ExtraAttackOptions
|
||||
// +0.5 for rounding, min to 1 dmg
|
||||
hit.damage_done = std::max(static_cast<int>(roll * static_cast<double>(hit.base_damage) + 0.5), 1);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Attack, "mitigation %d vs offense %d. base %d rolled %f damage %d", mitigation, hit.offense, hit.base_damage, roll, hit.damage_done);
|
||||
Log(Logs::Detail, Logs::Attack, "mitigation %d vs offense %d. base %d rolled %f damage %d", mitigation, hit.offense, hit.base_damage, roll, hit.damage_done);
|
||||
}
|
||||
|
||||
//Returns the weapon damage against the input mob
|
||||
@ -1197,7 +1197,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
|
||||
{
|
||||
if (!other)
|
||||
return;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "%s::DoAttack vs %s base %d min %d offense %d tohit %d skill %d", GetName(),
|
||||
Log(Logs::Detail, Logs::Combat, "%s::DoAttack vs %s base %d min %d offense %d tohit %d skill %d", GetName(),
|
||||
other->GetName(), hit.base_damage, hit.min_damage, hit.offense, hit.tohit, hit.skill);
|
||||
// check to see if we hit..
|
||||
if (other->AvoidDamage(this, hit)) {
|
||||
@ -1213,7 +1213,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
|
||||
//if (IsDead())
|
||||
return;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Avoided/strikethrough damage with code %d", hit.damage_done);
|
||||
Log(Logs::Detail, Logs::Combat, "Avoided/strikethrough damage with code %d", hit.damage_done);
|
||||
}
|
||||
|
||||
if (hit.damage_done >= 0) {
|
||||
@ -1223,9 +1223,9 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts)
|
||||
ApplyDamageTable(hit);
|
||||
CommonOutgoingHitSuccess(other, hit, opts);
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", hit.damage_done);
|
||||
Log(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", hit.damage_done);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack missed. Damage set to 0.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attack missed. Damage set to 0.");
|
||||
hit.damage_done = 0;
|
||||
}
|
||||
}
|
||||
@ -1238,14 +1238,14 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
{
|
||||
if (!other) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Client::Attack() for evaluation!");
|
||||
Log(Logs::General, Logs::Error, "A null Mob object was passed to Client::Attack() for evaluation!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!GetTarget())
|
||||
SetTarget(other);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":"");
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":"");
|
||||
|
||||
//SetAttackTimer();
|
||||
if (
|
||||
@ -1255,12 +1255,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|| (GetHP() < 0)
|
||||
|| (!IsAttackAllowed(other))
|
||||
) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, invalid circumstances.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, invalid circumstances.");
|
||||
return false; // Only bards can attack while casting
|
||||
}
|
||||
|
||||
if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||
Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable!
|
||||
return false;
|
||||
}
|
||||
@ -1280,19 +1280,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
if(weapon != nullptr) {
|
||||
if (!weapon->IsWeapon()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||
return(false);
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking without a weapon.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking without a weapon.");
|
||||
}
|
||||
|
||||
DamageHitInfo my_hit;
|
||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||
// also send Packet to near clients
|
||||
AttackAnimation(my_hit.skill, Hand, weapon);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill);
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill);
|
||||
|
||||
// Now figure out damage
|
||||
my_hit.damage_done = 1;
|
||||
@ -1360,7 +1360,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
|
||||
|
||||
// damage = mod_client_damage(damage, skillinuse, Hand, weapon, other);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Damage calculated: base %d min damage %d skill %d", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
Log(Logs::Detail, Logs::Combat, "Damage calculated: base %d min damage %d skill %d", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
|
||||
int hit_chance_bonus = 0;
|
||||
my_hit.offense = offense(my_hit.skill); // we need this a few times
|
||||
@ -1495,7 +1495,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQEmu::skills::Sk
|
||||
}
|
||||
|
||||
int exploss = 0;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill);
|
||||
Log(Logs::Detail, Logs::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
|
||||
@ -1756,7 +1756,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
{
|
||||
if (!other) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to NPC::Attack() for evaluation!");
|
||||
Log(Logs::General, Logs::Error, "A null Mob object was passed to NPC::Attack() for evaluation!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1774,7 +1774,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
if (other->IsClient())
|
||||
other->CastToClient()->RemoveXTarget(this, false);
|
||||
RemoveFromHateList(other);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetName());
|
||||
Log(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1804,10 +1804,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
//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
|
||||
if(weapon) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID);
|
||||
|
||||
if (Hand == EQEmu::inventory::slotSecondary && weapon->ItemType == EQEmu::item::ItemTypeShield){
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attack with shield canceled.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1906,7 +1906,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
|
||||
|
||||
other->AddToHateList(this, hate);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Final damage against %s: %d", other->GetName(), my_hit.damage_done);
|
||||
Log(Logs::Detail, Logs::Combat, "Final damage against %s: %d", other->GetName(), my_hit.damage_done);
|
||||
|
||||
if(other->IsClient() && IsPet() && GetOwner()->IsClient()) {
|
||||
//pets do half damage to clients in pvp
|
||||
@ -1961,7 +1961,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill
|
||||
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
||||
if(attacked_timer.Check())
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", other ? other->GetName() : "nullptr");
|
||||
Log(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", other ? other->GetName() : "nullptr");
|
||||
parse->EventNPC(EVENT_ATTACK, this, other, "", 0);
|
||||
}
|
||||
attacked_timer.Start(CombatEventTimer_expire);
|
||||
@ -1999,7 +1999,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, EQEmu::skills::Skill
|
||||
|
||||
bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::SkillType attack_skill)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d",
|
||||
Log(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d",
|
||||
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
|
||||
|
||||
Mob *oos = nullptr;
|
||||
@ -2045,7 +2045,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQEmu::skills::Skil
|
||||
|
||||
if (IsEngaged()) {
|
||||
zone->DelAggroMob();
|
||||
Log.Out(Logs::Detail, Logs::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount());
|
||||
Log(Logs::Detail, Logs::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount());
|
||||
}
|
||||
|
||||
SetHP(0);
|
||||
@ -2629,7 +2629,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
||||
if(DS == 0 && rev_ds == 0)
|
||||
return;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName());
|
||||
Log(Logs::Detail, Logs::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName());
|
||||
|
||||
//invert DS... spells yield negative values for a true damage shield
|
||||
if(DS < 0) {
|
||||
@ -2674,7 +2674,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
|
||||
rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID;
|
||||
|
||||
if(rev_ds < 0) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
||||
Log(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName());
|
||||
attacker->Damage(this, -rev_ds, rev_ds_spell_id, EQEmu::skills::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?
|
||||
}
|
||||
@ -2878,7 +2878,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
||||
int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100;
|
||||
if(damage_to_reduce >= buffs[slot].melee_rune)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
||||
Log(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
||||
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune);
|
||||
damage -= buffs[slot].melee_rune;
|
||||
if(!TryFadeEffect(slot))
|
||||
@ -2886,7 +2886,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
||||
Log(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d"
|
||||
" damage remaining.", damage_to_reduce, buffs[slot].melee_rune);
|
||||
buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce);
|
||||
damage -= damage_to_reduce;
|
||||
@ -2905,7 +2905,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
||||
|
||||
if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||
Log(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune);
|
||||
damage -= buffs[slot].melee_rune;
|
||||
if(!TryFadeEffect(slot))
|
||||
@ -2913,7 +2913,7 @@ int32 Mob::ReduceDamage(int32 damage)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||
Log(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||
" damage remaining.", damage_to_reduce, buffs[slot].melee_rune);
|
||||
|
||||
if (spellbonuses.MitigateMeleeRune[3])
|
||||
@ -3031,7 +3031,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
|
||||
|
||||
if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d"
|
||||
Log(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d"
|
||||
" damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune);
|
||||
damage -= buffs[slot].magic_rune;
|
||||
if(!TryFadeEffect(slot))
|
||||
@ -3039,7 +3039,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||
Log(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d"
|
||||
" damage remaining.", damage_to_reduce, buffs[slot].magic_rune);
|
||||
|
||||
if (spellbonuses.MitigateSpellRune[3])
|
||||
@ -3194,11 +3194,11 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
if (IsValidSpell(spell_id))
|
||||
ignore_invul = spell_id == 982 || spells[spell_id].cast_not_standing; // cazic touch
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d",
|
||||
Log(Logs::Detail, Logs::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);
|
||||
|
||||
if (!ignore_invul && (GetInvul() || DivineAura())) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage);
|
||||
Log(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage);
|
||||
damage = DMG_INVULNERABLE;
|
||||
}
|
||||
|
||||
@ -3242,7 +3242,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
int healed = damage;
|
||||
|
||||
healed = attacker->GetActSpellHealing(spell_id, healed);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName());
|
||||
Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName());
|
||||
attacker->HealDamage(healed);
|
||||
|
||||
//we used to do a message to the client, but its gone now.
|
||||
@ -3255,7 +3255,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse())
|
||||
{
|
||||
if (!pet->IsHeld()) {
|
||||
Log.Out(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName());
|
||||
Log(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName());
|
||||
pet->AddToHateList(attacker, 1,0, true, false, false, spell_id);
|
||||
pet->SetTarget(attacker);
|
||||
Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
|
||||
@ -3265,7 +3265,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
//see if any runes want to reduce this damage
|
||||
if(spell_id == SPELL_UNKNOWN) {
|
||||
damage = ReduceDamage(damage);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Melee Damage reduced to %d", damage);
|
||||
Log(Logs::Detail, Logs::Combat, "Melee Damage reduced to %d", damage);
|
||||
damage = ReduceAllDamage(damage);
|
||||
TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker);
|
||||
|
||||
@ -3326,7 +3326,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
|
||||
//fade mez if we are mezzed
|
||||
if (IsMezzed() && attacker) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Breaking mez due to attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Breaking mez due to attack.");
|
||||
entity_list.MessageClose_StringID(
|
||||
this, /* Sender */
|
||||
true, /* Skip Sender */
|
||||
@ -3409,7 +3409,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
//increment chances of interrupting
|
||||
if(IsCasting()) { //shouldnt interrupt on regular spell damage
|
||||
attacked_count++;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Melee attack while casting. Attack count %d", attacked_count);
|
||||
Log(Logs::Detail, Logs::Combat, "Melee attack while casting. Attack count %d", attacked_count);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3667,7 +3667,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand)
|
||||
ProcChance += ProcChance * ProcBonus / 100.0f;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
Log(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
return ProcChance;
|
||||
}
|
||||
|
||||
@ -3686,7 +3686,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h
|
||||
ProcBonus += static_cast<float>(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f;
|
||||
ProcChance = ProcChance + (ProcChance * ProcBonus);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
Log(Logs::Detail, Logs::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
return ProcChance;
|
||||
}
|
||||
|
||||
@ -3695,7 +3695,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
|
||||
|
||||
if (!on) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!");
|
||||
Log(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3735,17 +3735,17 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) {
|
||||
void Mob::TryWeaponProc(const EQEmu::ItemInstance* weapon_g, Mob *on, uint16 hand) {
|
||||
if(!on) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!");
|
||||
Log(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsAttackAllowed(on)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Preventing procing off of unattackable things.");
|
||||
Log(Logs::Detail, Logs::Combat, "Preventing procing off of unattackable things.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (DivineAura()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Procs canceled, Divine Aura is in effect.");
|
||||
Log(Logs::Detail, Logs::Combat, "Procs canceled, Divine Aura is in effect.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3792,7 +3792,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
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 (weapon->Proc.Level > ourlevel) {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Tried to proc (%s), but our level (%d) is lower than required (%d)",
|
||||
weapon->Name, ourlevel, weapon->Proc.Level);
|
||||
if (IsPet()) {
|
||||
@ -3803,7 +3803,7 @@ void Mob::TryWeaponProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *
|
||||
Message_StringID(13, PROC_TOOLOW);
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)",
|
||||
weapon->Name, weapon->Proc.Effect, WPC * 100);
|
||||
ExecWeaponProc(inst, weapon->Proc.Effect, on);
|
||||
@ -3883,12 +3883,12 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
// Perma procs (AAs)
|
||||
if (PermaProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus?
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Permanent proc %d procing spell %d (%d percent chance)",
|
||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||
ExecWeaponProc(nullptr, PermaProcs[i].spellID, on);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Permanent proc %d failed to proc %d (%d percent chance)",
|
||||
i, PermaProcs[i].spellID, PermaProcs[i].chance);
|
||||
}
|
||||
@ -3898,7 +3898,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
if (SpellProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
float chance = ProcChance * (static_cast<float>(SpellProcs[i].chance) / 100.0f);
|
||||
if (zone->random.Roll(chance)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Spell proc %d procing spell %d (%.2f percent chance)",
|
||||
i, SpellProcs[i].spellID, chance);
|
||||
auto outapp = new EQApplicationPacket(OP_BeginCast,sizeof(BeginCast_Struct));
|
||||
@ -3913,7 +3913,7 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
CheckNumHitsRemaining(NumHit::OffensiveSpellProcs, 0,
|
||||
SpellProcs[i].base_spellID);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Spell proc %d failed to proc %d (%.2f percent chance)",
|
||||
i, SpellProcs[i].spellID, chance);
|
||||
}
|
||||
@ -3923,14 +3923,14 @@ void Mob::TrySpellProc(const EQEmu::ItemInstance *inst, const EQEmu::ItemData *w
|
||||
if (RangedProcs[i].spellID != SPELL_UNKNOWN) {
|
||||
float chance = ProcChance * (static_cast<float>(RangedProcs[i].chance) / 100.0f);
|
||||
if (zone->random.Roll(chance)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Ranged proc %d procing spell %d (%.2f percent chance)",
|
||||
i, RangedProcs[i].spellID, chance);
|
||||
ExecWeaponProc(nullptr, RangedProcs[i].spellID, on);
|
||||
CheckNumHitsRemaining(NumHit::OffensiveSpellProcs, 0,
|
||||
RangedProcs[i].base_spellID);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Ranged proc %d failed to proc %d (%.2f percent chance)",
|
||||
i, RangedProcs[i].spellID, chance);
|
||||
}
|
||||
@ -4114,7 +4114,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
int og_damage = hit.damage_done;
|
||||
int crit_mod = 170 + GetCritDmgMob(hit.skill);
|
||||
hit.damage_done = hit.damage_done * crit_mod / 100;
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Crit success roll %d dex chance %d og dmg %d crit_mod %d new dmg %d", roll, dex_bonus,
|
||||
og_damage, crit_mod, hit.damage_done);
|
||||
|
||||
@ -4157,7 +4157,7 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
|
||||
|
||||
if (IsBerserk() || berserk) {
|
||||
hit.damage_done += og_damage * 119 / 100;
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Crip damage %d", hit.damage_done);
|
||||
Log(Logs::Detail, Logs::Combat, "Crip damage %d", hit.damage_done);
|
||||
|
||||
entity_list.FilteredMessageClose_StringID(
|
||||
this, /* Sender */
|
||||
@ -4237,7 +4237,7 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage)
|
||||
|
||||
void Mob::DoRiposte(Mob *defender)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Preforming a riposte");
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a riposte");
|
||||
|
||||
if (!defender)
|
||||
return;
|
||||
@ -4251,7 +4251,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
defender->itembonuses.DoubleRiposte;
|
||||
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_DoubleRiposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
if (HasDied())
|
||||
@ -4263,7 +4263,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
|
||||
// Live AA - Double Riposte
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat,
|
||||
Log(Logs::Detail, Logs::Combat,
|
||||
"Preforming a double riposted from SE_GiveDoubleRiposte base1 == 0 (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
@ -4277,7 +4277,7 @@ void Mob::DoRiposte(Mob *defender)
|
||||
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
|
||||
|
||||
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)",
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)",
|
||||
DoubleRipChance);
|
||||
|
||||
if (defender->GetClass() == MONK)
|
||||
@ -4482,7 +4482,7 @@ void Mob::ApplyDamageTable(DamageHitInfo &hit)
|
||||
|
||||
if (IsWarriorClass() && GetLevel() > 54)
|
||||
hit.damage_done++;
|
||||
Log.Out(Logs::Detail, Logs::Attack, "Damage table applied %d (max %d)", percent, damage_table.max_extra);
|
||||
Log(Logs::Detail, Logs::Attack, "Damage table applied %d (max %d)", percent, damage_table.max_extra);
|
||||
}
|
||||
|
||||
void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, uint16 hand, bool IsDefensive)
|
||||
@ -4490,7 +4490,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
|
||||
|
||||
if (!on) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!");
|
||||
Log(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4721,13 +4721,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
|
||||
|
||||
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
||||
BuffFadeBySlot(spellbonuses.Root[1]);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Spell broke root! BreakChance percent chance");
|
||||
Log(Logs::Detail, Logs::Combat, "Spell broke root! BreakChance percent chance");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Spell did not break root. BreakChance percent chance");
|
||||
Log(Logs::Detail, Logs::Combat, "Spell did not break root. BreakChance percent chance");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -4890,19 +4890,19 @@ void Mob::CommonBreakInvisibleFromCombat()
|
||||
{
|
||||
//break invis when you attack
|
||||
if(invisible) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack.");
|
||||
BuffFadeByEffect(SE_Invisibility);
|
||||
BuffFadeByEffect(SE_Invisibility2);
|
||||
invisible = false;
|
||||
}
|
||||
if(invisible_undead) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||
BuffFadeByEffect(SE_InvisVsUndead);
|
||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||
invisible_undead = false;
|
||||
}
|
||||
if(invisible_animals){
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||
invisible_animals = false;
|
||||
}
|
||||
|
||||
@ -660,7 +660,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
||||
effect == SE_StackingCommand_Overwrite)
|
||||
continue;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s",
|
||||
Log(Logs::Detail, Logs::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s",
|
||||
effect, rank.id, slot, base1, base2, GetCleanName());
|
||||
|
||||
uint8 focus = IsFocusEffect(0, 0, true, effect);
|
||||
@ -1498,7 +1498,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.Out(Logs::Detail, Logs::AA, "SPA %d not accounted for in AA %s (%d)", effect, rank.base_ability->name.c_str(), rank.id);
|
||||
Log(Logs::Detail, Logs::AA, "SPA %d not accounted for in AA %s (%d)", effect, rank.base_ability->name.c_str(), rank.id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
84
zone/bot.cpp
84
zone/bot.cpp
@ -1150,7 +1150,7 @@ int32 Bot::acmod() {
|
||||
else
|
||||
return (65 + ((agility - 300) / 21));
|
||||
#if EQDEBUG >= 11
|
||||
Log.Out(Logs::General, Logs::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level);
|
||||
Log(Logs::General, Logs::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@ -1890,7 +1890,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
//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((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime());
|
||||
Log(Logs::Detail, Logs::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());
|
||||
return;
|
||||
}
|
||||
@ -1908,7 +1908,7 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
if(!RangeWeapon || !Ammo)
|
||||
return;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID);
|
||||
Log(Logs::Detail, Logs::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID);
|
||||
if(!IsAttackAllowed(other) || IsCasting() || DivineAura() || IsStunned() || IsMezzed() || (GetAppearance() == eaDead))
|
||||
return;
|
||||
|
||||
@ -1918,21 +1918,21 @@ void Bot::BotRangedAttack(Mob* other) {
|
||||
|
||||
//break invis when you attack
|
||||
if(invisible) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack.");
|
||||
BuffFadeByEffect(SE_Invisibility);
|
||||
BuffFadeByEffect(SE_Invisibility2);
|
||||
invisible = false;
|
||||
}
|
||||
|
||||
if(invisible_undead) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack.");
|
||||
BuffFadeByEffect(SE_InvisVsUndead);
|
||||
BuffFadeByEffect(SE_InvisVsUndead2);
|
||||
invisible_undead = false;
|
||||
}
|
||||
|
||||
if(invisible_animals) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||
Log(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack.");
|
||||
BuffFadeByEffect(SE_InvisVsAnimals);
|
||||
invisible_animals = false;
|
||||
}
|
||||
@ -2138,7 +2138,7 @@ void Bot::AI_Process() {
|
||||
Mob* delete_me = HealRotationTarget();
|
||||
if (AIHealRotation(HealRotationTarget(), UseHealRotationFastHeals())) {
|
||||
#if (EQDEBUG >= 12)
|
||||
Log.Out(Logs::General, Logs::Error, "Bot::AI_Process() - Casting succeeded (m: %s, t: %s) : AdvHR(true)", GetCleanName(), ((delete_me) ? (delete_me->GetCleanName()) : ("nullptr")));
|
||||
Log(Logs::General, Logs::Error, "Bot::AI_Process() - Casting succeeded (m: %s, t: %s) : AdvHR(true)", GetCleanName(), ((delete_me) ? (delete_me->GetCleanName()) : ("nullptr")));
|
||||
#endif
|
||||
m_member_of_heal_rotation->SetMemberIsCasting(this);
|
||||
m_member_of_heal_rotation->UpdateTargetHealingStats(HealRotationTarget());
|
||||
@ -2146,7 +2146,7 @@ void Bot::AI_Process() {
|
||||
}
|
||||
else {
|
||||
#if (EQDEBUG >= 12)
|
||||
Log.Out(Logs::General, Logs::Error, "Bot::AI_Process() - Casting failed (m: %s, t: %s) : AdvHR(false)", GetCleanName(), ((delete_me) ? (delete_me->GetCleanName()) : ("nullptr")));
|
||||
Log(Logs::General, Logs::Error, "Bot::AI_Process() - Casting failed (m: %s, t: %s) : AdvHR(false)", GetCleanName(), ((delete_me) ? (delete_me->GetCleanName()) : ("nullptr")));
|
||||
#endif
|
||||
m_member_of_heal_rotation->SetMemberIsCasting(this, false);
|
||||
AdvanceHealRotation(false);
|
||||
@ -2163,7 +2163,7 @@ void Bot::AI_Process() {
|
||||
SetHasBeenSummoned(false);
|
||||
} else if(!IsRooted()) {
|
||||
if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) {
|
||||
Log.Out(Logs::Detail, Logs::AI, "Returning to location prior to being summoned.");
|
||||
Log(Logs::Detail, Logs::AI, "Returning to location prior to being summoned.");
|
||||
CalculateNewPosition2(m_PreSummonLocation.x, m_PreSummonLocation.y, m_PreSummonLocation.z, GetBotRunspeed());
|
||||
SetHeading(CalculateHeadingToTarget(m_PreSummonLocation.x, m_PreSummonLocation.y));
|
||||
return;
|
||||
@ -2498,7 +2498,7 @@ void Bot::AI_Process() {
|
||||
|
||||
if (AI_movement_timer->Check()) {
|
||||
if(!IsRooted()) {
|
||||
Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName());
|
||||
Log(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName());
|
||||
CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetBotRunspeed());
|
||||
return;
|
||||
}
|
||||
@ -2746,7 +2746,7 @@ void Bot::PetAIProcess() {
|
||||
else if (botPet->GetTarget() && botPet->GetAIMovementTimer()->Check()) {
|
||||
botPet->SetRunAnimSpeed(0);
|
||||
if(!botPet->IsRooted()) {
|
||||
Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName());
|
||||
Log(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName());
|
||||
botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed());
|
||||
return;
|
||||
} else {
|
||||
@ -3813,7 +3813,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQEmu::skills::SkillT
|
||||
|
||||
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
|
||||
if(attacked_timer.Check()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName());
|
||||
Log(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName());
|
||||
parse->EventNPC(EVENT_ATTACK, this, from, "", 0);
|
||||
}
|
||||
|
||||
@ -3821,7 +3821,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, EQEmu::skills::SkillT
|
||||
// if spell is lifetap add hp to the caster
|
||||
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) {
|
||||
int healed = GetActSpellHealing(spell_id, damage);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName());
|
||||
Log(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName());
|
||||
HealDamage(healed);
|
||||
entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() );
|
||||
}
|
||||
@ -3857,13 +3857,13 @@ void Bot::AddToHateList(Mob* other, uint32 hate, int32 damage, bool iYellForHelp
|
||||
bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) {
|
||||
if (!other) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Bot::Attack for evaluation!");
|
||||
Log(Logs::General, Logs::Error, "A null Mob object was passed to Bot::Attack for evaluation!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((GetHP() <= 0) || (GetAppearance() == eaDead)) {
|
||||
SetTarget(nullptr);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attempted to attack %s while unconscious or, otherwise, appearing dead", other->GetCleanName());
|
||||
Log(Logs::Detail, Logs::Combat, "Attempted to attack %s while unconscious or, otherwise, appearing dead", other->GetCleanName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3875,20 +3875,20 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
// takes more to compare a call result, load for a call, load a compare to address and compare, and finally
|
||||
// push a value to an address than to just load for a call and push a value to an address.
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other->GetCleanName(), Hand, (FromRiposte ? "(this is a riposte)" : ""));
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other->GetCleanName(), Hand, (FromRiposte ? "(this is a riposte)" : ""));
|
||||
if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || (!IsAttackAllowed(other))) {
|
||||
if(this->GetOwnerID())
|
||||
entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName());
|
||||
|
||||
if(other) {
|
||||
RemoveFromHateList(other);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetCleanName());
|
||||
Log(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetCleanName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if(DivineAura()) {//cant attack while invulnerable
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3906,19 +3906,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
if(weapon != nullptr) {
|
||||
if (!weapon->IsWeapon()) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||
Log(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID());
|
||||
return false;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID());
|
||||
}
|
||||
else
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking without a weapon.");
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking without a weapon.");
|
||||
|
||||
// calculate attack_skill and skillinuse depending on hand and weapon
|
||||
// also send Packet to near clients
|
||||
DamageHitInfo my_hit;
|
||||
AttackAnimation(my_hit.skill, Hand, weapon);
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill);
|
||||
Log(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, my_hit.skill);
|
||||
|
||||
// Now figure out damage
|
||||
my_hit.damage_done = 1;
|
||||
@ -3966,7 +3966,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Damage calculated: base %d min damage %d skill %d", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
Log(Logs::Detail, Logs::Combat, "Damage calculated: base %d min damage %d skill %d", my_hit.base_damage, my_hit.min_damage, my_hit.skill);
|
||||
|
||||
int hit_chance_bonus = 0;
|
||||
my_hit.offense = offense(my_hit.skill);
|
||||
@ -3984,7 +3984,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
|
||||
|
||||
DoAttack(other, my_hit, opts);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", my_hit.damage_done);
|
||||
Log(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", my_hit.damage_done);
|
||||
} else {
|
||||
my_hit.damage_done = DMG_INVULNERABLE;
|
||||
}
|
||||
@ -4595,7 +4595,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
Log.Out(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]);
|
||||
Log(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -4809,7 +4809,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Log.Out(Logs::General, Logs::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]);
|
||||
Log(Logs::General, Logs::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4849,7 +4849,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) {
|
||||
ProcChance += (ProcChance * ProcBonus / 100.0f);
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
Log(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
|
||||
return ProcChance;
|
||||
}
|
||||
|
||||
@ -4903,13 +4903,13 @@ bool Bot::TryFinishingBlow(Mob *defender, int &damage)
|
||||
int fb_damage = aabonuses.FinishingBlow[1];
|
||||
int levelreq = aabonuses.FinishingBlowLvl[0];
|
||||
if (defender->GetLevel() <= levelreq && (chance >= zone->random.Int(1, 1000))) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Landed a finishing blow: levelreq at %d, other level %d",
|
||||
Log(Logs::Detail, Logs::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());
|
||||
damage = fb_damage;
|
||||
return true;
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "FAILED a finishing blow: levelreq at %d, other level %d",
|
||||
Log(Logs::Detail, Logs::Combat, "FAILED a finishing blow: levelreq at %d, other level %d",
|
||||
levelreq, defender->GetLevel());
|
||||
return false;
|
||||
}
|
||||
@ -4918,14 +4918,14 @@ bool Bot::TryFinishingBlow(Mob *defender, int &damage)
|
||||
}
|
||||
|
||||
void Bot::DoRiposte(Mob* defender) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Preforming a riposte");
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a riposte");
|
||||
if (!defender)
|
||||
return;
|
||||
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
int32 DoubleRipChance = (defender->GetAABonuses().GiveDoubleRiposte[0] + defender->GetSpellBonuses().GiveDoubleRiposte[0] + defender->GetItemBonuses().GiveDoubleRiposte[0]);
|
||||
if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) {
|
||||
Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
Log(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance);
|
||||
defender->Attack(this, EQEmu::inventory::slotPrimary, true);
|
||||
}
|
||||
|
||||
@ -5548,7 +5548,7 @@ int32 Bot::CalcMaxMana() {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
Log.Out(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||
Log(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||
max_mana = 0;
|
||||
break;
|
||||
}
|
||||
@ -5976,14 +5976,14 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::CastingSlot slot,
|
||||
uint32* oSpellWillFinish, uint32 item_slot, int16 *resist_adjust, uint32 aa_id) {
|
||||
bool Result = false;
|
||||
if(zone && !zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))) {
|
||||
Log.Out(Logs::Detail, Logs::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);
|
||||
Log(Logs::Detail, Logs::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);
|
||||
|
||||
if(casting_spell_id == spell_id)
|
||||
ZeroCastingVars();
|
||||
|
||||
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))) {
|
||||
Log.Out(Logs::Detail, Logs::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() );
|
||||
Log(Logs::Detail, Logs::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() );
|
||||
if(IsSilenced() && !IsDiscipline(spell_id))
|
||||
Message_StringID(13, SILENCED_STRING);
|
||||
|
||||
@ -6007,7 +6007,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::CastingSlot slot,
|
||||
}
|
||||
|
||||
if(DivineAura()) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect.");
|
||||
Log(Logs::Detail, Logs::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect.");
|
||||
InterruptSpell(173, 0x121, false);
|
||||
return false;
|
||||
}
|
||||
@ -6017,13 +6017,13 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQEmu::CastingSlot slot,
|
||||
InterruptSpell(fizzle_msg, 0x121, spell_id);
|
||||
|
||||
uint32 use_mana = ((spells[spell_id].mana) / 4);
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana);
|
||||
Log(Logs::Detail, Logs::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana);
|
||||
SetMana(GetMana() - use_mana);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (HasActiveSong()) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong);
|
||||
Log(Logs::Detail, Logs::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong);
|
||||
bardsong = 0;
|
||||
bardsong_target_id = 0;
|
||||
bardsong_slot = EQEmu::CastingSlot::Gem1;
|
||||
@ -6137,19 +6137,19 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) {
|
||||
if(caster->IsBot()) {
|
||||
if(spells[spell_id].targettype == ST_Undead) {
|
||||
if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Bot's target is not an undead.");
|
||||
Log(Logs::Detail, Logs::Spells, "Bot's target is not an undead.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(spells[spell_id].targettype == ST_Summoned) {
|
||||
if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Summoned) && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3)) {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Bot's target is not a summoned creature.");
|
||||
Log(Logs::Detail, Logs::Spells, "Bot's target is not a summoned creature.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Spells, "No bot immunities to spell %d found.", spell_id);
|
||||
Log(Logs::Detail, Logs::Spells, "No bot immunities to spell %d found.", spell_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6300,7 +6300,7 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQEmu::
|
||||
if((spelltypeequal || spelltypetargetequal) || spelltypeclassequal || slotequal) {
|
||||
if(((spells[thespell].effectid[0] == 0) && (spells[thespell].base[0] < 0)) &&
|
||||
(spellTarget->GetHP() < ((spells[thespell].base[0] * (-1)) + 100))) {
|
||||
Log.Out(Logs::General, Logs::Spells, "Bot::DoFinishedSpellSingleTarget - GroupBuffing failure");
|
||||
Log(Logs::General, Logs::Spells, "Bot::DoFinishedSpellSingleTarget - GroupBuffing failure");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -7807,7 +7807,7 @@ bool Bot::CheckLoreConflict(const EQEmu::ItemData* item) {
|
||||
|
||||
bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, float iRange, uint32 iSpellTypes) {
|
||||
if((iSpellTypes&SpellTypes_Detrimental) != 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
||||
Log(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -454,7 +454,7 @@ public:
|
||||
|
||||
if (target_type == BCEnum::TT_Self && (entry_prototype->BCST() != BCEnum::SpT_Stance && entry_prototype->BCST() != BCEnum::SpT_SummonCorpse)) {
|
||||
#ifdef BCSTSPELLDUMP
|
||||
Log.Out(Logs::General, Logs::Error, "DELETING entry_prototype (primary clause) - name: %s, target_type: %s, BCST: %s",
|
||||
Log(Logs::General, Logs::Error, "DELETING entry_prototype (primary clause) - name: %s, target_type: %s, BCST: %s",
|
||||
spells[spell_id].name, BCEnum::TargetTypeEnumToString(target_type).c_str(), BCEnum::SpellTypeEnumToString(entry_prototype->BCST()).c_str());
|
||||
#endif
|
||||
safe_delete(entry_prototype);
|
||||
@ -462,7 +462,7 @@ public:
|
||||
}
|
||||
if (entry_prototype->BCST() == BCEnum::SpT_Stance && target_type != BCEnum::TT_Self) {
|
||||
#ifdef BCSTSPELLDUMP
|
||||
Log.Out(Logs::General, Logs::Error, "DELETING entry_prototype (secondary clause) - name: %s, BCST: %s, target_type: %s",
|
||||
Log(Logs::General, Logs::Error, "DELETING entry_prototype (secondary clause) - name: %s, BCST: %s, target_type: %s",
|
||||
spells[spell_id].name, BCEnum::SpellTypeEnumToString(entry_prototype->BCST()).c_str(), BCEnum::TargetTypeEnumToString(target_type).c_str());
|
||||
#endif
|
||||
safe_delete(entry_prototype);
|
||||
@ -1061,7 +1061,7 @@ private:
|
||||
std::string query = "SELECT `short_name`, `long_name` FROM `zone` WHERE '' NOT IN (`short_name`, `long_name`)";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log.Out(Logs::General, Logs::Error, "load_teleport_zone_names() - Error in zone names query: %s", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "load_teleport_zone_names() - Error in zone names query: %s", results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1088,14 +1088,14 @@ private:
|
||||
}
|
||||
|
||||
static void status_report() {
|
||||
Log.Out(Logs::General, Logs::Commands, "load_bot_command_spells(): - 'RuleI(Bots, CommandSpellRank)' set to %i.", RuleI(Bots, CommandSpellRank));
|
||||
Log(Logs::General, Logs::Commands, "load_bot_command_spells(): - 'RuleI(Bots, CommandSpellRank)' set to %i.", RuleI(Bots, CommandSpellRank));
|
||||
if (bot_command_spells.empty()) {
|
||||
Log.Out(Logs::General, Logs::Error, "load_bot_command_spells() - 'bot_command_spells' is empty.");
|
||||
Log(Logs::General, Logs::Error, "load_bot_command_spells() - 'bot_command_spells' is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = BCEnum::SpellTypeFirst; i <= BCEnum::SpellTypeLast; ++i)
|
||||
Log.Out(Logs::General, Logs::Commands, "load_bot_command_spells(): - '%s' returned %u spell entries.",
|
||||
Log(Logs::General, Logs::Commands, "load_bot_command_spells(): - '%s' returned %u spell entries.",
|
||||
BCEnum::SpellTypeEnumToString(static_cast<BCEnum::SpType>(i)).c_str(), bot_command_spells[static_cast<BCEnum::SpType>(i)].size());
|
||||
}
|
||||
|
||||
@ -1428,12 +1428,12 @@ int bot_command_init(void)
|
||||
auto bot_command_settings_iter = bot_command_settings.find(working_bcl_iter.first);
|
||||
if (bot_command_settings_iter == bot_command_settings.end()) {
|
||||
if (working_bcl_iter.second->access == 0)
|
||||
Log.Out(Logs::General, Logs::Commands, "bot_command_init(): Warning: Bot Command '%s' defaulting to access level 0!", working_bcl_iter.first.c_str());
|
||||
Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Bot Command '%s' defaulting to access level 0!", working_bcl_iter.first.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
working_bcl_iter.second->access = bot_command_settings_iter->second.first;
|
||||
Log.Out(Logs::General, Logs::Commands, "bot_command_init(): - Bot Command '%s' set to access level %d.", working_bcl_iter.first.c_str(), bot_command_settings_iter->second.first);
|
||||
Log(Logs::General, Logs::Commands, "bot_command_init(): - Bot Command '%s' set to access level %d.", working_bcl_iter.first.c_str(), bot_command_settings_iter->second.first);
|
||||
if (bot_command_settings_iter->second.second.empty())
|
||||
continue;
|
||||
|
||||
@ -1441,14 +1441,14 @@ int bot_command_init(void)
|
||||
if (alias_iter.empty())
|
||||
continue;
|
||||
if (bot_command_list.find(alias_iter) != bot_command_list.end()) {
|
||||
Log.Out(Logs::General, Logs::Commands, "bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!", alias_iter.c_str());
|
||||
Log(Logs::General, Logs::Commands, "bot_command_init(): Warning: Alias '%s' already exists as a bot command - skipping!", alias_iter.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
bot_command_list[alias_iter] = working_bcl_iter.second;
|
||||
bot_command_aliases[alias_iter] = working_bcl_iter.first;
|
||||
|
||||
Log.Out(Logs::General, Logs::Commands, "bot_command_init(): - Alias '%s' added to bot command '%s'.", alias_iter.c_str(), bot_command_aliases[alias_iter].c_str());
|
||||
Log(Logs::General, Logs::Commands, "bot_command_init(): - Alias '%s' added to bot command '%s'.", alias_iter.c_str(), bot_command_aliases[alias_iter].c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1494,21 +1494,21 @@ void bot_command_deinit(void)
|
||||
int bot_command_add(std::string bot_command_name, const char *desc, int access, BotCmdFuncPtr function)
|
||||
{
|
||||
if (bot_command_name.empty()) {
|
||||
Log.Out(Logs::General, Logs::Error, "bot_command_add() - Bot command added with empty name string - check bot_command.cpp.");
|
||||
Log(Logs::General, Logs::Error, "bot_command_add() - Bot command added with empty name string - check bot_command.cpp.");
|
||||
return -1;
|
||||
}
|
||||
if (function == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "bot_command_add() - Bot command '%s' added without a valid function pointer - check bot_command.cpp.", bot_command_name.c_str());
|
||||
Log(Logs::General, Logs::Error, "bot_command_add() - Bot command '%s' added without a valid function pointer - check bot_command.cpp.", bot_command_name.c_str());
|
||||
return -1;
|
||||
}
|
||||
if (bot_command_list.count(bot_command_name) != 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "bot_command_add() - Bot command '%s' is a duplicate bot command name - check bot_command.cpp.", bot_command_name.c_str());
|
||||
Log(Logs::General, Logs::Error, "bot_command_add() - Bot command '%s' is a duplicate bot command name - check bot_command.cpp.", bot_command_name.c_str());
|
||||
return -1;
|
||||
}
|
||||
for (auto iter : bot_command_list) {
|
||||
if (iter.second->function != function)
|
||||
continue;
|
||||
Log.Out(Logs::General, Logs::Error, "bot_command_add() - Bot command '%s' equates to an alias of '%s' - check bot_command.cpp.", bot_command_name.c_str(), iter.first.c_str());
|
||||
Log(Logs::General, Logs::Error, "bot_command_add() - Bot command '%s' equates to an alias of '%s' - check bot_command.cpp.", bot_command_name.c_str(), iter.first.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1563,11 +1563,11 @@ int bot_command_real_dispatch(Client *c, const char *message)
|
||||
}
|
||||
|
||||
if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) {
|
||||
Log.Out(Logs::General, Logs::Commands, "%s (%s) used bot command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE");
|
||||
Log(Logs::General, Logs::Commands, "%s (%s) used bot command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE");
|
||||
}
|
||||
|
||||
if(cur->function == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Bot command '%s' has a null function\n", cstr.c_str());
|
||||
Log(Logs::General, Logs::Error, "Bot command '%s' has a null function\n", cstr.c_str());
|
||||
return(-1);
|
||||
} else {
|
||||
//dispatch C++ bot command
|
||||
@ -3500,7 +3500,7 @@ void bot_command_pick_lock(Client *c, const Seperator *sep)
|
||||
float curelev = (diff.z * diff.z);
|
||||
#if (EQDEBUG >= 11)
|
||||
if (curdist <= 130 && curelev <= 65 && curelev >= 25) // 2D limit is '130' (x^2 + y^2), 1D theoretically should be '65' (z^2)
|
||||
Log.Out(Logs::Detail, Logs::Doors, "bot_command_pick_lock(): DoorID: %i - Elevation difference failure within theoretical limit (%f <= 65.0)", door_iter->GetDoorID(), curelev);
|
||||
Log(Logs::Detail, Logs::Doors, "bot_command_pick_lock(): DoorID: %i - Elevation difference failure within theoretical limit (%f <= 65.0)", door_iter->GetDoorID(), curelev);
|
||||
#endif
|
||||
if (curelev >= 25 || curdist > 130) // changed curelev from '10' to '25' - requiring diff.z to be less than '5'
|
||||
continue;
|
||||
@ -4188,7 +4188,7 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep)
|
||||
}
|
||||
if (!my_bot->GetBotID()) {
|
||||
c->Message(m_unknown, "An unknown error has occured - BotName: %s, BotID: %u", my_bot->GetCleanName(), my_bot->GetBotID());
|
||||
Log.Out(Logs::General, Logs::Commands, "bot_command_clone(): - Error: Active bot reported invalid ID (BotName: %s, BotID: %u, OwnerName: %s, OwnerID: %u, AcctName: %s, AcctID: %u)",
|
||||
Log(Logs::General, Logs::Commands, "bot_command_clone(): - Error: Active bot reported invalid ID (BotName: %s, BotID: %u, OwnerName: %s, OwnerID: %u, AcctName: %s, AcctID: %u)",
|
||||
my_bot->GetCleanName(), my_bot->GetBotID(), c->GetCleanName(), c->CharacterID(), c->AccountName(), c->AccountID());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -49,11 +49,11 @@ bool BotDatabase::Connect(const char* host, const char* user, const char* passwd
|
||||
uint32 errnum = 0;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Failed to connect to bot database: Error: %s", errbuf);
|
||||
Log(Logs::General, Logs::Error, "Failed to connect to bot database: Error: %s", errbuf);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Status, "Using bot database '%s' at %s:%d", database, host, port);
|
||||
Log(Logs::General, Logs::Status, "Using bot database '%s' at %s:%d", database, host, port);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1143,7 +1143,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& invent
|
||||
(uint32)atoul(row[14])
|
||||
);
|
||||
if (!item_inst) {
|
||||
Log.Out(Logs::General, Logs::Error, "Warning: bot_id '%i' has an invalid item_id '%i' in inventory slot '%i'", bot_id, item_id, slot_id);
|
||||
Log(Logs::General, Logs::Error, "Warning: bot_id '%i' has an invalid item_id '%i' in inventory slot '%i'", bot_id, item_id, slot_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1196,7 +1196,7 @@ bool BotDatabase::LoadItems(const uint32 bot_id, EQEmu::InventoryProfile& invent
|
||||
item_inst->SetOrnamentHeroModel((uint32)atoul(row[8]));
|
||||
|
||||
if (inventory_inst.PutItem(slot_id, *item_inst) == INVALID_INDEX)
|
||||
Log.Out(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in inventory: bot_id = '%i', item_id = '%i', slot_id = '%i'", bot_id, item_id, slot_id);
|
||||
Log(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in inventory: bot_id = '%i', item_id = '%i', slot_id = '%i'", bot_id, item_id, slot_id);
|
||||
|
||||
safe_delete(item_inst);
|
||||
}
|
||||
|
||||
@ -1137,7 +1137,7 @@ bool Bot::AI_PursueCastCheck() {
|
||||
|
||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||
|
||||
Log.Out(Logs::Detail, Logs::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
||||
Log(Logs::Detail, Logs::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells.");
|
||||
|
||||
if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) {
|
||||
if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) {
|
||||
@ -1165,7 +1165,7 @@ bool Bot::AI_IdleCastCheck() {
|
||||
|
||||
if (AIautocastspell_timer->Check(false)) {
|
||||
#if BotAI_DEBUG_Spells >= 25
|
||||
Log.Out(Logs::Detail, Logs::AI, "Bot Non-Engaged autocast check triggered: %s", this->GetCleanName());
|
||||
Log(Logs::Detail, Logs::AI, "Bot Non-Engaged autocast check triggered: %s", this->GetCleanName());
|
||||
#endif
|
||||
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
|
||||
|
||||
@ -1313,7 +1313,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
BotStanceType botStance = GetBotStance();
|
||||
bool mayGetAggro = HasOrMayGetAggro();
|
||||
|
||||
Log.Out(Logs::Detail, Logs::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells.");
|
||||
Log(Logs::Detail, Logs::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells.");
|
||||
|
||||
if(botClass == CLERIC) {
|
||||
if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) {
|
||||
@ -1563,11 +1563,11 @@ bool Bot::AIHealRotation(Mob* tar, bool useFastHeals) {
|
||||
}
|
||||
|
||||
#if BotAI_DEBUG_Spells >= 10
|
||||
Log.Out(Logs::Detail, Logs::AI, "Bot::AIHealRotation: heal spellid = %u, fastheals = %c, casterlevel = %u",
|
||||
Log(Logs::Detail, Logs::AI, "Bot::AIHealRotation: heal spellid = %u, fastheals = %c, casterlevel = %u",
|
||||
botSpell.SpellId, ((useFastHeals) ? ('T') : ('F')), GetLevel());
|
||||
#endif
|
||||
#if BotAI_DEBUG_Spells >= 25
|
||||
Log.Out(Logs::Detail, Logs::AI, "Bot::AIHealRotation: target = %s, current_time = %u, donthealmebefore = %u", tar->GetCleanName(), Timer::GetCurrentTime(), tar->DontHealMeBefore());
|
||||
Log(Logs::Detail, Logs::AI, "Bot::AIHealRotation: target = %s, current_time = %u, donthealmebefore = %u", tar->GetCleanName(), Timer::GetCurrentTime(), tar->DontHealMeBefore());
|
||||
#endif
|
||||
|
||||
// If there is still no spell id, then there isn't going to be one so we are done
|
||||
|
||||
@ -350,7 +350,7 @@ Client::~Client() {
|
||||
ToggleBuyerMode(false);
|
||||
|
||||
if(conn_state != ClientConnectFinished) {
|
||||
Log.Out(Logs::General, Logs::None, "Client '%s' was destroyed before reaching the connected state:", GetName());
|
||||
Log(Logs::General, Logs::None, "Client '%s' was destroyed before reaching the connected state:", GetName());
|
||||
ReportConnectingState();
|
||||
}
|
||||
|
||||
@ -511,31 +511,31 @@ void Client::SendLogoutPackets() {
|
||||
void Client::ReportConnectingState() {
|
||||
switch(conn_state) {
|
||||
case NoPacketsReceived: //havent gotten anything
|
||||
Log.Out(Logs::General, Logs::None, "Client has not sent us an initial zone entry packet.");
|
||||
Log(Logs::General, Logs::None, "Client has not sent us an initial zone entry packet.");
|
||||
break;
|
||||
case ReceivedZoneEntry: //got the first packet, loading up PP
|
||||
Log.Out(Logs::General, Logs::None, "Client sent initial zone packet, but we never got their player info from the database.");
|
||||
Log(Logs::General, Logs::None, "Client sent initial zone packet, but we never got their player info from the database.");
|
||||
break;
|
||||
case PlayerProfileLoaded: //our DB work is done, sending it
|
||||
Log.Out(Logs::General, Logs::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished.");
|
||||
Log(Logs::General, Logs::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished.");
|
||||
break;
|
||||
case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather
|
||||
Log.Out(Logs::General, Logs::None, "We successfully sent player info and spawns, waiting for client to request new zone.");
|
||||
Log(Logs::General, Logs::None, "We successfully sent player info and spawns, waiting for client to request new zone.");
|
||||
break;
|
||||
case NewZoneRequested: //received and sent new zone request
|
||||
Log.Out(Logs::General, Logs::None, "We received client's new zone request, waiting for client spawn request.");
|
||||
Log(Logs::General, Logs::None, "We received client's new zone request, waiting for client spawn request.");
|
||||
break;
|
||||
case ClientSpawnRequested: //client sent ReqClientSpawn
|
||||
Log.Out(Logs::General, Logs::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished.");
|
||||
Log(Logs::General, Logs::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished.");
|
||||
break;
|
||||
case ZoneContentsSent: //objects, doors, zone points
|
||||
Log.Out(Logs::General, Logs::None, "The rest of the zone contents were successfully sent, waiting for client ready notification.");
|
||||
Log(Logs::General, Logs::None, "The rest of the zone contents were successfully sent, waiting for client ready notification.");
|
||||
break;
|
||||
case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc
|
||||
Log.Out(Logs::General, Logs::None, "We received client ready notification, but never finished Client::CompleteConnect");
|
||||
Log(Logs::General, Logs::None, "We received client ready notification, but never finished Client::CompleteConnect");
|
||||
break;
|
||||
case ClientConnectFinished: //client finally moved to finished state, were done here
|
||||
Log.Out(Logs::General, Logs::None, "Client is successfully connected.");
|
||||
Log(Logs::General, Logs::None, "Client is successfully connected.");
|
||||
break;
|
||||
};
|
||||
}
|
||||
@ -736,7 +736,7 @@ bool Client::SendAllPackets() {
|
||||
if(eqs)
|
||||
eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req);
|
||||
iterator.RemoveCurrent();
|
||||
Log.Out(Logs::Moderate, Logs::Client_Server_Packet, "Transmitting a packet");
|
||||
Log(Logs::Moderate, Logs::Client_Server_Packet, "Transmitting a packet");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -784,7 +784,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
char message[4096];
|
||||
strn0cpy(message, orig_message, sizeof(message));
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message);
|
||||
Log(Logs::Detail, Logs::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message);
|
||||
|
||||
if (targetname == nullptr) {
|
||||
targetname = (!GetTarget()) ? "" : GetTarget()->GetName();
|
||||
@ -1611,7 +1611,7 @@ void Client::UpdateAdmin(bool iFromDB) {
|
||||
|
||||
if(m_pp.gm)
|
||||
{
|
||||
Log.Out(Logs::Moderate, Logs::Zone_Server, "%s - %s is a GM", __FUNCTION__ , GetName());
|
||||
Log(Logs::Moderate, Logs::Zone_Server, "%s - %s is a GM", __FUNCTION__ , GetName());
|
||||
// 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
|
||||
// SendAppearancePacket(AT_GM, 1, false);
|
||||
@ -2019,7 +2019,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
|
||||
|
||||
if (booktxt2[0] != '\0') {
|
||||
#if EQDEBUG >= 6
|
||||
Log.Out(Logs::General, Logs::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str());
|
||||
Log(Logs::General, Logs::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str());
|
||||
#endif
|
||||
auto outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct));
|
||||
|
||||
@ -2239,7 +2239,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){
|
||||
|
||||
SaveCurrency();
|
||||
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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(){
|
||||
@ -2279,7 +2279,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat
|
||||
SaveCurrency();
|
||||
|
||||
#if (EQDEBUG>=5)
|
||||
Log.Out(Logs::General, Logs::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i",
|
||||
Log(Logs::General, Logs::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);
|
||||
#endif
|
||||
}
|
||||
@ -2369,13 +2369,13 @@ bool Client::CheckIncreaseSkill(EQEmu::skills::SkillType skillid, Mob *against_w
|
||||
if(zone->random.Real(0, 99) < Chance)
|
||||
{
|
||||
SetSkill(skillid, GetRawSkill(skillid) + 1);
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Skill %d at value %d successfully gain with %d%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||
Log(Logs::Detail, Logs::Skills, "Skill %d at value %d successfully gain with %d%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||
return true;
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Skill %d at value %d failed to gain with %d%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||
Log(Logs::Detail, Logs::Skills, "Skill %d at value %d failed to gain with %d%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
|
||||
}
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill);
|
||||
Log(Logs::Detail, Logs::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -2396,10 +2396,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) {
|
||||
|
||||
if(zone->random.Real(0,100) < Chance) { // if they make the roll
|
||||
IncreaseLanguageSkill(langid); // increase the language skill by 1
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||
Log(Logs::Detail, Logs::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||
}
|
||||
else
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||
Log(Logs::Detail, Logs::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2508,7 +2508,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(EQEmu::skills::SkillType skil
|
||||
|
||||
Save();
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Reset %s's caster specialization skills to 1. "
|
||||
Log(Logs::General, Logs::Normal, "Reset %s's caster specialization skills to 1. "
|
||||
"Too many specializations skills were above 50.", GetCleanName());
|
||||
}
|
||||
|
||||
@ -4706,14 +4706,14 @@ void Client::HandleLDoNOpen(NPC *target)
|
||||
{
|
||||
if(target->GetClass() != LDON_TREASURE)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::None, "%s tried to open %s but %s was not a treasure chest.",
|
||||
Log(Logs::General, Logs::None, "%s tried to open %s but %s was not a treasure chest.",
|
||||
GetName(), target->GetName(), target->GetName());
|
||||
return;
|
||||
}
|
||||
|
||||
if(DistanceSquaredNoZ(m_Position, target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::None, "%s tried to open %s but %s was out of range",
|
||||
Log(Logs::General, Logs::None, "%s tried to open %s but %s was out of range",
|
||||
GetName(), target->GetName(), target->GetName());
|
||||
Message(13, "Treasure chest out of range.");
|
||||
return;
|
||||
@ -6351,7 +6351,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
PetRecord record;
|
||||
if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id);
|
||||
Log(Logs::General, Logs::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);
|
||||
return;
|
||||
}
|
||||
@ -6365,7 +6365,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
|
||||
const NPCType *npc_type = database.LoadNPCTypesData(pet.npc_id);
|
||||
if(npc_type == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Unknown npc type for doppelganger spell id: %d", spell_id);
|
||||
Log(Logs::General, Logs::Error, "Unknown npc type for doppelganger spell id: %d", spell_id);
|
||||
Message(0,"Unable to find pet!");
|
||||
return;
|
||||
}
|
||||
@ -7635,7 +7635,7 @@ void Client::SendMercPersonalInfo()
|
||||
stancecount += zone->merc_stance_list[GetMercInfo().MercTemplateID].size();
|
||||
if(stancecount > MAX_MERC_STANCES || mercCount > MAX_MERC || mercTypeCount > MAX_MERC_GRADES)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Mercenaries, "SendMercPersonalInfo canceled: (%i) (%i) (%i) for %s", stancecount, mercCount, mercTypeCount, GetName());
|
||||
Log(Logs::General, Logs::Mercenaries, "SendMercPersonalInfo canceled: (%i) (%i) (%i) for %s", stancecount, mercCount, mercTypeCount, GetName());
|
||||
SendMercMerchantResponsePacket(0);
|
||||
return;
|
||||
}
|
||||
@ -7731,13 +7731,13 @@ void Client::SendMercPersonalInfo()
|
||||
return;
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Mercenaries, "SendMercPersonalInfo Send Successful for %s.", GetName());
|
||||
Log(Logs::General, Logs::Mercenaries, "SendMercPersonalInfo Send Successful for %s.", GetName());
|
||||
|
||||
SendMercMerchantResponsePacket(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Mercenaries, "SendMercPersonalInfo Send Failed Due to no MercData (%i) for %s", GetMercInfo().MercTemplateID, GetName());
|
||||
Log(Logs::General, Logs::Mercenaries, "SendMercPersonalInfo Send Failed Due to no MercData (%i) for %s", GetMercInfo().MercTemplateID, GetName());
|
||||
}
|
||||
|
||||
}
|
||||
@ -8505,7 +8505,7 @@ void Client::Consume(const EQEmu::ItemData *item, uint8 type, int16 slot, bool a
|
||||
entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name);
|
||||
|
||||
#if EQDEBUG >= 5
|
||||
Log.Out(Logs::General, Logs::None, "Eating from slot:%i", (int)slot);
|
||||
Log(Logs::General, Logs::None, "Eating from slot:%i", (int)slot);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -8522,7 +8522,7 @@ void Client::Consume(const EQEmu::ItemData *item, uint8 type, int16 slot, bool a
|
||||
entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name);
|
||||
|
||||
#if EQDEBUG >= 5
|
||||
Log.Out(Logs::General, Logs::None, "Drinking from slot:%i", (int)slot);
|
||||
Log(Logs::General, Logs::None, "Drinking from slot:%i", (int)slot);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1021,7 +1021,7 @@ int32 Client::acmod()
|
||||
//seems about 21 agil per extra AC pt over 300...
|
||||
return (65 + ((agility - 300) / 21));
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Error, "Error in Client::acmod(): Agility: %i, Level: %i", agility, level);
|
||||
Log(Logs::Detail, Logs::Error, "Error in Client::acmod(): Agility: %i, Level: %i", agility, level);
|
||||
return 0;
|
||||
};
|
||||
|
||||
@ -1038,7 +1038,7 @@ int32 Client::CalcMaxMana()
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||
Log(Logs::Detail, Logs::Spells, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||
max_mana = 0;
|
||||
break;
|
||||
}
|
||||
@ -1056,7 +1056,7 @@ int32 Client::CalcMaxMana()
|
||||
cur_mana = curMana_cap;
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
||||
Log(Logs::Detail, Logs::Spells, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana);
|
||||
return max_mana;
|
||||
}
|
||||
|
||||
@ -1140,13 +1140,13 @@ int32 Client::CalcBaseMana()
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
Log.Out(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||
Log(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass());
|
||||
max_m = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if EQDEBUG >= 11
|
||||
Log.Out(Logs::General, Logs::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m);
|
||||
Log(Logs::General, Logs::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m);
|
||||
#endif
|
||||
return max_m;
|
||||
}
|
||||
@ -2023,7 +2023,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
|
||||
effectmod = 10;
|
||||
if (!nocap && effectmod > effectmodcap) // if the cap is calculated to be 0 using new rules, no cap.
|
||||
effectmod = effectmodcap;
|
||||
Log.Out(Logs::Detail, Logs::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id,
|
||||
Log(Logs::Detail, Logs::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id,
|
||||
effectmod, effectmodcap);
|
||||
return effectmod;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -584,7 +584,7 @@ bool Client::Process() {
|
||||
|
||||
if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) {
|
||||
OnDisconnect(true);
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name);
|
||||
Log(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name);
|
||||
|
||||
if (GetGM()) {
|
||||
if (GetMerc())
|
||||
@ -628,7 +628,7 @@ bool Client::Process() {
|
||||
}
|
||||
npc_scan_count++;
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Aggro, "Checking Reverse Aggro (client->npc) scanned_npcs (%i)", npc_scan_count);
|
||||
Log(Logs::General, Logs::Aggro, "Checking Reverse Aggro (client->npc) scanned_npcs (%i)", npc_scan_count);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -729,7 +729,7 @@ void Client::OnDisconnect(bool hard_disconnect) {
|
||||
Mob *Other = trade->With();
|
||||
if(Other)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Client disconnected during a trade. Returning their items.");
|
||||
Log(Logs::Detail, Logs::Trading, "Client disconnected during a trade. Returning their items.");
|
||||
FinishTrade(this);
|
||||
|
||||
if(Other->IsClient())
|
||||
@ -761,7 +761,7 @@ void Client::BulkSendInventoryItems()
|
||||
if(inst) {
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size, is_arrow);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||
Log(Logs::Detail, Logs::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);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
safe_delete(inst);
|
||||
@ -790,7 +790,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, slot_id);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -802,7 +802,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, EQEmu::inventory::slotPowerSource);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -817,7 +817,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, slot_id);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -831,7 +831,7 @@ void Client::BulkSendInventoryItems()
|
||||
inst->Serialize(ob, slot_id);
|
||||
|
||||
if (ob.tellp() == last_pos)
|
||||
Log.Out(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", slot_id);
|
||||
|
||||
last_pos = ob.tellp();
|
||||
}
|
||||
@ -919,7 +919,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
|
||||
// Account for merchant lists with gaps.
|
||||
if (ml.slot >= i) {
|
||||
if (ml.slot > i)
|
||||
Log.Out(Logs::General, Logs::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
|
||||
Log(Logs::General, Logs::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid);
|
||||
i = ml.slot + 1;
|
||||
}
|
||||
}
|
||||
@ -1011,7 +1011,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){
|
||||
Client* c = entity_list.GetClientByID(CustomerID);
|
||||
|
||||
if(!c) {
|
||||
Log.Out(Logs::Detail, Logs::Trading, "Previous customer has gone away.");
|
||||
Log(Logs::Detail, Logs::Trading, "Previous customer has gone away.");
|
||||
CustomerID = NewCustomer;
|
||||
return 1;
|
||||
}
|
||||
@ -1023,7 +1023,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
||||
{
|
||||
if(PendingRezzXP < 0) {
|
||||
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it.");
|
||||
Log(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it.");
|
||||
Message(13, "You have already been resurrected.\n");
|
||||
return;
|
||||
}
|
||||
@ -1033,7 +1033,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
|
||||
// corpse is in has shutdown since the rez spell was cast.
|
||||
database.MarkCorpseAsRezzed(PendingRezzDBID);
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||
Log(Logs::Detail, Logs::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i",
|
||||
this->name, (uint16)spells[SpellID].base[0],
|
||||
SpellID, ZoneID, InstanceID);
|
||||
|
||||
@ -1086,7 +1086,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
|
||||
{
|
||||
if(app->size != sizeof(MemorizeSpell_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct));
|
||||
Log(Logs::General, Logs::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct));
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
@ -1639,12 +1639,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
|
||||
EQEmu::skills::SkillType skill = (EQEmu::skills::SkillType)gmskill->skill_id;
|
||||
|
||||
if(!CanHaveSkill(skill)) {
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
||||
Log(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill);
|
||||
return;
|
||||
}
|
||||
|
||||
if(MaxSkill(skill) == 0) {
|
||||
Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill);
|
||||
Log(Logs::Detail, Logs::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2038,7 +2038,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
{
|
||||
if (PendingRezzXP < 0 || PendingRezzSpellID == 0)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Unexpected Rezz from hover request.");
|
||||
Log(Logs::Detail, Logs::Spells, "Unexpected Rezz from hover request.");
|
||||
return;
|
||||
}
|
||||
SetHP(GetMaxHP() / 5);
|
||||
@ -2072,10 +2072,10 @@ void Client::HandleRespawnFromHover(uint32 Option)
|
||||
|
||||
if (corpse && corpse->IsCorpse())
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Hover Rez in zone %s for corpse %s",
|
||||
Log(Logs::Detail, Logs::Spells, "Hover Rez in zone %s for corpse %s",
|
||||
zone->GetShortName(), PendingRezzCorpseName.c_str());
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Found corpse. Marking corpse as rezzed.");
|
||||
Log(Logs::Detail, Logs::Spells, "Found corpse. Marking corpse as rezzed.");
|
||||
|
||||
corpse->IsRezzed(true);
|
||||
corpse->CompleteResurrection();
|
||||
|
||||
@ -431,12 +431,12 @@ int command_init(void)
|
||||
auto iter_cs = command_settings.find(iter_cl->first);
|
||||
if (iter_cs == command_settings.end()) {
|
||||
if (iter_cl->second->access == 0)
|
||||
Log.Out(Logs::General, Logs::Commands, "command_init(): Warning: Command '%s' defaulting to access level 0!", iter_cl->first.c_str());
|
||||
Log(Logs::General, Logs::Commands, "command_init(): Warning: Command '%s' defaulting to access level 0!", iter_cl->first.c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
iter_cl->second->access = iter_cs->second.first;
|
||||
Log.Out(Logs::General, Logs::Commands, "command_init(): - Command '%s' set to access level %d.", iter_cl->first.c_str(), iter_cs->second.first);
|
||||
Log(Logs::General, Logs::Commands, "command_init(): - Command '%s' set to access level %d.", iter_cl->first.c_str(), iter_cs->second.first);
|
||||
if (iter_cs->second.second.empty())
|
||||
continue;
|
||||
|
||||
@ -445,14 +445,14 @@ int command_init(void)
|
||||
if (iter_aka->empty())
|
||||
continue;
|
||||
if (commandlist.find(*iter_aka) != commandlist.end()) {
|
||||
Log.Out(Logs::General, Logs::Commands, "command_init(): Warning: Alias '%s' already exists as a command - skipping!", iter_aka->c_str());
|
||||
Log(Logs::General, Logs::Commands, "command_init(): Warning: Alias '%s' already exists as a command - skipping!", iter_aka->c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
commandlist[*iter_aka] = iter_cl->second;
|
||||
commandaliases[*iter_aka] = iter_cl->first;
|
||||
|
||||
Log.Out(Logs::General, Logs::Commands, "command_init(): - Alias '%s' added to command '%s'.", iter_aka->c_str(), commandaliases[*iter_aka].c_str());
|
||||
Log(Logs::General, Logs::Commands, "command_init(): - Alias '%s' added to command '%s'.", iter_aka->c_str(), commandaliases[*iter_aka].c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -492,21 +492,21 @@ void command_deinit(void)
|
||||
int command_add(std::string command_name, const char *desc, int access, CmdFuncPtr function)
|
||||
{
|
||||
if (command_name.empty()) {
|
||||
Log.Out(Logs::General, Logs::Error, "command_add() - Command added with empty name string - check command.cpp.");
|
||||
Log(Logs::General, Logs::Error, "command_add() - Command added with empty name string - check command.cpp.");
|
||||
return -1;
|
||||
}
|
||||
if (function == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "command_add() - Command '%s' added without a valid function pointer - check command.cpp.", command_name.c_str());
|
||||
Log(Logs::General, Logs::Error, "command_add() - Command '%s' added without a valid function pointer - check command.cpp.", command_name.c_str());
|
||||
return -1;
|
||||
}
|
||||
if (commandlist.count(command_name) != 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "command_add() - Command '%s' is a duplicate command name - check command.cpp.", command_name.c_str());
|
||||
Log(Logs::General, Logs::Error, "command_add() - Command '%s' is a duplicate command name - check command.cpp.", command_name.c_str());
|
||||
return -1;
|
||||
}
|
||||
for (auto iter = commandlist.begin(); iter != commandlist.end(); ++iter) {
|
||||
if (iter->second->function != function)
|
||||
continue;
|
||||
Log.Out(Logs::General, Logs::Error, "command_add() - Command '%s' equates to an alias of '%s' - check command.cpp.", command_name.c_str(), iter->first.c_str());
|
||||
Log(Logs::General, Logs::Error, "command_add() - Command '%s' equates to an alias of '%s' - check command.cpp.", command_name.c_str(), iter->first.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -560,11 +560,11 @@ int command_realdispatch(Client *c, const char *message)
|
||||
}
|
||||
|
||||
if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) {
|
||||
Log.Out(Logs::General, Logs::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE");
|
||||
Log(Logs::General, Logs::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE");
|
||||
}
|
||||
|
||||
if(cur->function == nullptr) {
|
||||
Log.Out(Logs::General, Logs::Error, "Command '%s' has a null function\n", cstr.c_str());
|
||||
Log(Logs::General, Logs::Error, "Command '%s' has a null function\n", cstr.c_str());
|
||||
return(-1);
|
||||
} else {
|
||||
//dispatch C++ command
|
||||
@ -1274,7 +1274,7 @@ void command_viewpetition(Client *c, const Seperator *sep)
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) );
|
||||
Log(Logs::General, Logs::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) );
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again.");
|
||||
@ -1299,7 +1299,7 @@ void command_petitioninfo(Client *c, const Seperator *sep)
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||
Log(Logs::General, Logs::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again.");
|
||||
@ -1325,7 +1325,7 @@ void command_delpetition(Client *c, const Seperator *sep)
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||
Log(Logs::General, Logs::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) );
|
||||
|
||||
}
|
||||
|
||||
@ -1561,7 +1561,7 @@ void command_permaclass(Client *c, const Seperator *sep)
|
||||
c->Message(0,"Target is not a client.");
|
||||
else {
|
||||
c->Message(0, "Setting %s's class...Sending to char select.", t->GetName());
|
||||
Log.Out(Logs::General, Logs::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
||||
Log(Logs::General, Logs::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->Save();
|
||||
t->Kick();
|
||||
@ -1583,7 +1583,7 @@ void command_permarace(Client *c, const Seperator *sep)
|
||||
c->Message(0,"Target is not a client.");
|
||||
else {
|
||||
c->Message(0, "Setting %s's race - zone to take effect", t->GetName());
|
||||
Log.Out(Logs::General, Logs::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
||||
Log(Logs::General, Logs::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());
|
||||
t->SetBaseRace(atoi(sep->arg[1]));
|
||||
t->SetBaseGender(tmp);
|
||||
@ -1607,7 +1607,7 @@ void command_permagender(Client *c, const Seperator *sep)
|
||||
c->Message(0,"Target is not a client.");
|
||||
else {
|
||||
c->Message(0, "Setting %s's gender - zone to take effect", t->GetName());
|
||||
Log.Out(Logs::General, Logs::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) );
|
||||
Log(Logs::General, Logs::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->Save();
|
||||
t->SendIllusionPacket(atoi(sep->arg[1]));
|
||||
@ -1944,7 +1944,7 @@ void command_dbspawn2(Client *c, const Seperator *sep)
|
||||
{
|
||||
|
||||
if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) {
|
||||
Log.Out(Logs::General, Logs::Normal, "Spawning database spawn");
|
||||
Log(Logs::General, Logs::Normal, "Spawning database spawn");
|
||||
uint16 cond = 0;
|
||||
int16 cond_min = 0;
|
||||
if(sep->IsNumber(4)) {
|
||||
@ -2267,7 +2267,7 @@ void command_setlanguage(Client *c, const Seperator *sep)
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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 value = (uint8)atoi(sep->arg[2]);
|
||||
c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value );
|
||||
@ -2292,7 +2292,7 @@ void command_setskill(Client *c, const Seperator *sep)
|
||||
c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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]);
|
||||
uint16 skill_value = atoi(sep->arg[2]);
|
||||
if (skill_num <= EQEmu::skills::HIGHEST_SKILL)
|
||||
@ -2312,7 +2312,7 @@ void command_setskillall(Client *c, const Seperator *sep)
|
||||
}
|
||||
else {
|
||||
if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) {
|
||||
Log.Out(Logs::General, Logs::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName());
|
||||
Log(Logs::General, Logs::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName());
|
||||
uint16 level = atoi(sep->arg[1]);
|
||||
for (EQEmu::skills::SkillType skill_num = EQEmu::skills::Skill1HBlunt; skill_num <= EQEmu::skills::HIGHEST_SKILL; skill_num = (EQEmu::skills::SkillType)(skill_num + 1)) {
|
||||
c->GetTarget()->CastToClient()->SetSkill(skill_num, level);
|
||||
@ -3135,7 +3135,7 @@ void command_listpetition(Client *c, const Seperator *sep)
|
||||
if (!results.Success())
|
||||
return;
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Petition list requested by %s", c->GetName());
|
||||
Log(Logs::General, Logs::Normal, "Petition list requested by %s", c->GetName());
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return;
|
||||
@ -3793,7 +3793,7 @@ void command_lastname(Client *c, const Seperator *sep)
|
||||
|
||||
if(c->GetTarget() && c->GetTarget()->IsClient())
|
||||
t=c->GetTarget()->CastToClient();
|
||||
Log.Out(Logs::General, Logs::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName());
|
||||
Log(Logs::General, Logs::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName());
|
||||
|
||||
if(strlen(sep->arg[1]) <= 70)
|
||||
t->ChangeLastName(sep->arg[1]);
|
||||
@ -4350,7 +4350,7 @@ void command_iteminfo(Client *c, const Seperator *sep)
|
||||
}
|
||||
auto item = inst->GetItem();
|
||||
if (!item) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "(%s) Command #iteminfo processed an item with no data pointer");
|
||||
Log(Logs::General, Logs::Inventory, "(%s) Command #iteminfo processed an item with no data pointer");
|
||||
c->Message(13, "Error: This item has no data reference");
|
||||
return;
|
||||
}
|
||||
@ -4457,7 +4457,7 @@ void command_time(Client *c, const Seperator *sep)
|
||||
}
|
||||
c->Message(13, "Setting world time to %s:%i (Timezone: 0)...", sep->arg[1], minutes);
|
||||
zone->SetTime(atoi(sep->arg[1])+1, minutes);
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "%s :: Setting world time to %s:%i (Timezone: 0)...", c->GetCleanName(), sep->arg[1], minutes);
|
||||
Log(Logs::General, Logs::Zone_Server, "%s :: Setting world time to %s:%i (Timezone: 0)...", c->GetCleanName(), sep->arg[1], minutes);
|
||||
}
|
||||
else {
|
||||
c->Message(13, "To set the Time: #time HH [MM]");
|
||||
@ -4472,7 +4472,7 @@ void command_time(Client *c, const Seperator *sep)
|
||||
zone->zone_time.getEQTimeZoneMin()
|
||||
);
|
||||
c->Message(13, "It is now %s.", timeMessage);
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Current Time is: %s", timeMessage);
|
||||
Log(Logs::General, Logs::Zone_Server, "Current Time is: %s", timeMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4606,10 +4606,10 @@ void command_guild(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if(guild_id == GUILD_NONE) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(),
|
||||
sep->arg[2], charid);
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(),
|
||||
sep->arg[2], charid,
|
||||
guild_mgr.GetGuildName(guild_id), guild_id);
|
||||
}
|
||||
@ -4658,7 +4658,7 @@ void command_guild(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(),
|
||||
sep->arg[2], charid, rank);
|
||||
|
||||
if(!guild_mgr.SetGuildRank(charid, rank))
|
||||
@ -4700,7 +4700,7 @@ void command_guild(Client *c, const Seperator *sep)
|
||||
|
||||
uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::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);
|
||||
|
||||
if (id == GUILD_NONE)
|
||||
@ -4739,7 +4739,7 @@ void command_guild(Client *c, const Seperator *sep)
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(),
|
||||
guild_mgr.GetGuildName(id), id);
|
||||
|
||||
if (!guild_mgr.DeleteGuild(id))
|
||||
@ -4773,7 +4773,7 @@ void command_guild(Client *c, const Seperator *sep)
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(),
|
||||
guild_mgr.GetGuildName(id), id, sep->argplus[3]);
|
||||
|
||||
if (!guild_mgr.RenameGuild(id, sep->argplus[3]))
|
||||
@ -4824,7 +4824,7 @@ void command_guild(Client *c, const Seperator *sep)
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(),
|
||||
Log(Logs::Detail, Logs::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(),
|
||||
guild_mgr.GetGuildName(id), id, leader);
|
||||
|
||||
if(!guild_mgr.SetGuildLeader(id, leader))
|
||||
@ -5284,7 +5284,7 @@ void command_scribespells(Client *c, const Seperator *sep)
|
||||
t->Message(0, "Scribing spells to spellbook.");
|
||||
if(t != c)
|
||||
c->Message(0, "Scribing spells for %s.", t->GetName());
|
||||
Log.Out(Logs::General, Logs::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level);
|
||||
Log(Logs::General, Logs::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))
|
||||
{
|
||||
@ -5341,7 +5341,7 @@ void command_scribespell(Client *c, const Seperator *sep) {
|
||||
if(t != c)
|
||||
c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName());
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
||||
Log(Logs::General, Logs::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)) {
|
||||
book_slot = t->GetNextAvailableSpellBookSlot();
|
||||
@ -5388,7 +5388,7 @@ void command_unscribespell(Client *c, const Seperator *sep) {
|
||||
if(t != c)
|
||||
c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName());
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
||||
Log(Logs::General, Logs::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName());
|
||||
}
|
||||
else {
|
||||
t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id);
|
||||
@ -7828,7 +7828,7 @@ void command_traindisc(Client *c, const Seperator *sep)
|
||||
t->Message(0, "Training disciplines");
|
||||
if(t != c)
|
||||
c->Message(0, "Training disciplines for %s.", t->GetName());
|
||||
Log.Out(Logs::General, Logs::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level);
|
||||
Log(Logs::General, Logs::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++)
|
||||
{
|
||||
@ -10625,7 +10625,7 @@ void command_logtest(Client *c, const Seperator *sep){
|
||||
uint32 i = 0;
|
||||
t = std::clock();
|
||||
for (i = 0; i < atoi(sep->arg[1]); i++){
|
||||
Log.Out(Logs::General, Logs::Debug, "[%u] Test #2... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||
Log(Logs::General, Logs::Debug, "[%u] Test #2... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
}
|
||||
@ -10657,22 +10657,22 @@ void command_logs(Client *c, const Seperator *sep){
|
||||
c->Message(0, "[Category ID | console | file | gmsay | Category Description]");
|
||||
redisplay_columns = 0;
|
||||
}
|
||||
c->Message(0, StringFormat("--- %i | %u | %u | %u | %s", i, Log.log_settings[i].log_to_console, Log.log_settings[i].log_to_file, Log.log_settings[i].log_to_gmsay, Logs::LogCategoryName[i]).c_str());
|
||||
c->Message(0, StringFormat("--- %i | %u | %u | %u | %s", i, LogSys.log_settings[i].log_to_console, LogSys.log_settings[i].log_to_file, LogSys.log_settings[i].log_to_gmsay, Logs::LogCategoryName[i]).c_str());
|
||||
redisplay_columns++;
|
||||
}
|
||||
}
|
||||
/* #logs set */
|
||||
if (strcasecmp(sep->arg[1], "set") == 0){
|
||||
if (strcasecmp(sep->arg[2], "console") == 0){
|
||||
Log.log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]);
|
||||
LogSys.log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]);
|
||||
logs_set = 1;
|
||||
}
|
||||
else if (strcasecmp(sep->arg[2], "file") == 0){
|
||||
Log.log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]);
|
||||
LogSys.log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]);
|
||||
logs_set = 1;
|
||||
}
|
||||
else if (strcasecmp(sep->arg[2], "gmsay") == 0){
|
||||
Log.log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]);
|
||||
LogSys.log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]);
|
||||
logs_set = 1;
|
||||
}
|
||||
else{
|
||||
@ -10687,10 +10687,10 @@ void command_logs(Client *c, const Seperator *sep){
|
||||
This is used in hot places of code to check if its enabled in any way before triggering logs
|
||||
*/
|
||||
if (atoi(sep->arg[4]) > 0){
|
||||
Log.log_settings[atoi(sep->arg[3])].is_category_enabled = 1;
|
||||
LogSys.log_settings[atoi(sep->arg[3])].is_category_enabled = 1;
|
||||
}
|
||||
else{
|
||||
Log.log_settings[atoi(sep->arg[3])].is_category_enabled = 0;
|
||||
LogSys.log_settings[atoi(sep->arg[3])].is_category_enabled = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10713,7 +10713,7 @@ void command_mysqltest(Client *c, const Seperator *sep)
|
||||
auto results = database.QueryDatabase(query);
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Debug, "MySQL Test... Took %f seconds", ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||
Log(Logs::General, Logs::Debug, "MySQL Test... Took %f seconds", ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
void command_resetaa_timer(Client *c, const Seperator *sep) {
|
||||
|
||||
@ -798,7 +798,7 @@ bool Corpse::Process() {
|
||||
spc->zone_id = zone->graveyard_zoneid();
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
Log.Out(Logs::General, Logs::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid()));
|
||||
Log(Logs::General, Logs::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid()));
|
||||
corpse_db_id = 0;
|
||||
}
|
||||
|
||||
@ -828,10 +828,10 @@ bool Corpse::Process() {
|
||||
Save();
|
||||
player_corpse_depop = true;
|
||||
corpse_db_id = 0;
|
||||
Log.Out(Logs::General, Logs::None, "Tagged %s player corpse has buried.", this->GetName());
|
||||
Log(Logs::General, Logs::None, "Tagged %s player corpse has buried.", this->GetName());
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to bury %s player corpse.", this->GetName());
|
||||
Log(Logs::General, Logs::Error, "Unable to bury %s player corpse.", this->GetName());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1046,7 +1046,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item_data = *cur;
|
||||
item = database.GetItem(item_data->item_id);
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,9 +133,9 @@ bool Doors::Process()
|
||||
void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
{
|
||||
//door debugging info dump
|
||||
Log.Out(Logs::Detail, Logs::Doors, "%s clicked door %s (dbid %d, eqid %d) at %s", sender->GetName(), door_name, db_id, door_id, to_string(m_Position).c_str());
|
||||
Log.Out(Logs::Detail, Logs::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.Out(Logs::Detail, Logs::Doors, " size %d, invert %d, dest: %s %s", size, invert_state, dest_zone, to_string(m_Destination).c_str());
|
||||
Log(Logs::Detail, Logs::Doors, "%s clicked door %s (dbid %d, eqid %d) at %s", sender->GetName(), door_name, db_id, door_id, to_string(m_Position).c_str());
|
||||
Log(Logs::Detail, Logs::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(Logs::Detail, Logs::Doors, " size %d, invert %d, dest: %s %s", size, invert_state, dest_zone, to_string(m_Destination).c_str());
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
|
||||
MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer;
|
||||
@ -291,7 +291,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger)
|
||||
float modskill = sender->GetSkill(EQEmu::skills::SkillPickLock);
|
||||
sender->CheckIncreaseSkill(EQEmu::skills::SkillPickLock, nullptr, 1);
|
||||
|
||||
Log.Out(Logs::General, Logs::Skills, "Client has lockpicks: skill=%f", modskill);
|
||||
Log(Logs::General, Logs::Skills, "Client has lockpicks: skill=%f", modskill);
|
||||
|
||||
if(GetLockpick() <= modskill)
|
||||
{
|
||||
@ -547,13 +547,13 @@ void Doors::ToggleState(Mob *sender)
|
||||
}
|
||||
|
||||
void Doors::DumpDoor(){
|
||||
Log.Out(Logs::General, Logs::None,
|
||||
Log(Logs::General, Logs::None,
|
||||
"db_id:%i door_id:%i zone_name:%s door_name:%s %s",
|
||||
db_id, door_id, zone_name, door_name, to_string(m_Position).c_str());
|
||||
Log.Out(Logs::General, Logs::None,
|
||||
Log(Logs::General, Logs::None,
|
||||
"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");
|
||||
Log.Out(Logs::General, Logs::None,
|
||||
Log(Logs::General, Logs::None,
|
||||
"dest_zone:%s destination:%s ",
|
||||
dest_zone, to_string(m_Destination).c_str());
|
||||
}
|
||||
@ -629,7 +629,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version)
|
||||
}
|
||||
|
||||
bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) {
|
||||
Log.Out(Logs::General, Logs::Status, "Loading Doors from database...");
|
||||
Log(Logs::General, Logs::Status, "Loading Doors from database...");
|
||||
|
||||
|
||||
// Door tmpDoor;
|
||||
@ -656,7 +656,7 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name
|
||||
into[rowIndex].db_id = atoi(row[0]);
|
||||
into[rowIndex].door_id = atoi(row[1]);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Doors, "Door Load: db id: %u, door_id %u", into[rowIndex].db_id, into[rowIndex].door_id);
|
||||
Log(Logs::Detail, Logs::Doors, "Door Load: db id: %u, door_id %u", into[rowIndex].db_id, into[rowIndex].door_id);
|
||||
|
||||
strn0cpy(into[rowIndex].zone_name,row[2],32);
|
||||
strn0cpy(into[rowIndex].door_name,row[3],32);
|
||||
|
||||
@ -484,7 +484,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
const EQEmu::ItemData *item = database.GetItem(itemid);
|
||||
if(item == nullptr) {
|
||||
Message(13, "Unable to find the tome you turned in!");
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
|
||||
Log(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ void PerlembParser::ReloadQuests() {
|
||||
perl = nullptr;
|
||||
}
|
||||
|
||||
Log.Out(Logs::General, Logs::Status, "Error re-initializing perlembed: %s", e.what());
|
||||
Log(Logs::General, Logs::Status, "Error re-initializing perlembed: %s", e.what());
|
||||
throw e.what();
|
||||
}
|
||||
|
||||
|
||||
@ -3654,13 +3654,13 @@ XS(XS__debug)
|
||||
return;
|
||||
|
||||
if (debug_level == Logs::General){
|
||||
Log.Out(Logs::General, Logs::QuestDebug, log_message);
|
||||
Log(Logs::General, Logs::QuestDebug, log_message);
|
||||
}
|
||||
else if (debug_level == Logs::Moderate){
|
||||
Log.Out(Logs::Moderate, Logs::QuestDebug, log_message);
|
||||
Log(Logs::Moderate, Logs::QuestDebug, log_message);
|
||||
}
|
||||
else if (debug_level == Logs::Detail){
|
||||
Log.Out(Logs::Detail, Logs::QuestDebug, log_message);
|
||||
Log(Logs::Detail, Logs::QuestDebug, log_message);
|
||||
}
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
@ -3693,7 +3693,7 @@ EXTERN_C XS(boot_quest)
|
||||
file[255] = '\0';
|
||||
|
||||
if(items != 1)
|
||||
Log.Out(Logs::General, Logs::Error, "boot_quest does not take any arguments.");
|
||||
Log(Logs::General, Logs::Error, "boot_quest does not take any arguments.");
|
||||
|
||||
char buf[128]; //shouldent have any function names longer than this.
|
||||
|
||||
|
||||
@ -140,12 +140,12 @@ void Embperl::DoInit() {
|
||||
catch(const char *err)
|
||||
{
|
||||
//remember... lasterr() is no good if we crap out here, in construction
|
||||
Log.Out(Logs::General, Logs::Quests, "perl error: %s", err);
|
||||
Log(Logs::General, Logs::Quests, "perl error: %s", err);
|
||||
throw "failed to install eval_file hook";
|
||||
}
|
||||
|
||||
#ifdef EMBPERL_IO_CAPTURE
|
||||
Log.Out(Logs::General, Logs::Quests, "Tying perl output to eqemu logs");
|
||||
Log(Logs::General, Logs::Quests, "Tying perl output to eqemu logs");
|
||||
//make a tieable class to capture IO and pass it into EQEMuLog
|
||||
eval_pv(
|
||||
"package EQEmuIO; "
|
||||
@ -170,7 +170,7 @@ void Embperl::DoInit() {
|
||||
,FALSE
|
||||
);
|
||||
|
||||
Log.Out(Logs::General, Logs::Quests, "Loading perlemb plugins.");
|
||||
Log(Logs::General, Logs::Quests, "Loading perlemb plugins.");
|
||||
try
|
||||
{
|
||||
std::string perl_command;
|
||||
@ -179,7 +179,7 @@ void Embperl::DoInit() {
|
||||
}
|
||||
catch(const char *err)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Quests, "Warning - %s: %s", Config->PluginPlFile.c_str(), err);
|
||||
Log(Logs::General, Logs::Quests, "Warning - %s: %s", Config->PluginPlFile.c_str(), err);
|
||||
}
|
||||
try
|
||||
{
|
||||
@ -197,7 +197,7 @@ void Embperl::DoInit() {
|
||||
}
|
||||
catch(const char *err)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Quests, "Perl warning: %s", err);
|
||||
Log(Logs::General, Logs::Quests, "Perl warning: %s", err);
|
||||
}
|
||||
#endif //EMBPERL_PLUGIN
|
||||
in_use = false;
|
||||
|
||||
@ -68,7 +68,7 @@ EXTERN_C XS(boot_qc)
|
||||
file[255] = '\0';
|
||||
|
||||
if(items != 1)
|
||||
Log.Out(Logs::General, Logs::Error, "boot_qc does not take any arguments.");
|
||||
Log(Logs::General, Logs::Error, "boot_qc does not take any arguments.");
|
||||
|
||||
char buf[128]; //shouldent have any function names longer than this.
|
||||
|
||||
@ -104,7 +104,7 @@ XS(XS_EQEmuIO_PRINT)
|
||||
int len = 0;
|
||||
for(i = 0; *cur != '\0'; i++, cur++) {
|
||||
if(*cur == '\n') {
|
||||
Log.Out(Logs::General, Logs::Quests, str);
|
||||
Log(Logs::General, Logs::Quests, str);
|
||||
len = 0;
|
||||
pos = i+1;
|
||||
} else {
|
||||
@ -112,7 +112,7 @@ XS(XS_EQEmuIO_PRINT)
|
||||
}
|
||||
}
|
||||
if(len > 0) {
|
||||
Log.Out(Logs::General, Logs::Quests, str);
|
||||
Log(Logs::General, Logs::Quests, str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,12 +73,12 @@ Entity::~Entity()
|
||||
Client *Entity::CastToClient()
|
||||
{
|
||||
if (this == 0x00) {
|
||||
Log.Out(Logs::General, Logs::Error, "CastToClient error (nullptr)");
|
||||
Log(Logs::General, Logs::Error, "CastToClient error (nullptr)");
|
||||
return 0;
|
||||
}
|
||||
#ifdef _EQDEBUG
|
||||
if (!IsClient()) {
|
||||
Log.Out(Logs::General, Logs::Error, "CastToClient error (not client)");
|
||||
Log(Logs::General, Logs::Error, "CastToClient error (not client)");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -90,7 +90,7 @@ NPC *Entity::CastToNPC()
|
||||
{
|
||||
#ifdef _EQDEBUG
|
||||
if (!IsNPC()) {
|
||||
Log.Out(Logs::General, Logs::Error, "CastToNPC error (Not NPC)");
|
||||
Log(Logs::General, Logs::Error, "CastToNPC error (Not NPC)");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -363,7 +363,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline)
|
||||
{
|
||||
if (*it == nullptr)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "nullptr group, %s:%i", fname, fline);
|
||||
Log(Logs::General, Logs::Error, "nullptr group, %s:%i", fname, fline);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -521,17 +521,17 @@ void EntityList::MobProcess()
|
||||
#ifdef _WINDOWS
|
||||
struct in_addr in;
|
||||
in.s_addr = mob->CastToClient()->GetIP();
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Dropping client: Process=false, ip=%s port=%u", inet_ntoa(in), mob->CastToClient()->GetPort());
|
||||
Log(Logs::General, Logs::Zone_Server, "Dropping client: Process=false, ip=%s port=%u", inet_ntoa(in), mob->CastToClient()->GetPort());
|
||||
#endif
|
||||
zone->StartShutdownTimer();
|
||||
Group *g = GetGroupByMob(mob);
|
||||
if(g) {
|
||||
Log.Out(Logs::General, Logs::Error, "About to delete a client still in a group.");
|
||||
Log(Logs::General, Logs::Error, "About to delete a client still in a group.");
|
||||
g->DelMember(mob);
|
||||
}
|
||||
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
|
||||
if(r) {
|
||||
Log.Out(Logs::General, Logs::Error, "About to delete a client still in a raid.");
|
||||
Log(Logs::General, Logs::Error, "About to delete a client still in a raid.");
|
||||
r->MemberZoned(mob->CastToClient());
|
||||
}
|
||||
entity_list.RemoveClient(id);
|
||||
@ -578,7 +578,7 @@ void EntityList::AddGroup(Group *group)
|
||||
|
||||
uint32 gid = worldserver.NextGroupID();
|
||||
if (gid == 0) {
|
||||
Log.Out(Logs::General, Logs::Error,
|
||||
Log(Logs::General, Logs::Error,
|
||||
"Unable to get new group ID from world server. group is going to be broken.");
|
||||
return;
|
||||
}
|
||||
@ -607,7 +607,7 @@ void EntityList::AddRaid(Raid *raid)
|
||||
|
||||
uint32 gid = worldserver.NextGroupID();
|
||||
if (gid == 0) {
|
||||
Log.Out(Logs::General, Logs::Error,
|
||||
Log(Logs::General, Logs::Error,
|
||||
"Unable to get new group ID from world server. group is going to be broken.");
|
||||
return;
|
||||
}
|
||||
@ -793,7 +793,7 @@ void EntityList::CheckSpawnQueue()
|
||||
auto it = npc_list.find(ns->spawn.spawnId);
|
||||
if (it == npc_list.end()) {
|
||||
// We must of despawned, hope that's the reason!
|
||||
Log.Out(Logs::General, Logs::Error, "Error in EntityList::CheckSpawnQueue: Unable to find NPC for spawnId '%u'", ns->spawn.spawnId);
|
||||
Log(Logs::General, Logs::Error, "Error in EntityList::CheckSpawnQueue: Unable to find NPC for spawnId '%u'", ns->spawn.spawnId);
|
||||
}
|
||||
else {
|
||||
NPC *pnpc = it->second;
|
||||
@ -2674,7 +2674,7 @@ char *EntityList::MakeNameUnique(char *name)
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name);
|
||||
Log(Logs::General, Logs::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name);
|
||||
char tmp[64] = "!";
|
||||
strn0cpy(&tmp[1], name, sizeof(tmp) - 1);
|
||||
strcpy(name, tmp);
|
||||
@ -3526,7 +3526,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID)
|
||||
// If we have been passed a TaskID, only reload the client state if they have
|
||||
// that Task active.
|
||||
if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) {
|
||||
Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
||||
Log(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName());
|
||||
client->RemoveClientTaskState();
|
||||
client->LoadClientTaskState();
|
||||
taskmanager->SendActiveTasksToClient(client);
|
||||
|
||||
@ -331,7 +331,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
}
|
||||
|
||||
void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
Log.Out(Logs::Detail, Logs::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
|
||||
Log(Logs::Detail, Logs::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 = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2()
|
||||
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) {
|
||||
@ -446,7 +446,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
|
||||
m_pp.aapoints = set_aaxp / max_AAXP;
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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
|
||||
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);
|
||||
@ -572,7 +572,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
||||
void Client::SetLevel(uint8 set_level, bool command)
|
||||
{
|
||||
if (GetEXPForLevel(set_level) == 0xFFFFFFFF) {
|
||||
Log.Out(Logs::General, Logs::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level);
|
||||
Log(Logs::General, Logs::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -630,7 +630,7 @@ void Client::SetLevel(uint8 set_level, bool command)
|
||||
safe_delete(outapp);
|
||||
this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change
|
||||
|
||||
Log.Out(Logs::General, Logs::Normal, "Setting Level for %s to %i", GetName(), set_level);
|
||||
Log(Logs::General, Logs::Normal, "Setting Level for %s to %i", GetName(), set_level);
|
||||
|
||||
CalcBonuses();
|
||||
|
||||
|
||||
@ -142,11 +142,11 @@ void Mob::CalculateNewFearpoint()
|
||||
m_FearWalkTarget = glm::vec3(Loc.x, Loc.y, Loc.z);
|
||||
currently_fleeing = true;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z);
|
||||
Log(Logs::Detail, Logs::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z);
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection.");
|
||||
Log(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection.");
|
||||
}
|
||||
|
||||
int loop = 0;
|
||||
|
||||
@ -69,7 +69,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
|
||||
|
||||
item[index] = atoi(row[0]);
|
||||
chance[index] = atoi(row[1]) + chancepool;
|
||||
Log.Out(Logs::General, Logs::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]);
|
||||
Log(Logs::General, Logs::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]);
|
||||
chancepool = chance[index];
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ void Client::ForageItem(bool guarantee) {
|
||||
const EQEmu::ItemData* food_item = database.GetItem(foragedfood);
|
||||
|
||||
if(!food_item) {
|
||||
Log.Out(Logs::General, Logs::Error, "nullptr returned from database.GetItem in ClientForageItem");
|
||||
Log(Logs::General, Logs::Error, "nullptr returned from database.GetItem in ClientForageItem");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -790,7 +790,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) {
|
||||
caster->SpellOnTarget(spell_id, members[z]->GetPet());
|
||||
#endif
|
||||
} else
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
||||
Log(Logs::Detail, Logs::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -829,7 +829,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) {
|
||||
members[z]->GetPet()->BardPulse(spell_id, caster);
|
||||
#endif
|
||||
} else
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
||||
Log(Logs::Detail, Logs::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1133,7 +1133,7 @@ bool Group::LearnMembers() {
|
||||
return false;
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
Log.Out(Logs::General, Logs::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1162,7 +1162,7 @@ void Group::VerifyGroup() {
|
||||
for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (membername[i][0] == '\0') {
|
||||
#if EQDEBUG >= 7
|
||||
Log.Out(Logs::General, Logs::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i);
|
||||
Log(Logs::General, Logs::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i);
|
||||
#endif
|
||||
members[i] = nullptr;
|
||||
continue;
|
||||
@ -1171,7 +1171,7 @@ void Group::VerifyGroup() {
|
||||
Mob *them = entity_list.GetMob(membername[i]);
|
||||
if(them == nullptr && members[i] != nullptr) { //they aren't in zone
|
||||
#if EQDEBUG >= 6
|
||||
Log.Out(Logs::General, Logs::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]);
|
||||
Log(Logs::General, Logs::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]);
|
||||
#endif
|
||||
membername[i][0] = '\0';
|
||||
members[i] = nullptr;
|
||||
@ -1180,13 +1180,13 @@ void Group::VerifyGroup() {
|
||||
|
||||
if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good.
|
||||
#if EQDEBUG >= 5
|
||||
Log.Out(Logs::General, Logs::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]);
|
||||
Log(Logs::General, Logs::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]);
|
||||
#endif
|
||||
members[i] = them;
|
||||
continue;
|
||||
}
|
||||
#if EQDEBUG >= 8
|
||||
Log.Out(Logs::General, Logs::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]);
|
||||
Log(Logs::General, Logs::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -1521,7 +1521,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle)
|
||||
MainTankName.c_str(), GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1567,7 +1567,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle)
|
||||
MainAssistName.c_str(), GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
}
|
||||
@ -1614,7 +1614,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle)
|
||||
PullerName.c_str(), GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@ -1765,7 +1765,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle)
|
||||
std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
if(!toggle) {
|
||||
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
|
||||
@ -1814,7 +1814,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle)
|
||||
std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
if(!toggle)
|
||||
{
|
||||
@ -1842,7 +1842,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle)
|
||||
std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
if(!toggle) {
|
||||
for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {
|
||||
@ -1925,7 +1925,7 @@ void Group::SetGroupMentor(int percent, char *name)
|
||||
mentoree_name.c_str(), mentor_percent, GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
void Group::ClearGroupMentor()
|
||||
@ -1936,7 +1936,7 @@ void Group::ClearGroupMentor()
|
||||
std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
void Group::NotifyAssistTarget(Client *c)
|
||||
@ -2006,7 +2006,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName)
|
||||
NewNPCMarkerName, GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
void Group::NotifyMarkNPC(Client *c)
|
||||
@ -2087,7 +2087,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName)
|
||||
std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@ -2104,7 +2104,7 @@ void Group::SaveGroupLeaderAA()
|
||||
safe_delete_array(queryBuffer);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str());
|
||||
Log(Logs::General, Logs::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
|
||||
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
@ -147,10 +147,10 @@ void Client::SendGuildSpawnAppearance() {
|
||||
if (!IsInAGuild()) {
|
||||
// clear guildtag
|
||||
SendAppearancePacket(AT_GuildID, GUILD_NONE);
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for no guild tag.");
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending spawn appearance for no guild tag.");
|
||||
} else {
|
||||
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
|
||||
SendAppearancePacket(AT_GuildID, GuildID());
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
|
||||
{
|
||||
@ -174,11 +174,11 @@ void Client::SendGuildList() {
|
||||
//ask the guild manager to build us a nice guild list packet
|
||||
outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size);
|
||||
if(outapp->pBuffer == nullptr) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unable to make guild list!");
|
||||
Log(Logs::Detail, Logs::Guilds, "Unable to make guild list!");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size);
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
@ -195,7 +195,7 @@ void Client::SendGuildMembers() {
|
||||
outapp->pBuffer = data;
|
||||
data = nullptr;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size);
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
@ -227,7 +227,7 @@ void Client::RefreshGuildInfo()
|
||||
|
||||
CharGuildInfo info;
|
||||
if(!guild_mgr.GetCharInfo(CharacterID(), info)) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID());
|
||||
Log(Logs::Detail, Logs::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){
|
||||
outgj->rank = gj->rank;
|
||||
outgj->zoneid = gj->zoneid;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size);
|
||||
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ extern WorldServer worldserver;
|
||||
extern volatile bool is_zone_loaded;
|
||||
|
||||
void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation);
|
||||
auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct));
|
||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||
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) {
|
||||
if(guild_id == 0) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Guild lookup for char %d when sending char refresh.", charid);
|
||||
Log(Logs::Detail, Logs::Guilds, "Guild lookup for char %d when sending char refresh.", charid);
|
||||
|
||||
CharGuildInfo gci;
|
||||
if(!GetCharInfo(charid, gci)) {
|
||||
@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id);
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct));
|
||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||
@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID)
|
||||
}
|
||||
|
||||
void ZoneGuildManager::SendGuildDelete(uint32 guild_id) {
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Sending guild delete for guild %d to world", guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Sending guild delete for guild %d to world", guild_id);
|
||||
auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct));
|
||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||
s->guild_id = guild_id;
|
||||
@ -261,12 +261,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
switch(pack->opcode) {
|
||||
case ServerOP_RefreshGuild: {
|
||||
if(pack->size != sizeof(ServerGuildRefresh_Struct)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
||||
Log(Logs::General, Logs::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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.
|
||||
RefreshGuild(s->guild_id);
|
||||
@ -295,12 +295,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
|
||||
case ServerOP_GuildCharRefresh: {
|
||||
if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||
Log(Logs::General, Logs::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id);
|
||||
Log(Logs::Detail, Logs::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);
|
||||
|
||||
@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
{
|
||||
if(pack->size != sizeof(ServerGuildRankUpdate_Struct))
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d",
|
||||
Log(Logs::General, Logs::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d",
|
||||
pack->size, sizeof(ServerGuildRankUpdate_Struct));
|
||||
|
||||
return;
|
||||
@ -364,12 +364,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
|
||||
case ServerOP_DeleteGuild: {
|
||||
if(pack->size != sizeof(ServerGuildID_Struct)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
||||
Log(Logs::General, Logs::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct));
|
||||
return;
|
||||
}
|
||||
ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Guilds, "Received guild delete from world for guild %d", s->guild_id);
|
||||
Log(Logs::Detail, Logs::Guilds, "Received guild delete from world for guild %d", s->guild_id);
|
||||
|
||||
//clear all the guild tags.
|
||||
entity_list.RefreshAllGuildInfo(s->guild_id);
|
||||
@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
|
||||
if (!c || !c->IsInAGuild())
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Guilds,"Invalid Client or not in guild. ID=%i", FromID);
|
||||
Log(Logs::Detail, Logs::Guilds,"Invalid Client or not in guild. ID=%i", FromID);
|
||||
break;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::Guilds,"Processing ServerOP_OnlineGuildMembersResponse");
|
||||
Log(Logs::Detail, Logs::Guilds,"Processing ServerOP_OnlineGuildMembersResponse");
|
||||
auto outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct));
|
||||
GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer;
|
||||
char Name[64];
|
||||
@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
|
||||
VARSTRUCT_DECODE_STRING(Name, Buffer);
|
||||
strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName));
|
||||
gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
||||
Log.Out(Logs::Detail, Logs::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID);
|
||||
Log(Logs::Detail, Logs::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID);
|
||||
c->QueuePacket(outapp);
|
||||
}
|
||||
safe_delete(outapp);
|
||||
@ -683,7 +683,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
||||
|
||||
if(Iterator == Banks.end())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to find guild bank for guild ID %i", c->GuildID());
|
||||
Log(Logs::General, Logs::Error, "Unable to find guild bank for guild ID %i", c->GuildID());
|
||||
|
||||
return;
|
||||
}
|
||||
@ -856,7 +856,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
||||
|
||||
if(Iterator == Banks.end())
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "Unable to find guild bank for guild ID %i", GuildID);
|
||||
Log(Logs::General, Logs::Error, "Unable to find guild bank for guild ID %i", GuildID);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -902,7 +902,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
||||
|
||||
if(Slot < 0)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Error, "No space to add item to the guild bank.");
|
||||
Log(Logs::General, Logs::Error, "No space to add item to the guild bank.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -860,42 +860,42 @@ void HealRotation::bias_targets()
|
||||
m_casting_target_poke = true;
|
||||
|
||||
#if (EQDEBUG >= 12)
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::bias_targets() - *** Post-processing state ***");
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation Settings:");
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_interval_ms = %u", m_interval_ms);
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_next_cast_time_ms = %u (current_time: %u, time_diff: %i)", m_next_cast_time_ms, Timer::GetCurrentTime(), ((int32)Timer::GetCurrentTime() - (int32)m_next_cast_time_ms));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_next_poke_time_ms = %u (current_time: %u, time_diff: %i)", m_next_poke_time_ms, Timer::GetCurrentTime(), ((int32)Timer::GetCurrentTime() - (int32)m_next_poke_time_ms));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_fast_heals = %s", ((m_fast_heals) ? ("true") : ("false")));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_adaptive_targeting = %s", ((m_adaptive_targeting) ? ("true") : ("false")));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_casting_override = %s", ((m_casting_override) ? ("true") : ("false")));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_casting_target_poke = %s", ((m_casting_target_poke) ? ("true") : ("false")));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_active_heal_target = %s", ((m_active_heal_target) ? ("true") : ("false")));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_is_active = %s", ((m_is_active) ? ("true") : ("false")));
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_member_list.size() = %i", m_member_pool.size());
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_cycle_list.size() = %i", m_cycle_pool.size());
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation::m_target_list.size() = %i", m_target_pool.size());
|
||||
if (m_member_pool.size()) { Log.Out(Logs::General, Logs::Error, "(std::shared_ptr<HealRotation>::use_count() = %i", m_member_pool.front()->MemberOfHealRotation()->use_count()); }
|
||||
else { Log.Out(Logs::General, Logs::Error, "(std::shared_ptr<HealRotation>::use_count() = unknown (0)"); }
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation Members:");
|
||||
Log(Logs::General, Logs::Error, "HealRotation::bias_targets() - *** Post-processing state ***");
|
||||
Log(Logs::General, Logs::Error, "HealRotation Settings:");
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_interval_ms = %u", m_interval_ms);
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_next_cast_time_ms = %u (current_time: %u, time_diff: %i)", m_next_cast_time_ms, Timer::GetCurrentTime(), ((int32)Timer::GetCurrentTime() - (int32)m_next_cast_time_ms));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_next_poke_time_ms = %u (current_time: %u, time_diff: %i)", m_next_poke_time_ms, Timer::GetCurrentTime(), ((int32)Timer::GetCurrentTime() - (int32)m_next_poke_time_ms));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_fast_heals = %s", ((m_fast_heals) ? ("true") : ("false")));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_adaptive_targeting = %s", ((m_adaptive_targeting) ? ("true") : ("false")));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_casting_override = %s", ((m_casting_override) ? ("true") : ("false")));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_casting_target_poke = %s", ((m_casting_target_poke) ? ("true") : ("false")));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_active_heal_target = %s", ((m_active_heal_target) ? ("true") : ("false")));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_is_active = %s", ((m_is_active) ? ("true") : ("false")));
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_member_list.size() = %i", m_member_pool.size());
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_cycle_list.size() = %i", m_cycle_pool.size());
|
||||
Log(Logs::General, Logs::Error, "HealRotation::m_target_list.size() = %i", m_target_pool.size());
|
||||
if (m_member_pool.size()) { Log(Logs::General, Logs::Error, "(std::shared_ptr<HealRotation>::use_count() = %i", m_member_pool.front()->MemberOfHealRotation()->use_count()); }
|
||||
else { Log(Logs::General, Logs::Error, "(std::shared_ptr<HealRotation>::use_count() = unknown (0)"); }
|
||||
Log(Logs::General, Logs::Error, "HealRotation Members:");
|
||||
int member_index = 0;
|
||||
for (auto mlist_iter : m_member_pool) {
|
||||
if (!mlist_iter) { continue; }
|
||||
Log.Out(Logs::General, Logs::Error, "(%i) %s (hrcast: %c)", (++member_index), mlist_iter->GetCleanName(), ((mlist_iter->AmICastingForHealRotation())?('T'):('F')));
|
||||
Log(Logs::General, Logs::Error, "(%i) %s (hrcast: %c)", (++member_index), mlist_iter->GetCleanName(), ((mlist_iter->AmICastingForHealRotation())?('T'):('F')));
|
||||
}
|
||||
if (!member_index) { Log.Out(Logs::General, Logs::Error, "(0) None"); }
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation Cycle:");
|
||||
if (!member_index) { Log(Logs::General, Logs::Error, "(0) None"); }
|
||||
Log(Logs::General, Logs::Error, "HealRotation Cycle:");
|
||||
int cycle_index = 0;
|
||||
for (auto clist_iter : m_cycle_pool) {
|
||||
if (!clist_iter) { continue; }
|
||||
Log.Out(Logs::General, Logs::Error, "(%i) %s", (++cycle_index), clist_iter->GetCleanName());
|
||||
Log(Logs::General, Logs::Error, "(%i) %s", (++cycle_index), clist_iter->GetCleanName());
|
||||
}
|
||||
if (!cycle_index) { Log.Out(Logs::General, Logs::Error, "(0) None"); }
|
||||
Log.Out(Logs::General, Logs::Error, "HealRotation Targets: (sort type: %u)", sort_type);
|
||||
if (!cycle_index) { Log(Logs::General, Logs::Error, "(0) None"); }
|
||||
Log(Logs::General, Logs::Error, "HealRotation Targets: (sort type: %u)", sort_type);
|
||||
int target_index = 0;
|
||||
|
||||
for (auto tlist_iter : m_target_pool) {
|
||||
if (!tlist_iter) { continue; }
|
||||
Log.Out(Logs::General, Logs::Error, "(%i) %s (hp: %3.1f%%, at: %u, dontheal: %c, crit(base): %c(%c), safe(base): %c(%c), hcnt(ext): %u(%u), hfreq(ext): %f(%f))",
|
||||
Log(Logs::General, Logs::Error, "(%i) %s (hp: %3.1f%%, at: %u, dontheal: %c, crit(base): %c(%c), safe(base): %c(%c), hcnt(ext): %u(%u), hfreq(ext): %f(%f))",
|
||||
(++target_index), tlist_iter->GetCleanName(),
|
||||
tlist_iter->GetHPRatio(),
|
||||
ClassArmorType(tlist_iter->GetClass()),
|
||||
@ -909,7 +909,7 @@ void HealRotation::bias_targets()
|
||||
tlist_iter->HealRotationHealFrequency(),
|
||||
tlist_iter->HealRotationExtendedHealFrequency());
|
||||
}
|
||||
if (!target_index) { Log.Out(Logs::General, Logs::Error, "(0) None (hp: 0.0\%, at: 0, dontheal: F, crit(base): F(F), safe(base): F(F), hcnt(ext): 0(0), hfreq(ext): 0.0(0.0))"); }
|
||||
if (!target_index) { Log(Logs::General, Logs::Error, "(0) None (hp: 0.0\%, at: 0, dontheal: F, crit(base): F(F), safe(base): F(F), hcnt(ext): 0(0), hfreq(ext): 0.0(0.0))"); }
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) {
|
||||
}
|
||||
|
||||
if (results.RowCount() != 1) {
|
||||
Log.Out(Logs::General, Logs::Error, "No Database entry for mount: %s, check the horses table", fileName);
|
||||
Log(Logs::General, Logs::Error, "No Database entry for mount: %s, check the horses table", fileName);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ void Client::SummonHorse(uint16 spell_id) {
|
||||
return;
|
||||
}
|
||||
if(!Horse::IsHorseSpell(spell_id)) {
|
||||
Log.Out(Logs::General, Logs::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id);
|
||||
Log(Logs::General, Logs::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// make sure the item exists
|
||||
if(item == nullptr) {
|
||||
Message(13, "Item %u does not exist.", item_id);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
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
|
||||
else if (((!item->IsClassCommon()) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) {
|
||||
Message(13, "You can not augment an augment or a non-common class item.");
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
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)))) {
|
||||
Message(13, "You are not a GM or do not have the status to summon this item.");
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
if(augtest == nullptr) {
|
||||
if(augments[iter]) {
|
||||
Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
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
|
||||
else if(augtest->AugType == 0) {
|
||||
Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
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)))) {
|
||||
Message(13, "You are not a GM or do not have the status to summon this augment.");
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
if(enforcewear) {
|
||||
if ((item->AugSlotType[iter] == EQEmu::item::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);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
|
||||
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);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
|
||||
if(restrictfail) {
|
||||
Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// check for class usability
|
||||
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));
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// check for race usability
|
||||
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));
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// check for slot usability
|
||||
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));
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
if(inst == nullptr) {
|
||||
Message(13, "An unknown server error has occurred and your item was not created.");
|
||||
// this goes to logfile since this is a major error
|
||||
Log.Out(Logs::General, Logs::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(Logs::General, Logs::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);
|
||||
|
||||
return false;
|
||||
@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
|
||||
if(!(slots & ((uint32)1 << slottest))) {
|
||||
Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
|
||||
to_slot = EQEmu::inventory::slotCursor;
|
||||
@ -596,7 +596,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
|
||||
// Drop item from inventory to ground (generally only dropped from SLOT_CURSOR)
|
||||
void Client::DropItem(int16 slot_id, bool recurse)
|
||||
{
|
||||
Log.Out(Logs::General, Logs::Inventory, "'%s' (char_id: %u) Attempting to drop item from slot %i on the ground",
|
||||
Log(Logs::General, Logs::Inventory, "'%s' (char_id: %u) Attempting to drop item from slot %i on the ground",
|
||||
GetCleanName(), CharacterID(), slot_id);
|
||||
|
||||
if(GetInv().CheckNoDrop(slot_id, recurse) && RuleI(World, FVNoDropFlag) == 0 ||
|
||||
@ -604,20 +604,20 @@ void Client::DropItem(int16 slot_id, bool recurse)
|
||||
{
|
||||
auto invalid_drop = m_inv.GetItem(slot_id);
|
||||
if (!invalid_drop) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Error in InventoryProfile::CheckNoDrop() - returned 'true' for empty slot");
|
||||
Log(Logs::General, Logs::Inventory, "Error in InventoryProfile::CheckNoDrop() - returned 'true' for empty slot");
|
||||
}
|
||||
else {
|
||||
if (Log.log_settings[Logs::Inventory].is_category_enabled) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "DropItem() Hack detected - full item parse:");
|
||||
Log.Out(Logs::General, Logs::Inventory, "depth: 0, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
if (LogSys.log_settings[Logs::Inventory].is_category_enabled) {
|
||||
Log(Logs::General, Logs::Inventory, "DropItem() Hack detected - full item parse:");
|
||||
Log(Logs::General, Logs::Inventory, "depth: 0, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(invalid_drop->GetItem() ? invalid_drop->GetItem()->Name : "null data"), invalid_drop->GetID(), invalid_drop->IsDroppable(false));
|
||||
|
||||
for (auto iter1 : *invalid_drop->GetContents()) { // depth 1
|
||||
Log.Out(Logs::General, Logs::Inventory, "-depth: 1, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
Log(Logs::General, Logs::Inventory, "-depth: 1, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(iter1.second->GetItem() ? iter1.second->GetItem()->Name : "null data"), iter1.second->GetID(), iter1.second->IsDroppable(false));
|
||||
|
||||
for (auto iter2 : *iter1.second->GetContents()) { // depth 2
|
||||
Log.Out(Logs::General, Logs::Inventory, "--depth: 2, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
Log(Logs::General, Logs::Inventory, "--depth: 2, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(iter2.second->GetItem() ? iter2.second->GetItem()->Name : "null data"), iter2.second->GetID(), iter2.second->IsDroppable(false));
|
||||
}
|
||||
}
|
||||
@ -633,39 +633,39 @@ void Client::DropItem(int16 slot_id, bool recurse)
|
||||
// Take control of item in client inventory
|
||||
EQEmu::ItemInstance *inst = m_inv.PopItem(slot_id);
|
||||
if(inst) {
|
||||
if (Log.log_settings[Logs::Inventory].is_category_enabled) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "DropItem() Processing - full item parse:");
|
||||
Log.Out(Logs::General, Logs::Inventory, "depth: 0, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
if (LogSys.log_settings[Logs::Inventory].is_category_enabled) {
|
||||
Log(Logs::General, Logs::Inventory, "DropItem() Processing - full item parse:");
|
||||
Log(Logs::General, Logs::Inventory, "depth: 0, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(inst->GetItem() ? inst->GetItem()->Name : "null data"), inst->GetID(), inst->IsDroppable(false));
|
||||
|
||||
if (!inst->IsDroppable(false))
|
||||
Log.Out(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
Log(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
|
||||
for (auto iter1 : *inst->GetContents()) { // depth 1
|
||||
Log.Out(Logs::General, Logs::Inventory, "-depth: 1, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
Log(Logs::General, Logs::Inventory, "-depth: 1, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(iter1.second->GetItem() ? iter1.second->GetItem()->Name : "null data"), iter1.second->GetID(), iter1.second->IsDroppable(false));
|
||||
|
||||
if (!iter1.second->IsDroppable(false))
|
||||
Log.Out(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
Log(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
|
||||
for (auto iter2 : *iter1.second->GetContents()) { // depth 2
|
||||
Log.Out(Logs::General, Logs::Inventory, "--depth: 2, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
Log(Logs::General, Logs::Inventory, "--depth: 2, Item: '%s' (id: %u), IsDroppable: %s",
|
||||
(iter2.second->GetItem() ? iter2.second->GetItem()->Name : "null data"), iter2.second->GetID(), iter2.second->IsDroppable(false));
|
||||
|
||||
if (!iter2.second->IsDroppable(false))
|
||||
Log.Out(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
Log(Logs::General, Logs::Error, "Non-droppable item being processed for drop by '%s'", GetCleanName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int i = parse->EventItem(EVENT_DROP_ITEM, this, inst, nullptr, "", slot_id);
|
||||
if(i != 0) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Item drop handled by [EVENT_DROP_ITEM]");
|
||||
Log(Logs::General, Logs::Inventory, "Item drop handled by [EVENT_DROP_ITEM]");
|
||||
safe_delete(inst);
|
||||
}
|
||||
} else {
|
||||
// Item doesn't exist in inventory!
|
||||
Log.Out(Logs::General, Logs::Inventory, "DropItem() - No item found in slot %i", slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "DropItem() - No item found in slot %i", slot_id);
|
||||
Message(13, "Error: Item not found in slot %i", slot_id);
|
||||
return;
|
||||
}
|
||||
@ -687,7 +687,7 @@ void Client::DropItem(int16 slot_id, bool recurse)
|
||||
entity_list.AddObject(object, true);
|
||||
object->StartDecay();
|
||||
|
||||
Log.Out(Logs::General, Logs::Inventory, "Item drop handled ut assolet");
|
||||
Log(Logs::General, Logs::Inventory, "Item drop handled ut assolet");
|
||||
|
||||
safe_delete(inst);
|
||||
}
|
||||
@ -758,7 +758,7 @@ void Client::SendCursorBuffer()
|
||||
}
|
||||
|
||||
if (!lore_pass) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor",
|
||||
Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor",
|
||||
GetName(), test_item->Name, test_item->ID);
|
||||
Message_StringID(MT_LootMessages, 290);
|
||||
parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
|
||||
@ -773,7 +773,7 @@ void Client::SendCursorBuffer()
|
||||
// Remove item from inventory
|
||||
void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) {
|
||||
#if (EQDEBUG >= 5)
|
||||
Log.Out(Logs::General, Logs::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false");
|
||||
Log(Logs::General, Logs::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false");
|
||||
#endif
|
||||
|
||||
// Added 'IsSlotValid(slot_id)' check to both segments of client packet processing.
|
||||
@ -894,7 +894,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd
|
||||
|
||||
bool Client::PushItemOnCursor(const EQEmu::ItemInstance& inst, bool client_update)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID);
|
||||
Log(Logs::Detail, Logs::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID);
|
||||
m_inv.PushCursor(inst);
|
||||
|
||||
if (client_update) {
|
||||
@ -910,7 +910,7 @@ bool Client::PushItemOnCursor(const EQEmu::ItemInstance& inst, bool client_updat
|
||||
// (Also saves changes back to the database: this may be optimized in the future)
|
||||
// client_update: Sends packet to client
|
||||
bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst, bool client_update) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||
|
||||
if (slot_id == EQEmu::inventory::slotCursor) { // don't trust macros before conditional statements...
|
||||
return PushItemOnCursor(inst, client_update);
|
||||
@ -939,7 +939,7 @@ bool Client::PutItemInInventory(int16 slot_id, const EQEmu::ItemInstance& inst,
|
||||
|
||||
void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst, ServerLootItem_Struct** bag_item_data)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id);
|
||||
|
||||
bool cursor_empty = m_inv.CursorEmpty();
|
||||
|
||||
@ -983,7 +983,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
|
||||
// Dump bag contents to cursor in the event that owning bag is not the first cursor item
|
||||
// (This assumes that the data passed is correctly associated..no safety checks are implemented)
|
||||
if (slot_id == EQEmu::inventory::slotCursor && !cursor_empty) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory,
|
||||
Log(Logs::Detail, Logs::Inventory,
|
||||
"Putting bag loot item %s (%d) into slot %d (non-empty cursor override)",
|
||||
inst.GetItem()->Name, inst.GetItem()->ID, EQEmu::inventory::slotCursor);
|
||||
|
||||
@ -992,7 +992,7 @@ void Client::PutLootInInventory(int16 slot_id, const EQEmu::ItemInstance &inst,
|
||||
else {
|
||||
auto bag_slot = EQEmu::InventoryProfile::CalcSlotId(slot_id, index);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Inventory,
|
||||
Log(Logs::Detail, Logs::Inventory,
|
||||
"Putting bag loot item %s (%d) into slot %d (bag slot %d)",
|
||||
inst.GetItem()->Name, inst.GetItem()->ID, bag_slot, index);
|
||||
|
||||
@ -1418,7 +1418,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.
|
||||
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);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||
Log(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1426,7 +1426,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.
|
||||
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);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||
Log(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1450,7 +1450,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
|
||||
if (!lore_pass) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor",
|
||||
Log(Logs::General, Logs::Inventory, "(%s) Duplicate lore items are not allowed - destroying item %s(id:%u) on cursor",
|
||||
GetName(), test_item->Name, test_item->ID);
|
||||
Message_StringID(MT_LootMessages, 290);
|
||||
parse->EventItem(EVENT_DESTROY_ITEM, this, test_inst, nullptr, "", 0);
|
||||
@ -1462,7 +1462,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
|
||||
if (move_in->to_slot == (uint32)INVALID_INDEX) {
|
||||
if (move_in->from_slot == (uint32)EQEmu::inventory::slotCursor) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot);
|
||||
Log(Logs::Detail, Logs::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot);
|
||||
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
|
||||
|
||||
EQEmu::ItemInstance *inst = m_inv.GetItem(EQEmu::inventory::slotCursor);
|
||||
@ -1476,7 +1476,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
return true; // Item destroyed by client
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot);
|
||||
Log(Logs::Detail, Logs::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
|
||||
DeleteItemInInventory(move_in->from_slot);
|
||||
return true; // Item deletion
|
||||
@ -1512,7 +1512,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
EQEmu::ItemInstance* src_inst = m_inv.GetItem(src_slot_id);
|
||||
EQEmu::ItemInstance* dst_inst = m_inv.GetItem(dst_slot_id);
|
||||
if (src_inst){
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
//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))
|
||||
@ -1522,7 +1522,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
}
|
||||
if (dst_inst) {
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
}
|
||||
if (Trader && srcitemid>0){
|
||||
@ -1559,7 +1559,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
move_in->from_slot = dst_slot_check;
|
||||
move_in->to_slot = src_slot_check;
|
||||
move_in->number_in_stack = dst_inst->GetCharges();
|
||||
if(!SwapItem(move_in)) { Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
@ -1567,7 +1567,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
//verify shared bank transactions in the database
|
||||
if (src_inst && src_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && src_slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||
if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
|
||||
Log(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name);
|
||||
DeleteItemInInventory(dst_slot_id,0,true);
|
||||
return(false);
|
||||
}
|
||||
@ -1582,7 +1582,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
}
|
||||
if (dst_inst && dst_slot_id >= EQEmu::legacy::SHARED_BANK_BEGIN && dst_slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END) {
|
||||
if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
|
||||
Log(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name);
|
||||
DeleteItemInInventory(src_slot_id,0,true);
|
||||
return(false);
|
||||
}
|
||||
@ -1619,7 +1619,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
ndh_item_data.append(StringFormat(", nodrop=%s(%u)", (ndh_item->NoDrop == 0 ? "true" : "false"), ndh_item->NoDrop));
|
||||
}
|
||||
}
|
||||
Log.Out(Logs::General, Logs::Error, "WorldKick() of Player %s(id:%u, acct:%u) due to 'NoDrop Hack' detection >> SlotID:%i, ItemData:'%s'",
|
||||
Log(Logs::General, Logs::Error, "WorldKick() of Player %s(id:%u, acct:%u) due to 'NoDrop Hack' detection >> SlotID:%i, ItemData:'%s'",
|
||||
GetName(), CharacterID(), AccountID(), src_slot_id, ndh_item_data.c_str());
|
||||
ndh_inst = nullptr;
|
||||
|
||||
@ -1721,7 +1721,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
return false;
|
||||
}
|
||||
if (with) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName());
|
||||
Log(Logs::Detail, Logs::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
|
||||
if (!m_inv[EQEmu::inventory::slotCursor]) {
|
||||
Message(13, "Error: Cursor item not located on server!");
|
||||
@ -1754,18 +1754,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if (move_in->number_in_stack > 0) {
|
||||
// Determine if charged items can stack
|
||||
if(src_inst && !src_inst->IsStackable()) {
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
}
|
||||
|
||||
if (dst_inst) {
|
||||
if(src_inst->GetID() != dst_inst->GetID()) {
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
}
|
||||
if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) {
|
||||
//we have a chance of stacking.
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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
|
||||
uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges();
|
||||
if (usedcharges > move_in->number_in_stack)
|
||||
@ -1777,15 +1777,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
// Depleted all charges?
|
||||
if (src_inst->GetCharges() < 1)
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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);
|
||||
m_inv.DeleteItem(src_slot_id);
|
||||
all_to_stack = true;
|
||||
} else {
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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 {
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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;
|
||||
}
|
||||
}
|
||||
@ -1794,12 +1794,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) {
|
||||
// Move entire stack
|
||||
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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 {
|
||||
// Split into two
|
||||
src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack);
|
||||
Log.Out(Logs::Detail, Logs::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(Logs::Detail, Logs::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());
|
||||
EQEmu::ItemInstance* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack);
|
||||
m_inv.PutItem(dst_slot_id, *inst);
|
||||
safe_delete(inst);
|
||||
@ -1824,7 +1824,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
|
||||
SetMaterial(dst_slot_id,src_inst->GetItem()->ID);
|
||||
}
|
||||
if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; }
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id);
|
||||
|
||||
if (src_slot_id <= EQEmu::legacy::EQUIPMENT_END || src_slot_id == EQEmu::inventory::slotPowerSource) {
|
||||
if(src_inst) {
|
||||
@ -1887,7 +1887,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) {
|
||||
|
||||
// resync the 'from' and 'to' slots on an as-needed basis
|
||||
// Not as effective as the full process, but less intrusive to gameplay
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot);
|
||||
Log(Logs::Detail, Logs::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...");
|
||||
|
||||
if ((move_slots->from_slot >= EQEmu::legacy::EQUIPMENT_BEGIN && move_slots->from_slot <= EQEmu::legacy::CURSOR_BAG_END) || move_slots->from_slot == EQEmu::inventory::slotPowerSource) {
|
||||
@ -2269,7 +2269,7 @@ static bool CopyBagContents(EQEmu::ItemInstance* new_bag, const EQEmu::ItemInsta
|
||||
for (auto bag_slot = 0; bag_slot < old_bag->GetItem()->BagSlots; ++bag_slot) {
|
||||
if (!old_bag->GetItem(bag_slot)) { continue; }
|
||||
if (old_bag->GetItem(bag_slot)->GetItem()->Size > new_bag->GetItem()->BagSize) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Copy Bag Contents: Failure due to %s is larger than size capacity of %s (%i > %i)",
|
||||
Log(Logs::General, Logs::Inventory, "Copy Bag Contents: Failure due to %s is larger than size capacity of %s (%i > %i)",
|
||||
old_bag->GetItem(bag_slot)->GetItem()->Name, new_bag->GetItem()->Name, old_bag->GetItem(bag_slot)->GetItem()->Size, new_bag->GetItem()->BagSize);
|
||||
return false;
|
||||
}
|
||||
@ -2300,7 +2300,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
if (!new_inst) { continue; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
}
|
||||
safe_delete(new_inst);
|
||||
@ -2321,7 +2321,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
if (!new_inst) { continue; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
}
|
||||
safe_delete(new_inst);
|
||||
@ -2342,7 +2342,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
if (!new_inst) { continue; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, slot_id);
|
||||
PutItemInInventory(slot_id, *new_inst, client_update);
|
||||
}
|
||||
safe_delete(new_inst);
|
||||
@ -2363,7 +2363,7 @@ void Client::DisenchantSummonedBags(bool client_update)
|
||||
if (!new_inst) { break; }
|
||||
|
||||
if (CopyBagContents(new_inst, inst)) {
|
||||
Log.Out(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::inventory::slotCursor);
|
||||
Log(Logs::General, Logs::Inventory, "Disenchant Summoned Bags: Replacing %s with %s in slot %i", inst->GetItem()->Name, new_inst->GetItem()->Name, EQEmu::inventory::slotCursor);
|
||||
std::list<EQEmu::ItemInstance*> local;
|
||||
local.push_front(new_inst);
|
||||
m_inv.PopItem(EQEmu::inventory::slotCursor);
|
||||
@ -2399,7 +2399,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id <= EQEmu::legacy::EQUIPMENT_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
DeleteItemInInventory(slot_id, 0, client_update);
|
||||
}
|
||||
}
|
||||
@ -2407,7 +2407,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::GENERAL_BEGIN; slot_id <= EQEmu::legacy::GENERAL_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if (inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
DeleteItemInInventory(slot_id, 0, client_update);
|
||||
}
|
||||
}
|
||||
@ -2415,7 +2415,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
if (m_inv[EQEmu::inventory::slotPowerSource]) {
|
||||
auto inst = m_inv[EQEmu::inventory::slotPowerSource];
|
||||
if (inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
|
||||
Log(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
|
||||
DeleteItemInInventory(EQEmu::inventory::slotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
|
||||
}
|
||||
}
|
||||
@ -2423,7 +2423,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::GENERAL_BAGS_BEGIN; slot_id <= EQEmu::legacy::CURSOR_BAG_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
DeleteItemInInventory(slot_id, 0, client_update);
|
||||
}
|
||||
}
|
||||
@ -2431,7 +2431,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::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
|
||||
}
|
||||
}
|
||||
@ -2439,7 +2439,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::BANK_BAGS_BEGIN; slot_id <= EQEmu::legacy::BANK_BAGS_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::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
|
||||
}
|
||||
}
|
||||
@ -2447,7 +2447,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::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
|
||||
}
|
||||
}
|
||||
@ -2455,7 +2455,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
for (auto slot_id = EQEmu::legacy::SHARED_BANK_BAGS_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_BAGS_END; ++slot_id) {
|
||||
auto inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::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
|
||||
}
|
||||
}
|
||||
@ -2473,7 +2473,7 @@ void Client::RemoveNoRent(bool client_update)
|
||||
auto inst = *iter;
|
||||
if (inst == nullptr) { continue; }
|
||||
if (!inst->GetItem()->NoRent) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||
Log(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||
}
|
||||
else {
|
||||
m_inv.PushCursor(*inst);
|
||||
@ -2494,7 +2494,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
}
|
||||
else {
|
||||
@ -2507,7 +2507,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if (CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
}
|
||||
else {
|
||||
@ -2520,7 +2520,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = m_inv.PopItem(EQEmu::inventory::slotPowerSource);
|
||||
if (inst) {
|
||||
if (CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource);
|
||||
database.SaveInventory(character_id, nullptr, EQEmu::inventory::slotPowerSource);
|
||||
}
|
||||
else {
|
||||
@ -2534,7 +2534,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
}
|
||||
else {
|
||||
@ -2547,7 +2547,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
}
|
||||
else {
|
||||
@ -2560,7 +2560,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
if (inst == nullptr) { continue; }
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
}
|
||||
else {
|
||||
@ -2585,7 +2585,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
auto inst = *iter;
|
||||
if (inst == nullptr) { continue; }
|
||||
if (CheckLoreConflict(inst->GetItem())) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||
safe_delete(inst);
|
||||
}
|
||||
else {
|
||||
@ -2604,7 +2604,7 @@ void Client::RemoveDuplicateLore(bool client_update)
|
||||
m_inv.PushCursor(*inst);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||
Log(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name);
|
||||
}
|
||||
safe_delete(inst);
|
||||
}
|
||||
@ -2622,7 +2622,7 @@ void Client::MoveSlotNotAllowed(bool client_update)
|
||||
auto inst = m_inv.PopItem(slot_id);
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size, is_arrow);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id);
|
||||
Log(Logs::Detail, Logs::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);
|
||||
database.SaveInventory(character_id, nullptr, slot_id);
|
||||
safe_delete(inst);
|
||||
@ -2633,7 +2633,7 @@ void Client::MoveSlotNotAllowed(bool client_update)
|
||||
auto inst = m_inv.PopItem(EQEmu::inventory::slotPowerSource);
|
||||
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
|
||||
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsClassBag(), true, inst->GetItem()->Size, is_arrow);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource, free_slot_id);
|
||||
Log(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, EQEmu::inventory::slotPowerSource, free_slot_id);
|
||||
PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false);
|
||||
database.SaveInventory(character_id, nullptr, EQEmu::inventory::slotPowerSource);
|
||||
safe_delete(inst);
|
||||
@ -2770,7 +2770,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app)
|
||||
|
||||
BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer;
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->Number, bs->Name);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->Number, bs->Name);
|
||||
strcpy(m_pp.bandoliers[bs->Number].Name, bs->Name);
|
||||
|
||||
const EQEmu::ItemInstance* InvItem = nullptr;
|
||||
@ -2784,13 +2784,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app)
|
||||
InvItem = GetInv()[WeaponSlot];
|
||||
if(InvItem) {
|
||||
BaseItem = InvItem->GetItem();
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot);
|
||||
m_pp.bandoliers[bs->Number].Items[BandolierSlot].ID = BaseItem->ID;
|
||||
m_pp.bandoliers[bs->Number].Items[BandolierSlot].Icon = BaseItem->Icon;
|
||||
database.SaveCharacterBandolier(this->CharacterID(), bs->Number, BandolierSlot, m_pp.bandoliers[bs->Number].Items[BandolierSlot].ID, m_pp.bandoliers[bs->Number].Items[BandolierSlot].Icon, bs->Name);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot);
|
||||
m_pp.bandoliers[bs->Number].Items[BandolierSlot].ID = 0;
|
||||
m_pp.bandoliers[bs->Number].Items[BandolierSlot].Icon = 0;
|
||||
}
|
||||
@ -2800,7 +2800,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app)
|
||||
void Client::RemoveBandolier(const EQApplicationPacket *app)
|
||||
{
|
||||
BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer;
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s removing set", GetName(), bds->Number);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s removing set", GetName(), bds->Number);
|
||||
memset(m_pp.bandoliers[bds->Number].Name, 0, 32);
|
||||
for(int i = bandolierPrimary; i <= bandolierAmmo; i++) {
|
||||
m_pp.bandoliers[bds->Number].Items[i].ID = 0;
|
||||
@ -2815,7 +2815,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
// any items currently in the weapon slots to inventory.
|
||||
|
||||
BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer;
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s activating set %i", GetName(), bss->Number);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s activating set %i", GetName(), bss->Number);
|
||||
int16 slot = 0;
|
||||
int16 WeaponSlot = 0;
|
||||
EQEmu::ItemInstance *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory
|
||||
@ -2882,19 +2882,19 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
else { // The player doesn't have the required weapon with them.
|
||||
BandolierItems[BandolierSlot] = 0;
|
||||
if (slot == INVALID_INDEX) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot);
|
||||
Log(Logs::Detail, Logs::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot);
|
||||
EQEmu::ItemInstance *InvItem = m_inv.PopItem(WeaponSlot);
|
||||
if(InvItem) {
|
||||
// If there was an item in that weapon slot, put it in the inventory
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory",
|
||||
Log(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory",
|
||||
InvItem->GetItem()->Name, WeaponSlot);
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
Log(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
if (MoveItemToInventory(InvItem)) {
|
||||
database.SaveInventory(character_id, 0, WeaponSlot);
|
||||
Log.Out(Logs::General, Logs::Error, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
Log(Logs::General, Logs::Error, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
Log(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
}
|
||||
safe_delete(InvItem);
|
||||
}
|
||||
@ -2928,7 +2928,7 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
if(InvItem) {
|
||||
// If there was already an item in that weapon slot that we replaced, find a place to put it
|
||||
if (!MoveItemToInventory(InvItem)) {
|
||||
Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
Log(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
}
|
||||
safe_delete(InvItem);
|
||||
}
|
||||
@ -2939,13 +2939,13 @@ void Client::SetBandolier(const EQApplicationPacket *app)
|
||||
// put it in the player's inventory.
|
||||
EQEmu::ItemInstance *InvItem = m_inv.PopItem(WeaponSlot);
|
||||
if(InvItem) {
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name);
|
||||
Log(Logs::Detail, Logs::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name);
|
||||
// If there was an item in that weapon slot, put it in the inventory
|
||||
if (MoveItemToInventory(InvItem)) {
|
||||
database.SaveInventory(character_id, 0, WeaponSlot);
|
||||
}
|
||||
else {
|
||||
Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
Log(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name);
|
||||
}
|
||||
safe_delete(InvItem);
|
||||
}
|
||||
@ -2978,7 +2978,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name);
|
||||
Log(Logs::Detail, Logs::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name);
|
||||
|
||||
uint32 ItemID = ItemToReturn->GetItem()->ID;
|
||||
|
||||
@ -3058,7 +3058,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
|
||||
database.SaveInventory(character_id, m_inv.GetItem(i), i);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -3081,7 +3081,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
|
||||
database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot);
|
||||
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot);
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -3091,7 +3091,7 @@ bool Client::MoveItemToInventory(EQEmu::ItemInstance *ItemToReturn, bool UpdateC
|
||||
|
||||
// Store on the cursor
|
||||
//
|
||||
Log.Out(Logs::Detail, Logs::Inventory, "Char: %s No space, putting on the cursor", GetName());
|
||||
Log(Logs::Detail, Logs::Inventory, "Char: %s No space, putting on the cursor", GetName());
|
||||
|
||||
PushItemOnCursor(*ItemToReturn, UpdateClient);
|
||||
|
||||
@ -3162,7 +3162,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
log = true;
|
||||
|
||||
if (log) {
|
||||
Log.Out(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
|
||||
Log(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
|
||||
}
|
||||
if (!silent) {
|
||||
requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE"));
|
||||
@ -3183,8 +3183,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
}
|
||||
|
||||
if (log) {
|
||||
Log.Out(Logs::General, Logs::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End");
|
||||
Log(Logs::General, Logs::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End");
|
||||
}
|
||||
if (!silent) {
|
||||
requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE"));
|
||||
@ -3199,7 +3199,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool
|
||||
void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const EQEmu::ItemInstance* inst, const EQEmu::ItemInstance* parent, bool log, bool silent, bool &error, int depth)
|
||||
{
|
||||
if (depth >= 10) {
|
||||
Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)");
|
||||
Log(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3230,7 +3230,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea
|
||||
else { e = ""; }
|
||||
|
||||
if (log) {
|
||||
Log.Out(Logs::General, Logs::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s",
|
||||
Log(Logs::General, Logs::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s",
|
||||
head, depth, i.c_str(), p.c_str(), e.c_str());
|
||||
}
|
||||
if (!silent) {
|
||||
|
||||
@ -232,7 +232,7 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
|
||||
|
||||
auto item = new ServerLootItem_Struct;
|
||||
#if EQDEBUG>=11
|
||||
Log.Out(Logs::General, Logs::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID);
|
||||
Log(Logs::General, Logs::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID);
|
||||
#endif
|
||||
|
||||
EQApplicationPacket* outapp = nullptr;
|
||||
|
||||
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