net: Pass a pointer rather than a reference in DMLSession::on_message

This commit is contained in:
Joshua Scott 2018-04-20 18:57:05 +01:00
parent 993191ec51
commit a00f9b5003
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ namespace net
void send_message(const dml::Message &message); void send_message(const dml::Message &message);
protected: protected:
void on_application_message(const PacketHeader& header) override; void on_application_message(const PacketHeader& header) override;
virtual void on_message(const dml::Message &message) {} virtual void on_message(const dml::Message *message) {}
virtual void on_invalid_message(InvalidDMLMessageErrorCode error) {} virtual void on_invalid_message(InvalidDMLMessageErrorCode error) {}
private: private:
const dml::MessageManager &m_manager; const dml::MessageManager &m_manager;

View File

@ -31,7 +31,7 @@ namespace net
// Are we sufficiently authenticated to handle this message? // Are we sufficiently authenticated to handle this message?
if (get_access_level() >= message->get_access_level()) if (get_access_level() >= message->get_access_level())
on_message(*message); on_message(message);
else else
on_invalid_message(InvalidDMLMessageErrorCode::INSUFFICIENT_ACCESS); on_invalid_message(InvalidDMLMessageErrorCode::INSUFFICIENT_ACCESS);
delete message; delete message;