OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
12 #include "../../stdafx.h"
13 #include "../../date_func.h"
14 #include "../../debug.h"
17 #include "../../safeguards.h"
35 Debug(net, 0,
"[tcp/turn] Received invalid packet type {}", type);
47 static const int MAX_PACKETS_TO_RECEIVE = 4;
48 int i = MAX_PACKETS_TO_RECEIVE;
52 if (!cont)
return true;
55 return i != MAX_PACKETS_TO_RECEIVE - 1;
65 Debug(net, 0,
"[tcp/turn] Received illegal packet type {}", type);
virtual bool Receive_SERCLI_CONNECT(Packet *p)
Client or servers wants to connect to the TURN server (on request by the Game Coordinator).
virtual bool Receive_TURN_ERROR(Packet *p)
TURN server was unable to connect the client or server based on the token.
virtual Packet * ReceivePacket()
Receives a packet for the given client.
virtual bool Receive_TURN_CONNECTED(Packet *p)
TURN server has connected client and server together and will now relay all packets to each other.
PacketTurnType
Enum with all types of TCP TURN packets.
bool HandlePacket(Packet *p)
Handle the given packet, i.e.
Internal entity of a packet.
bool ReceivePackets()
Receive a packet at TCP level.
@ PACKET_TURN_TURN_ERROR
TURN server is unable to relay.
@ PACKET_TURN_SERCLI_CONNECT
Client or server is connecting to the TURN server.
bool ReceiveInvalidPacket(PacketTurnType type)
Helper for logging receiving invalid packets.
uint8 Recv_uint8()
Read a 8 bits integer from the packet.
#define Debug(name, level, format_string,...)
Ouptut a line of debugging information.
@ PACKET_TURN_TURN_CONNECTED
TURN server indicates the socket is now being relayed.