diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/bind/core_bind.cpp | 20 | ||||
-rw-r--r-- | core/io/file_access_network.cpp | 2 | ||||
-rw-r--r-- | core/io/http_client.cpp | 12 | ||||
-rw-r--r-- | core/io/http_client.h | 2 | ||||
-rw-r--r-- | core/io/stream_peer_ssl.cpp | 6 | ||||
-rw-r--r-- | core/io/stream_peer_ssl.h | 6 | ||||
-rw-r--r-- | core/io/stream_peer_tcp.cpp | 10 | ||||
-rw-r--r-- | core/io/stream_peer_tcp.h | 6 | ||||
-rw-r--r-- | core/object_type_db.cpp | 9 | ||||
-rw-r--r-- | core/script_debugger_remote.cpp | 10 |
10 files changed, 46 insertions, 37 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index a77385faa6..c8feb8b7d3 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2508,22 +2508,22 @@ void _ClassDB::_bind_methods() { ClassDB::bind_method(_MD("can_instance","class"),&_ClassDB::can_instance); ClassDB::bind_method(_MD("instance","class"),&_ClassDB::instance); - ClassDB::bind_method(_MD("has_signal","class","signal"),&_ClassDB::has_signal); - ClassDB::bind_method(_MD("get_signal","class","signal"),&_ClassDB::get_signal); - ClassDB::bind_method(_MD("get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_has_signal","class","signal"),&_ClassDB::has_signal); + ClassDB::bind_method(_MD("class_get_signal","class","signal"),&_ClassDB::get_signal); + ClassDB::bind_method(_MD("class_get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); - ClassDB::bind_method(_MD("get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); - ClassDB::bind_method(_MD("has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); + ClassDB::bind_method(_MD("class_has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); - ClassDB::bind_method(_MD("get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); - ClassDB::bind_method(_MD("get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); + ClassDB::bind_method(_MD("class_get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); - ClassDB::bind_method(_MD("has_integer_constant","class","name"),&_ClassDB::has_integer_constant); - ClassDB::bind_method(_MD("get_integer_constant","class","name"),&_ClassDB::get_integer_constant); + ClassDB::bind_method(_MD("class_has_integer_constant","class","name"),&_ClassDB::has_integer_constant); + ClassDB::bind_method(_MD("class_get_integer_constant","class","name"),&_ClassDB::get_integer_constant); - ClassDB::bind_method(_MD("get_category","class"),&_ClassDB::get_category); + ClassDB::bind_method(_MD("class_get_category","class"),&_ClassDB::get_category); ClassDB::bind_method(_MD("is_class_enabled","class"),&_ClassDB::is_class_enabled); diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 662902281b..7bf750f6e1 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -206,7 +206,7 @@ Error FileAccessNetworkClient::connect(const String& p_host,int p_port,const Str } DEBUG_PRINT("IP: "+String(ip)+" port "+itos(p_port)); - Error err = client->connect(ip,p_port); + Error err = client->connect_to_host(ip,p_port); ERR_FAIL_COND_V(err,err); while(client->get_status()==StreamPeerTCP::STATUS_CONNECTING) { //DEBUG_PRINT("trying to connect...."); diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 5e57f55f87..63c8abbbad 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -33,7 +33,7 @@ void HTTPClient::set_ip_type(IP::Type p_type) { ip_type = p_type; } -Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){ +Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){ close(); tcp_connection->set_ip_type(ip_type); @@ -57,7 +57,7 @@ Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_ve if (conn_host.is_valid_ip_address()) { //is ip - Error err = tcp_connection->connect(IP_Address(conn_host),p_port); + Error err = tcp_connection->connect_to_host(IP_Address(conn_host),p_port); if (err) { status=STATUS_CANT_CONNECT; return err; @@ -232,7 +232,7 @@ Error HTTPClient::get_response_headers(List<String> *r_response) { void HTTPClient::close(){ if (tcp_connection->get_status()!=StreamPeerTCP::STATUS_NONE) - tcp_connection->disconnect(); + tcp_connection->disconnect_from_host(); connection.unref(); status=STATUS_DISCONNECTED; @@ -267,7 +267,7 @@ Error HTTPClient::poll(){ case IP::RESOLVER_STATUS_DONE: { IP_Address host = IP::get_singleton()->get_resolve_item_address(resolving); - Error err = tcp_connection->connect(host,conn_port); + Error err = tcp_connection->connect_to_host(host,conn_port); IP::get_singleton()->erase_resolve_item(resolving); resolving=IP::RESOLVER_INVALID_ID; if (err) { @@ -300,7 +300,7 @@ Error HTTPClient::poll(){ case StreamPeerTCP::STATUS_CONNECTED: { if (ssl) { Ref<StreamPeerSSL> ssl = StreamPeerSSL::create(); - Error err = ssl->connect(tcp_connection,true,ssl_verify_host?conn_host:String()); + Error err = ssl->connect_to_stream(tcp_connection,true,ssl_verify_host?conn_host:String()); if (err!=OK) { close(); status=STATUS_SSL_HANDSHAKE_ERROR; @@ -640,7 +640,7 @@ Error HTTPClient::_get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received) void HTTPClient::_bind_methods() { ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPClient::set_ip_type); - ClassDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); + ClassDB::bind_method(_MD("connect_to_host:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect_to_host,DEFVAL(false),DEFVAL(true)); ClassDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); ClassDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); ClassDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); diff --git a/core/io/http_client.h b/core/io/http_client.h index c6f96db1d6..496d22530b 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -167,7 +167,7 @@ public: void set_ip_type(IP::Type p_type); //Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request - Error connect(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); + Error connect_to_host(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); void set_connection(const Ref<StreamPeer>& p_connection); Ref<StreamPeer> get_connection() const; diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index aab42a2989..fc535e94b0 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -57,10 +57,10 @@ bool StreamPeerSSL::is_available() { void StreamPeerSSL::_bind_methods() { - ClassDB::bind_method(_MD("accept:Error","stream:StreamPeer"),&StreamPeerSSL::accept); - ClassDB::bind_method(_MD("connect:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect,DEFVAL(false),DEFVAL(String())); + ClassDB::bind_method(_MD("accept_stream:Error","stream:StreamPeer"),&StreamPeerSSL::accept_stream); + ClassDB::bind_method(_MD("connect_to_stream:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect_to_stream,DEFVAL(false),DEFVAL(String())); ClassDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); - ClassDB::bind_method(_MD("disconnect"),&StreamPeerSSL::disconnect); + ClassDB::bind_method(_MD("disconnect_from_stream"),&StreamPeerSSL::disconnect_from_stream); BIND_CONSTANT( STATUS_DISCONNECTED ); BIND_CONSTANT( STATUS_CONNECTED ); BIND_CONSTANT( STATUS_ERROR_NO_CERTIFICATE ); diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index 8675433a30..9aafac874d 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -57,11 +57,11 @@ public: STATUS_ERROR_HOSTNAME_MISMATCH }; - virtual Error accept(Ref<StreamPeer> p_base)=0; - virtual Error connect(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String())=0; + virtual Error accept_stream(Ref<StreamPeer> p_base)=0; + virtual Error connect_to_stream(Ref<StreamPeer> p_base,bool p_validate_certs=false,const String& p_for_hostname=String())=0; virtual Status get_status() const=0; - virtual void disconnect()=0; + virtual void disconnect_from_stream()=0; static StreamPeerSSL* create(); diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index 2218057cf7..0a59c32995 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -41,24 +41,24 @@ Error StreamPeerTCP::_connect(const String& p_address,int p_port) { return ERR_CANT_RESOLVE; } - connect(ip,p_port); + connect_to_host(ip,p_port); return OK; } void StreamPeerTCP::set_ip_type(IP::Type p_type) { - disconnect(); + disconnect_from_host(); ip_type = p_type; } void StreamPeerTCP::_bind_methods() { ClassDB::bind_method(_MD("set_ip_type","ip_type"),&StreamPeerTCP::set_ip_type); - ClassDB::bind_method(_MD("connect","host","port"),&StreamPeerTCP::_connect); - ClassDB::bind_method(_MD("is_connected"),&StreamPeerTCP::is_connected); + ClassDB::bind_method(_MD("connect_to_host","host","port"),&StreamPeerTCP::_connect); + ClassDB::bind_method(_MD("is_connected_to_host"),&StreamPeerTCP::is_connected_to_host); ClassDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); ClassDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); ClassDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); - ClassDB::bind_method(_MD("disconnect"),&StreamPeerTCP::disconnect); + ClassDB::bind_method(_MD("disconnect_from_host"),&StreamPeerTCP::disconnect_from_host); BIND_CONSTANT( STATUS_NONE ); BIND_CONSTANT( STATUS_CONNECTING ); diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index 8f6dfaf3f8..2b25f31739 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -60,13 +60,13 @@ protected: public: virtual void set_ip_type(IP::Type p_type); - virtual Error connect(const IP_Address& p_host, uint16_t p_port)=0; + virtual Error connect_to_host(const IP_Address& p_host, uint16_t p_port)=0; //read/write from streampeer - virtual bool is_connected() const=0; + virtual bool is_connected_to_host() const=0; virtual Status get_status() const=0; - virtual void disconnect()=0; + virtual void disconnect_from_host()=0; virtual IP_Address get_connected_host() const=0; virtual uint16_t get_connected_port() const=0; virtual void set_nodelay(bool p_enabled)=0; diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp index 3139ea9511..24b9c26e71 100644 --- a/core/object_type_db.cpp +++ b/core/object_type_db.cpp @@ -1111,6 +1111,15 @@ MethodBind* ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const String instance_type=p_bind->get_instance_class(); +#ifdef DEBUG_ENABLED + + if (has_method(instance_type,mdname)) { + ERR_EXPLAIN("Class "+String(instance_type)+" already has a method "+String(mdname)); + ERR_FAIL_V(NULL); + } +#endif + + ClassInfo *type=classes.getptr(instance_type); if (!type) { ERR_PRINTS("Couldn't bind method '"+mdname+"' for instance: "+instance_type); diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index a120a28896..bb0109467e 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -66,7 +66,7 @@ Error ScriptDebuggerRemote::connect_to_host(const String& p_host,uint16_t p_port int port = p_port; int tries = 3; - tcp_client->connect(ip, port); + tcp_client->connect_to_host(ip, port); while (tries--) { @@ -129,7 +129,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { //or when execution is paused from editor - if (!tcp_client->is_connected()) { + if (!tcp_client->is_connected_to_host()) { ERR_EXPLAIN("Script Debugger failed to connect, but being used anyway."); ERR_FAIL(); } @@ -446,7 +446,7 @@ void ScriptDebuggerRemote::_err_handler(void* ud,const char* p_func,const char*p sdr->mutex->lock(); - if (!sdr->locking && sdr->tcp_client->is_connected()) { + if (!sdr->locking && sdr->tcp_client->is_connected_to_host()) { sdr->errors.push_back(oe); } @@ -887,7 +887,7 @@ void ScriptDebuggerRemote::idle_poll() { void ScriptDebuggerRemote::send_message(const String& p_message, const Array &p_args) { mutex->lock(); - if (!locking && tcp_client->is_connected()) { + if (!locking && tcp_client->is_connected_to_host()) { Message msg; msg.message=p_message; @@ -928,7 +928,7 @@ void ScriptDebuggerRemote::_print_handler(void *p_this,const String& p_string) { } sdr->mutex->lock(); - if (!sdr->locking && sdr->tcp_client->is_connected()) { + if (!sdr->locking && sdr->tcp_client->is_connected_to_host()) { sdr->output_strings.push_back(s); } |