Add Client Type for CON/RTA distinction.

This commit is contained in:
HikikoMarmy
2025-04-24 11:19:17 +01:00
parent a1989de8dc
commit 9cf6dea79f
5 changed files with 18 additions and 2 deletions

7
Game/Constant.hpp Normal file
View File

@@ -0,0 +1,7 @@
#pragma once
enum class RealmClientType {
UNKNOWN = 0,
CHAMPIONS_OF_NORRATH = 1,
RETURN_TO_ARMS = 2,
};

View File

@@ -4,10 +4,13 @@ RealmUser::RealmUser()
{
sock = nullptr;
m_clientType = RealmClientType::UNKNOWN;
m_sessionId = L"";
m_localAddr = "";
m_discoveryAddr = "";
m_discoveryPort = 0;
m_isHost = false;
m_gameId = 0;
@@ -21,10 +24,13 @@ RealmUser::~RealmUser()
sock.reset();
}
m_clientType = RealmClientType::UNKNOWN;
m_sessionId = L"";
m_localAddr = "";
m_discoveryAddr = "";
m_discoveryPort = 0;
m_isHost = false;
m_gameId = 0;

View File

@@ -8,6 +8,8 @@ public:
public:
sptr_socket sock; // For Realm Lobby
RealmClientType m_clientType;
std::wstring m_sessionId; // Unique Session ID for the user (Generated at login)
bool m_isHost; // True if this user is the host of a realm

View File

@@ -22,7 +22,7 @@ std::wstring RealmUserManager::GenerateSessionId()
return sessionId;
}
sptr_user RealmUserManager::CreateUser( sptr_socket socket )
sptr_user RealmUserManager::CreateUser( sptr_socket socket, RealmClientType clientType )
{
Log::Debug( "ClientManager::CreateUser() - Created new user" );
@@ -30,6 +30,7 @@ sptr_user RealmUserManager::CreateUser( sptr_socket socket )
user->m_sessionId = GenerateSessionId();
user->sock = socket;
user->m_clientType = clientType;
m_users.push_back( user );

View File

@@ -28,7 +28,7 @@ public:
public:
static std::wstring GenerateSessionId();
sptr_user CreateUser( sptr_socket socket );
sptr_user CreateUser( sptr_socket socket, RealmClientType clientType );
void RemoveUser( sptr_user user );
void RemoveUser( const std::wstring &sessionId );
void RemoveUser( const sptr_socket socket );