aboutsummaryrefslogtreecommitdiff
path: root/core/io/ip.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli2016-12-01 06:34:05 +0100
committerFabio Alessandrelli2017-01-04 00:46:32 +0100
commite8a6cbc8979089839cddecce6f59a053f4416640 (patch)
treef5671d5fcc72761dfdae09a5b0bbb9734434c41e /core/io/ip.cpp
parent47ae6c6507e1081e48d34c21cc3925ee3ae95a47 (diff)
downloadgodot-e8a6cbc8979089839cddecce6f59a053f4416640.tar.gz
godot-e8a6cbc8979089839cddecce6f59a053f4416640.tar.zst
godot-e8a6cbc8979089839cddecce6f59a053f4416640.zip
Migrate int.IP_TYPE_ constants to IP.TYPE_
(cherry picked from commit c18c5013f837ea7d4de2f022d36f84e0abce6439)
Diffstat (limited to 'core/io/ip.cpp')
-rw-r--r--core/io/ip.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index f0f273af1..00835c26d 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -32,7 +32,6 @@
#include "hash_map.h"
VARIANT_ENUM_CAST(IP::ResolverStatus);
-VARIANT_ENUM_CAST(IP_Address::AddrType);
/************* RESOLVER ******************/
@@ -44,12 +43,12 @@ struct _IP_ResolverPrivate {
volatile IP::ResolverStatus status;
IP_Address response;
String hostname;
- IP_Address::AddrType type;
+ IP::Type type;
void clear() {
status = IP::RESOLVER_STATUS_NONE;
response = IP_Address();
- type = IP_Address::TYPE_NONE;
+ type = IP::TYPE_NONE;
hostname="";
};
@@ -112,7 +111,7 @@ struct _IP_ResolverPrivate {
-IP_Address IP::resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type) {
+IP_Address IP::resolve_hostname(const String& p_hostname, IP::Type p_type) {
GLOBAL_LOCK_FUNCTION;
@@ -126,7 +125,7 @@ IP_Address IP::resolve_hostname(const String& p_hostname, IP_Address::AddrType p
return res;
}
-IP::ResolverID IP::resolve_hostname_queue_item(const String& p_hostname, IP_Address::AddrType p_type) {
+IP::ResolverID IP::resolve_hostname_queue_item(const String& p_hostname, IP::Type p_type) {
GLOBAL_LOCK_FUNCTION;
@@ -212,8 +211,8 @@ Array IP::_get_local_addresses() const {
void IP::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP_Address::TYPE_ANY));
- ObjectTypeDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP_Address::TYPE_ANY));
+ ObjectTypeDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP::TYPE_ANY));
+ ObjectTypeDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP::TYPE_ANY));
ObjectTypeDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status);
ObjectTypeDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address);
ObjectTypeDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item);
@@ -228,6 +227,10 @@ void IP::_bind_methods() {
BIND_CONSTANT( RESOLVER_MAX_QUERIES );
BIND_CONSTANT( RESOLVER_INVALID_ID );
+ BIND_CONSTANT( TYPE_NONE );
+ BIND_CONSTANT( TYPE_IPV4 );
+ BIND_CONSTANT( TYPE_IPV6 );
+ BIND_CONSTANT( TYPE_ANY );
}