From 094c6c70d731a025f8e3549164811c917d9dc43f Mon Sep 17 00:00:00 2001 From: masoud bh Date: Thu, 19 Nov 2015 11:33:39 +0330 Subject: [PATCH 1/6] Fix Windows Export --- platform/windows/export/export.cpp | 4 ++-- platform/windows/export/export.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index d09152234ad..29f21bf227c 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -197,9 +197,9 @@ void EditorExportPlatformWindows::_get_property_list( List *p_list } -Error EditorExportPlatformWindows::export_project(const String& p_path, bool p_debug, bool p_dumb,bool p_remote_debug) { +Error EditorExportPlatformWindows::export_project(const String& p_path, bool p_debug, int p_flags) { - Error err = EditorExportPlatformPC::export_project(p_path, p_debug, p_dumb, p_remote_debug); + Error err = EditorExportPlatformPC::export_project(p_path, p_debug, p_flags); if(err != OK) { return err; diff --git a/platform/windows/export/export.h b/platform/windows/export/export.h index 702acc04b2d..ada74b9d77b 100644 --- a/platform/windows/export/export.h +++ b/platform/windows/export/export.h @@ -29,7 +29,7 @@ protected: void _get_property_list( List *p_list) const; public: - Error export_project(const String& p_path, bool p_debug, bool p_dumb=false, bool p_remote_debug=false); + Error export_project(const String& p_path, bool p_debug, int p_flags=0); EditorExportPlatformWindows(); }; From 2b36da0f79dd4b279a28fe2ff850fb4664e1a79f Mon Sep 17 00:00:00 2001 From: ZuBsPaCe Date: Thu, 19 Nov 2015 11:07:46 +0100 Subject: [PATCH 2/6] Fixes Visual Studio compile error due to pe_bliss Error: C2039: 'min': is not a member of 'std' Reason: #2518 introduced pe_bliss Fix: Visual Studio 2015 & 2013 need to include algorithm header before string, otherwise std:min cannot be used. See: http://stackoverflow.com/questions/17409956 --- tools/pe_bliss/pe_section.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/pe_bliss/pe_section.cpp b/tools/pe_bliss/pe_section.cpp index 7aed5e2c26a..72127e22e25 100644 --- a/tools/pe_bliss/pe_section.cpp +++ b/tools/pe_bliss/pe_section.cpp @@ -19,6 +19,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include #include #include "utils.h" #include "pe_section.h" From 07110c3a14426f6981ae8b6c9ea036e47f5a1cc0 Mon Sep 17 00:00:00 2001 From: Ovnuniarchos Date: Thu, 19 Nov 2015 11:18:22 +0100 Subject: [PATCH 3/6] Changed capabilities list. --- doc/base/classes.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 24c5799350f..de226297847 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -26819,7 +26819,11 @@ This method controls whether the position between two cached points is interpola Lazy (non-greedy) quantifiers [code]*?[/code] Begining [code]^[/code] and end [code]$[/code] anchors Alternation [code]|[/code] - Backreferences [code]\1[/code] to [code]\99[/code] + Backreferences [code]\1[/code] to [code]\9[/code] + POSIX character classes [code][[:alnum:]][/code] + Lookahead [code](?=)[/code], [code](?!)[/code] and lookbehind [code](?<=)[/code], [code](?<!)[/code] + ASCII [code]\xFF[/code] and Unicode [code]\uFFFF[/code] code points (in a style similar to Python) + Word boundaries [code]\b[/code], [code]\B[/code] From 5c7e9e7e633088fae7e9c9e30c3814a1b2a7207c Mon Sep 17 00:00:00 2001 From: Aren Villanueva Date: Wed, 18 Nov 2015 22:33:29 +1100 Subject: [PATCH 4/6] Fixes the make_doc.sh, <, > and & signs in descriptions that cause the parser to break. Documentation for HTTPClient. Added a query_string_from_dict method to HTTPClient to create a x-www-form-urlencoded valid query string for GET and POST messages. String now has http_escape() and http_unescape() methods to help facilitate the above query_string_from_dict method. --- core/io/http_client.cpp | 15 +++++++++++-- core/io/http_client.h | 2 ++ core/ustring.cpp | 42 +++++++++++++++++++++++++++++++++++++ core/ustring.h | 2 ++ doc/base/classes.xml | 44 ++++++++++++++++++++++++++++++++++++--- tools/doc/doc_data.cpp | 2 ++ tools/docdump/makehtml.py | 19 ++++++++++++++--- 7 files changed, 118 insertions(+), 8 deletions(-) diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 24012660d2f..58092efd4b8 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -579,7 +579,7 @@ Error HTTPClient::_get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received) void HTTPClient::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); + ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); ObjectTypeDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); ObjectTypeDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); ObjectTypeDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text); @@ -601,6 +601,8 @@ void HTTPClient::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_status"),&HTTPClient::get_status); ObjectTypeDB::bind_method(_MD("poll:Error"),&HTTPClient::poll); + ObjectTypeDB::bind_method(_MD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); + BIND_CONSTANT( METHOD_GET ); BIND_CONSTANT( METHOD_HEAD ); @@ -689,6 +691,16 @@ void HTTPClient::set_read_chunk_size(int p_size) { read_chunk_size=p_size; } +String HTTPClient::query_string_from_dict(const Dictionary& p_dict) { + String query = ""; + Array keys = p_dict.keys(); + for (int i = 0; i < keys.size(); ++i) { + query += "&" + String(keys[i]).http_escape() + "=" + String(p_dict[keys[i]]).http_escape(); + } + query.erase(0, 1); + return query; +} + HTTPClient::HTTPClient(){ tcp_connection = StreamPeerTCP::create_ref(); @@ -710,4 +722,3 @@ HTTPClient::~HTTPClient(){ } - diff --git a/core/io/http_client.h b/core/io/http_client.h index 21281f38c5c..b103dc43fc2 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -192,6 +192,8 @@ public: Error poll(); + String query_string_from_dict(const Dictionary& p_dict); + HTTPClient(); ~HTTPClient(); }; diff --git a/core/ustring.cpp b/core/ustring.cpp index 7582376fe0b..2dffdf066cd 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3079,6 +3079,48 @@ String String::world_wrap(int p_chars_per_line) const { return ret; } +String String::http_escape() const { + const CharString temp = utf8(); + String res; + for (int i = 0; i < length(); ++i) { + CharType ord = temp[i]; + if (ord == '.' || ord == '-' || ord == '_' || ord == '~' || + (ord >= 'a' && ord <= 'z') || + (ord >= 'A' && ord <= 'Z') || + (ord >= '0' && ord <= '9')) { + res += ord; + } else { + char h_Val[3]; + snprintf(h_Val, 3, "%.2X", ord); + res += "%"; + res += h_Val; + } + } + return res; +} + +String String::http_unescape() const { + String res; + for (int i = 0; i < length(); ++i) { + if (ord_at(i) == '%' && i+2 < length()) { + CharType ord1 = ord_at(i+1); + if ((ord1 >= '0' && ord1 <= '9') || (ord1 >= 'A' && ord1 <= 'Z')) { + CharType ord2 = ord_at(i+2); + if ((ord2 >= '0' && ord2 <= '9') || (ord2 >= 'A' && ord2 <= 'Z')) { + char bytes[2] = {ord1, ord2}; + res += (char)strtol(bytes, NULL, 16); + i+=2; + } + } else { + res += ord_at(i); + } + } else { + res += ord_at(i); + } + } + return String::utf8(res.ascii()); +} + String String::c_unescape() const { String escaped=*this; diff --git a/core/ustring.h b/core/ustring.h index fa25a07eb07..2f3c4bff4d7 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -207,6 +207,8 @@ public: String xml_escape(bool p_escape_quotes=false) const; String xml_unescape() const; + String http_escape() const; + String http_unescape() const; String c_escape() const; String c_unescape() const; String world_wrap(int p_chars_per_line) const; diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 24c5799350f..e805adce6dc 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -12518,9 +12518,13 @@ This approximation makes straight segments between each point, then subdivides t - + + Connect to a host. This needs to be done before any requests are sent. +The host should not have http:// prepended but will strip the protocol identifier if provided. + +verify_host will check the SSL identity of the host if set to true. @@ -12541,6 +12545,20 @@ This approximation makes straight segments between each point, then subdivides t + Sends a request to the connected host. The url is the what is normally behind the hostname, +i.e; +http://somehost.com/index.php +url would be "index.php" + +Headers are HTTP request headers + +To create a POST request with query strings to push to the server, do: +var fields = {"username" : "user", + "password" : "pass"} +var queryString = httpClient.query_string_from_dict(fields) +var headers = ["Content-Type: application/x-www-form-urlencoded", + "Content-Length: " + str(queryString.length())] +var result = httpClient.request(httpClient.METHOD_POST, "index.php", headers, queryString) @@ -12548,7 +12566,8 @@ This approximation makes straight segments between each point, then subdivides t - + + Stub function @@ -12557,6 +12576,7 @@ This approximation makes straight segments between each point, then subdivides t + Stub function @@ -12609,12 +12629,14 @@ This approximation makes straight segments between each point, then subdivides t + Sets the size of the buffer used and maximum bytes to read per iteration + If set to true, execute will wait until all data is read from the response. @@ -12627,14 +12649,30 @@ This approximation makes straight segments between each point, then subdivides t + Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates. - + + This needs to be called in order to have any request processed. Check results with [method get_status] + + + + + + + Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary. + +var fields = {"username": "user", "password": "pass"} +String queryString = httpClient.query_string_from_dict(fields) + +returns:= "username=user&password=pass" + + diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 432f3586275..c1d3e5e3148 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -189,9 +189,11 @@ void DocData::generate(bool p_basic_types) { arginfo=E->get().return_val; if (arginfo.type==Variant::NIL) continue; +#ifdef DEBUG_METHODS_ENABLED if (m && m->get_return_type()!=StringName()) method.return_type=m->get_return_type(); else +#endif method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type); } else { diff --git a/tools/docdump/makehtml.py b/tools/docdump/makehtml.py index d533ca1b8b7..9b9c62f33b1 100644 --- a/tools/docdump/makehtml.py +++ b/tools/docdump/makehtml.py @@ -1,5 +1,19 @@ import sys import xml.etree.ElementTree as ET +from xml.sax.saxutils import escape, unescape + +html_escape_table = { + '"': """, + "'": "'" +} + +html_unescape_table = {v:k for k, v in html_escape_table.items()} + +def html_escape(text): + return escape(text, html_escape_table) + +def html_unescape(text): + return unescape(text, html_unescape_table) input_list = [] @@ -96,7 +110,7 @@ def make_html_class_list(class_list,columns): idx=0 for n in class_list: - col = idx/col_max + col = int(idx/col_max) if (col>=columns): col=columns-1 fit_columns[col]+=[n] @@ -299,6 +313,7 @@ def make_type(p_type,p_parent): def make_text_def(class_name,parent,text): + text = html_escape(text) pos=0 while(True): pos = text.find("[",pos) @@ -598,7 +613,6 @@ def make_html_class(node): descr=node.find("description") if (descr!=None and descr.text.strip()!=""): - h4=ET.SubElement(div,"h4") h4.text="Description:" @@ -644,7 +658,6 @@ def make_html_class(node): class_names=[] classes={} - for file in input_list: tree = ET.parse(file) doc=tree.getroot() From 30d488913197b6d84a6b2d106c266c7ae175cfa7 Mon Sep 17 00:00:00 2001 From: Aren Villanueva Date: Thu, 19 Nov 2015 20:34:52 +1100 Subject: [PATCH 5/6] Fixes https://github.com/godotengine/godot/issues/2821 --- tools/pe_bliss/SCsub | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/pe_bliss/SCsub b/tools/pe_bliss/SCsub index 34524f10efb..8173769c39c 100644 --- a/tools/pe_bliss/SCsub +++ b/tools/pe_bliss/SCsub @@ -1,5 +1,6 @@ Import('env') env.add_source_files(env.tool_sources,"*.cpp") +env.Append(LIBS=["iconv"]) Export('env') From bc3b5847b0fa8d91edb4f6774e5699f4dea567f4 Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Thu, 19 Nov 2015 09:56:04 -0300 Subject: [PATCH 6/6] Fix SplitContainer bool properties --- scene/gui/split_container.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index d7ee7a6b863..49067bb3a02 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -435,8 +435,8 @@ void SplitContainer::_bind_methods() { ADD_SIGNAL( MethodInfo("dragged",PropertyInfo(Variant::INT,"offset"))); ADD_PROPERTY( PropertyInfo(Variant::INT,"split/offset"),_SCS("set_split_offset"),_SCS("get_split_offset")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"split/collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"split/dragger_visible"),_SCS("set_dragger_visible"),_SCS("is_dragger_visible")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"split/collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"split/dragger_visible"),_SCS("set_dragger_visible"),_SCS("is_dragger_visible")); }