You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
UDP.set_send_address to UDP.set_dest_address
This commit is contained in:
@@ -36,7 +36,7 @@ String PacketPeerUDP::_get_packet_ip() const {
|
|||||||
return get_packet_address();
|
return get_packet_address();
|
||||||
}
|
}
|
||||||
|
|
||||||
Error PacketPeerUDP::_set_send_address(const String& p_address, int p_port) {
|
Error PacketPeerUDP::_set_dest_address(const String& p_address, int p_port) {
|
||||||
|
|
||||||
IP_Address ip;
|
IP_Address ip;
|
||||||
if (p_address.is_valid_ip_address()) {
|
if (p_address.is_valid_ip_address()) {
|
||||||
@@ -47,7 +47,7 @@ Error PacketPeerUDP::_set_send_address(const String& p_address, int p_port) {
|
|||||||
return ERR_CANT_RESOLVE;
|
return ERR_CANT_RESOLVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_send_address(ip,p_port);
|
set_dest_address(ip,p_port);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ void PacketPeerUDP::_bind_methods() {
|
|||||||
ClassDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip);
|
ClassDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip);
|
||||||
//ClassDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address);
|
//ClassDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address);
|
||||||
ClassDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port);
|
ClassDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port);
|
||||||
ClassDB::bind_method(_MD("set_send_address","host","port"),&PacketPeerUDP::_set_send_address);
|
ClassDB::bind_method(_MD("set_dest_address","host","port"),&PacketPeerUDP::_set_dest_address);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ protected:
|
|||||||
|
|
||||||
String _get_packet_ip() const;
|
String _get_packet_ip() const;
|
||||||
|
|
||||||
virtual Error _set_send_address(const String& p_address,int p_port);
|
virtual Error _set_dest_address(const String& p_address,int p_port);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
virtual bool is_listening() const=0;
|
virtual bool is_listening() const=0;
|
||||||
virtual IP_Address get_packet_address() const=0;
|
virtual IP_Address get_packet_address() const=0;
|
||||||
virtual int get_packet_port() const=0;
|
virtual int get_packet_port() const=0;
|
||||||
virtual void set_send_address(const IP_Address& p_address,int p_port)=0;
|
virtual void set_dest_address(const IP_Address& p_address,int p_port)=0;
|
||||||
|
|
||||||
|
|
||||||
static Ref<PacketPeerUDP> create_ref();
|
static Ref<PacketPeerUDP> create_ref();
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ int PacketPeerUDPPosix::_get_socket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PacketPeerUDPPosix::set_send_address(const IP_Address& p_address,int p_port) {
|
void PacketPeerUDPPosix::set_dest_address(const IP_Address& p_address,int p_port) {
|
||||||
|
|
||||||
peer_addr=p_address;
|
peer_addr=p_address;
|
||||||
peer_port=p_port;
|
peer_port=p_port;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
virtual IP_Address get_packet_address() const;
|
virtual IP_Address get_packet_address() const;
|
||||||
virtual int get_packet_port() const;
|
virtual int get_packet_port() const;
|
||||||
|
|
||||||
virtual void set_send_address(const IP_Address& p_address,int p_port);
|
virtual void set_dest_address(const IP_Address& p_address,int p_port);
|
||||||
|
|
||||||
static void make_default();
|
static void make_default();
|
||||||
|
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ int PacketPeerUDPWinsock::_get_socket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PacketPeerUDPWinsock::set_send_address(const IP_Address& p_address,int p_port) {
|
void PacketPeerUDPWinsock::set_dest_address(const IP_Address& p_address,int p_port) {
|
||||||
|
|
||||||
peer_addr=p_address;
|
peer_addr=p_address;
|
||||||
peer_port=p_port;
|
peer_port=p_port;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
virtual IP_Address get_packet_address() const;
|
virtual IP_Address get_packet_address() const;
|
||||||
virtual int get_packet_port() const;
|
virtual int get_packet_port() const;
|
||||||
|
|
||||||
virtual void set_send_address(const IP_Address& p_address,int p_port);
|
virtual void set_dest_address(const IP_Address& p_address,int p_port);
|
||||||
|
|
||||||
static void make_default();
|
static void make_default();
|
||||||
PacketPeerUDPWinsock();
|
PacketPeerUDPWinsock();
|
||||||
|
|||||||
Reference in New Issue
Block a user