net: Add a method to get the MessageManager instance from a DMLSession

This commit is contained in:
Joshua Scott 2018-04-20 17:12:31 +01:00
parent 1927426034
commit e26a20d650
2 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,8 @@ namespace net
DMLSession(uint16_t id, const dml::MessageManager &manager);
virtual ~DMLSession() = default;
const dml::MessageManager &get_manager() const;
void send_message(const dml::Message &message);
protected:
void on_application_message(const PacketHeader& header) override;

View File

@ -9,6 +9,11 @@ namespace net
DMLSession::DMLSession(const uint16_t id, const dml::MessageManager& manager)
: Session(id), m_manager(manager) {}
const dml::MessageManager& DMLSession::get_manager() const
{
return m_manager;
}
void DMLSession::send_message(const dml::Message& message)
{
send_packet(false, 0, message);