mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Simplify error logging
This commit is contained in:
+12
-12
@@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
|
||||
//Todo cheat detection
|
||||
Message(Chat::Red, "Invalid unsolicited zone request.");
|
||||
Log(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id);
|
||||
LogError("Zoning [{}]: Invalid unsolicited zone request to zone id [{}]", GetName(), target_zone_id);
|
||||
SendZoneCancel(zc);
|
||||
return;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
//if we didnt get a zone point, or its to a different zone,
|
||||
//then we assume this is invalid.
|
||||
if(!zone_point || zone_point->target_zone_id != target_zone_id) {
|
||||
Log(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id);
|
||||
LogError("Zoning [{}]: Invalid unsolicited zone request to zone id [{}]", GetName(), target_zone_id);
|
||||
//todo cheat detection
|
||||
SendZoneCancel(zc);
|
||||
return;
|
||||
@@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
if(target_zone_name == nullptr) {
|
||||
//invalid zone...
|
||||
Message(Chat::Red, "Invalid target zone ID.");
|
||||
Log(Logs::General, Logs::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id);
|
||||
LogError("Zoning [{}]: Unable to get zone name for zone id [{}]", GetName(), target_zone_id);
|
||||
SendZoneCancel(zc);
|
||||
return;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) {
|
||||
//invalid zone...
|
||||
Message(Chat::Red, "Invalid target zone while getting safe points.");
|
||||
Log(Logs::General, Logs::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name);
|
||||
LogError("Zoning [{}]: Unable to get safe coordinates for zone [{}]", GetName(), target_zone_name);
|
||||
SendZoneCancel(zc);
|
||||
return;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
|
||||
//could not find a valid reason for them to be zoning, stop it.
|
||||
//todo cheat detection
|
||||
Log(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name);
|
||||
LogError("Zoning [{}]: Invalid unsolicited zone request to zone id [{}]. Not near a zone point", GetName(), target_zone_name);
|
||||
SendZoneCancel(zc);
|
||||
return;
|
||||
default:
|
||||
@@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
|
||||
//we have successfully zoned
|
||||
DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions);
|
||||
} else {
|
||||
Log(Logs::General, Logs::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name);
|
||||
LogError("Zoning [{}]: Rules prevent this char from zoning into [{}]", GetName(), target_zone_name);
|
||||
SendZoneError(zc, myerror);
|
||||
}
|
||||
}
|
||||
@@ -313,7 +313,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) {
|
||||
|
||||
void Client::SendZoneError(ZoneChange_Struct *zc, int8 err)
|
||||
{
|
||||
Log(Logs::General, Logs::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID);
|
||||
LogError("Zone [{}] is not available because target wasn't found or character insufficent level", zc->zoneID);
|
||||
|
||||
EQApplicationPacket *outapp = nullptr;
|
||||
outapp = new EQApplicationPacket(OP_ZoneChange, sizeof(ZoneChange_Struct));
|
||||
@@ -471,7 +471,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y,
|
||||
ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm);
|
||||
break;
|
||||
default:
|
||||
Log(Logs::General, Logs::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation.");
|
||||
LogError("Client::ProcessMovePC received a reguest to perform an unsupported client zone operation");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -547,7 +547,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
||||
SetHeading(heading);
|
||||
break;
|
||||
default:
|
||||
Log(Logs::General, Logs::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation.");
|
||||
LogError("Client::ZonePC() received a reguest to perform an unsupported client zone operation");
|
||||
ReadyToZone = false;
|
||||
break;
|
||||
}
|
||||
@@ -777,7 +777,7 @@ void Client::SetZoneFlag(uint32 zone_id) {
|
||||
std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log(Logs::General, Logs::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str());
|
||||
LogError("MySQL Error while trying to set zone flag for [{}]: [{}]", GetName(), results.ErrorMessage().c_str());
|
||||
}
|
||||
|
||||
void Client::ClearZoneFlag(uint32 zone_id) {
|
||||
@@ -790,7 +790,7 @@ void Client::ClearZoneFlag(uint32 zone_id) {
|
||||
std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success())
|
||||
Log(Logs::General, Logs::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str());
|
||||
LogError("MySQL Error while trying to clear zone flag for [{}]: [{}]", GetName(), results.ErrorMessage().c_str());
|
||||
|
||||
}
|
||||
|
||||
@@ -800,7 +800,7 @@ void Client::LoadZoneFlags() {
|
||||
std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Log(Logs::General, Logs::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str());
|
||||
LogError("MySQL Error while trying to load zone flags for [{}]: [{}]", GetName(), results.ErrorMessage().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user