mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
* [Logging] Unify netcode logging * More tweaks, generator * Exclude OP_SpecialMesg at callback level * Consolidate packet loggers * Log at EQStream level instead of proxy * Fix C->S * Server to server logging * C-S for Loginserver * Hook UCS for C->S * Update eqemu_logsys.h * World C->S logging * Translate opcodes through patch system for client to server * Additional logging requests * Add detailed opcode translation logging * vStringFormat resiliency * Translate loginserver C->S * Simplify out message string (reduce copies) and ignore legacy formats * Update eqemu_logsys.cpp * Log file format * Handle deprecated categories
116 lines
2.3 KiB
C++
116 lines
2.3 KiB
C++
|
|
#include "global_define.h"
|
|
#include "eq_stream_proxy.h"
|
|
#include "struct_strategy.h"
|
|
#include "eqemu_logsys.h"
|
|
#include "opcodemgr.h"
|
|
|
|
|
|
EQStreamProxy::EQStreamProxy(std::shared_ptr<EQStreamInterface> &stream, const StructStrategy *structs, OpcodeManager **opcodes)
|
|
: m_stream(stream),
|
|
m_structs(structs),
|
|
m_opcodes(opcodes)
|
|
{
|
|
stream = nullptr; //take the stream.
|
|
m_stream->SetOpcodeManager(m_opcodes);
|
|
}
|
|
|
|
EQStreamProxy::~EQStreamProxy() {
|
|
}
|
|
|
|
std::string EQStreamProxy::Describe() const {
|
|
return(m_structs->Describe());
|
|
}
|
|
|
|
const EQ::versions::ClientVersion EQStreamProxy::ClientVersion() const
|
|
{
|
|
return m_structs->ClientVersion();
|
|
}
|
|
|
|
EQStreamState EQStreamProxy::GetState()
|
|
{
|
|
return m_stream->GetState();
|
|
}
|
|
|
|
void EQStreamProxy::SetOpcodeManager(OpcodeManager **opm)
|
|
{
|
|
return m_stream->SetOpcodeManager(opm);
|
|
}
|
|
|
|
void EQStreamProxy::QueuePacket(const EQApplicationPacket *p, bool ack_req) {
|
|
if (p == nullptr) {
|
|
return;
|
|
}
|
|
|
|
EQApplicationPacket *newp = p->Copy();
|
|
FastQueuePacket(&newp, ack_req);
|
|
}
|
|
|
|
void EQStreamProxy::FastQueuePacket(EQApplicationPacket **p, bool ack_req) {
|
|
if(p == nullptr || *p == nullptr)
|
|
return;
|
|
m_structs->Encode(p, m_stream, ack_req);
|
|
}
|
|
|
|
EQApplicationPacket *EQStreamProxy::PopPacket() {
|
|
EQApplicationPacket *pack = m_stream->PopPacket();
|
|
if(pack == nullptr)
|
|
return(nullptr);
|
|
|
|
//pass this packet through the struct strategy.
|
|
m_structs->Decode(pack);
|
|
return(pack);
|
|
}
|
|
|
|
void EQStreamProxy::Close() {
|
|
m_stream->Close();
|
|
}
|
|
|
|
std::string EQStreamProxy::GetRemoteAddr() const {
|
|
return(m_stream->GetRemoteAddr());
|
|
}
|
|
|
|
uint32 EQStreamProxy::GetRemoteIP() const {
|
|
return(m_stream->GetRemoteIP());
|
|
}
|
|
|
|
uint16 EQStreamProxy::GetRemotePort() const {
|
|
return(m_stream->GetRemotePort());
|
|
}
|
|
|
|
void EQStreamProxy::ReleaseFromUse() {
|
|
m_stream->ReleaseFromUse();
|
|
}
|
|
|
|
void EQStreamProxy::RemoveData() {
|
|
m_stream->RemoveData();
|
|
}
|
|
|
|
EQStreamInterface::Stats EQStreamProxy::GetStats() const
|
|
{
|
|
return m_stream->GetStats();
|
|
}
|
|
|
|
void EQStreamProxy::ResetStats()
|
|
{
|
|
m_stream->ResetStats();
|
|
}
|
|
|
|
EQStreamManagerInterface *EQStreamProxy::GetManager() const
|
|
{
|
|
return m_stream->GetManager();
|
|
}
|
|
|
|
bool EQStreamProxy::CheckState(EQStreamState state) {
|
|
if(m_stream)
|
|
return(m_stream->CheckState(state));
|
|
|
|
return false;
|
|
}
|
|
|
|
OpcodeManager *EQStreamProxy::GetOpcodeManager() const
|
|
{
|
|
return (*m_opcodes);
|
|
}
|
|
|