mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Move worldserver logging ot use LogInfo
This commit is contained in:
parent
678c25e02c
commit
be291d58b0
@ -252,7 +252,7 @@ uint32 Database::CreateAccount(
|
||||
|
||||
bool Database::DeleteAccount(const char* name, const char *loginserver) {
|
||||
std::string query = StringFormat("DELETE FROM account WHERE name='%s' AND ls_id='%s'", name, loginserver);
|
||||
Log(Logs::General, Logs::WorldServer, "Account Attempting to be deleted:'%s:%s'", loginserver, name);
|
||||
LogInfo("Account Attempting to be deleted:'[{}]:[{}]'", loginserver, name);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
@ -299,7 +299,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(Logs::General, Logs::WorldServer, "Account: %i tried to request name: %s, but it is already taken...", account_id, name);
|
||||
LogInfo("Account: [{}] tried to request name: [{}], but it is already taken", account_id, name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -317,10 +317,10 @@ bool Database::ReserveName(uint32 account_id, char* name) {
|
||||
bool Database::DeleteCharacter(char *name) {
|
||||
uint32 charid = 0;
|
||||
if(!name || !strlen(name)) {
|
||||
Log(Logs::General, Logs::WorldServer, "DeleteCharacter: request to delete without a name (empty char slot)");
|
||||
LogInfo("DeleteCharacter: request to delete without a name (empty char slot)");
|
||||
return false;
|
||||
}
|
||||
Log(Logs::General, Logs::WorldServer, "Database::DeleteCharacter name : '%s'", name);
|
||||
LogInfo("Database::DeleteCharacter name : [{}]", 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);
|
||||
@ -2237,7 +2237,7 @@ struct TimeOfDay_Struct Database::LoadTime(time_t &realtime)
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success() || results.RowCount() == 0){
|
||||
Log(Logs::Detail, Logs::WorldServer, "Loading EQ time of day failed. Using defaults.");
|
||||
LogInfo("Loading EQ time of day failed. Using defaults");
|
||||
eqTime.minute = 0;
|
||||
eqTime.hour = 9;
|
||||
eqTime.day = 1;
|
||||
|
||||
144
world/client.cpp
144
world/client.cpp
@ -158,7 +158,7 @@ void Client::SendEnterWorld(std::string name)
|
||||
eqs->Close();
|
||||
return;
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Telling client to continue session.");
|
||||
LogInfo("Telling client to continue session");
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ void Client::SendCharInfo() {
|
||||
QueuePacket(outapp);
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::WorldServer, "[Error] Database did not return an OP_SendCharInfo packet for account %u", GetAccountID());
|
||||
LogInfo("[Error] Database did not return an OP_SendCharInfo packet for account [{}]", GetAccountID());
|
||||
}
|
||||
safe_delete(outapp);
|
||||
}
|
||||
@ -411,7 +411,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
||||
LogDebug("Receiving Login Info Packet from Client | name [{0}] password [{1}]", name, password);
|
||||
|
||||
if (strlen(password) <= 1) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Login without a password");
|
||||
LogInfo("Login without a password");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -483,7 +483,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Bad/Expired session key '%s'", name);
|
||||
LogInfo("Bad/Expired session key [{}]", name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -491,7 +491,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app)
|
||||
bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
||||
{
|
||||
if (GetAccountID() == 0) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Name approval request with no logged in account");
|
||||
LogInfo("Name approval request with no logged in account");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -499,7 +499,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
||||
uchar race = app->pBuffer[64];
|
||||
uchar clas = app->pBuffer[68];
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceIDName(race), GetClassIDName(clas));
|
||||
LogInfo("Name approval request. Name=[{}], race=[{}], class=[{}]", char_name, GetRaceIDName(race), GetClassIDName(clas));
|
||||
|
||||
EQApplicationPacket *outapp;
|
||||
outapp = new EQApplicationPacket;
|
||||
@ -660,11 +660,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app)
|
||||
|
||||
bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
||||
if (GetAccountID() == 0) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Account ID not set; unable to create character.");
|
||||
LogInfo("Account ID not set; unable to create character");
|
||||
return false;
|
||||
}
|
||||
else if (app->size != sizeof(CharCreate_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on OP_CharacterCreate. Got: %d, Expected: %d", app->size, sizeof(CharCreate_Struct));
|
||||
LogInfo("Wrong size on OP_CharacterCreate. Got: [{}], Expected: [{}]", app->size, sizeof(CharCreate_Struct));
|
||||
DumpPacket(app);
|
||||
// the previous behavior was essentially returning true here
|
||||
// but that seems a bit odd to me.
|
||||
@ -691,14 +691,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) {
|
||||
|
||||
bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
if (GetAccountID() == 0) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Enter world with no logged in account");
|
||||
LogInfo("Enter world with no logged in account");
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(GetAdmin() < 0)
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Account banned or suspended.");
|
||||
LogInfo("Account banned or suspended");
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
@ -714,14 +714,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(Logs::Detail, Logs::WorldServer, "Could not get CharInfo for '%s'", char_name);
|
||||
LogInfo("Could not get CharInfo for [{}]", char_name);
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make sure this account owns this character
|
||||
if (tmpaccid != GetAccountID()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "This account does not own the character named '%s'", char_name);
|
||||
LogInfo("This account does not own the character named [{}]", char_name);
|
||||
eqs->Close();
|
||||
return true;
|
||||
}
|
||||
@ -763,7 +763,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
zone_id = database.MoveCharacterToBind(charid, 4);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "'%s' is trying to go home before they're able...", char_name);
|
||||
LogInfo("[{}] 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;
|
||||
@ -787,7 +787,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
|
||||
database.MoveCharacterToZone(charid, database.GetZoneName(zone_id));
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "'%s' is trying to go to tutorial but are not allowed...", char_name);
|
||||
LogInfo("[{}] 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;
|
||||
@ -798,7 +798,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(Logs::Detail, Logs::WorldServer, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zone_id, char_name);
|
||||
LogInfo("Zone not found in database zone_id=[{}], moveing char to arena character:[{}]", zone_id, char_name);
|
||||
}
|
||||
|
||||
if(instance_id > 0)
|
||||
@ -943,7 +943,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) {
|
||||
|
||||
uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer);
|
||||
if(char_acct_id == GetAccountID()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Delete character: %s", app->pBuffer);
|
||||
LogInfo("Delete character: [{}]", app->pBuffer);
|
||||
database.DeleteCharacter((char *)app->pBuffer);
|
||||
SendCharInfo();
|
||||
}
|
||||
@ -964,24 +964,24 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
||||
|
||||
EmuOpcode opcode = app->GetOpcode();
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied EQApplicationPacket");
|
||||
LogNetcode("Received EQApplicationPacket [{:#04x}]", opcode);
|
||||
|
||||
if (!eqs->CheckState(ESTABLISHED)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Client disconnected (net inactive on send)");
|
||||
LogInfo("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(Logs::Detail, Logs::WorldServer, "GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID());
|
||||
LogInfo("GM Account not permited from source address [{}] and accountid [{}]", 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(Logs::Detail, Logs::WorldServer, "Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]);
|
||||
LogInfo("Expecting OP_SendLoginInfo, got [{}]", OpcodeNames[opcode]);
|
||||
return false;
|
||||
}
|
||||
else if (opcode == OP_AckPacket) {
|
||||
@ -1060,7 +1060,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Received unknown EQApplicationPacket");
|
||||
LogNetcode("Received unknown EQApplicationPacket");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1078,7 +1078,7 @@ bool Client::Process() {
|
||||
to.sin_addr.s_addr = ip;
|
||||
|
||||
if (autobootup_timeout.Check()) {
|
||||
Log(Logs::General, Logs::WorldServer, "Zone bootup timer expired, bootup failed or too slow.");
|
||||
LogInfo("Zone bootup timer expired, bootup failed or too slow");
|
||||
TellClientZoneUnavailable();
|
||||
}
|
||||
|
||||
@ -1112,7 +1112,7 @@ bool Client::Process() {
|
||||
loginserverlist.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
Log(Logs::Detail, Logs::WorldServer, "Client disconnected (not active in process)");
|
||||
LogInfo("Client disconnected (not active in process)");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1168,17 +1168,17 @@ void Client::EnterWorld(bool TryBootup) {
|
||||
}
|
||||
else {
|
||||
if (TryBootup) {
|
||||
Log(Logs::General, Logs::WorldServer, "Attempting autobootup of %s (%d:%d)", zone_name, zone_id, instance_id);
|
||||
LogInfo("Attempting autobootup of [{}] ([{}]:[{}])", 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(Logs::General, Logs::WorldServer, "No zoneserver available to boot up.");
|
||||
LogInfo("No zoneserver available to boot up");
|
||||
TellClientZoneUnavailable();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::WorldServer, "Requested zone %s is not running.", zone_name);
|
||||
LogInfo("Requested zone [{}] is not running", zone_name);
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
@ -1187,7 +1187,7 @@ void Client::EnterWorld(bool TryBootup) {
|
||||
zone_waiting_for_bootup = 0;
|
||||
|
||||
if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zone_id)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Enter world failed. Zone is locked.");
|
||||
LogInfo("Enter world failed. Zone is locked");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
@ -1243,9 +1243,9 @@ void Client::Clearance(int8 response)
|
||||
{
|
||||
if (zs == 0)
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to find zoneserver in Client::Clearance!!");
|
||||
LogInfo("Unable to find zoneserver in Client::Clearance!!");
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Invalid response %d in Client::Clearance", response);
|
||||
LogInfo("Invalid response [{}] in Client::Clearance", response);
|
||||
}
|
||||
|
||||
TellClientZoneUnavailable();
|
||||
@ -1255,20 +1255,20 @@ void Client::Clearance(int8 response)
|
||||
EQApplicationPacket* outapp;
|
||||
|
||||
if (zs->GetCAddress() == nullptr) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to do zs->GetCAddress() in Client::Clearance!!");
|
||||
LogInfo("Unable to do zs->GetCAddress() in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
|
||||
if (zone_id == 0) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "zoneID is nullptr in Client::Clearance!!");
|
||||
LogInfo("zoneID is nullptr in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
|
||||
const char* zonename = database.GetZoneName(zone_id);
|
||||
if (zonename == 0) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "zonename is nullptr in Client::Clearance!!");
|
||||
LogInfo("zonename is nullptr in Client::Clearance!!");
|
||||
TellClientZoneUnavailable();
|
||||
return;
|
||||
}
|
||||
@ -1292,10 +1292,10 @@ void Client::Clearance(int8 response)
|
||||
|
||||
if(strcmp(zs_addr, "127.0.0.1") == 0)
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str());
|
||||
LogInfo("Local zone address was [{}], setting local address to: [{}]", zs_addr, WorldConfig::get()->LocalAddress.c_str());
|
||||
zs_addr = WorldConfig::get()->LocalAddress.c_str();
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Local zone address %s", zs_addr);
|
||||
LogInfo("Local zone address [{}]", zs_addr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1310,7 +1310,7 @@ void Client::Clearance(int8 response)
|
||||
|
||||
strcpy(zsi->ip, zs_addr);
|
||||
zsi->port =zs->GetCPort();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Sending client to zone %s (%d:%d) at %s:%d", zonename, zone_id, instance_id, zsi->ip, zsi->port);
|
||||
LogInfo("Sending client to zone [{}] ([{}]:[{}]) at [{}]:[{}]", zonename, zone_id, instance_id, zsi->ip, zsi->port);
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
@ -1342,7 +1342,7 @@ bool Client::GenPassKey(char* key) {
|
||||
}
|
||||
|
||||
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Sending EQApplicationPacket OpCode 0x%04x", app->GetOpcode());
|
||||
LogInfo("Sending EQApplicationPacket OpCode {:#04x}", app->GetOpcode());
|
||||
|
||||
ack_req = true; // It's broke right now, dont delete this line till fix it. =P
|
||||
eqs->QueuePacket(app, ack_req);
|
||||
@ -1430,27 +1430,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
||||
|
||||
in.s_addr = GetIP();
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
|
||||
Log(Logs::Detail, Logs::WorldServer, "Name: %s", name);
|
||||
LogInfo("Character creation request from [{}] LS#[{}] ([{}]:[{}]) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort());
|
||||
LogInfo("Name: [{}]", name);
|
||||
Log(Logs::Detail, Logs::WorldServer, "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(Logs::Detail, Logs::WorldServer, "STR STA AGI DEX WIS INT CHA Total");
|
||||
LogInfo("STR STA AGI DEX WIS INT CHA Total");
|
||||
Log(Logs::Detail, Logs::WorldServer, "%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(Logs::Detail, Logs::WorldServer, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor);
|
||||
LogInfo("Face: [{}] Eye colors: [{}] [{}]", cc->face, cc->eyecolor1, cc->eyecolor2);
|
||||
LogInfo("Hairstyle: [{}] Haircolor: [{}]", cc->hairstyle, cc->haircolor);
|
||||
LogInfo("Beard: [{}] Beardcolor: [{}]", cc->beard, cc->beardcolor);
|
||||
|
||||
/* Validate the char creation struct */
|
||||
if (m_ClientVersionBit & EQEmu::versions::maskSoFAndLater) {
|
||||
if (!CheckCharCreateInfoSoF(cc)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
LogInfo("CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!CheckCharCreateInfoTitanium(cc)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
LogInfo("CheckCharCreateInfo did not validate the request (bad race/class/stats)");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1512,14 +1512,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::maskSoFAndLater) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID));
|
||||
LogInfo("Found 'SoFStartZoneID' rule setting: [{}]", RuleI(World, SoFStartZoneID));
|
||||
if (RuleI(World, SoFStartZoneID) > 0) {
|
||||
pp.zone_id = RuleI(World, SoFStartZoneID);
|
||||
cc->start_zone = pp.zone_id;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::WorldServer, "Found 'TitaniumStartZoneID' rule setting: %i", RuleI(World, TitaniumStartZoneID));
|
||||
LogInfo("Found 'TitaniumStartZoneID' rule setting: [{}]", RuleI(World, TitaniumStartZoneID));
|
||||
if (RuleI(World, TitaniumStartZoneID) > 0) { /* if there's a startzone variable put them in there */
|
||||
|
||||
pp.zone_id = RuleI(World, TitaniumStartZoneID);
|
||||
@ -1592,10 +1592,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(Logs::Detail, Logs::WorldServer, "Character creation failed: %s", pp.name);
|
||||
LogInfo("Character creation failed: [{}]", pp.name);
|
||||
return false;
|
||||
}
|
||||
Log(Logs::Detail, Logs::WorldServer, "Character creation successful: %s", pp.name);
|
||||
LogInfo("Character creation successful: [{}]", pp.name);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1605,7 +1605,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
if (!cc)
|
||||
return false;
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Validating char creation info...");
|
||||
LogInfo("Validating char creation info");
|
||||
|
||||
RaceClassCombos class_combo;
|
||||
bool found = false;
|
||||
@ -1622,7 +1622,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Could not find class/race/deity/start_zone combination");
|
||||
LogInfo("Could not find class/race/deity/start_zone combination");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1639,7 +1639,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Could not find starting stats for selected character combo, cannot verify stats");
|
||||
LogInfo("Could not find starting stats for selected character combo, cannot verify stats");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1652,37 +1652,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc)
|
||||
allocation.DefaultPointAllocation[6];
|
||||
|
||||
if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Strength out of range");
|
||||
LogInfo("Strength out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Dexterity out of range");
|
||||
LogInfo("Dexterity out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Agility out of range");
|
||||
LogInfo("Agility out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Stamina out of range");
|
||||
LogInfo("Stamina out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Intelligence out of range");
|
||||
LogInfo("Intelligence out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wisdom out of range");
|
||||
LogInfo("Wisdom out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Charisma out of range");
|
||||
LogInfo("Charisma out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1695,7 +1695,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(Logs::Detail, Logs::WorldServer, "Current Stats > Maximum Stats");
|
||||
LogInfo("Current Stats > Maximum Stats");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1776,7 +1776,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
if (!cc)
|
||||
return false;
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Validating char creation info...");
|
||||
LogInfo("Validating char creation info");
|
||||
|
||||
classtemp = cc->class_ - 1;
|
||||
racetemp = cc->race - 1;
|
||||
@ -1789,16 +1789,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(Logs::Detail, Logs::WorldServer, " class is out of range");
|
||||
LogInfo(" class is out of range");
|
||||
return false;
|
||||
}
|
||||
if (racetemp >= _TABLE_RACES) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " race is out of range");
|
||||
LogInfo(" race is out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs?
|
||||
Log(Logs::Detail, Logs::WorldServer, " invalid race/class combination");
|
||||
LogInfo(" 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;
|
||||
@ -1826,43 +1826,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc)
|
||||
// that are messed up not just the first hit
|
||||
|
||||
if (bTOTAL + stat_points != cTOTAL) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL);
|
||||
LogInfo(" stat points total doesn't match expected value: expecting [{}] got [{}]", bTOTAL + stat_points, cTOTAL);
|
||||
Charerrors++;
|
||||
}
|
||||
|
||||
if (cc->STR > bSTR + stat_points || cc->STR < bSTR) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat STR is out of range");
|
||||
LogInfo(" stat STR is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->STA > bSTA + stat_points || cc->STA < bSTA) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat STA is out of range");
|
||||
LogInfo(" stat STA is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat AGI is out of range");
|
||||
LogInfo(" stat AGI is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat DEX is out of range");
|
||||
LogInfo(" stat DEX is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat WIS is out of range");
|
||||
LogInfo(" stat WIS is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->INT > bINT + stat_points || cc->INT < bINT) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat INT is out of range");
|
||||
LogInfo(" stat INT is out of range");
|
||||
Charerrors++;
|
||||
}
|
||||
if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " stat CHA is out of range");
|
||||
LogInfo(" 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(Logs::Detail, Logs::WorldServer, "Found %d errors in character creation request", Charerrors);
|
||||
LogInfo("Found [{}] errors in character creation request", Charerrors);
|
||||
|
||||
return Charerrors == 0;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ void ClientList::Process() {
|
||||
if (!iterator.GetData()->Process()) {
|
||||
struct in_addr in;
|
||||
in.s_addr = iterator.GetData()->GetIP();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort());
|
||||
LogInfo("Removing client from [{}]:[{}]", inet_ntoa(in), iterator.GetData()->GetPort());
|
||||
iterator.RemoveCurrent();
|
||||
}
|
||||
else
|
||||
@ -399,7 +399,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
||||
|
||||
if(!from)
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Invalid client. FromID=%i GuildID=%i", FromID, GuildID);
|
||||
LogInfo("Invalid client. FromID=[{}] GuildID=[{}]", FromID, GuildID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -724,7 +724,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S
|
||||
safe_delete_array(output);
|
||||
}
|
||||
catch(...){
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unknown error in world's SendWhoAll (probably mem error), ignoring...");
|
||||
LogInfo("Unknown error in world's SendWhoAll (probably mem error), ignoring");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -867,7 +867,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon
|
||||
safe_delete(pack2);
|
||||
}
|
||||
catch(...){
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unknown error in world's SendFriendsWho (probably mem error), ignoring...");
|
||||
LogInfo("Unknown error in world's SendFriendsWho (probably mem error), ignoring");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1103,7 +1103,6 @@ Client* ClientList::FindByAccountID(uint32 account_id) {
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "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;
|
||||
@ -1118,7 +1117,6 @@ Client* ClientList::FindByName(char* charname) {
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData());
|
||||
if (iterator.GetData()->GetCharName() == charname) {
|
||||
Client* tmp = iterator.GetData();
|
||||
return tmp;
|
||||
|
||||
@ -79,25 +79,25 @@ void LauncherLink::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_ZAAuth: {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Got authentication from %s when they are already authenticated.", m_name.c_str());
|
||||
LogInfo("Got authentication from [{}] when they are already authenticated", m_name.c_str());
|
||||
break;
|
||||
}
|
||||
case ServerOP_LauncherConnectInfo: {
|
||||
const LauncherConnectInfo *it = (const LauncherConnectInfo *)pack->pBuffer;
|
||||
if (HasName()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name);
|
||||
LogInfo("Launcher [{}] received an additional connect packet with name [{}]. 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(Logs::Detail, Logs::WorldServer, "Unknown launcher '%s' connected. Disconnecting.", it->name);
|
||||
LogInfo("Unknown launcher [{}] connected. Disconnecting", it->name);
|
||||
Disconnect();
|
||||
break;
|
||||
}
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Launcher Identified itself as '%s'. Loading zone list.", it->name);
|
||||
LogInfo("Launcher Identified itself as [{}]. Loading zone list", it->name);
|
||||
|
||||
std::vector<LauncherZone> result;
|
||||
//database.GetLauncherZones(it->name, result);
|
||||
@ -111,7 +111,7 @@ void LauncherLink::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
||||
zs.port = cur->port;
|
||||
zs.up = false;
|
||||
zs.starts = 0;
|
||||
Log(Logs::Detail, Logs::WorldServer, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port);
|
||||
LogInfo("[{}]: Loaded zone [{}] on port [{}]", m_name.c_str(), cur->name.c_str(), zs.port);
|
||||
m_states[cur->name] = zs;
|
||||
}
|
||||
|
||||
@ -127,17 +127,17 @@ void LauncherLink::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
|
||||
std::map<std::string, ZoneState>::iterator res;
|
||||
res = m_states.find(it->short_name);
|
||||
if (res == m_states.end()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name);
|
||||
LogInfo("[{}]: reported state for zone [{}] which it does not have", m_name.c_str(), it->short_name);
|
||||
break;
|
||||
}
|
||||
Log(Logs::Detail, Logs::WorldServer, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running ? "STARTED" : "STOPPED", it->start_count);
|
||||
LogInfo("[{}]: [{}] reported state [{}] ([{}] 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(Logs::Detail, Logs::WorldServer, "Unknown ServerOPcode from launcher 0x%04x, size %d", pack->opcode, pack->size);
|
||||
LogInfo("Unknown ServerOPcode from launcher {:#04x}, size [{}]", pack->opcode, pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
@ -153,7 +153,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) {
|
||||
zs.port = port;
|
||||
zs.up = false;
|
||||
zs.starts = 0;
|
||||
Log(Logs::Detail, Logs::WorldServer, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port);
|
||||
LogInfo("[{}]: Loaded zone [{}] on port [{}]", m_name.c_str(), short_name, zs.port);
|
||||
m_states[short_name] = zs;
|
||||
|
||||
StartZone(short_name, port);
|
||||
|
||||
@ -65,10 +65,10 @@ void LauncherList::Process() {
|
||||
std::map<std::string, LauncherLink *>::iterator res;
|
||||
res = m_launchers.find(name);
|
||||
if (res != m_launchers.end()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Ghosting launcher %s", name.c_str());
|
||||
LogInfo("Ghosting launcher [{}]", name.c_str());
|
||||
delete res->second;
|
||||
}
|
||||
Log(Logs::Detail, Logs::WorldServer, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
||||
LogInfo("Removing pending launcher [{}]. Adding [{}] to active list", l->GetID(), name.c_str());
|
||||
//put the launcher in the list.
|
||||
m_launchers[name] = l;
|
||||
}
|
||||
@ -99,7 +99,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) {
|
||||
|
||||
void LauncherList::Add(std::shared_ptr<EQ::Net::ServertalkServerConnection> conn) {
|
||||
auto it = new LauncherLink(nextID++, conn);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Adding pending launcher %d", it->GetID());
|
||||
LogInfo("Adding pending launcher [{}]", it->GetID());
|
||||
m_pendingLaunchers.push_back(it);
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ LoginServer::~LoginServer()
|
||||
void LoginServer::ProcessUsertoWorldReqLeg(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
UsertoWorldRequestLegacy_Struct *utwr = (UsertoWorldRequestLegacy_Struct *) p.Data();
|
||||
uint32 id = database.GetAccountIDFromLSID("eqemu", utwr->lsaccountid);
|
||||
@ -122,7 +122,7 @@ void LoginServer::ProcessUsertoWorldReqLeg(uint16_t opcode, EQ::Net::Packet &p)
|
||||
void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
UsertoWorldRequest_Struct *utwr = (UsertoWorldRequest_Struct *) p.Data();
|
||||
uint32 id = database.GetAccountIDFromLSID(utwr->login, utwr->lsaccountid);
|
||||
@ -182,7 +182,7 @@ void LoginServer::ProcessUsertoWorldReq(uint16_t opcode, EQ::Net::Packet &p)
|
||||
void LoginServer::ProcessLSClientAuthLegacy(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Received ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
try {
|
||||
auto client_authentication_request = p.GetSerialize<ClientAuthLegacy_Struct>(0);
|
||||
@ -216,7 +216,7 @@ void LoginServer::ProcessLSClientAuthLegacy(uint16_t opcode, EQ::Net::Packet &p)
|
||||
void LoginServer::ProcessLSClientAuth(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Received ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
try {
|
||||
auto client_authentication_request = p.GetSerialize<ClientAuth_Struct>(0);
|
||||
@ -251,18 +251,18 @@ void LoginServer::ProcessLSClientAuth(uint16_t opcode, EQ::Net::Packet &p)
|
||||
void LoginServer::ProcessLSFatalError(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Login server responded with FatalError.");
|
||||
LogInfo("Login server responded with FatalError");
|
||||
if (p.Length() > 1) {
|
||||
Log(Logs::Detail, Logs::WorldServer, " %s", (const char *) p.Data());
|
||||
LogInfo(" [{}]", (const char *) p.Data());
|
||||
}
|
||||
}
|
||||
|
||||
void LoginServer::ProcessSystemwideMessage(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
ServerSystemwideMessage *swm = (ServerSystemwideMessage *) p.Data();
|
||||
zoneserver_list.SendEmoteMessageRaw(0, 0, 0, swm->type, swm->message);
|
||||
@ -271,20 +271,20 @@ void LoginServer::ProcessSystemwideMessage(uint16_t opcode, EQ::Net::Packet &p)
|
||||
void LoginServer::ProcessLSRemoteAddr(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
if (!Config->WorldAddress.length()) {
|
||||
WorldConfig::SetWorldAddress((char *) p.Data());
|
||||
Log(Logs::Detail, Logs::WorldServer, "Loginserver provided %s as world address", (const char *) p.Data());
|
||||
LogInfo("Loginserver provided [{}] as world address", (const char *) p.Data());
|
||||
}
|
||||
}
|
||||
|
||||
void LoginServer::ProcessLSAccountUpdate(uint16_t opcode, EQ::Net::Packet &p)
|
||||
{
|
||||
const WorldConfig *Config = WorldConfig::get();
|
||||
Log(Logs::Detail, Logs::WorldServer, "Recevied ServerPacket from LS OpCode 0x04x", opcode);
|
||||
LogNetcode("Received ServerPacket from LS OpCode {:#04x}", opcode);
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Received ServerOP_LSAccountUpdate packet from loginserver");
|
||||
LogNetcode("Received ServerOP_LSAccountUpdate packet from loginserver");
|
||||
CanAccountUpdate = true;
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ bool LoginServer::Connect()
|
||||
{
|
||||
char errbuf[1024];
|
||||
if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to resolve '%s' to an IP.", LoginServerAddress);
|
||||
LogInfo("Unable to resolve [{}] to an IP", LoginServerAddress);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) {
|
||||
}
|
||||
|
||||
bool LoginServerList::SendAccountUpdate(ServerPacket* pack) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers");
|
||||
LogInfo("Requested to send ServerOP_LSAccountUpdate packet to all loginservers");
|
||||
for (auto &iter : m_list) {
|
||||
if ((*iter).CanUpdate()) {
|
||||
(*iter).SendAccountUpdate(pack);
|
||||
|
||||
100
world/net.cpp
100
world/net.cpp
@ -140,29 +140,29 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
// Load server configuration
|
||||
Log(Logs::General, Logs::WorldServer, "Loading server configuration..");
|
||||
LogInfo("Loading server configuration");
|
||||
if (!WorldConfig::LoadConfig()) {
|
||||
Log(Logs::General, Logs::WorldServer, "Loading server configuration failed.");
|
||||
LogInfo("Loading server configuration failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Config = WorldConfig::get();
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "CURRENT_VERSION: %s", CURRENT_VERSION);
|
||||
LogInfo("CURRENT_VERSION: [{}]", CURRENT_VERSION);
|
||||
|
||||
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
|
||||
Log(Logs::General, Logs::WorldServer, "Could not set signal handler");
|
||||
LogInfo("Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
|
||||
Log(Logs::General, Logs::WorldServer, "Could not set signal handler");
|
||||
LogInfo("Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
|
||||
Log(Logs::General, Logs::WorldServer, "Could not set signal handler");
|
||||
LogInfo("Could not set signal handler");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@ -171,7 +171,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(), Config->LoginLegacy);
|
||||
Log(Logs::General, Logs::WorldServer, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort);
|
||||
LogInfo("Added loginserver [{}]:[{}]", Config->LoginHost.c_str(), Config->LoginPort);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -181,19 +181,19 @@ int main(int argc, char** argv) {
|
||||
while (iterator.MoreElements()) {
|
||||
loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str(),
|
||||
iterator.GetData()->LoginLegacy);
|
||||
Log(Logs::General, Logs::WorldServer, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
|
||||
LogInfo("Added loginserver [{}]:[{}]", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort);
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Connecting to MySQL %s@%s:%i...", Config->DatabaseUsername.c_str(), Config->DatabaseHost.c_str(), Config->DatabasePort);
|
||||
LogInfo("Connecting to MySQL [{}]@[{}]:[{}]", Config->DatabaseUsername.c_str(), Config->DatabaseHost.c_str(), Config->DatabasePort);
|
||||
if (!database.Connect(
|
||||
Config->DatabaseHost.c_str(),
|
||||
Config->DatabaseUsername.c_str(),
|
||||
Config->DatabasePassword.c_str(),
|
||||
Config->DatabaseDB.c_str(),
|
||||
Config->DatabasePort)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Cannot continue without a database connection.");
|
||||
LogInfo("Cannot continue without a database connection");
|
||||
return 1;
|
||||
}
|
||||
guild_mgr.SetDatabase(&database);
|
||||
@ -302,10 +302,10 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if (!ignore_db) {
|
||||
Log(Logs::General, Logs::WorldServer, "Checking Database Conversions..");
|
||||
LogInfo("Checking Database Conversions");
|
||||
database.CheckDatabaseConversions();
|
||||
}
|
||||
Log(Logs::General, Logs::WorldServer, "Loading variables..");
|
||||
LogInfo("Loading variables");
|
||||
database.LoadVariables();
|
||||
|
||||
std::string hotfix_name;
|
||||
@ -315,57 +315,57 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Purging expired data buckets...");
|
||||
LogInfo("Purging expired data buckets");
|
||||
database.PurgeAllDeletedDataBuckets();
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading zones..");
|
||||
LogInfo("Loading zones");
|
||||
database.LoadZoneNames();
|
||||
Log(Logs::General, Logs::WorldServer, "Clearing groups..");
|
||||
LogInfo("Clearing groups");
|
||||
database.ClearGroup();
|
||||
Log(Logs::General, Logs::WorldServer, "Clearing raids..");
|
||||
LogInfo("Clearing raids");
|
||||
database.ClearRaid();
|
||||
database.ClearRaidDetails();
|
||||
database.ClearRaidLeader();
|
||||
Log(Logs::General, Logs::WorldServer, "Clearing inventory snapshots..");
|
||||
LogInfo("Clearing inventory snapshots");
|
||||
database.ClearInvSnapshots();
|
||||
Log(Logs::General, Logs::WorldServer, "Loading items..");
|
||||
LogInfo("Loading items");
|
||||
if (!database.LoadItems(hotfix_name))
|
||||
Log(Logs::General, Logs::WorldServer, "Error: Could not load item data. But ignoring");
|
||||
Log(Logs::General, Logs::WorldServer, "Loading skill caps..");
|
||||
LogInfo("Error: Could not load item data. But ignoring");
|
||||
LogInfo("Loading skill caps");
|
||||
if (!database.LoadSkillCaps(std::string(hotfix_name)))
|
||||
Log(Logs::General, Logs::WorldServer, "Error: Could not load skill cap data. But ignoring");
|
||||
Log(Logs::General, Logs::WorldServer, "Loading guilds..");
|
||||
LogInfo("Error: Could not load skill cap data. But ignoring");
|
||||
LogInfo("Loading guilds");
|
||||
guild_mgr.LoadGuilds();
|
||||
//rules:
|
||||
{
|
||||
std::string tmp;
|
||||
if (database.GetVariable("RuleSet", tmp)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Loading rule set '%s'", tmp.c_str());
|
||||
LogInfo("Loading rule set [{}]", tmp.c_str());
|
||||
if (!RuleManager::Instance()->LoadRules(&database, tmp.c_str(), false)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Failed to load ruleset '%s', falling back to defaults.", tmp.c_str());
|
||||
LogInfo("Failed to load ruleset [{}], falling back to defaults", tmp.c_str());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!RuleManager::Instance()->LoadRules(&database, "default", false)) {
|
||||
Log(Logs::General, Logs::WorldServer, "No rule set configured, using default rules");
|
||||
LogInfo("No rule set configured, using default rules");
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::WorldServer, "Loaded default rule set 'default'", tmp.c_str());
|
||||
LogInfo("Loaded default rule set 'default'", tmp.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
EQEmu::InitializeDynamicLookups();
|
||||
Log(Logs::General, Logs::WorldServer, "Initialized dynamic dictionary entries");
|
||||
LogInfo("Initialized dynamic dictionary entries");
|
||||
}
|
||||
|
||||
if (RuleB(World, ClearTempMerchantlist)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Clearing temporary merchant lists..");
|
||||
LogInfo("Clearing temporary merchant lists");
|
||||
database.ClearMerchantTemp();
|
||||
}
|
||||
|
||||
RuleManager::Instance()->SaveRules(&database);
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading EQ time of day..");
|
||||
LogInfo("Loading EQ time of day");
|
||||
TimeOfDay_Struct eqTime;
|
||||
time_t realtime;
|
||||
eqTime = database.LoadTime(realtime);
|
||||
@ -373,7 +373,7 @@ int main(int argc, char** argv) {
|
||||
Timer EQTimeTimer(600000);
|
||||
EQTimeTimer.Start(600000);
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading launcher list..");
|
||||
LogInfo("Loading launcher list");
|
||||
launcher_list.LoadList();
|
||||
|
||||
std::string tmp;
|
||||
@ -381,37 +381,37 @@ int main(int argc, char** argv) {
|
||||
if (tmp.length() == 1 && tmp[0] == '1') {
|
||||
holdzones = true;
|
||||
}
|
||||
Log(Logs::General, Logs::WorldServer, "Reboot zone modes %s", holdzones ? "ON" : "OFF");
|
||||
LogInfo("Reboot zone modes [{}]", holdzones ? "ON" : "OFF");
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses());
|
||||
LogInfo("Deleted [{}] stale player corpses from database", database.DeleteStalePlayerCorpses());
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading adventures...");
|
||||
LogInfo("Loading adventures");
|
||||
if (!adventure_manager.LoadAdventureTemplates())
|
||||
{
|
||||
Log(Logs::General, Logs::WorldServer, "Unable to load adventure templates.");
|
||||
LogInfo("Unable to load adventure templates");
|
||||
}
|
||||
|
||||
if (!adventure_manager.LoadAdventureEntries())
|
||||
{
|
||||
Log(Logs::General, Logs::WorldServer, "Unable to load adventure templates.");
|
||||
LogInfo("Unable to load adventure templates");
|
||||
}
|
||||
|
||||
adventure_manager.Load();
|
||||
adventure_manager.LoadLeaderboardInfo();
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Purging expired instances");
|
||||
LogInfo("Purging expired instances");
|
||||
database.PurgeExpiredInstances();
|
||||
|
||||
Timer PurgeInstanceTimer(450000);
|
||||
PurgeInstanceTimer.Start(450000);
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading char create info...");
|
||||
LogInfo("Loading char create info");
|
||||
database.LoadCharacterCreateAllocations();
|
||||
database.LoadCharacterCreateCombos();
|
||||
|
||||
std::unique_ptr<EQ::Net::ConsoleServer> console;
|
||||
if (Config->TelnetEnabled) {
|
||||
Log(Logs::General, Logs::WorldServer, "Console (TCP) listener started.");
|
||||
LogInfo("Console (TCP) listener started");
|
||||
console.reset(new EQ::Net::ConsoleServer(Config->TelnetIP, Config->TelnetTCPPort));
|
||||
RegisterConsoleFunctions(console);
|
||||
}
|
||||
@ -424,7 +424,7 @@ int main(int argc, char** argv) {
|
||||
server_opts.ipv6 = false;
|
||||
server_opts.credentials = Config->SharedKey;
|
||||
server_connection->Listen(server_opts);
|
||||
Log(Logs::General, Logs::WorldServer, "Server (TCP) listener started.");
|
||||
LogInfo("Server (TCP) listener started");
|
||||
|
||||
server_connection->OnConnectionIdentified("Zone", [&console](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||
LogInfo("New Zone Server connection from {2} at {0}:{1}",
|
||||
@ -542,20 +542,20 @@ 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(Logs::Detail, Logs::WorldServer, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in));
|
||||
LogInfo("Checking inbound connection [{}] against BannedIPs table", inet_ntoa(in));
|
||||
if (!database.CheckBannedIPs(inet_ntoa(in))) { //Lieka: Check inbound IP against banned IP table.
|
||||
Log(Logs::Detail, Logs::WorldServer, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in));
|
||||
LogInfo("Connection [{}] PASSED banned IPs check. Processing connection", inet_ntoa(in));
|
||||
auto client = new Client(eqsi);
|
||||
// @merth: client->zoneattempt=0;
|
||||
client_list.Add(client);
|
||||
}
|
||||
else {
|
||||
Log(Logs::General, Logs::WorldServer, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in));
|
||||
LogInfo("Connection from [{}] 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(Logs::Detail, Logs::WorldServer, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||
LogInfo("New connection from [{}]:[{}], processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||
auto client = new Client(eqsi);
|
||||
// @merth: client->zoneattempt=0;
|
||||
client_list.Add(client);
|
||||
@ -573,9 +573,9 @@ 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(Logs::General, Logs::WorldServer, "Failed to save eqtime.");
|
||||
LogInfo("Failed to save eqtime");
|
||||
else
|
||||
Log(Logs::Detail, Logs::WorldServer, "EQTime successfully saved.");
|
||||
LogInfo("EQTime successfully saved");
|
||||
}
|
||||
|
||||
zoneserver_list.Process();
|
||||
@ -594,18 +594,18 @@ int main(int argc, char** argv) {
|
||||
EQ::EventLoop::Get().Process();
|
||||
Sleep(5);
|
||||
}
|
||||
Log(Logs::General, Logs::WorldServer, "World main loop completed.");
|
||||
Log(Logs::General, Logs::WorldServer, "Shutting down zone connections (if any).");
|
||||
LogInfo("World main loop completed");
|
||||
LogInfo("Shutting down zone connections (if any)");
|
||||
zoneserver_list.KillAll();
|
||||
Log(Logs::General, Logs::WorldServer, "Zone (TCP) listener stopped.");
|
||||
Log(Logs::General, Logs::WorldServer, "Signaling HTTP service to stop...");
|
||||
LogInfo("Zone (TCP) listener stopped");
|
||||
LogInfo("Signaling HTTP service to stop");
|
||||
LogSys.CloseFileLogs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CatchSignal(int sig_num) {
|
||||
Log(Logs::General, Logs::WorldServer, "Caught signal %d", sig_num);
|
||||
LogInfo("Caught signal [{}]", sig_num);
|
||||
RunLoops = false;
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ void ZSList::KillAll() {
|
||||
void ZSList::Process() {
|
||||
|
||||
if (shutdowntimer && shutdowntimer->Check()) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)");
|
||||
LogInfo("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;
|
||||
@ -570,7 +570,7 @@ void ZSList::RebootZone(const char* ip1, uint16 port, const char* ip2, uint32 sk
|
||||
s->port = port;
|
||||
s->zoneid = zoneid;
|
||||
if (zoneid != 0)
|
||||
Log(Logs::Detail, Logs::WorldServer, "Rebooting static zone with the ID of: %i", zoneid);
|
||||
LogInfo("Rebooting static zone with the ID of: [{}]", zoneid);
|
||||
tmp[z]->SendPacket(pack);
|
||||
delete pack;
|
||||
safe_delete_array(tmp);
|
||||
|
||||
@ -541,10 +541,10 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
|
||||
RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*)pack->pBuffer;
|
||||
if (zoneserver_list.SendPacket(pack)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Sent Rez packet for %s", sRezz->rez.your_name);
|
||||
LogInfo("Sent Rez packet for [{}]", sRezz->rez.your_name);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Could not send Rez packet for %s", sRezz->rez.your_name);
|
||||
LogInfo("Could not send Rez packet for [{}]", sRezz->rez.your_name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -589,21 +589,21 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
ServerConnectInfo* sci = (ServerConnectInfo*)p.pBuffer;
|
||||
sci->port = client_port;
|
||||
SendPacket(&p);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Auto zone port configuration. Telling zone to use port %d", client_port);
|
||||
LogInfo("Auto zone port configuration. Telling zone to use port [{}]", client_port);
|
||||
}
|
||||
else {
|
||||
client_port = sci->port;
|
||||
Log(Logs::Detail, Logs::WorldServer, "Zone specified port %d.", client_port);
|
||||
LogInfo("Zone specified port [{}]", client_port);
|
||||
}
|
||||
|
||||
if (sci->address[0]) {
|
||||
strn0cpy(client_address, sci->address, 250);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Zone specified address %s.", sci->address);
|
||||
LogInfo("Zone specified address [{}]", sci->address);
|
||||
}
|
||||
|
||||
if (sci->local_address[0]) {
|
||||
strn0cpy(client_local_address, sci->local_address, 250);
|
||||
Log(Logs::Detail, Logs::WorldServer, "Zone specified local address %s.", sci->address);
|
||||
LogInfo("Zone specified local address [{}]", sci->address);
|
||||
}
|
||||
|
||||
if (sci->process_id) {
|
||||
@ -617,7 +617,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer;
|
||||
launcher_name = ln->launcher_name;
|
||||
launched_name = ln->zone_name;
|
||||
Log(Logs::Detail, Logs::WorldServer, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str());
|
||||
LogInfo("Zone started with name [{}] by launcher [{}]", launched_name.c_str(), launcher_name.c_str());
|
||||
break;
|
||||
}
|
||||
case ServerOP_ShutdownAll: {
|
||||
@ -705,7 +705,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
|
||||
/* This is a request from the egress zone */
|
||||
if (GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Processing ZTZ for egress from zone for client %s\n", ztz->name);
|
||||
LogInfo("Processing ZTZ for egress from zone for client [{}]\n", ztz->name);
|
||||
|
||||
if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) {
|
||||
ztz->response = 0;
|
||||
@ -723,20 +723,20 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
|
||||
/* Zone was already running*/
|
||||
if (ingress_server) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Found a zone already booted for %s\n", ztz->name);
|
||||
LogInfo("Found a zone already booted for [{}]\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(Logs::Detail, Logs::WorldServer, "Successfully booted a zone for %s\n", ztz->name);
|
||||
LogInfo("Successfully booted a zone for [{}]\n", ztz->name);
|
||||
// bootup successful, ready to rock
|
||||
ztz->response = 1;
|
||||
ingress_server = zoneserver_list.FindByID(server_id);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "FAILED to boot a zone for %s\n", ztz->name);
|
||||
LogInfo("failed to boot a zone for [{}]\n", ztz->name);
|
||||
// bootup failed, send back error code 0
|
||||
ztz->response = 0;
|
||||
}
|
||||
@ -751,7 +751,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
/* Response from Ingress server, route back to egress */
|
||||
else {
|
||||
|
||||
Log(Logs::Detail, Logs::WorldServer, "Processing ZTZ for ingress to zone for client %s\n", ztz->name);
|
||||
LogInfo("Processing ZTZ for ingress to zone for client [{}]\n", ztz->name);
|
||||
ZoneServer *egress_server = nullptr;
|
||||
if (ztz->current_instance_id > 0) {
|
||||
egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id);
|
||||
@ -769,7 +769,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_ClientList: {
|
||||
if (pack->size != sizeof(ServerClientList_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_ClientList. Got: %d, Expected: %d", pack->size, sizeof(ServerClientList_Struct));
|
||||
LogInfo("Wrong size on ServerOP_ClientList. Got: [{}], Expected: [{}]", pack->size, sizeof(ServerClientList_Struct));
|
||||
break;
|
||||
}
|
||||
client_list.ClientUpdate(this, (ServerClientList_Struct*)pack->pBuffer);
|
||||
@ -778,7 +778,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
case ServerOP_ClientListKA: {
|
||||
ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*)pack->pBuffer;
|
||||
if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d", pack->size, (4 + (4 * sclka->numupdates)));
|
||||
LogInfo("Wrong size on ServerOP_ClientListKA. Got: [{}], Expected: [{}]", pack->size, (4 + (4 * sclka->numupdates)));
|
||||
break;
|
||||
}
|
||||
client_list.CLEKeepAlive(sclka->numupdates, sclka->wid);
|
||||
@ -893,7 +893,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_GMGoto: {
|
||||
if (pack->size != sizeof(ServerGMGoto_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d", pack->size, sizeof(ServerGMGoto_Struct));
|
||||
LogInfo("Wrong size on ServerOP_GMGoto. Got: [{}], Expected: [{}]", pack->size, sizeof(ServerGMGoto_Struct));
|
||||
break;
|
||||
}
|
||||
ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*)pack->pBuffer;
|
||||
@ -913,7 +913,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_Lock: {
|
||||
if (pack->size != sizeof(ServerLock_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_Lock. Got: %d, Expected: %d", pack->size, sizeof(ServerLock_Struct));
|
||||
LogInfo("Wrong size on ServerOP_Lock. Got: [{}], Expected: [{}]", pack->size, sizeof(ServerLock_Struct));
|
||||
break;
|
||||
}
|
||||
ServerLock_Struct* slock = (ServerLock_Struct*)pack->pBuffer;
|
||||
@ -938,7 +938,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_Motd: {
|
||||
if (pack->size != sizeof(ServerMotd_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_Motd. Got: %d, Expected: %d", pack->size, sizeof(ServerMotd_Struct));
|
||||
LogInfo("Wrong size on ServerOP_Motd. Got: [{}], Expected: [{}]", pack->size, sizeof(ServerMotd_Struct));
|
||||
break;
|
||||
}
|
||||
ServerMotd_Struct* smotd = (ServerMotd_Struct*)pack->pBuffer;
|
||||
@ -949,7 +949,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_Uptime: {
|
||||
if (pack->size != sizeof(ServerUptime_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_Uptime. Got: %d, Expected: %d", pack->size, sizeof(ServerUptime_Struct));
|
||||
LogInfo("Wrong size on ServerOP_Uptime. Got: [{}], Expected: [{}]", pack->size, sizeof(ServerUptime_Struct));
|
||||
break;
|
||||
}
|
||||
ServerUptime_Struct* sus = (ServerUptime_Struct*)pack->pBuffer;
|
||||
@ -968,7 +968,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
break;
|
||||
}
|
||||
case ServerOP_GetWorldTime: {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Broadcasting a world time update");
|
||||
LogInfo("Broadcasting a world time update");
|
||||
auto pack = new ServerPacket;
|
||||
|
||||
pack->opcode = ServerOP_SyncWorldTime;
|
||||
@ -987,17 +987,17 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
break;
|
||||
}
|
||||
case ServerOP_SetWorldTime: {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Received SetWorldTime");
|
||||
LogNetcode("Received SetWorldTime");
|
||||
eqTimeOfDay* newtime = (eqTimeOfDay*)pack->pBuffer;
|
||||
zoneserver_list.worldclock.SetCurrentEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime);
|
||||
Log(Logs::Detail, Logs::WorldServer, "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);
|
||||
LogInfo("New time = [{}]-[{}]-[{}] [{}]:[{}] ([{}])\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(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d", pack->size, sizeof(ServerGenericWorldQuery_Struct));
|
||||
LogInfo("Wrong size on ServerOP_IPLookup. Got: [{}], Expected (at least): [{}]", pack->size, sizeof(ServerGenericWorldQuery_Struct));
|
||||
break;
|
||||
}
|
||||
ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*)pack->pBuffer;
|
||||
@ -1009,7 +1009,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_LockZone: {
|
||||
if (pack->size < sizeof(ServerLockZone_Struct)) {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Wrong size on ServerOP_LockZone. Got: %d, Expected: %d", pack->size, sizeof(ServerLockZone_Struct));
|
||||
LogInfo("Wrong size on ServerOP_LockZone. Got: [{}], Expected: [{}]", pack->size, sizeof(ServerLockZone_Struct));
|
||||
break;
|
||||
}
|
||||
ServerLockZone_Struct* s = (ServerLockZone_Struct*)pack->pBuffer;
|
||||
@ -1087,7 +1087,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
zs->SendPacket(pack);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||
LogInfo("Unable to locate zone record for instance id [{}] in zoneserver list for ServerOP_Consent_Response operation", s->instance_id);
|
||||
}
|
||||
safe_delete(pack);
|
||||
}
|
||||
@ -1112,7 +1112,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
zs->SendPacket(pack);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
LogInfo("Unable to locate zone record for zone id [{}] in zoneserver list for ServerOP_Consent_Response operation", s->zone_id);
|
||||
}
|
||||
safe_delete(pack);
|
||||
}
|
||||
@ -1132,7 +1132,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
zs->SendPacket(pack);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
LogInfo("Unable to locate zone record for zone id [{}] in zoneserver list for ServerOP_Consent_Response operation", s->zone_id);
|
||||
}
|
||||
safe_delete(pack);
|
||||
}
|
||||
@ -1151,7 +1151,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
zs->SendPacket(pack);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id);
|
||||
LogInfo("Unable to locate zone record for instance id [{}] in zoneserver list for ServerOP_Consent_Response operation", s->instance_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1161,7 +1161,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
zs->SendPacket(pack);
|
||||
}
|
||||
else {
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id);
|
||||
LogInfo("Unable to locate zone record for zone id [{}] in zoneserver list for ServerOP_Consent_Response operation", s->zone_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1263,7 +1263,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
|
||||
case ServerOP_LSAccountUpdate:
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Received ServerOP_LSAccountUpdate packet from zone");
|
||||
LogNetcode("Received ServerOP_LSAccountUpdate packet from zone");
|
||||
loginserverlist.SendAccountUpdate(pack);
|
||||
break;
|
||||
}
|
||||
@ -1326,14 +1326,14 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
case ServerOP_ChangeSharedMem: {
|
||||
std::string hotfix_name = std::string((char*)pack->pBuffer);
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading items...");
|
||||
LogInfo("Loading items");
|
||||
if (!database.LoadItems(hotfix_name)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Error: Could not load item data. But ignoring");
|
||||
LogInfo("Error: Could not load item data. But ignoring");
|
||||
}
|
||||
|
||||
Log(Logs::General, Logs::WorldServer, "Loading skill caps...");
|
||||
LogInfo("Loading skill caps");
|
||||
if (!database.LoadSkillCaps(hotfix_name)) {
|
||||
Log(Logs::General, Logs::WorldServer, "Error: Could not load skill cap data. But ignoring");
|
||||
LogInfo("Error: Could not load skill cap data. But ignoring");
|
||||
}
|
||||
|
||||
zoneserver_list.SendPacket(pack);
|
||||
@ -1352,7 +1352,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log(Logs::Detail, Logs::WorldServer, "Unknown ServerOPcode from zone 0x%04x, size %d", pack->opcode, pack->size);
|
||||
LogInfo("Unknown ServerOPcode from zone {:#04x}, size [{}]", pack->opcode, pack->size);
|
||||
DumpPacket(pack->pBuffer, pack->size);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -503,7 +503,7 @@ int main(int argc, char** argv) {
|
||||
//now that we know what patch they are running, start up their client object
|
||||
struct in_addr in;
|
||||
in.s_addr = eqsi->GetRemoteIP();
|
||||
Log(Logs::Detail, Logs::WorldServer, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||
LogInfo("New client from [{}]:[{}]", inet_ntoa(in), ntohs(eqsi->GetRemotePort()));
|
||||
auto client = new Client(eqsi);
|
||||
entity_list.AddClient(client);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user