From f870298e5de22d685532973f3b003bd00b6dc77c Mon Sep 17 00:00:00 2001 From: Apex Liu Date: Tue, 17 May 2022 23:50:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E5=88=B03.6.1-a2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 ++- build/builder/build-assist.py | 38 +----------------- build/builder/core/ver.py | 6 +-- client/tp-player/thr_data.cpp | 28 +++++++------ .../TP-Assist.xcodeproj/project.pbxproj | 12 ++++-- client/tp_assist_macos/src/csrc/ts_ver.h | 12 +++--- .../tp_assist_macos/src/csrc/ts_ws_client.cpp | 2 +- client/tp_assist_win/tp_assist.rc | Bin 8606 -> 8606 bytes client/tp_assist_win/ts_ver.h | 2 +- dist/client/windows/assist/installer.nsi | Bin 2938 -> 2938 bytes server/share/assist/README.txt | 4 ++ server/tp_core/core/tp_core.rc | Bin 5146 -> 5146 bytes server/tp_core/core/ts_ver.h | 2 +- server/www/teleport/webroot/app/app_ver.py | 6 +-- .../webroot/app/base/assist_bridge.py | 4 +- version.in | 10 ++--- 16 files changed, 56 insertions(+), 76 deletions(-) create mode 100644 server/share/assist/README.txt diff --git a/.gitignore b/.gitignore index 90863ba..283ad00 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,8 @@ __pycache__ /server/share/db /server/share/log /server/share/replay +/server/share/assist/*.exe +/server/share/assist/*.dmg # for generated files. @@ -85,9 +87,11 @@ __pycache__ # for not finished code /common/libex/test /client/tp_rdp -/server/tp_core/protocol/rdp /client/tools/tprdp /client/build-tp-player-* +/client/tp_assist_macos/src/tp-player.app +/server/tp_core/protocol/rdp +/server/hot-fix /server/tools/tpr2mp4 # for MacOS. diff --git a/build/builder/build-assist.py b/build/builder/build-assist.py index d7f3c16..6373b87 100644 --- a/build/builder/build-assist.py +++ b/build/builder/build-assist.py @@ -179,7 +179,7 @@ class BuilderMacOS(BuilderBase): # copy all files of tp-player. configuration = ctx.target_path.capitalize() player_path = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path) - assist_path = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'build', configuration, 'TP-Assist.app') + assist_path = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'build', configuration, 'TP-Assist.app', 'Contents', 'Resources') utils.copy_ex(player_path, assist_path, 'tp-player.app') json_file = os.path.join(env.root_path, 'dist', 'client', 'macos', 'dmg.json') @@ -190,42 +190,6 @@ class BuilderMacOS(BuilderBase): utils.make_dmg(json_file, dmg_file) utils.ensure_file_exists(dmg_file) - @staticmethod - def _build_installer(): - return - # tmp_path = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist') - # tmp_app_path = os.path.join(tmp_path, 'apps') - # tmp_cfg_path = os.path.join(tmp_app_path, 'cfg') - # - # if os.path.exists(tmp_app_path): - # utils.remove(tmp_app_path) - # - # utils.makedirs(tmp_app_path) - # utils.makedirs(tmp_cfg_path) - # - # utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe') - # utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'cfg'), tmp_cfg_path, ('tp-assist.default.json', 'tp-assist.json')) - # - # utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist_win'), tmp_app_path, 'site') - # - # utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty')) - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe') - # - # utils.makedirs(os.path.join(tmp_app_path, 'tools', 'winscp')) - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'WinSCP.exe') - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'license.txt') - # - # utils.makedirs(os.path.join(tmp_app_path, 'tools', 'tprdp')) - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-client.exe') - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-replay.exe') - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'libeay32.dll') - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'ssleay32.dll') - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'msvcr120.dll') - # - # utils.copy_file(os.path.join(env.root_path, 'client', 'tools'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs') - # - # utils.nsis_build(os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi')) - class BuilderLinux(BuilderBase): def __init__(self): diff --git a/build/builder/core/ver.py b/build/builder/core/ver.py index 06bb397..0eca76b 100644 --- a/build/builder/core/ver.py +++ b/build/builder/core/ver.py @@ -1,4 +1,4 @@ # -*- coding: utf8 -*- -VER_TP_SERVER = "3.6.0" -VER_TP_ASSIST = "3.6.0" -VER_TP_STATE = "a1" +VER_TP_SERVER = "3.6.1" +VER_TP_ASSIST = "3.6.1" +VER_TP_STATE = "a2" diff --git a/client/tp-player/thr_data.cpp b/client/tp-player/thr_data.cpp index 09ba1ed..90d4866 100644 --- a/client/tp-player/thr_data.cpp +++ b/client/tp-player/thr_data.cpp @@ -71,17 +71,21 @@ static QImage* _rdpimg2QImage(int w, int h, int bitsPerPixel, bool isCompressed, } } -static QImage* _raw2QImage(int w, int h, const uint8_t* dat, uint32_t len) { - QImage* out; - +static QImage* _raw2QImage(int w, int h, const uint8_t* dat, uint32_t /*len*/) { // TODO: 这里需要进一步优化,直接操作QImage的buffer。 - out = new QImage(w, h, QImage::Format_RGB16); + + uint16_t a = 0; + uint8_t r = 0; + uint8_t g = 0; + uint8_t b = 0; + + QImage* out = new QImage(w, h, QImage::Format_RGB16); for(int y = 0; y < h; y++) { for(int x = 0; x < w; x++) { - uint16 a = ((uint16*)dat)[y * w + x]; - uint8 r = ((a & 0xf800) >> 11) * 255 / 31; - uint8 g = ((a & 0x07e0) >> 5) * 255 / 63; - uint8 b = (a & 0x001f) * 255 / 31; + a = ((uint16_t*)dat)[y * w + x]; + r = ((a & 0xf800) >> 11) * 255 / 31; + g = ((a & 0x07e0) >> 5) * 255 / 63; + b = (a & 0x001f) * 255 / 31; out->setPixelColor(x, y, QColor(r,g,b)); } } @@ -375,7 +379,7 @@ void ThrData::_run() { // 拖动滚动条后,需要显示一次关键帧数据,然后跳过后续关键帧。 if(pkg.type == TS_RECORD_TYPE_RDP_KEYFRAME) { - qDebug("----key frame: %ld, processed=%" PRId64 ", pkg.size=%d", pkg.time_ms, file_processed, pkg.size); + qDebug("----key frame: %u, processed=%" PRId64 ", pkg.size=%d", pkg.time_ms, file_processed, pkg.size); if(m_need_show_kf) { m_need_show_kf = false; qDebug("++ show keyframe."); @@ -511,7 +515,7 @@ UpdateData* ThrData::_parse(const TS_RECORD_PKG& pkg, const QByteArray& data) { } else if(pkg.type == TS_RECORD_TYPE_RDP_KEYFRAME) { UpdateData* ud = new UpdateData(TYPE_IMAGE, pkg.time_ms); - const TS_RECORD_RDP_KEYFRAME_INFO* info = reinterpret_cast(data.data()); + // const TS_RECORD_RDP_KEYFRAME_INFO* info = reinterpret_cast(data.data()); const uint8_t* data_buf = reinterpret_cast(data.data() + sizeof(TS_RECORD_RDP_KEYFRAME_INFO)); uint32_t data_len = data.size() - sizeof(TS_RECORD_RDP_KEYFRAME_INFO); @@ -558,7 +562,7 @@ UpdateData* ThrData::_parse(const TS_RECORD_PKG& pkg, const QByteArray& data) { void ThrData::restart(uint32_t start_ms) { - qDebug("restart at %ld ms", start_ms); + qDebug("restart at %u ms", start_ms); // 让处理线程处理完当前循环,然后等待 m_need_restart = true; @@ -590,7 +594,7 @@ void ThrData::restart(uint32_t start_ms) { if(i > 0) i--; - qDebug("restart acturelly at %ld ms, kf: %d", m_kf[i].time_ms, i); + qDebug("restart acturelly at %u ms, kf: %ld", m_kf[i].time_ms, i); // 指定要播放的数据的开始位置 m_offset = m_kf[i].offset; diff --git a/client/tp_assist_macos/TP-Assist.xcodeproj/project.pbxproj b/client/tp_assist_macos/TP-Assist.xcodeproj/project.pbxproj index 3f020da..ab8e3e8 100644 --- a/client/tp_assist_macos/TP-Assist.xcodeproj/project.pbxproj +++ b/client/tp_assist_macos/TP-Assist.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 7A18188F1F7D5D7F00F3C882 /* AppDelegate-C-Interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A18188E1F7D5D7F00F3C882 /* AppDelegate-C-Interface.cpp */; }; 7A1F87B1215D5A1600B69F88 /* StatusIconAlt@2X.png in Resources */ = {isa = PBXBuildFile; fileRef = 7A1F87AF215D5A1600B69F88 /* StatusIconAlt@2X.png */; }; 7A1F87B2215D5A1600B69F88 /* StatusIcon@2X.png in Resources */ = {isa = PBXBuildFile; fileRef = 7A1F87B0215D5A1600B69F88 /* StatusIcon@2X.png */; }; + 7A2034FB2833F355009E1491 /* tp-player.app in Resources */ = {isa = PBXBuildFile; fileRef = 7A2034FA2833F355009E1491 /* tp-player.app */; }; 7A27E4A91F6A8EEC004FDE5D /* ts_env.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A27E4A71F6A8EEC004FDE5D /* ts_env.cpp */; }; 7A7C6C9121973C24006869D9 /* StatusIconAlt@3X.png in Resources */ = {isa = PBXBuildFile; fileRef = 7A7C6C8F21973C24006869D9 /* StatusIconAlt@3X.png */; }; 7A7C6C9221973C24006869D9 /* StatusIcon@3X.png in Resources */ = {isa = PBXBuildFile; fileRef = 7A7C6C9021973C24006869D9 /* StatusIcon@3X.png */; }; @@ -72,6 +73,7 @@ 7A1F87AA215D574500B69F88 /* version.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; name = version.h; path = ../../../../external/jsoncpp/include/json/version.h; sourceTree = ""; }; 7A1F87AF215D5A1600B69F88 /* StatusIconAlt@2X.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "StatusIconAlt@2X.png"; sourceTree = ""; }; 7A1F87B0215D5A1600B69F88 /* StatusIcon@2X.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "StatusIcon@2X.png"; sourceTree = ""; }; + 7A2034FA2833F355009E1491 /* tp-player.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; path = "tp-player.app"; sourceTree = ""; }; 7A27E4A61F6A899B004FDE5D /* ts_const.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ts_const.h; sourceTree = ""; }; 7A27E4A71F6A8EEC004FDE5D /* ts_env.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ts_env.cpp; sourceTree = ""; }; 7A27E4A81F6A8EEC004FDE5D /* ts_env.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ts_env.h; sourceTree = ""; }; @@ -312,6 +314,7 @@ C149EC0415D5214600B1F558 /* Supporting Files */ = { isa = PBXGroup; children = ( + 7A2034FA2833F355009E1491 /* tp-player.app */, C159DC2715D5DE7F00F5DE24 /* teleport.icns */, C149EC0515D5214600B1F558 /* TP-Assist-Info.plist */, C149EC0615D5214600B1F558 /* InfoPlist.strings */, @@ -393,6 +396,7 @@ 0ADB3B0D178EF8DB004E9BB9 /* StatusIcon.png in Resources */, 7A1F87B2215D5A1600B69F88 /* StatusIcon@2X.png in Resources */, 7A7C6C9221973C24006869D9 /* StatusIcon@3X.png in Resources */, + 7A2034FB2833F355009E1491 /* tp-player.app in Resources */, 0ADB3B0C178EF8DB004E9BB9 /* StatusIconAlt.png in Resources */, 7A1F87B1215D5A1600B69F88 /* StatusIconAlt@2X.png in Resources */, 7A7C6C9121973C24006869D9 /* StatusIconAlt@3X.png in Resources */, @@ -586,7 +590,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3.6.0; + CURRENT_PROJECT_VERSION = 3.6.1; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/TP-Assist-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -604,7 +608,7 @@ INFOPLIST_FILE = "src/TP-Assist-Info.plist"; LIBRARY_SEARCH_PATHS = ../../external/macos/release/lib; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 3.6.1; PRODUCT_BUNDLE_IDENTIFIER = "teleport.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; VALID_ARCHS = x86_64; @@ -617,7 +621,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3.6.0; + CURRENT_PROJECT_VERSION = 3.6.1; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/TP-Assist-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -634,7 +638,7 @@ INFOPLIST_FILE = "src/TP-Assist-Info.plist"; LIBRARY_SEARCH_PATHS = ../../external/macos/release/lib; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 3.6.0; + MARKETING_VERSION = 3.6.1; PRODUCT_BUNDLE_IDENTIFIER = "teleport.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; VALID_ARCHS = x86_64; diff --git a/client/tp_assist_macos/src/csrc/ts_ver.h b/client/tp_assist_macos/src/csrc/ts_ver.h index c86e996..fbc6728 100644 --- a/client/tp_assist_macos/src/csrc/ts_ver.h +++ b/client/tp_assist_macos/src/csrc/ts_ver.h @@ -1,6 +1,6 @@ -#ifndef __TS_ASSIST_VER_H__ -#define __TS_ASSIST_VER_H__ - -#define TP_ASSIST_VER L"3.6.0" - -#endif // __TS_ASSIST_VER_H__ +#ifndef __TS_ASSIST_VER_H__ +#define __TS_ASSIST_VER_H__ + +#define TP_ASSIST_VER L"3.6.1" + +#endif // __TS_ASSIST_VER_H__ diff --git a/client/tp_assist_macos/src/csrc/ts_ws_client.cpp b/client/tp_assist_macos/src/csrc/ts_ws_client.cpp index 8b7e93f..5799674 100644 --- a/client/tp_assist_macos/src/csrc/ts_ws_client.cpp +++ b/client/tp_assist_macos/src/csrc/ts_ws_client.cpp @@ -465,7 +465,7 @@ void TsWsClient::_rpc_func_replay_rdp(ex_astr& buf, AssistMessage& msg_req, Json ex_astrs s_argv; ex_wstr w_exec_file = g_env.m_bundle_path; - ex_path_join(w_exec_file, false, L"tp-player.app", L"Contents", L"MacOS", L"tp-player", nullptr); + ex_path_join(w_exec_file, false, L"Contents", L"Resources", L"tp-player.app", L"Contents", L"MacOS", L"tp-player", nullptr); ex_astr exec_file; ex_wstr2astr(w_exec_file, exec_file); diff --git a/client/tp_assist_win/tp_assist.rc b/client/tp_assist_win/tp_assist.rc index 76388273875ba434bbd94ed654695e6194f82cf1..5a799a772ba7d486d9e201eeda1ee2b083ecf1a0 100644 GIT binary patch delta 70 zcmbQ|JkNPUhy<%4gARki&5a^3IZ;G-@+?`Q J&9h`#SO71}4-NnT delta 68 zcmbQ|JkNPUhy=R`g9smFU diff --git a/server/tp_core/core/ts_ver.h b/server/tp_core/core/ts_ver.h index 7a8973d..f70f4f6 100644 --- a/server/tp_core/core/ts_ver.h +++ b/server/tp_core/core/ts_ver.h @@ -1,6 +1,6 @@ #ifndef __TS_SERVER_VER_H__ #define __TS_SERVER_VER_H__ -#define TP_SERVER_VER L"3.6.0" +#define TP_SERVER_VER L"3.6.1" #endif // __TS_SERVER_VER_H__ diff --git a/server/www/teleport/webroot/app/app_ver.py b/server/www/teleport/webroot/app/app_ver.py index 561e380..8f5553c 100644 --- a/server/www/teleport/webroot/app/app_ver.py +++ b/server/www/teleport/webroot/app/app_ver.py @@ -1,4 +1,4 @@ # -*- coding: utf8 -*- -TP_SERVER_VER = "3.6.0" -TP_ASSIST_REQUIRE_VER = "3.6.0" -TP_STATE_VER = "a1" +TP_SERVER_VER = "3.6.1" +TP_ASSIST_REQUIRE_VER = "3.6.1" +TP_STATE_VER = "a2" diff --git a/server/www/teleport/webroot/app/base/assist_bridge.py b/server/www/teleport/webroot/app/base/assist_bridge.py index 28404f3..85424b7 100644 --- a/server/www/teleport/webroot/app/base/assist_bridge.py +++ b/server/www/teleport/webroot/app/base/assist_bridge.py @@ -190,7 +190,7 @@ class TPAssistBridge(object): caller.send_response(assist_msg, TPE_OK, data=param) def on_disconnect(self, caller): - log.d('assist-ws-disconnect:', caller.assist_id) + log.d('assist-ws {} disconnected\n'.format(caller.assist_id)) with self._lock: if caller.client_type == AssistInfo.WS_CLIENT_WEB: if caller in self._ws_web: @@ -198,7 +198,7 @@ class TPAssistBridge(object): return elif caller.client_type == AssistInfo.WS_CLIENT_ASSIST: if caller not in self._ws_assist: - log.e('assist-ws disconnected, but not in charge.\n') + log.e('assist-ws {} disconnected, but not in charge.\n'.format(caller.assist_id)) return assist_id = self._ws_assist[caller] del self._ws_assist[caller] diff --git a/version.in b/version.in index 71078cf..b9ee605 100644 --- a/version.in +++ b/version.in @@ -10,9 +10,9 @@ Minor: 次版本号。如果两个程序集的名称和主版本号相同,而 Revision: 修订号。主版本号和次版本号都相同但修订号不同的程序集应是完全可互换的。 这适用于修复以前发布的程序集中的错误或安全漏洞。 -TP_SERVER 3.6.0 # 整个服务端打包的版本 -TP_TPCORE 3.6.0 # 核心服务 tp_core 的版本 +TP_SERVER 3.6.1 # 整个服务端打包的版本 +TP_TPCORE 3.6.1 # 核心服务 tp_core 的版本 TP_TPWEB 3.1.0 # web服务 tp_web 的版本(一般除非升级Python,否则不会变化) -TP_ASSIST 3.6.0 # 助手版本 -TP_ASSIST_REQUIRE 3.6.0 # 适配的助手最低版本 -TP_STATE a1 # 版本状态,可以是 beta1,rc2 等,用于打包文件名及部分界面。如果是 release 则界面上不显示。 +TP_ASSIST 3.6.1 # 助手版本 +TP_ASSIST_REQUIRE 3.6.1 # 适配的助手最低版本 +TP_STATE a2 # 版本状态,可以是 beta1,rc2 等,用于打包文件名及部分界面。如果是 release 则界面上不显示。