mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
Implement Packet logs with dumps
- Category: 41: Packet: Server -> Client With Dump - Category: 42: Packet: Server -> Client With Dump See: http://wiki.eqemulator.org/p?Logging_System_Overhaul#packet-logging-levels
This commit is contained in:
parent
e1c49f93e2
commit
f2667cee23
@ -1,5 +1,12 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
|
||||
== 02/02/2015 ==
|
||||
Akkadius: Implement Packet logs with dumps
|
||||
- Category: 41: Packet: Server -> Client With Dump
|
||||
- Category: 42: Packet: Server -> Client With Dump
|
||||
See: http://wiki.eqemulator.org/p?Logging_System_Overhaul#packet-logging-levels
|
||||
|
||||
== 02/01/2015 ==
|
||||
demonstar55: Add quest debugging to lua
|
||||
eq.debug("Test debug level implicit 1")
|
||||
|
||||
@ -511,12 +511,8 @@ void DumpPacket(const EQApplicationPacket* app, bool iShowInfo) {
|
||||
// DumpPacketAscii(app->pBuffer, app->size);
|
||||
}
|
||||
|
||||
std::string DumpPacketToString(const EQApplicationPacket* app, bool iShowInfo){
|
||||
std::string DumpPacketToString(const EQApplicationPacket* app){
|
||||
std::ostringstream out;
|
||||
if (iShowInfo) {
|
||||
out << "Dumping Applayer: 0x" << std::hex << std::setfill('0') << std::setw(4) << app->GetOpcode() << std::dec;
|
||||
out << " size:" << app->size << std::endl;
|
||||
}
|
||||
out << DumpPacketHexToString(app->pBuffer, app->size);
|
||||
return out.str();
|
||||
}
|
||||
@ -147,6 +147,6 @@ protected:
|
||||
};
|
||||
|
||||
extern void DumpPacket(const EQApplicationPacket* app, bool iShowInfo = false);
|
||||
extern std::string DumpPacketToString(const EQApplicationPacket* app, bool iShowInfo = false);
|
||||
extern std::string DumpPacketToString(const EQApplicationPacket* app);
|
||||
|
||||
#endif
|
||||
|
||||
@ -556,14 +556,18 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
|
||||
|
||||
void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
|
||||
{
|
||||
uint32 chunksize,used;
|
||||
uint32 chunksize, used;
|
||||
uint32 length;
|
||||
|
||||
// DumpPacket(p);
|
||||
|
||||
if (Log.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] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
|
||||
Log.Out(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 (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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -80,6 +80,8 @@ namespace Logs {
|
||||
QuestDebug,
|
||||
Server_Client_Packet,
|
||||
Client_Server_Packet_Unhandled,
|
||||
Server_Client_Packet_With_Dump,
|
||||
Client_Server_Packet_With_Dump,
|
||||
MaxCategoryID /* Don't Remove this*/
|
||||
};
|
||||
|
||||
@ -126,6 +128,8 @@ namespace Logs {
|
||||
"Quest Debug",
|
||||
"Packet :: Server -> Client",
|
||||
"Packet :: Client -> Server Unhandled",
|
||||
"Packet :: Server -> Client (Dump)",
|
||||
"Packet :: Client -> Server (Dump)",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9074
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9075
|
||||
#define COMPILE_DATE __DATE__
|
||||
#define COMPILE_TIME __TIME__
|
||||
#ifndef WIN32
|
||||
|
||||
@ -328,6 +328,7 @@
|
||||
9072|2015_01_30_merc_attack_delay.sql|SHOW COLUMNS FROM `merc_stats` LIKE 'attack_delay'|empty|
|
||||
9073|2015_01_31_character_item_recast.sql|SHOW TABLES LIKE 'character_item_recast'|empty|
|
||||
9074|2015_02_01_logsys_packet_logs.sql|SELECT * FROM `logsys_categories` WHERE `log_category_description` LIKE 'Packet: Server -> Client'|empty|
|
||||
9075|2015_02_02_logsys_packet_logs_with_dump.sql|SELECT * FROM `logsys_categories` WHERE `log_category_description` LIKE 'Packet: Server -> Client With Dump'|empty|
|
||||
|
||||
# Upgrade conditions:
|
||||
# This won't be needed after this system is implemented, but it is used database that are not
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
REPLACE INTO `logsys_categories` (`log_category_id`, `log_category_description`) VALUES ('41', 'Packet: Server -> Client With Dump');
|
||||
REPLACE INTO `logsys_categories` (`log_category_id`, `log_category_description`) VALUES ('42', 'Packet: Server -> Client With Dump');
|
||||
@ -405,7 +405,10 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
if (Log.log_settings[Logs::Client_Server_Packet].is_category_enabled == 1)
|
||||
Log.Out(Logs::General, Logs::Client_Server_Packet, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str());
|
||||
Log.Out(Logs::General, Logs::Client_Server_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size());
|
||||
|
||||
if (Log.log_settings[Logs::Client_Server_Packet_With_Dump].is_category_enabled == 1)
|
||||
Log.Out(Logs::General, Logs::Client_Server_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str());
|
||||
|
||||
EmuOpcode opcode = app->GetOpcode();
|
||||
if (opcode == OP_AckPacket) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user