Initialize more members of CNetClient

The username and the jid have to be set before the client is connected.
With this commit it's not possible to initialize them to late.
This commit is contained in:
phosit
2024-11-10 20:37:40 +01:00
parent b686dfa047
commit f03be7b568
4 changed files with 14 additions and 46 deletions
+3 -13
View File
@@ -74,8 +74,10 @@ public:
/**
* Construct a client associated with the given game object.
* The game must exist for the lifetime of this object.
* The user's name will be displayed to all players.
* The JID of the host is needed for the secure lobby authentication.
*/
CNetClient(CGame* game);
CNetClient(CGame* game, const CStrW& username = L"anonymous", const CStr& hostJID = {});
virtual ~CNetClient();
@@ -92,18 +94,6 @@ public:
void TraceMember(JSTracer *trc);
/**
* Set the user's name that will be displayed to all players.
* This must not be called after the connection setup.
*/
void SetUserName(const CStrW& username);
/**
* Store the JID of the host.
* This is needed for the secure lobby authentication.
*/
void SetHostJID(const CStr& jid);
void SetControllerSecret(const std::string& secret);
bool IsController() const { return m_IsController; }