Reorganized and cleaned up the solution.

This commit is contained in:
HikikoMarmy
2026-03-02 12:37:07 +00:00
parent 8012f30170
commit d4dfbddf69
175 changed files with 1516 additions and 1136 deletions

View File

@@ -0,0 +1,44 @@
#pragma once
#include <memory>
#include "Common/ByteStream.hpp"
class GenericResponse;
using sptr_generic_response = std::shared_ptr< GenericResponse >;
class RealmUser;
using sptr_user = std::shared_ptr< RealmUser >;
class RealmSocket;
using sptr_socket = std::shared_ptr< RealmSocket >;
class GenericRequest {
public:
int16_t m_packetId;
uint32_t m_trackId;
virtual ~GenericRequest() = default;
virtual sptr_generic_response ProcessRequest( sptr_socket user, sptr_byte_stream stream )
{
throw std::runtime_error( "ProcessRequest not implemented for GenericRequest" );
}
virtual sptr_generic_response ProcessRequest( sptr_byte_stream stream )
{
throw std::runtime_error( "ProcessRequest not implemented for GenericRequest" );
}
void DeserializeHeader( sptr_byte_stream stream )
{
m_packetId = stream->read_u16();
m_trackId = stream->read_u32();
auto version = stream->read_u32(); // 2 for CON and 6 for RTA
};
virtual void Deserialize( sptr_byte_stream stream ) = 0;
};
using sptr_generic_request = std::shared_ptr< GenericRequest >;