diff options
| author | Juan Linietsky | 2014-05-24 01:35:47 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-05-24 01:35:47 -0300 |
| commit | 1cad087969efefa401a11051343cd0689f660770 (patch) | |
| tree | 1595dd049bdb7289752012dca4398b2251fb08fa /core/io/ip.cpp | |
| parent | f9ff086235cd4ff406b136f62fff77b85c0873f9 (diff) | |
| download | godot-1cad087969efefa401a11051343cd0689f660770.tar.gz godot-1cad087969efefa401a11051343cd0689f660770.tar.zst godot-1cad087969efefa401a11051343cd0689f660770.zip | |
Diffstat (limited to 'core/io/ip.cpp')
| -rw-r--r-- | core/io/ip.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 503a00944..d2a685f6b 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -188,6 +188,18 @@ void IP::erase_resolve_item(ResolverID p_id) { } +Array IP::_get_local_addresses() const { + + Array addresses; + List<IP_Address> ip_addresses; + get_local_addresses(&ip_addresses); + for(List<IP_Address>::Element *E=ip_addresses.front();E;E=E->next()) { + addresses.push_back(E->get()); + } + + return addresses; +} + void IP::_bind_methods() { ObjectTypeDB::bind_method(_MD("resolve_hostname","host"),&IP::resolve_hostname); @@ -195,6 +207,7 @@ void IP::_bind_methods() { 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); + ObjectTypeDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses); BIND_CONSTANT( RESOLVER_STATUS_NONE ); BIND_CONSTANT( RESOLVER_STATUS_WAITING ); |
