/
CConnectManager.h
68 lines (53 loc) · 2.31 KB
/
CConnectManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: core/CConnectManager.h
* PURPOSE: Header file for connect manager
* DEVELOPERS: Christian Myhre Lundheim <>
* Jax <>
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __CCONNECTMANAGER_H
#define __CCONNECTMANAGER_H
#include <ctime>
#include <gui/CGUI.h>
#include <xfire.h>
#include "CServerInfo.h"
class CConnectManager
{
public:
CConnectManager ( void );
~CConnectManager ( void );
bool Connect ( const char* szHost, unsigned short usPort, const char* szNick, const char* szPassword, bool bNotifyServerBrowser = false, bool bForceInternalHTTPServer = false );
bool Reconnect ( const char* szHost, unsigned short usPort, const char* szPassword, bool bSave = true, bool bForceInternalHTTPServer = false );
bool Abort ( void );
void DoPulse ( void );
void OnServerExists ( void );
bool ShouldUseInternalHTTPServer ( void ) { return m_bForceInternalHTTPServer; }
static bool StaticProcessPacket ( unsigned char ucPacketID, class NetBitStreamInterface& bitStream );
std::string m_strLastHost;
unsigned short m_usLastPort;
std::string m_strLastPassword;
private:
bool Event_OnCancelClick ( CGUIElement * pElement );
in_addr m_Address;
std::string m_strHost;
unsigned short m_usPort;
std::string m_strNick;
std::string m_strPassword;
bool m_bIsDetectingVersion;
bool m_bIsConnecting;
bool m_bReconnect;
bool m_bSave;
bool m_bForceInternalHTTPServer;
time_t m_tConnectStarted;
bool m_bHasSentTcpRequest;
GUI_CALLBACK* m_pOnCancelClick;
CServerListItem* m_pServerItem;
bool m_bNotifyServerBrowser;
bool CheckNickProvided ( const char* szNick );
};
#endif