mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Launch session at construction of Net*
This way it's statically assured that the session aren't launched multiple times.
This commit is contained in:
@@ -100,12 +100,6 @@ public:
|
||||
*/
|
||||
CStr GetGUID() const { return m_GUID; }
|
||||
|
||||
/**
|
||||
* Set up a connection to the remote networked server.
|
||||
* @return true on success, false on connection failure
|
||||
*/
|
||||
bool SetupConnection(ENetHost* enetClient);
|
||||
|
||||
/**
|
||||
* Connect to the remote networked server using lobby.
|
||||
* Push netstatus messages on failure.
|
||||
@@ -259,6 +253,10 @@ public:
|
||||
*/
|
||||
void HandleGetServerDataFailed(const CStr& error);
|
||||
private:
|
||||
struct PrivateTag {};
|
||||
CNetClient(PrivateTag, CGame* game, std::string serverAddressOrHostname,
|
||||
std::uint16_t serverPont, const CStrW& username = L"anonymous", const CStr& hostJID = {},
|
||||
std::string hashedPassword = {}, std::string controllerSecret = {});
|
||||
|
||||
void SendAuthenticateMessage();
|
||||
|
||||
@@ -286,6 +284,12 @@ private:
|
||||
static bool OnClientPaused(CNetClient* client, CFsmEvent<CNetMessage*>* event);
|
||||
static bool OnLoadedGame(CNetClient* client, CFsmEvent<CNetMessage*>* event);
|
||||
|
||||
/**
|
||||
* Set up a connection to the remote networked server.
|
||||
* @return true on success, false on connection failure
|
||||
*/
|
||||
void SetupConnection(ENetHost* enetClient);
|
||||
|
||||
/**
|
||||
* Take ownership of a session object, and use it for all network communication.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user