Codechange: use references for UDP packets
This commit is contained in:
@@ -30,23 +30,23 @@ protected:
|
||||
/** The opened sockets. */
|
||||
SocketList sockets;
|
||||
|
||||
void ReceiveInvalidPacket(PacketUDPType, NetworkAddress *client_addr);
|
||||
void ReceiveInvalidPacket(PacketUDPType, NetworkAddress &client_addr);
|
||||
|
||||
/**
|
||||
* Queries to the server for information about the game.
|
||||
* @param p The received packet.
|
||||
* @param client_addr The origin of the packet.
|
||||
*/
|
||||
virtual void Receive_CLIENT_FIND_SERVER(Packet *p, NetworkAddress *client_addr);
|
||||
virtual void Receive_CLIENT_FIND_SERVER(Packet &p, NetworkAddress &client_addr);
|
||||
|
||||
/**
|
||||
* Response to a query letting the client know we are here.
|
||||
* @param p The received packet.
|
||||
* @param client_addr The origin of the packet.
|
||||
*/
|
||||
virtual void Receive_SERVER_RESPONSE(Packet *p, NetworkAddress *client_addr);
|
||||
virtual void Receive_SERVER_RESPONSE(Packet &p, NetworkAddress &client_addr);
|
||||
|
||||
void HandleUDPPacket(Packet *p, NetworkAddress *client_addr);
|
||||
void HandleUDPPacket(Packet &p, NetworkAddress &client_addr);
|
||||
public:
|
||||
NetworkUDPSocketHandler(NetworkAddressList *bind = nullptr);
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
bool Listen();
|
||||
void CloseSocket();
|
||||
|
||||
void SendPacket(Packet *p, NetworkAddress *recv, bool all = false, bool broadcast = false);
|
||||
void SendPacket(Packet &p, NetworkAddress &recv, bool all = false, bool broadcast = false);
|
||||
void ReceivePackets();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user