Parse Game Name and Location.

This commit is contained in:
HikikoMarmy
2025-04-15 21:13:51 +01:00
parent 71a1ef719b
commit 247cd434e5
6 changed files with 38 additions and 14 deletions

View File

@@ -7,14 +7,14 @@ void RequestCreatePrivateGame::Deserialize( sptr_byte_stream stream )
DeserializeHeader( stream );
m_sessionId = stream->read_encrypted_utf16();
m_gameName = stream->read_utf16();
m_gameInfo = stream->read_utf16();
}
sptr_generic_response RequestCreatePrivateGame::ProcessRequest( sptr_user user, sptr_byte_stream stream )
{
Deserialize( stream );
auto result = GameSessionManager::Get().CreatePrivateGameSession( user, m_gameName );
auto result = GameSessionManager::Get().CreatePrivateGameSession( user, m_gameInfo );
if( !result )
{
@@ -22,7 +22,7 @@ sptr_generic_response RequestCreatePrivateGame::ProcessRequest( sptr_user user,
return std::make_shared< ResultCreatePrivateGame >( this, CREATE_REPLY::GENERAL_ERROR, "", 0 );
}
Log::Info( "[%S] Create Private Game: %S", m_sessionId.c_str(), m_gameName.c_str() );
Log::Info( "[%S] Create Private Game: %S", m_sessionId.c_str(), m_gameInfo.c_str() );
return std::make_shared< ResultCreatePrivateGame >( this, CREATE_REPLY::SUCCESS, Config::service_ip, Config::discovery_port );
}

View File

@@ -4,7 +4,7 @@ class RequestCreatePrivateGame : public GenericRequest
{
private:
std::wstring m_sessionId;
std::wstring m_gameName;
std::wstring m_gameInfo;
enum CREATE_REPLY {
SUCCESS = 0,

View File

@@ -17,14 +17,14 @@ void RequestCreatePublicGame::Deserialize( sptr_byte_stream stream )
auto unknown_c = stream->read_u32();
auto unknown_d = stream->read_u32();
m_gameName = stream->read_utf16();
m_gameInfo = stream->read_utf16();
}
sptr_generic_response RequestCreatePublicGame::ProcessRequest( sptr_user user, sptr_byte_stream stream )
{
Deserialize( stream );
auto result = GameSessionManager::Get().CreatePublicGameSession( user, m_gameName );
auto result = GameSessionManager::Get().CreatePublicGameSession( user, m_gameInfo );
if( !result )
{
@@ -32,7 +32,7 @@ sptr_generic_response RequestCreatePublicGame::ProcessRequest( sptr_user user, s
return std::make_shared< ResultCreatePublicGame >( this, CREATE_REPLY::GENERAL_ERROR, "", 0 );
}
Log::Info( "[%S] Create Public Game: %S", m_sessionId.c_str(), m_gameName.c_str() );
Log::Info( "[%S] Create Public Game: %S", m_sessionId.c_str(), m_gameInfo.c_str() );
return std::make_shared< ResultCreatePublicGame >(this, CREATE_REPLY::SUCCESS, Config::service_ip, Config::discovery_port);
}

View File

@@ -4,7 +4,7 @@ class RequestCreatePublicGame : public GenericRequest
{
private:
std::wstring m_sessionId;
std::wstring m_gameName;
std::wstring m_gameInfo;
int32_t m_minimumLevel;
int32_t m_maximumLevel;