From 3d4206ba93a036456b93d01ddb008d7b20f633ae Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 4 Dec 2024 12:24:12 +0800 Subject: [PATCH] Updated site. Updated httplib to 0.18.3. --- Docs/i18n/zh-Hans/code.json | 12 ++-- .../src/components/HomepageFeatures/index.tsx | 64 ++++++++++-------- .../HomepageFeatures/styles.module.css | 40 +++++++++-- Docs/src/pages/index.module.css | 5 +- Docs/src/pages/index.tsx | 3 +- Docs/static/img/pix-dora.png | Bin 0 -> 8447 bytes Docs/static/img/pix-toto.png | Bin 0 -> 7248 bytes Source/3rdParty/httplib/httplib.h | 55 +++++++++------ 8 files changed, 116 insertions(+), 63 deletions(-) create mode 100644 Docs/static/img/pix-dora.png create mode 100644 Docs/static/img/pix-toto.png diff --git a/Docs/i18n/zh-Hans/code.json b/Docs/i18n/zh-Hans/code.json index a664db3fc..afba29711 100644 --- a/Docs/i18n/zh-Hans/code.json +++ b/Docs/i18n/zh-Hans/code.json @@ -4,15 +4,15 @@ "description": "The feature title one in front page" }, "feature_description_one": { - "message": "Dora SSR 的理念:开发游戏是一种更有深度地玩游戏的方式。", + "message": "开发游戏是一种更有深度地玩游戏的方式。", "description": "The feature description one in front page" }, "feature_title_two": { - "message": "不限设备,不限场地", + "message": "不限设备,或场地", "description": "The feature title two in front page" }, "feature_description_two": { - "message": "Dora SSR 的目标:在任何电子设备上极速提供开箱即用的游戏开发环境。", + "message": "在任何电子设备上极速提供开箱即用的游戏开发环境。", "description": "The feature description two in front page" }, "feature_title_three": { @@ -20,7 +20,7 @@ "description": "The feature title three in front page" }, "feature_description_three": { - "message": "Dora SSR 提供多元的编程语言支持,满足你多样的编程口味!", + "message": "提供多元的编程语言支持,满足你多样的编程口味!", "description": "The feature description three in front page" }, "theme.ErrorPageContent.title": { @@ -446,11 +446,11 @@ "description": "The engine feature description Rust Scripting Support in front page" }, "promotion_section_title": { - "message": "为什么选择 Dora SSR", + "message": "为什么选择 Dora", "description": "The promotion section title in front page" }, "feature_section_title": { - "message": "部分引擎功能特性", + "message": "部分引擎功能", "description": "The feature section title in front page" }, "engine_feature_title_cross_platform_game_dev_support": { diff --git a/Docs/src/components/HomepageFeatures/index.tsx b/Docs/src/components/HomepageFeatures/index.tsx index fca446e06..935cfae48 100644 --- a/Docs/src/components/HomepageFeatures/index.tsx +++ b/Docs/src/components/HomepageFeatures/index.tsx @@ -3,6 +3,9 @@ import clsx from 'clsx'; import styles from './styles.module.css'; import Translate from '@docusaurus/Translate'; +const pix_dora = require('@site/static/img/pix-dora.png'); +const pix_toto = require('@site/static/img/pix-toto.png'); + const feature_img_one = require('@site/static/img/1.png'); const feature_img_two = require('@site/static/img/2.png'); const feature_img_three = require('@site/static/img/3.png'); @@ -15,23 +18,6 @@ type FeatureItem = { }; const PromotionFeatureList: FeatureItem[] = [ - { - title: ( - - Play as You Create - - ), - image: feature_title_one, - description: ( - - What Dora SSR is for: Making Game Development a New Gaming. - - ), - }, { title: ( - Satisfy your coding cravings with Dora SSR's versatile language support! + Satisfy your coding cravings with versatile language support! + + ), + }, + { + title: ( + + Play as You Create + + ), + image: feature_title_one, + description: ( + + Making Game Development a New Gaming. ), }, @@ -68,13 +71,15 @@ const PromotionFeatureList: FeatureItem[] = [ function PromotionFeature({title, Svg, image, description}: FeatureItem) { return ( -
-
- {Svg ? : image} -
-
-

{title}

-

{description}

+
+
+
+ {Svg ? : image} +
+
+

{title}

+

{description}

+
); @@ -169,8 +174,8 @@ const EngineFeatureList: FeatureItem[] = [ { title: ( + id='engine_feature_platformer_game_support' + description='The engine feature title Platformer Game Support in front page'> Platformer Game Support ), @@ -363,8 +368,10 @@ export default function HomepageFeatures(): JSX.Element { - Why Dora SSR + Why Dora + pix_dora + SSR
{PromotionFeatureList.map((props, idx) => ( @@ -374,6 +381,7 @@ export default function HomepageFeatures(): JSX.Element {

+ pix_toto diff --git a/Docs/src/components/HomepageFeatures/styles.module.css b/Docs/src/components/HomepageFeatures/styles.module.css index 6fac5679f..39a9bcc01 100644 --- a/Docs/src/components/HomepageFeatures/styles.module.css +++ b/Docs/src/components/HomepageFeatures/styles.module.css @@ -16,13 +16,41 @@ --feature-card-description-color: var(--feature-card-description-color-dark); } +.promotionFeature { + display: flex; + flex-direction: row; + border: 2px solid #f9d86d; /* 黄色边框 */ + border-radius: 15px; + box-shadow: 0 4px 8px var(--feature-card-shadow); + width: 100%; + height: 100%; + padding-right: 1rem; +} + +.cardText { + width: 100%; + padding-top: 2rem; +} + +.cardText h3 { + color: var(--ifm-color-primary); + font-size: 20px; + margin-bottom: 5px; +} + +.cardText p { + font-size: 14px; + line-height: 1.6; +} + .features { - padding: 4rem 0; + padding: 4rem 0 0 0; } .featureCard { background-color: var(--feature-card-bg); border-radius: 8px; + border: 1px solid var(--feature-card-shadow); box-shadow: 0 2px 4px var(--feature-card-shadow); padding: 1.5rem; transition: transform 0.2s ease-in-out; @@ -45,8 +73,8 @@ } .featureImg { - height: 90%; - width: 90%; + width: 100%; + height: auto; max-width: 500px; } @@ -74,7 +102,7 @@ .featureSection { margin-bottom: 2rem; padding-bottom: 2rem; - border-bottom: 1px solid #eaeaea; + border-bottom: 1px solid var(--feature-card-shadow); } .featureSection:last-of-type { @@ -84,3 +112,7 @@ .featureSection h2 { margin-bottom: 1.5rem; } + +.pixImg { + width: 40px; +} diff --git a/Docs/src/pages/index.module.css b/Docs/src/pages/index.module.css index 0f0638849..0b3fc9469 100644 --- a/Docs/src/pages/index.module.css +++ b/Docs/src/pages/index.module.css @@ -20,16 +20,17 @@ .heroTitle { font-size: 5rem; color: var(--ifm-color-title); + padding-bottom: 1rem; } .heroSubtitle { - padding-bottom: 1rem; + padding-bottom: 2rem; color: var(--ifm-color-subtitle); } @media screen and (max-width: 996px) { .heroBanner { - padding: 2rem; + padding: 2rem 0; } } diff --git a/Docs/src/pages/index.tsx b/Docs/src/pages/index.tsx index ad36eeeeb..6e337d6d9 100644 --- a/Docs/src/pages/index.tsx +++ b/Docs/src/pages/index.tsx @@ -18,7 +18,7 @@ function HomepageHeader() {

The Dora game engine, Special Super Rare edition.

diff --git a/Docs/static/img/pix-dora.png b/Docs/static/img/pix-dora.png new file mode 100644 index 0000000000000000000000000000000000000000..85d8e1dcea54663ea0893b0abb688a908270e4d4 GIT binary patch literal 8447 zcmeHNc{tSVyZ=gAT5JWrc6RLgUqC%Va9U4U*2<_|Ic;3=l6Eb`Qy2sx$b$c=XvhW{kcE){meC2jyu}y z+Wz}?004F!wY78s03ISZIt2JYixynW0Gzf4n>&~TK;6|HD<`)Bz;?s478b{&Tx<{u zN3ARjbd3!RH1)J}0l@YOJ`e5YIx3MyZZm8dC~MOZrLlndyoe@ZU3$f;AxxXj~RH@j8JaxgMtw{+goQ#DfKPhy#UcgE$}iRX*k z$kbpaW|#@H z0@#vd8&ODMnY(YmEbAGtUVNj)OGy_vek+UiV`0u8^^+u5< zc^Uq>PAb9C08qa^ru8+-^;C#v;B|GqOPW)$z$e>R{@?qxJ>QUFy~16jHz%~jR4US? zRDE1ivvXmY6J)XjEwk&5j*wxt@}%y&0x2(XR ziyqQs#PZIs#c50O{AYxM4crEe=hq#ju+zP%*expr@~ zCGX1nB~ePA=aw?X-;X590qXli6$Il??WZs?J6_uGF85`=Ex3i}k}s`ckj=-|dL&em zaDg_Kdd*_aq;I!ZPHZ`#09YO2ojD>+=Y>7p`uM46Ga&qlcZ<1t`qsz*-A|WxU*oY< zkldZzc=xv(mudpkD*2-CiXKQYi1-b4G4Rs?BYv%my#ZUtcwBUZijwz!-~Q%^2=;Q1 zh`37{O2MK>=Fw%(Yto;2w^@iDm$@OZ#{yxyMf}L@U6)Fks?-_6X}ULE9rZgA*k#dl z*ZGVXM?8*SSx2z^*@=guA=~N$oQwo;SjlIvzUvvuYh7x3dNYDIL4<*I>dgNn>bc$Q zVufh3h$y@yQ%6+dxiumuMnzCmvHF_Wy)9>tyuT)QPrfC?Hm9P;dpDnzmG1FlH+H<1 z7r#7Nl1K0$7?f5y^B>1o9v*ZbR6n z5l5Uag%Fsfi~B9z+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zE~!U*ED0nwc$sJc4yb2^;b z%&>DMcnvZa2oqEoh!h4THc(8vwgZzqD8`>q-tT4wb+>0oZ%ATgy2Ly^FinCI-LonJ zQsY-^tPD4p2thUPn)vToHhut2+s#5$sEDD^j5deKc-7VC<9Hg0LOZd&IMsj45$Lo-eY683;OXc zp-AZMFSUu?Orj?W0yRc3$5!kHPdKRYOp5&tC>BeiqIrdg4~`H`A=!VIL80v&pqQFL z`DTeFlvO|>8bKVsO<}ck*bT$z8g;NPtpL*;#6b{Px;pGeZfFCeUuOfM!})y;$}5ZO zl3@9~2gzc6GaIb9_pp|2ZodNS>^%|&wqu~{#U49fV|0=KMits33SBq$;5Lk3$@n)9 zqf}$?`msk)-mkb#*{q0?=lhQ>J6(8AovO`fgyq41tjPa+cV*1reE04QPIIMhk|1-8 zzPbGlze5JEJZtmgoH{`$&x6)j5h$jCVb2y#1NNNzDi0L>Atz6|PSK9t3k9Ww>3w@4 zL0lTewHG)z^R~I|eW{v@-Y;?GgVkBayS| literal 0 HcmV?d00001 diff --git a/Source/3rdParty/httplib/httplib.h b/Source/3rdParty/httplib/httplib.h index 39609b227..26afd3d06 100644 --- a/Source/3rdParty/httplib/httplib.h +++ b/Source/3rdParty/httplib/httplib.h @@ -8,7 +8,7 @@ #ifndef CPPHTTPLIB_HTTPLIB_H #define CPPHTTPLIB_HTTPLIB_H -#define CPPHTTPLIB_VERSION "0.18.1" +#define CPPHTTPLIB_VERSION "0.18.3" /* * Configuration @@ -613,6 +613,7 @@ using Ranges = std::vector; struct Request { std::string method; std::string path; + Params params; Headers headers; std::string body; @@ -624,7 +625,6 @@ struct Request { // for server std::string version; std::string target; - Params params; MultipartFormDataMap files; Ranges ranges; Match matches; @@ -2275,7 +2275,7 @@ inline std::wstring u8string_to_wstring(const char *s) { wlen = ::MultiByteToWideChar( CP_UTF8, 0, s, len, const_cast(reinterpret_cast(ws.data())), wlen); - if (wlen != ws.size()) { ws.clear(); } + if (wlen != static_cast(ws.size())) { ws.clear(); } } return ws; } @@ -7432,9 +7432,13 @@ inline bool ClientImpl::send(Request &req, Response &res, Error &error) { #ifdef CPPHTTPLIB_OPENSSL_SUPPORT inline bool ClientImpl::is_ssl_peer_could_be_closed(SSL *ssl) const { + detail::set_nonblocking(socket_.sock, true); + auto se = detail::scope_exit( + [&]() { detail::set_nonblocking(socket_.sock, false); }); + char buf[1]; return !SSL_peek(ssl, buf, 1) && - SSL_get_error(ssl, 0) == SSL_ERROR_ZERO_RETURN; + SSL_get_error(ssl, 0) == SSL_ERROR_ZERO_RETURN; } #endif @@ -7452,9 +7456,7 @@ inline bool ClientImpl::send_(Request &req, Response &res, Error &error) { #ifdef CPPHTTPLIB_OPENSSL_SUPPORT if (is_alive && is_ssl()) { - if (is_ssl_peer_could_be_closed(socket_.ssl)) { - is_alive = false; - } + if (is_ssl_peer_could_be_closed(socket_.ssl)) { is_alive = false; } } #endif @@ -7813,7 +7815,13 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req, { detail::BufferStream bstrm; - const auto &path = url_encode_ ? detail::encode_url(req.path) : req.path; + const auto &path_with_query = + req.params.empty() ? req.path + : append_query_params(req.path, req.params); + + const auto &path = + url_encode_ ? detail::encode_url(path_with_query) : path_with_query; + detail::write_request_line(bstrm, req.method, path); header_writer_(bstrm, req.headers); @@ -7972,7 +7980,9 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req, // Body if ((res.status != StatusCode::NoContent_204) && req.method != "HEAD" && req.method != "CONNECT") { - auto redirect = 300 < res.status && res.status < 400 && follow_location_; + auto redirect = 300 < res.status && res.status < 400 && + res.status != StatusCode::NotModified_304 && + follow_location_; if (req.response_handler && !redirect) { if (!req.response_handler(res)) { @@ -7993,9 +8003,7 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req, : static_cast( [&](const char *buf, size_t n, uint64_t /*off*/, uint64_t /*len*/) { - if (res.body.size() + n > res.body.max_size()) { - return false; - } + assert(res.body.size() + n <= res.body.max_size()); res.body.append(buf, n); return true; }); @@ -8009,18 +8017,23 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req, if (res.has_header("Content-Length")) { if (!req.content_receiver) { - auto len = std::min(res.get_header_value_u64("Content-Length"), - res.body.max_size()); - if (len > 0) { res.body.reserve(len); } + auto len = res.get_header_value_u64("Content-Length"); + if (len > res.body.max_size()) { + error = Error::Read; + return false; + } + res.body.reserve(static_cast(len)); } } - int dummy_status; - if (!detail::read_content(strm, res, (std::numeric_limits::max)(), - dummy_status, std::move(progress), std::move(out), - decompress_)) { - if (error != Error::Canceled) { error = Error::Read; } - return false; + if (res.status != StatusCode::NotModified_304) { + int dummy_status; + if (!detail::read_content(strm, res, (std::numeric_limits::max)(), + dummy_status, std::move(progress), + std::move(out), decompress_)) { + if (error != Error::Canceled) { error = Error::Read; } + return false; + } } }