19#ifndef CONNECT_TO_SERVER_HPP
20#define CONNECT_TO_SERVER_HPP
23#include "utils/cpp2011.hpp"
41 std::shared_ptr<Server> m_server;
43 irr::core::stringw m_error_msg;
53 std::atomic<ConnectState> m_state;
55 void getClientServerInfo();
57 bool tryConnect(
int timeout,
int retry,
bool another_port =
false,
59 static ENetAddress m_server_address;
61 static int m_retry_count;
62 static bool m_done_intecept;
67 virtual void setup() OVERRIDE;
69 virtual
void update(
int ticks) OVERRIDE;
Definition: connect_to_server.hpp:39
virtual void update(int ticks) OVERRIDE
Called by the protocol listener, synchronously with the main loop.
Definition: connect_to_server.cpp:350
bool registerWithSTKServer()
Register this client with the STK server.
Definition: connect_to_server.cpp:497
ConnectState
State for finite state machine.
Definition: connect_to_server.hpp:47
virtual ~ConnectToServer()
Destructor.
Definition: connect_to_server.cpp:93
virtual void setup() OVERRIDE
Initialise the protocol.
Definition: connect_to_server.cpp:108
static int interceptCallback(ENetHost *host, ENetEvent *event)
Intercept callback in enet to allow change server address and port if needed (Happens when there is f...
Definition: connect_to_server.cpp:402
virtual void asynchronousUpdate() OVERRIDE
Called by the protocol listener as often as possible.
Definition: connect_to_server.cpp:178
Abstract class used to define the global protocol functions.
Definition: protocol.hpp:92
Definition: server.hpp:44
Generic protocols declarations.