Simplification of discovery events

This commit is contained in:
HikikoMarmy
2025-07-01 15:11:11 +01:00
parent aa0129b5b0
commit 256a8c55c2
3 changed files with 12 additions and 15 deletions

View File

@@ -1,10 +1,11 @@
#include "NotifyGameDiscovered.h"
#include "../../Game/RealmUser.h"
NotifyGameDiscovered::NotifyGameDiscovered( std::string clientIp, int32_t clientPort, RealmGameType clientType ) : GenericMessage( 0x3E )
NotifyGameDiscovered::NotifyGameDiscovered( sptr_user user ) : GenericMessage( 0x3E )
{
this->m_clientIp = std::move( clientIp );
this->m_clientPort = clientPort;
this->m_clientType = clientType;
this->m_clientIp = user->m_discoveryAddr;
this->m_clientPort = user->m_discoveryPort;
this->m_clientType = user->m_gameType;
}
void NotifyGameDiscovered::Serialize( ByteBuffer &out ) const

View File

@@ -5,6 +5,7 @@
#include "../GenericNetMessage.h"
#include "../../Common/Constant.h"
#include "../../Common/ForwardDecl.h"
class NotifyGameDiscovered : public GenericMessage {
private:
@@ -13,6 +14,6 @@ private:
RealmGameType m_clientType;
public:
NotifyGameDiscovered( std::string clientIp, int32_t clientPort, RealmGameType clientType );
NotifyGameDiscovered( sptr_user user );
void Serialize(ByteBuffer &out) const override;
};