|
SuperTuxKart
|
One instance of this is started for every peer who tries to connect to this server. More...
#include <connect_to_peer.hpp>

Public Member Functions | |
| ConnectToPeer (const SocketAddress &address) | |
| Constructor for peer address. More... | |
| virtual void | setup () OVERRIDE |
| Called when the protocol is going to start. More... | |
| virtual void | update (int ticks) OVERRIDE |
| Called by the protocol listener, synchronously with the main loop. More... | |
| virtual void | asynchronousUpdate () OVERRIDE |
| Simple finite state machine: Start a GetPeerAddress protocol. More... | |
Public Member Functions inherited from Protocol | |
| Protocol (ProtocolType type) | |
| Constructor Sets the basic protocol parameters, as the callback object and the protocol type. More... | |
| virtual | ~Protocol () |
| Destructor. | |
| bool | checkDataSize (Event *event, unsigned int minimum_size) |
| functions to check incoming data easily More... | |
| void | sendMessageToPeers (NetworkString *message, bool reliable=true) |
| Sends a message to all validated peers in game, encrypt the message if needed. More... | |
| void | sendMessageToPeersInServer (NetworkString *message, bool reliable=true) |
| Sends a message to all validated peers in server, encrypt the message if needed. More... | |
| void | sendToServer (NetworkString *message, bool reliable=true) |
| Sends a message from a client to the server. | |
| virtual void | requestStart () |
| Starts a request in the protocol manager to start this protocol. | |
| virtual void | requestTerminate () |
| Submits a request to the ProtocolManager to terminate this protocol. | |
| virtual bool | notifyEvent (Event *event) |
| Notify a protocol matching the Event type of that event. More... | |
| virtual bool | notifyEventAsynchronous (Event *event) |
| Notify a protocol matching the Event type of that event. More... | |
| ProtocolType | getProtocolType () const |
| Method to get a protocol's type. More... | |
| void | setHandleConnections (bool b) |
| Sets if this protocol should receive connection events. | |
| void | setHandleDisconnections (bool b) |
| Sets if this protocol should receive disconnection events. | |
| virtual bool | handleConnects () const |
| Return true if this protocol should be informed about connects. | |
| virtual bool | handleDisconnects () const |
| Return true if this protocol should be informed about disconnects. | |
Protected Types | |
| enum | STATE { WAIT_FOR_CONNECTION , DONE , EXITING } |
Protected Attributes | |
| SocketAddress | m_peer_address |
| uint64_t | m_timer = 0 |
| Timer use for tracking broadcast. | |
| unsigned | m_tried_connection = 0 |
| If greater than a certain value, terminate this protocol. | |
| enum ConnectToPeer::STATE | m_state |
Protected Attributes inherited from Protocol | |
| ProtocolType | m_type |
| The type of the protocol. | |
| bool | m_handle_connections |
| True if this protocol should receive connection events. | |
| bool | m_handle_disconnections |
| TRue if this protocol should recceiver disconnection events. | |
One instance of this is started for every peer who tries to connect to this server.
| ConnectToPeer::ConnectToPeer | ( | const SocketAddress & | address | ) |
Constructor for peer address.
| address | The address to connect to. |
|
virtual |
Simple finite state machine: Start a GetPeerAddress protocol.
Once the result has been received, start a ping protocol (hoping to be able to connect to the NAT peer using its public port). The ping protocol should make sure that the peer's firewall still lets packages through by the time the actual game starts.
Implements Protocol.
|
inlinevirtual |
|
inlinevirtual |
Called by the protocol listener, synchronously with the main loop.
Must be re-defined.
Implements Protocol.