diff --git a/CHANGELOG b/CHANGELOG index 8fd6e034223b74ea0f49421f126d817e20123cf5..2414277458d4ddc062a7e0db5be55bb68ce9234e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,31 @@ +XEngine_APIService V3.2.0.1001 + +增加:编译开关日志提示 +增加:lua脚本功能开关编译选项 +修改:LUA,二维码和图像处理现在默认关闭 +修改:LUA,二维码和图像处理没有启用的时候返回501了 +修改:现在makefile支持linux和macos的编译开关了 +修改:不在需要bank和id处理的utf转换了 +修改:重新设计了语言翻译从有道改为百度 +修改:翻译语言日志提示 +修改:翻译类型使用枚举型替代 +修复:没有启用音频还开始录制的问题 +删除:lua init 变量 +删除:OPENCC库和相关代码已经被移除使用翻译替代 + +added:build switch tips +added:lua buid switch +modify:lua and qr and image switch defualt is close +modify:lua and qr and image reply is 501 when they is disable +modify:makefile support linux and macos for build switch +modify:does not need utf convert for bank and idcard +modify:Redesigning translation from youdao to baidu +modify:translation language tips +modify:translation type used enum instead. +fixed:not enable audio then start +delete:lua init value +delete:opencc library and code,use translation instead +====================================================================================== XEngine_APIService V3.1.0.1001 增加:为opencv和qr增加自定义编译开关 diff --git a/README.en.md b/README.en.md index 0b03c294e335597a8b0c59b6129f0e4911f1e116..cb286a824f57b32f52b8c13e3063657d781b5b2e 100644 --- a/README.en.md +++ b/README.en.md @@ -35,21 +35,20 @@ Support privatization deployment, free, safe, open source, controllable 14. Bank card verification 15. Exchange rate calculation (planned) 16. QR code generation and parse -17. Simplified and Traditional Conversion -18. Twenty-four solar terms (planned) -19. Xinhua Dictionary -20. Metering Conversion -21. network test -22. Distributed lock -23. short url creator and forward -24. local system time -25. math Calculation -26. log service -27. Plugin hot reload -28. Sensitive word detection -29. remote control(back management) -30. Image Process -31. process deamon +17. Twenty-four solar terms (planned) +18. Translation +19. Metering Conversion +20. network test +21. Distributed lock +22. short url creator and forward +23. local system time +24. math Calculation +25. log service +26. Plugin hot reload +27. Sensitive word detection +28. remote control(back management) +29. Image Process +30. process deamon ## install @@ -69,18 +68,18 @@ MYSQL database version 8.0 or above is required. Create a table through CreateDa Modify the database configuration in XSQL in the configuration file to your #### Windows -need to vcpkg configure third-part env.refer vcpkg install guide.after installed and execution:vcpkg.exe install lua:x86-windows opencc:x86-windows opencv[contrib]:x86-windows libqrencode:x86-windows lua:x64-windows opencc:x64-windows opencv[contrib]:x64-windows libqrencode:x64-windows +need to vcpkg configure third-part env.refer vcpkg install guide.after installed and execution:vcpkg.exe install lua:x86-windows opencv[contrib]:x86-windows libqrencode:x86-windows lua:x64-windows opencv[contrib]:x64-windows libqrencode:x64-windows use vs open and compile,suport windows 7sp1 and above Just Run it #### Linux -ubuntu:sudo apt install libopencc-dev +ubuntu:sudo apt install sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev centos:compile by self use makefile compile,UBUNTU22.04 x64 or RockyLinux 9 x64 Run it on the terminal #### Macos -install opencc:brew install opencc opencc opencv qrencode +install opencc:brew install lua opencv qrencode use makefile compile,mac 13 and above Run it on the terminal @@ -165,28 +164,16 @@ api:http://app.xyry.org:5501/api?function=bank¶ms1=6214832830000000 "msg":"success" } ``` -language -api:http://app.xyry.org:5501/api?function=language¶ms1=简体到繁体¶ms2=1 -```json -{ - "code":0, - "data":{ - "enType":1, - "tszDestStr":"簡體到繁體", - "tszSourceStr":"简体到繁体" - }, - "msg":"success" -} -``` translation -api:http://app.xyry.org:5501/api?function=translation¶ms1=中国¶ms2=0 +api:http://127.0.0.1:5501/api?function=translation&msg=中文翻译成英文&src=1&dst=2 ```json { "code":0, "data":{ - "enType":0, - "tszDestStr":"China", - "tszSourceStr":"中国" + "tszDestStr":"Translate from Chinese to English", + "tszFromStr":"zh", + "tszSourceStr":"中文翻译成英文", + "tszToStr":"en" }, "msg":"success" } diff --git a/README.md b/README.md index 5da6578e9ad6dacb3623ce68897bc3e8b35e2f97..3c544397817d67f5aaad03d7fb5f549cd01e0b19 100644 --- a/README.md +++ b/README.md @@ -34,21 +34,20 @@ c c++ interface api service 14. 银行卡验证 15. 汇率计算(计划中) 16. 二维码生成解析 -17. 简繁转换 -18. 二十四节气(计划中) -19. 新华词典 -20. 计量转换 -21. 网络测试 -22. 分布式锁API -23. 短连接生成和转发 -24. 本地标准时间 -25. 数学计算 -26. 日志服务 -27. 插件脚本热重载 -28. 敏感词检测 -29. 远程控制(后台管理) -30. 图像处理 -31. 进程守护 +17. 二十四节气(计划中) +18. 翻译 +19. 计量转换 +20. 网络测试 +21. 分布式锁API +22. 短连接生成和转发 +23. 本地标准时间 +24. 数学计算 +25. 日志服务 +26. 插件脚本热重载 +27. 敏感词检测 +28. 远程控制(后台管理) +29. 图像处理 +30. 进程守护 ## 安装教程 @@ -68,18 +67,18 @@ macos执行:./XEngine_LINEnv.sh -i 3 修改配置文件里面XSQL里面的数据库配置为你的 #### Windows -需要vcpkg配置第三方环境,具体参考vcpkg安装方式,安装好后执行:vcpkg.exe install lua:x86-windows opencc:x86-windows opencv[contrib]:x86-windows libqrencode:x86-windows lua:x64-windows opencc:x64-windows opencv[contrib]:x64-windows libqrencode:x64-windows +需要vcpkg配置第三方环境,具体参考vcpkg安装方式,安装好后执行:vcpkg.exe install lua:x86-windows opencv[contrib]:x86-windows libqrencode:x86-windows lua:x64-windows opencv[contrib]:x64-windows libqrencode:x64-windows 使用VS打开并且编译,支持WINDOWS 7SP1以上系统 直接运行即可 #### Linux -ubuntu:sudo apt install liblua5.3-dev libopencc-dev libopencv-dev libopencv-contrib-dev libqrencode-dev +ubuntu:sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev centos:需要自己编译 Linux使用Makefile编译,UBUNTU22.04 x64或者RockyLinux 9 x64 在控制台运行 #### Macos -安装opencc,执行命令:brew install lua opencc opencv qrencode +安装opencc,执行命令:brew install lua opencv qrencode 使用makefile编译,控制台运行,需要mac 13以及以上版本 在控制台运行 @@ -163,28 +162,16 @@ make FLAGS=CleanAll 清理编译 "msg":"success" } ``` -语言转换 -接口:http://app.xyry.org:5501/api?function=language¶ms1=简体到繁体¶ms2=1 -```json -{ - "code":0, - "data":{ - "enType":1, - "tszDestStr":"簡體到繁體", - "tszSourceStr":"简体到繁体" - }, - "msg":"success" -} -``` 翻译 -接口:http://app.xyry.org:5501/api?function=translation¶ms1=中国¶ms2=0 +接口:http://127.0.0.1:5501/api?function=translation&msg=中文翻译成英文&src=1&dst=2 ```json { "code":0, "data":{ - "enType":0, - "tszDestStr":"China", - "tszSourceStr":"中国" + "tszDestStr":"Translate from Chinese to English", + "tszFromStr":"zh", + "tszSourceStr":"中文翻译成英文", + "tszToStr":"en" }, "msg":"success" } diff --git a/XEngine_Docment/Docment_en.docx b/XEngine_Docment/Docment_en.docx index f555383ff79552d3ff097eb5e63f15440ca8a8f6..1cc98de38e1008d8e23ff3561fb8f001328dcdd7 100644 Binary files a/XEngine_Docment/Docment_en.docx and b/XEngine_Docment/Docment_en.docx differ diff --git a/XEngine_Docment/Docment_zh.docx b/XEngine_Docment/Docment_zh.docx index b562a6cdd7d435e464dcb9596808fda1f8b4b79e..1941bc638c0b79a42c3fa7e2e8f0a2bf06550aaf 100644 Binary files a/XEngine_Docment/Docment_zh.docx and b/XEngine_Docment/Docment_zh.docx differ diff --git a/XEngine_Release/XEngine_Config/XEngine_Config.json b/XEngine_Release/XEngine_Config/XEngine_Config.json index 6489ba6b72c9607b5a019077444d5d14a2bce254..02338b7eccbcab56f1b96f083eb77a113eb6234e 100644 --- a/XEngine_Release/XEngine_Config/XEngine_Config.json +++ b/XEngine_Release/XEngine_Config/XEngine_Config.json @@ -30,7 +30,11 @@ }, "XApi":{ "tszBankUrl":"https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?cardNo=%s&cardBinCheck=true", - "tszTranslationUrl":"http://fanyi.youdao.com/translate?&doctype=json&type=%s&i=%s" + "tszTranslationUrl":"https://fanyi-api.baidu.com/api/trans/vip/translate", + "st_TranslationInfo":{ + "appid":"20231228001924304", + "key":"udXGjpmNVeQHml1FjT8E" + } }, "XPlugin":{ "bEnable":true, @@ -38,7 +42,6 @@ "tszPluginLua":"./XEngine_Config/XEngine_PluginLua.json" }, "XConfig":{ - "tszConfigOPencc":"./XEngine_Config/XEngine_OPenccConfig.json", "tszConfigQRCode":"./XEngine_Config/XEngine_QRCode.json", "tszConfigDeamon":"./XEngine_Config/XEngine_DeamonConfig.json", "tszConfigHTTPMime":"./XEngine_Config/HttpMime.types", @@ -52,11 +55,12 @@ "tszUserName":"xyry", "tszUserPass":"11", "st_VerSwitch":{ - "bBackService":false, - "bDeamon":false + "bBackService":true, + "bDeamon":true } }, "XVer":[ + "3.2.0.1001 Build20231229", "3.1.0.1001 Build20231102", "3.0.0.1001 Build20230908", "2.11.0.1001 Build20230829", diff --git a/XEngine_Release/XEngine_Config/XEngine_OPenccConfig.json b/XEngine_Release/XEngine_Config/XEngine_OPenccConfig.json deleted file mode 100644 index e361bdc01e391b2cf53dd9395a13af830eba4571..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/XEngine_OPenccConfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "tszFiles2t":"./XEngine_Config/opencc/s2t.json", - "tszFilet2s":"./XEngine_Config/opencc/t2s.json", - "tszFiles2tw":"./XEngine_Config/opencc/s2tw.json", - "tszFiletw2s":"./XEngine_Config/opencc/tw2s.json", - "tszFiles2hk":"./XEngine_Config/opencc/s2hk.json", - "tszFilehk2s":"./XEngine_Config/opencc/hk2s.json", - "tszFiles2twp":"./XEngine_Config/opencc/s2twp.json", - "tszFiletw2sp":"./XEngine_Config/opencc/tw2sp.json", - "tszFilet2tw":"./XEngine_Config/opencc/t2tw.json", - "tszFilehk2t":"./XEngine_Config/opencc/hk2t.json", - "tszFilet2hk":"./XEngine_Config/opencc/t2hk.json", - "tszFilet2jp":"./XEngine_Config/opencc/t2jp.json", - "tszFilejp2t":"./XEngine_Config/opencc/jp2t.json", - "tszFiletw2t":"./XEngine_Config/opencc/tw2t.json" -} \ No newline at end of file diff --git a/XEngine_Release/XEngine_Config/opencc/HKVariants.ocd2 b/XEngine_Release/XEngine_Config/opencc/HKVariants.ocd2 deleted file mode 100644 index 81f25dc33fbcd944361055cd19f23480b5fc2c5d..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/HKVariants.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/HKVariantsRev.ocd2 b/XEngine_Release/XEngine_Config/opencc/HKVariantsRev.ocd2 deleted file mode 100644 index ba20b8fb357228c5e97a15991154c19f9d7126c4..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/HKVariantsRev.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/HKVariantsRevPhrases.ocd2 b/XEngine_Release/XEngine_Config/opencc/HKVariantsRevPhrases.ocd2 deleted file mode 100644 index e608d58b8c92aeeb7a38977788b6af338890a7a7..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/HKVariantsRevPhrases.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/JPShinjitaiCharacters.ocd2 b/XEngine_Release/XEngine_Config/opencc/JPShinjitaiCharacters.ocd2 deleted file mode 100644 index 07fabadedead8045a2348d3f8208c79e5adf67ca..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/JPShinjitaiCharacters.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/JPShinjitaiPhrases.ocd2 b/XEngine_Release/XEngine_Config/opencc/JPShinjitaiPhrases.ocd2 deleted file mode 100644 index f7984d8f6b0daaa01c7a2a013df587237b673126..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/JPShinjitaiPhrases.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/JPVariants.ocd2 b/XEngine_Release/XEngine_Config/opencc/JPVariants.ocd2 deleted file mode 100644 index fbd6ef23c9dd81e682ad3a66889261056243d991..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/JPVariants.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/JPVariantsRev.ocd2 b/XEngine_Release/XEngine_Config/opencc/JPVariantsRev.ocd2 deleted file mode 100644 index 7a7e05454846a32741f9e96a3aa00dbd281d8747..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/JPVariantsRev.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/STCharacters.ocd2 b/XEngine_Release/XEngine_Config/opencc/STCharacters.ocd2 deleted file mode 100644 index 3f0a5b1053a037db00a4744bb4a6134a5dd96744..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/STCharacters.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/STPhrases.ocd2 b/XEngine_Release/XEngine_Config/opencc/STPhrases.ocd2 deleted file mode 100644 index 13cd9be046c2ff18ce6d52ef70d94737b3655510..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/STPhrases.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TSCharacters.ocd2 b/XEngine_Release/XEngine_Config/opencc/TSCharacters.ocd2 deleted file mode 100644 index e07fffe4b6554fd29b8cd5a3f43feb888be8dd0c..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TSCharacters.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TSPhrases.ocd2 b/XEngine_Release/XEngine_Config/opencc/TSPhrases.ocd2 deleted file mode 100644 index e3b832f80c31eeea3690f2502fe96c7b1c563d3d..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TSPhrases.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TWPhrases.ocd2 b/XEngine_Release/XEngine_Config/opencc/TWPhrases.ocd2 deleted file mode 100644 index df2ba70a944da1e9ed589ea5d44c83c4b9cdb26a..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TWPhrases.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TWPhrasesRev.ocd2 b/XEngine_Release/XEngine_Config/opencc/TWPhrasesRev.ocd2 deleted file mode 100644 index 06cd1e302e7fb52659253459eb70c163b37c7239..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TWPhrasesRev.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TWVariants.ocd2 b/XEngine_Release/XEngine_Config/opencc/TWVariants.ocd2 deleted file mode 100644 index 8d74395586e0ba932d2e371e0a704eb6bdbe8553..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TWVariants.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TWVariantsRev.ocd2 b/XEngine_Release/XEngine_Config/opencc/TWVariantsRev.ocd2 deleted file mode 100644 index 2546811c433ecf42d365a1e32bf6e3b8dfa50e1e..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TWVariantsRev.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/TWVariantsRevPhrases.ocd2 b/XEngine_Release/XEngine_Config/opencc/TWVariantsRevPhrases.ocd2 deleted file mode 100644 index eb305e0766e6523e29178b48c692e3e086fde8bc..0000000000000000000000000000000000000000 Binary files a/XEngine_Release/XEngine_Config/opencc/TWVariantsRevPhrases.ocd2 and /dev/null differ diff --git a/XEngine_Release/XEngine_Config/opencc/hk2s.json b/XEngine_Release/XEngine_Config/opencc/hk2s.json deleted file mode 100644 index cf0e9b975c6562979b91653ce4b0a2d072905a00..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/hk2s.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "Traditional Chinese (Hong Kong variant) to Simplified Chinese", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "TSPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "HKVariantsRevPhrases.ocd2" - }, { - "type": "ocd2", - "file": "HKVariantsRev.ocd2" - }] - } - }, { - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TSPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TSCharacters.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/hk2t.json b/XEngine_Release/XEngine_Config/opencc/hk2t.json deleted file mode 100644 index 0d47b91745d8728c62793d3563e685e5f4a0f61d..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/hk2t.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "Traditional Chinese (Hong Kong variant) to Traditional Chinese", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "HKVariantsRevPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "HKVariantsRevPhrases.ocd2" - }, { - "type": "ocd2", - "file": "HKVariantsRev.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/jp2t.json b/XEngine_Release/XEngine_Config/opencc/jp2t.json deleted file mode 100644 index 025d891975b09a987a18faefa513609d0a134993..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/jp2t.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "New Japanese Kanji (Shinjitai) to Traditional Chinese Characters (Kyūjitai)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "JPShinjitaiPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "JPShinjitaiPhrases.ocd2" - }, { - "type": "ocd2", - "file": "JPShinjitaiCharacters.ocd2" - }, { - "type": "ocd2", - "file": "JPVariantsRev.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/s2hk.json b/XEngine_Release/XEngine_Config/opencc/s2hk.json deleted file mode 100644 index fcaa017eeee74dac3ea50f752e36eb2a59e88f63..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/s2hk.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "Simplified Chinese to Traditional Chinese (Hong Kong variant)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "STPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "STPhrases.ocd2" - }, { - "type": "ocd2", - "file": "STCharacters.ocd2" - }] - } - }, { - "dict": { - "type": "ocd2", - "file": "HKVariants.ocd2" - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/s2t.json b/XEngine_Release/XEngine_Config/opencc/s2t.json deleted file mode 100644 index 87516acbdd37cbe76de2c24eea918611d22f9b4d..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/s2t.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "Simplified Chinese to Traditional Chinese", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "STPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "STPhrases.ocd2" - }, { - "type": "ocd2", - "file": "STCharacters.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/s2tw.json b/XEngine_Release/XEngine_Config/opencc/s2tw.json deleted file mode 100644 index 2a3d7656beea964cae33d272badc5ed69e494beb..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/s2tw.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "Simplified Chinese to Traditional Chinese (Taiwan standard)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "STPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "STPhrases.ocd2" - }, { - "type": "ocd2", - "file": "STCharacters.ocd2" - }] - } - }, { - "dict": { - "type": "ocd2", - "file": "TWVariants.ocd2" - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/s2twp.json b/XEngine_Release/XEngine_Config/opencc/s2twp.json deleted file mode 100644 index 2f36e9352c8ff8ded5cb9143edd6177fab3f926a..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/s2twp.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Simplified Chinese to Traditional Chinese (Taiwan standard, with phrases)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "STPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "STPhrases.ocd2" - }, { - "type": "ocd2", - "file": "STCharacters.ocd2" - }] - } - }, { - "dict": { - "type": "ocd2", - "file": "TWPhrases.ocd2" - } - }, { - "dict": { - "type": "ocd2", - "file": "TWVariants.ocd2" - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/t2hk.json b/XEngine_Release/XEngine_Config/opencc/t2hk.json deleted file mode 100644 index 519d4a3fd7ac66810999b65ed04fc2ccc6daa08b..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/t2hk.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Traditional Chinese to Traditional Chinese (Hong Kong variant)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "HKVariants.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "ocd2", - "file": "HKVariants.ocd2" - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/t2jp.json b/XEngine_Release/XEngine_Config/opencc/t2jp.json deleted file mode 100644 index 7a43217ffcdd920d5fe189275aa35cfbb074dd59..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/t2jp.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Traditional Chinese Characters (Kyūjitai) to New Japanese Kanji (Shinjitai)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "JPVariants.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "ocd2", - "file": "JPVariants.ocd2" - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/t2s.json b/XEngine_Release/XEngine_Config/opencc/t2s.json deleted file mode 100644 index 06cf5f58e98ee4d55d22bc4ef00d9f2f5dc9fa75..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/t2s.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "Traditional Chinese to Simplified Chinese", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "TSPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TSPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TSCharacters.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/t2tw.json b/XEngine_Release/XEngine_Config/opencc/t2tw.json deleted file mode 100644 index 0394f600d97ebbe569b30efe4d47267e850eaba8..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/t2tw.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Traditional Chinese to Traditional Chinese (Taiwan standard)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "TWVariants.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "ocd2", - "file": "TWVariants.ocd2" - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/tw2s.json b/XEngine_Release/XEngine_Config/opencc/tw2s.json deleted file mode 100644 index 4f554393ecd914e38aa13926226eb97bce61102b..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/tw2s.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "Traditional Chinese (Taiwan standard) to Simplified Chinese", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "TSPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TWVariantsRevPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TWVariantsRev.ocd2" - }] - } - }, { - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TSPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TSCharacters.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/tw2sp.json b/XEngine_Release/XEngine_Config/opencc/tw2sp.json deleted file mode 100644 index 64eb9d97796730d3c1f4065704e39159a1932b36..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/tw2sp.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "Traditional Chinese (Taiwan standard) to Simplified Chinese (with phrases)", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "TSPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TWPhrasesRev.ocd2" - }, { - "type": "ocd2", - "file": "TWVariantsRevPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TWVariantsRev.ocd2" - }] - } - }, { - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TSPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TSCharacters.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/tw2t.json b/XEngine_Release/XEngine_Config/opencc/tw2t.json deleted file mode 100644 index ad5295b6544abc1a17387db67fab68646650f9af..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/tw2t.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "Traditional Chinese (Taiwan standard) to Traditional Chinese", - "segmentation": { - "type": "mmseg", - "dict": { - "type": "ocd2", - "file": "TWVariantsRevPhrases.ocd2" - } - }, - "conversion_chain": [{ - "dict": { - "type": "group", - "dicts": [{ - "type": "ocd2", - "file": "TWVariantsRevPhrases.ocd2" - }, { - "type": "ocd2", - "file": "TWVariantsRev.ocd2" - }] - } - }] -} diff --git a/XEngine_Release/XEngine_Config/opencc/vcpkg.spdx.json b/XEngine_Release/XEngine_Config/opencc/vcpkg.spdx.json deleted file mode 100644 index badea9655c69d74dbd57912d439af2669df013ee..0000000000000000000000000000000000000000 --- a/XEngine_Release/XEngine_Config/opencc/vcpkg.spdx.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", - "spdxVersion": "SPDX-2.2", - "dataLicense": "CC0-1.0", - "SPDXID": "SPDXRef-DOCUMENT", - "documentNamespace": "https://spdx.org/spdxdocs/opencc-x86-windows-1.1.6#1-4418284f-b38c-421e-a8e8-45466db9a2c9", - "name": "opencc:x86-windows@1.1.6#1 52ca8cb6662baf775a1b4ec7fb3c3666097599d74bb2911520e8a5ec98633fc1", - "creationInfo": { - "creators": [ - "Tool: vcpkg-27de5b69dac4b6fe8259d283cd4011e6d20a84ce" - ], - "created": "2023-10-30T03:50:03Z" - }, - "relationships": [ - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "GENERATES", - "relatedSpdxElement": "SPDXRef-binary" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-0" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-1" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-2" - }, - { - "spdxElementId": "SPDXRef-binary", - "relationshipType": "GENERATED_FROM", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-0", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-1", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - } - ], - "packages": [ - { - "name": "opencc", - "SPDXID": "SPDXRef-port", - "versionInfo": "1.1.6#1", - "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/opencc", - "homepage": "https://github.com/BYVoid/OpenCC", - "licenseConcluded": "Apache-2.0", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "description": "A project for conversions between Traditional Chinese, Simplified Chinese and Japanese Kanji (Shinjitai)", - "comment": "This is the port (recipe) consumed by vcpkg." - }, - { - "name": "opencc:x86-windows", - "SPDXID": "SPDXRef-binary", - "versionInfo": "52ca8cb6662baf775a1b4ec7fb3c3666097599d74bb2911520e8a5ec98633fc1", - "downloadLocation": "NONE", - "licenseConcluded": "Apache-2.0", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is a binary package built by vcpkg." - }, - { - "SPDXID": "SPDXRef-resource-1", - "name": "BYVoid/OpenCC", - "downloadLocation": "git+https://github.com/BYVoid/OpenCC@ver.1.1.6", - "licenseConcluded": "NOASSERTION", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "checksums": [ - { - "algorithm": "SHA512", - "checksumValue": "bfc40bdf1348e6a265b3304ab1e8acee2f4b6ac9c377ff3d8c996435a92dee98c3758503186b4fd424653faf44db339f8a90300e3290c59942ccf04b1bbb2a30" - } - ] - } - ], - "files": [ - { - "fileName": "./D:/vcpkg/ports/opencc/fix-dependencies.patch", - "SPDXID": "SPDXRef-file-0", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "495ac3be36e9d2a350d909e120ceb92dc7f5fc7edf10ffb274be803e8a8b79e5" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./D:/vcpkg/ports/opencc/portfile.cmake", - "SPDXID": "SPDXRef-file-1", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "b2292bfc8abd9ef70e09513a207a6351f9c887035206359ba89ee94fe0c5457c" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./D:/vcpkg/ports/opencc/vcpkg.json", - "SPDXID": "SPDXRef-file-2", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "4a3967777ea499bc78ee425ab5a513b94e4cad3add9c9358cc08dd44e355a69b" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - } - ] -} diff --git a/XEngine_Source/Makefile b/XEngine_Source/Makefile index ee40b2b195ff0240057e59723ec6f2b168373879..8f8747af42f1c79a3bd9e71dbe05b2a3cb0a5f0f 100644 --- a/XEngine_Source/Makefile +++ b/XEngine_Source/Makefile @@ -1,7 +1,11 @@ RELEASE = 0 UNICODE = 0 PLATFORM=linux -FLAGS= +FLAGS= +#编译开关 +QR=1 +LUA=1 +OPENCV=1 #要编译的模块 THIRDPART_MODULE_JSONCPP = ./XEngine_ThirdPart/jsoncpp @@ -44,9 +48,9 @@ libXEngine_ModuleProtocol.so: libXEngine_ModuleSystem.so: make -C $(MODULE_SYSTEM_PATH) PLATFORM=$(PLATFORM) $(FLAGS) libXEngine_ModuleHelp.so: - make -C $(MODULE_HELP_PATH) PLATFORM=$(PLATFORM) $(FLAGS) + make -C $(MODULE_HELP_PATH) SWITCHQR=$(QR) SWITCHCV=$(OPENCV) PLATFORM=$(PLATFORM) $(FLAGS) libXEngine_ModulePlugin.so: - make -C $(MODULE_PLUGIN_PATH) PLATFORM=$(PLATFORM) $(FLAGS) + make -C $(MODULE_PLUGIN_PATH) SWITCHLUA=$(LUA) PLATFORM=$(PLATFORM) $(FLAGS) libModulePlugin_Zodiac.so: make -C $(PLUGIN_MODULE_ZODIAC) PLATFORM=$(PLATFORM) $(FLAGS) diff --git a/XEngine_Source/VSCopy-x64.bat b/XEngine_Source/VSCopy-x64.bat index 5e11a8882adf56bb8e41de2b9adcac1129f1d2ed..56c7c3d8a5e1b20c08ca9ffcb73eb667e3440f1d 100644 --- a/XEngine_Source/VSCopy-x64.bat +++ b/XEngine_Source/VSCopy-x64.bat @@ -15,30 +15,17 @@ copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./" copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_Authorize.dll" "./" copy /y "%XEngine_Lib64%\XEngine_RfcComponents\RfcComponents_HttpProtocol.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_StreamMedia\StreamMedia_StreamClient.dll" "./" + copy /y "%XEngine_Lib64%\XEngine_AVCodec\XEngine_AVHelp.dll" "./" copy /y "%XEngine_Lib64%\XEngine_AVCodec\XEngine_VideoCodec.dll" "./" copy /y "%XEngine_Lib64%\XEngine_AVCodec\XEngine_AudioCodec.dll" "./" copy /y "%XEngine_Lib64%\XEngine_AVCodec\XEngine_AVCollect.dll" "./" - -copy /y "%XEngine_Lib64%\XEngine_StreamMedia\StreamMedia_StreamClient.dll" "./" - -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\bson-1.0.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\mongoc-1.0.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\libmariadb.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\libpq.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\sqlite3.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\zlib1.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_HelpComponents\plugin\caching_sha2_password.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_NetHelp\libcurl.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_NetHelp\nghttp2.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\libssl-3-x64.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\libcrypto-3-x64.dll" "./" - -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\avcodec-59.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\avdevice-59.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\avfilter-8.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\avformat-59.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\avutil-57.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\swresample-4.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\swscale-6.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_LibEx\AVCodec\postproc-56.dll" "./" \ No newline at end of file +copy /y "%XEngine_Lib64%\XEngine_AVCodec\avcodec-60.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\avdevice-60.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\avfilter-9.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\avformat-60.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\avutil-58.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\swresample-4.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\swscale-7.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_AVCodec\postproc-57.dll" "./" \ No newline at end of file diff --git a/XEngine_Source/VSCopy-x86.bat b/XEngine_Source/VSCopy-x86.bat index f7951cfe01d6ec48721ce627c4da2eebaaf19d74..679e9a9c6d30952390bea1b19fce3947b667e01d 100644 --- a/XEngine_Source/VSCopy-x86.bat +++ b/XEngine_Source/VSCopy-x86.bat @@ -15,29 +15,17 @@ copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./" copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_Authorize.dll" "./" copy /y "%XEngine_Lib32%\XEngine_RfcComponents\RfcComponents_HttpProtocol.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_StreamMedia\StreamMedia_StreamClient.dll" "./" + copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_AVHelp.dll" "./" copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_VideoCodec.dll" "./" copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_AudioCodec.dll" "./" copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_AVCollect.dll" "./" - -copy /y "%XEngine_Lib32%\XEngine_StreamMedia\StreamMedia_StreamClient.dll" "./" - -copy /y "%XEngine_Lib32%\XEngine_HelpComponents\bson-1.0.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_HelpComponents\mongoc-1.0.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_HelpComponents\libmariadb.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_HelpComponents\libpq.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_HelpComponents\sqlite3.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_HelpComponents\zlib1.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_NetHelp\libcurl.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_NetHelp\nghttp2.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\libcrypto-3.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\libssl-3.dll" "./" - -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\avcodec-59.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\avdevice-59.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\avfilter-8.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\avformat-59.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\avutil-57.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\swresample-4.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\swscale-6.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_LibEx\AVCodec\postproc-56.dll" "./" \ No newline at end of file +copy /y "%XEngine_Lib32%\XEngine_AVCodec\avcodec-60.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\avdevice-60.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\avfilter-9.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\avformat-60.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\avutil-58.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\swresample-4.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\swscale-7.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_AVCodec\postproc-57.dll" "./" \ No newline at end of file diff --git a/XEngine_Source/XEngine_BuildSwitch.h b/XEngine_Source/XEngine_BuildSwitch.h index d36c6aa87d3782af0a7537c1c7a688497a75510b..60e23010eca18a21eaa96a84ba306dbcaf423380 100644 --- a/XEngine_Source/XEngine_BuildSwitch.h +++ b/XEngine_Source/XEngine_BuildSwitch.h @@ -14,4 +14,5 @@ // 自定义编译头开关 ////////////////////////////////////////////////////////////////////////// #define _XENGINE_BUILD_SWITCH_OPENCV 1 //1 打开OPENCV支持 -#define _XENGINE_BUILD_SWITCH_QRDECODEC 1 //1 打开二维码识别 \ No newline at end of file +#define _XENGINE_BUILD_SWITCH_QRDECODEC 1 //1 打开二维码识别 +#define _XENGINE_BUILD_SWITCH_LUA 1 //1 打开LUA脚本支持 \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h index 21509324d320e923de2486419214fe95cb730022..88e918567bfe6f86220efeaa2d639f58deb5d60a 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h @@ -53,6 +53,11 @@ typedef struct { XCHAR tszBankUrl[MAX_PATH]; //银行卡验证地址 XCHAR tszTranslationUrl[MAX_PATH]; //翻译接口 + struct + { + XCHAR tszAPPID[MAX_PATH]; + XCHAR tszAPPKey[MAX_PATH]; + }st_TranslationInfo; }st_XApi; struct { @@ -62,7 +67,6 @@ typedef struct }st_XPlugin; struct { - XCHAR tszConfigOPencc[MAX_PATH]; //OPENCC配置地址 XCHAR tszConfigQRCode[MAX_PATH]; //二维码配置地址 XCHAR tszConfigDeamon[MAX_PATH]; //守护进程配置文件 XCHAR tszConfigHTTPMime[MAX_PATH]; //HTTPMINE配置文件 @@ -93,24 +97,6 @@ typedef struct list* pStl_ListVer; }st_XVer; }XENGINE_SERVICECONFIG; -//OPENCC语言转换配置文件 -typedef struct -{ - XCHAR tszFiles2t[MAX_PATH]; - XCHAR tszFilet2s[MAX_PATH]; - XCHAR tszFiles2tw[MAX_PATH]; - XCHAR tszFiletw2s[MAX_PATH]; - XCHAR tszFiles2hk[MAX_PATH]; - XCHAR tszFilehk2s[MAX_PATH]; - XCHAR tszFiles2twp[MAX_PATH]; - XCHAR tszFiletw2sp[MAX_PATH]; - XCHAR tszFilet2tw[MAX_PATH]; - XCHAR tszFilehk2t[MAX_PATH]; - XCHAR tszFilet2hk[MAX_PATH]; - XCHAR tszFilet2jp[MAX_PATH]; - XCHAR tszFilejp2t[MAX_PATH]; - XCHAR tszFiletw2t[MAX_PATH]; -}XENGINE_OPENCCCONFIG; //二维码模型库 typedef struct { @@ -185,25 +171,6 @@ extern "C" XLONG ModuleConfigure_GetLastError(int* pInt_ErrorCode = NULL); *********************************************************************/ extern "C" bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); /******************************************************************** -函数名称:ModuleConfigure_Json_OPenccFile -函数功能:读取JSON配置文件 - 参数.一:lpszConfigFile - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入要读取的配置文件 - 参数.二:pSt_OPenccConfig - In/Out:Out - 类型:数据结构指针 - 可空:N - 意思:输出OPENCC配置信息 -返回值 - 类型:逻辑型 - 意思:是否成功 -备注: -*********************************************************************/ -extern "C" bool ModuleConfigure_Json_OPenccFile(LPCXSTR lpszConfigFile, XENGINE_OPENCCCONFIG* pSt_OPenccConfig); -/******************************************************************** 函数名称:ModuleConfigure_Json_QRCodeFile 函数功能:读取JSON配置文件 参数.一:lpszConfigFile diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp index bac14a1a0080e082c12e0a381fd57a56fa419cb1..3d50bca510da3f35a6f75ecc67f2a17a24006c64 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp @@ -123,7 +123,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE pSt_ServerConfig->st_XLog.nLogLeave = st_JsonXLog["LogLeave"].asInt(); _tcsxcpy(pSt_ServerConfig->st_XLog.tszLogFile, st_JsonXLog["tszLogFile"].asCString()); - if (st_JsonRoot["XApi"].empty() || (2 != st_JsonRoot["XApi"].size())) + if (st_JsonRoot["XApi"].empty() || (3 != st_JsonRoot["XApi"].size())) { Config_IsErrorOccur = true; Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XAPI; @@ -132,6 +132,9 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE Json::Value st_JsonXApi = st_JsonRoot["XApi"]; _tcsxcpy(pSt_ServerConfig->st_XApi.tszBankUrl, st_JsonXApi["tszBankUrl"].asCString()); _tcsxcpy(pSt_ServerConfig->st_XApi.tszTranslationUrl, st_JsonXApi["tszTranslationUrl"].asCString()); + Json::Value st_JsonTranslationInfo = st_JsonXApi["st_TranslationInfo"]; + _tcsxcpy(pSt_ServerConfig->st_XApi.st_TranslationInfo.tszAPPID, st_JsonTranslationInfo["appid"].asCString()); + _tcsxcpy(pSt_ServerConfig->st_XApi.st_TranslationInfo.tszAPPKey, st_JsonTranslationInfo["key"].asCString()); if (st_JsonRoot["XSql"].empty() || (4 != st_JsonRoot["XSql"].size())) { @@ -156,14 +159,13 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE _tcsxcpy(pSt_ServerConfig->st_XPlugin.tszPluginLib, st_JsonXPlugin["tszPluginLib"].asCString()); _tcsxcpy(pSt_ServerConfig->st_XPlugin.tszPluginLua, st_JsonXPlugin["tszPluginLua"].asCString()); - if (st_JsonRoot["XConfig"].empty() || (5 != st_JsonRoot["XConfig"].size())) + if (st_JsonRoot["XConfig"].empty() || (4 != st_JsonRoot["XConfig"].size())) { Config_IsErrorOccur = true; Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_XCONFIG; return false; } Json::Value st_JsonXConfig = st_JsonRoot["XConfig"]; - _tcsxcpy(pSt_ServerConfig->st_XConfig.tszConfigOPencc, st_JsonXConfig["tszConfigOPencc"].asCString()); _tcsxcpy(pSt_ServerConfig->st_XConfig.tszConfigQRCode, st_JsonXConfig["tszConfigQRCode"].asCString()); _tcsxcpy(pSt_ServerConfig->st_XConfig.tszConfigDeamon, st_JsonXConfig["tszConfigDeamon"].asCString()); _tcsxcpy(pSt_ServerConfig->st_XConfig.tszConfigHTTPMime, st_JsonXConfig["tszConfigHTTPMime"].asCString()); @@ -214,81 +216,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE return true; } /******************************************************************** -函数名称:ModuleConfigure_Json_OPenccFile -函数功能:读取JSON配置文件 - 参数.一:lpszConfigFile - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入要读取的配置文件 - 参数.二:pSt_OPenccConfig - In/Out:Out - 类型:数据结构指针 - 可空:N - 意思:输出OPENCC配置信息 -返回值 - 类型:逻辑型 - 意思:是否成功 -备注: -*********************************************************************/ -bool CModuleConfigure_Json::ModuleConfigure_Json_OPenccFile(LPCXSTR lpszConfigFile, XENGINE_OPENCCCONFIG* pSt_OPenccConfig) -{ - Config_IsErrorOccur = false; - - if ((NULL == lpszConfigFile) || (NULL == pSt_OPenccConfig)) - { - Config_IsErrorOccur = true; - Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_PARAMENT; - return false; - } - Json::Value st_JsonRoot; - JSONCPP_STRING st_JsonError; - Json::CharReaderBuilder st_JsonBuilder; - //读取配置文件所有内容到缓冲区 - FILE* pSt_File = _xtfopen(lpszConfigFile, _X("rb")); - if (NULL == pSt_File) - { - Config_IsErrorOccur = true; - Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_OPENFILE; - return false; - } - size_t nCount = 0; - XCHAR tszMsgBuffer[4096]; - while (1) - { - size_t nRet = fread(tszMsgBuffer + nCount, 1, 2048, pSt_File); - if (nRet <= 0) - { - break; - } - nCount += nRet; - } - fclose(pSt_File); - //开始解析配置文件 - std::unique_ptr const pSt_JsonReader(st_JsonBuilder.newCharReader()); - if (!pSt_JsonReader->parse(tszMsgBuffer, tszMsgBuffer + nCount, &st_JsonRoot, &st_JsonError)) - { - Config_IsErrorOccur = true; - Config_dwErrorCode = ERROR_MODULE_CONFIGURE_JSON_PARSE; - return false; - } - _tcsxcpy(pSt_OPenccConfig->tszFiles2t, st_JsonRoot["tszFiles2t"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilet2s, st_JsonRoot["tszFilet2s"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFiles2tw, st_JsonRoot["tszFiles2tw"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFiletw2s, st_JsonRoot["tszFiletw2s"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFiles2hk, st_JsonRoot["tszFiles2hk"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilehk2s, st_JsonRoot["tszFilehk2s"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFiles2twp, st_JsonRoot["tszFiles2twp"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFiletw2sp, st_JsonRoot["tszFiletw2sp"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilet2tw, st_JsonRoot["tszFilet2tw"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilehk2t, st_JsonRoot["tszFilehk2t"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilet2hk, st_JsonRoot["tszFilet2hk"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilet2jp, st_JsonRoot["tszFilet2jp"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFilejp2t, st_JsonRoot["tszFilejp2t"].asCString()); - _tcsxcpy(pSt_OPenccConfig->tszFiletw2t, st_JsonRoot["tszFiletw2t"].asCString()); - return true; -} -/******************************************************************** 函数名称:ModuleConfigure_Json_QRCodeFile 函数功能:读取JSON配置文件 参数.一:lpszConfigFile diff --git a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h index a4ac9d0418d18132a8e18f24124dcdba95d3d852..a581b7dfae38a536ffde49930cb89c7f340e9cad 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h +++ b/XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.h @@ -18,7 +18,6 @@ public: ~CModuleConfigure_Json(); public: bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVICECONFIG* pSt_ServerConfig); - bool ModuleConfigure_Json_OPenccFile(LPCXSTR lpszConfigFile, XENGINE_OPENCCCONFIG* pSt_OPenccConfig); bool ModuleConfigure_Json_QRCodeFile(LPCXSTR lpszConfigFile, XENGINE_QRCODECONFIG* pSt_QRCodeConfig); bool ModuleConfigure_Json_PluginFile(LPCXSTR lpszConfigFile, XENGINE_PLUGINCONFIG* pSt_PluginConfig); bool ModuleConfigure_Json_DeamonList(LPCXSTR lpszConfigFile, XENGINE_DEAMONAPPLIST* pSt_AppConfig); diff --git a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def index 1680488f29f75f438876269cf383c964b8fcbaa8..39159263d367377094affa1be06b825ff0e8aca6 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def +++ b/XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.def @@ -4,7 +4,6 @@ EXPORTS ModuleConfigure_GetLastError ModuleConfigure_Json_File - ModuleConfigure_Json_OPenccFile ModuleConfigure_Json_QRCodeFile ModuleConfigure_Json_PluginFile ModuleConfigure_Json_DeamonList \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleConfigure/pch.cpp b/XEngine_Source/XEngine_ModuleConfigure/pch.cpp index 2711d70ea7fbd4b42b0b463ded0025b1fd2d5e80..ac44382d829a4f9ac0ad9f89060b73c1f9a9809f 100644 --- a/XEngine_Source/XEngine_ModuleConfigure/pch.cpp +++ b/XEngine_Source/XEngine_ModuleConfigure/pch.cpp @@ -33,10 +33,6 @@ extern "C" bool ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XENGINE_SERVIC { return m_ConfigJson.ModuleConfigure_Json_File(lpszConfigFile, pSt_ServerConfig); } -extern "C" bool ModuleConfigure_Json_OPenccFile(LPCXSTR lpszConfigFile, XENGINE_OPENCCCONFIG * pSt_OPenccConfig) -{ - return m_ConfigJson.ModuleConfigure_Json_OPenccFile(lpszConfigFile, pSt_OPenccConfig); -} extern "C" bool ModuleConfigure_Json_QRCodeFile(LPCXSTR lpszConfigFile, XENGINE_QRCODECONFIG * pSt_QRCodeConfig) { return m_ConfigJson.ModuleConfigure_Json_QRCodeFile(lpszConfigFile, pSt_QRCodeConfig); diff --git a/XEngine_Source/XEngine_ModuleHelp/Makefile b/XEngine_Source/XEngine_ModuleHelp/Makefile index 8625a10bd864d8ca028f6a570f1c0f92cf6e0f38..303546c29f90803a121b896f305dd0dcb1990876 100644 --- a/XEngine_Source/XEngine_ModuleHelp/Makefile +++ b/XEngine_Source/XEngine_ModuleHelp/Makefile @@ -6,12 +6,18 @@ FILEEXT = LIBFLAG = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ -I /usr/include/opencv4 +LOADHDR = -I ./ -I /usr/include/opencv4 LOADSO = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_Client -LIB = -lXEngine_BaseLib -lXClient_Socket -lopencc -lqrencode -llzma -lpng16 -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -ltiff -lopencv_wechat_qrcode +LIB = -lXEngine_BaseLib -lXClient_Socket LIBEX = OBJECTS = ModuleHelp_IDCard.o ModuleHelp_Language.o ModuleHelp_P2PClient.o ModuleHelp_Locker.o ModuleHelp_QRCode.o ModuleHelp_SocketTest.o ModuleHelp_ImageGet.o ModuleHelp_ImageSet.o pch.o +ifeq ($(SWITCHQR),1) + LIB += -lqrencode +endif +ifeq ($(SWITCHCV),1) + LIB += -llzma -lpng16 -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -ltiff -lopencv_wechat_qrcode +endif ifeq ($(RELEASE),1) FLAGS = -c diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h index 21c403c7740dce2e90f774b2811f8a14032bba40..892436d248f7652fb3e89af19665589c52c18a35 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Define.h @@ -388,30 +388,6 @@ extern "C" bool ModuleHelp_IDCard_CheckSum(XENGINE_IDCARDINFO* pSt_IDInfo); /* 导出的语言转换帮助函数 */ /************************************************************************/ /******************************************************************** -函数名称:ModuleHelp_Language_ConvertZh -函数功能:中文语言转换函数 - 参数.一:lpszJsonFile - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入转换的配置文件 - 参数.一:lpszSourceStr - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入要转换的字符串 - 参数.一:ptszDestStr - In/Out:Out - 类型:字符指针 - 可空:N - 意思:输出转换后的字符串 -返回值 - 类型:逻辑型 - 意思:是否成功 -备注: -*********************************************************************/ -extern "C" bool ModuleHelp_Language_ConvertZh(LPCXSTR lpszJsonFile, LPCXSTR lpszSourceStr, XCHAR* ptszDestStr); -/******************************************************************** 函数名称:ModuleHelp_Translation_Convert 函数功能:翻译类型转换 参数.一:enTranslationType diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp index 0c95e617a820e926d22cfc3c9993bb8d4d928f4b..6cb5e3e33388a14506e3b92c906ed47a7d34c44a 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.cpp @@ -22,56 +22,6 @@ CModuleHelp_Language::~CModuleHelp_Language() // 公有函数 ////////////////////////////////////////////////////////////////////////// /******************************************************************** -函数名称:ModuleHelp_Language_ConvertZh -函数功能:中文语言转换 - 参数.一:lpszJsonFile - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入转换的配置文件 - 参数.一:lpszSourceStr - In/Out:In - 类型:常量字符指针 - 可空:N - 意思:输入要转换的字符串 - 参数.一:ptszDestStr - In/Out:Out - 类型:字符指针 - 可空:N - 意思:输出转换后的字符串 -返回值 - 类型:逻辑型 - 意思:是否成功 -备注: -*********************************************************************/ -bool CModuleHelp_Language::ModuleHelp_Language_ConvertZh(LPCXSTR lpszJsonFile, LPCXSTR lpszSourceStr, XCHAR* ptszDestStr) -{ - ModuleHelp_IsErrorOccur = false; - - if ((NULL == lpszJsonFile) || (NULL == lpszSourceStr) || (NULL == ptszDestStr)) - { - ModuleHelp_IsErrorOccur = true; - ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_LANGUAGE_PARAMENT; - return false; - } - opencc_t m_OPencc = opencc_open(lpszJsonFile); - if ((opencc_t)-1 == m_OPencc) - { - ModuleHelp_IsErrorOccur = true; - ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_LANGUAGE_FAILED; - return false; - } - if ((size_t)-1 == opencc_convert_utf8_to_buffer(m_OPencc, lpszSourceStr, strlen(lpszSourceStr), ptszDestStr)) - { - ModuleHelp_IsErrorOccur = true; - ModuleHelp_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_HELP_LANGUAGE_NOTSUPPORT; - return false; - } - opencc_close(m_OPencc); - - return true; -} -/******************************************************************** 函数名称:ModuleHelp_Translation_Convert 函数功能:翻译类型转换 参数.一:enTranslationType @@ -104,53 +54,105 @@ bool CModuleHelp_Language::ModuleHelp_Translation_Convert(ENUM_XENGINE_APISERVIC { _tcsxcpy(ptszTranslationType, _X("auto")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2EN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("zh")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EN == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("en")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_YUE == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("yue")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_WYW == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("wyw")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_JP == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("jp")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_KOR == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("kor")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_FRA == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("fra")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SPA == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("spa")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_TH == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("th")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_DE == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("de")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_IT == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("it")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EL == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("el")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_NL == enTranslationType) + { + _tcsxcpy(ptszTranslationType, _X("nl")); + } + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_PL == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("ZH_CN2EN")); + _tcsxcpy(ptszTranslationType, _X("pl")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2JA == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_BUL == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("ZH_CN2JA")); + _tcsxcpy(ptszTranslationType, _X("bul")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2KR == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EST == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("ZH_CN2KR")); + _tcsxcpy(ptszTranslationType, _X("est")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2FR == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_DAN == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("ZH_CN2FR")); + _tcsxcpy(ptszTranslationType, _X("dan")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2RU == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_FIN == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("ZH_CN2RU")); + _tcsxcpy(ptszTranslationType, _X("fin")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2SP == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_CS == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("ZH_CN2SP")); + _tcsxcpy(ptszTranslationType, _X("cs")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EN2ZH_CN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ROM == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("EN2ZH_CN")); + _tcsxcpy(ptszTranslationType, _X("rom")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_JA2ZH_CN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SLO == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("JA2ZH_CN")); + _tcsxcpy(ptszTranslationType, _X("slo")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_KR2ZH_CN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SWE == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("KR2ZH_CN")); + _tcsxcpy(ptszTranslationType, _X("swe")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_FR2ZH_CN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_HU == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("FR2ZH_CN")); + _tcsxcpy(ptszTranslationType, _X("hu")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_RU2ZH_CN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_CHT == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("RU2ZH_CN")); + _tcsxcpy(ptszTranslationType, _X("cht")); } - else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SP2ZH_CN == enTranslationType) + else if (ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_VIE == enTranslationType) { - _tcsxcpy(ptszTranslationType, _X("SP2ZH_CN")); + _tcsxcpy(ptszTranslationType, _X("vie")); } else { diff --git a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.h b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.h index f42bc0524c294a53e2e31793a2476d5d53764c96..eb37bf7ddb1f5d770840a0ee342476c44f3e80e3 100644 --- a/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.h +++ b/XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Language/ModuleHelp_Language.h @@ -17,7 +17,6 @@ public: CModuleHelp_Language(); ~CModuleHelp_Language(); public: - bool ModuleHelp_Language_ConvertZh(LPCXSTR lpszJsonFile, LPCXSTR lpszSourceStr, XCHAR* ptszDestStr); bool ModuleHelp_Translation_Convert(ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE enTranslationType, XCHAR* ptszTranslationType); private: }; \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def index 1a8a5ca8824720e0c3a862f3c9a1be91b8148b08..780969514f9a112c670ca085999c2ef740ea6e7c 100644 --- a/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def +++ b/XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.def @@ -6,7 +6,6 @@ EXPORTS ModuleHelp_IDCard_CheckBirth ModuleHelp_IDCard_CheckSum - ModuleHelp_Language_ConvertZh ModuleHelp_Translation_Convert ModuleHelp_P2PClient_Init diff --git a/XEngine_Source/XEngine_ModuleHelp/pch.cpp b/XEngine_Source/XEngine_ModuleHelp/pch.cpp index 34aa208b14de1d9d7b46d256131b9b593b17385a..00699b08bcf28daf4ad7bd6385f441a5f5f6b01e 100644 --- a/XEngine_Source/XEngine_ModuleHelp/pch.cpp +++ b/XEngine_Source/XEngine_ModuleHelp/pch.cpp @@ -54,10 +54,6 @@ extern "C" bool ModuleHelp_IDCard_CheckSum(XENGINE_IDCARDINFO * pSt_IDInfo) /************************************************************************/ /* 导出的语言转换帮助函数 */ /************************************************************************/ -extern "C" bool ModuleHelp_Language_ConvertZh(LPCXSTR lpszJsonFile, LPCXSTR lpszSourceStr, XCHAR * ptszDestStr) -{ - return m_Language.ModuleHelp_Language_ConvertZh(lpszJsonFile, lpszSourceStr, ptszDestStr); -} extern "C" bool ModuleHelp_Translation_Convert(ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE enTranslationType, XCHAR * ptszTranslationType) { return m_Language.ModuleHelp_Translation_Convert(enTranslationType, ptszTranslationType); diff --git a/XEngine_Source/XEngine_ModuleHelp/pch.h b/XEngine_Source/XEngine_ModuleHelp/pch.h index e42cca751f5ceb7a26c41f6a231a2014e79625db..1d02e0e5609c8ee9339f3f9bec639d0eee4930fc 100644 --- a/XEngine_Source/XEngine_ModuleHelp/pch.h +++ b/XEngine_Source/XEngine_ModuleHelp/pch.h @@ -25,7 +25,6 @@ #include #include #include -#include #if _XENGINE_BUILD_SWITCH_OPENCV == 1 #include #include diff --git a/XEngine_Source/XEngine_ModulePlugin/Makefile b/XEngine_Source/XEngine_ModulePlugin/Makefile index 193f9a3e6b4aa9c639469fd931dbb1cb341bbd62..34bb4dbfec551c87077979f9abaa83f4a571ef98 100644 --- a/XEngine_Source/XEngine_ModulePlugin/Makefile +++ b/XEngine_Source/XEngine_ModulePlugin/Makefile @@ -6,7 +6,7 @@ FILEEXT = LIBFLAG = RELEASE = 0 UNICODE = 0 -LOADHDR = -I ./ +LOADHDR = -I ./ -I /usr/include/lua5.4 LOADSO = -L /usr/local/lib/XEngine_Release/XEngine_BaseLib LIB = -lXEngine_BaseLib LIBEX = @@ -36,7 +36,9 @@ ifeq ($(PLATFORM),linux) endif FILEEXT = so LIBFLAG = -shared - LIB += -llua5.3 + ifeq ($(SWITCHLUA),1) + LIB += -llua5.4 + endif LIBEX = -lpthread -lrt -ldl LOADBIN = -Wl,-rpath=./,--disable-new-dtags else ifeq ($(PLATFORM),mac) @@ -45,7 +47,9 @@ else ifeq ($(PLATFORM),mac) PLATDIR = XEngine_Mac FILEEXT = dylib LIBFLAG = -dynamiclib - LIB += -llua + ifeq ($(SWITCHLUA),1) + LIB += -llua + endif LIBEX = -lpthread -ldl LOADBIN = -Wl,-rpath,@loader_path/./ endif diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp index ca353b864d3d740f114e9a7f7f4cb3e847afb813..19dcd11e546fb02d9378565f068c31b7d36ede29 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.cpp @@ -13,7 +13,6 @@ *********************************************************************/ CModulePlugin_LuaCore::CModulePlugin_LuaCore() { - bIsInit = false; } CModulePlugin_LuaCore::~CModulePlugin_LuaCore() { @@ -32,15 +31,6 @@ CModulePlugin_LuaCore::~CModulePlugin_LuaCore() bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Init() { ModulePlugin_IsErrorOccur = false; - //判断是否初始化 - if (bIsInit) - { - ModulePlugin_IsErrorOccur = true; - ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_ISINITED; - return false; - } - //启动线程 - bIsInit = true; return true; } /******************************************************************** @@ -144,6 +134,7 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Exec(XNETHANDLE xhModule, XCHAR st_csStl.unlock_shared(); return false; } +#if (1 == _XENGINE_BUILD_SWITCH_LUA) if (0 == lua_getglobal(stl_MapIterator->second.pSt_LuaState, "PluginCore_Call")) { ModulePlugin_IsErrorOccur = true; @@ -186,7 +177,7 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Exec(XNETHANDLE xhModule, XCHAR lua_pop(stl_MapIterator->second.pSt_LuaState, -1); st_csStl.unlock_shared(); - +#endif return true; } /******************************************************************** @@ -201,12 +192,7 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Destroy() { ModulePlugin_IsErrorOccur = false; - //判断是否初始化 - if (!bIsInit) - { - return true; - } - bIsInit = false; +#if (1 == _XENGINE_BUILD_SWITCH_LUA) //清理STL元素空间 st_csStl.lock(); unordered_map::iterator stl_MapIterator = stl_MapFrameWork.begin(); @@ -219,7 +205,7 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Destroy() } stl_MapFrameWork.clear(); st_csStl.unlock(); - +#endif return true; } ////////////////////////////////////////////////////////////////////////// @@ -258,6 +244,7 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Add(XNETHANDLE xhNet, LPCXSTR l ModulePlugin_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PLUGIN_PARAMENT; return false; } +#if (1 == _XENGINE_BUILD_SWITCH_LUA) PLUGINCORE_LUAFRAMEWORK st_LuaCore; memset(&st_LuaCore, '\0', sizeof(PLUGINCORE_LUAFRAMEWORK)); @@ -309,5 +296,6 @@ bool CModulePlugin_LuaCore::ModulePlugin_LuaCore_Add(XNETHANDLE xhNet, LPCXSTR l st_csStl.lock(); stl_MapFrameWork.insert(make_pair(xhNet, st_LuaCore)); st_csStl.unlock(); +#endif return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h index 2e472cb217d243d554db7d11472453b11805ea77..ac56aef7f440304a1c22e98c59b6fbeecd26a70d 100644 --- a/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h +++ b/XEngine_Source/XEngine_ModulePlugin/ModulePlugin_LuaCore/ModulePlugin_LuaCore.h @@ -13,7 +13,9 @@ typedef struct { XCHAR tszModuleFile[MAX_PATH]; +#if (1 == _XENGINE_BUILD_SWITCH_LUA) lua_State* pSt_LuaState; +#endif }PLUGINCORE_LUAFRAMEWORK; class CModulePlugin_LuaCore @@ -28,8 +30,6 @@ public: bool ModulePlugin_LuaCore_Destroy(); protected: bool ModulePlugin_LuaCore_Add(XNETHANDLE xhNet, LPCXSTR lpszPluginFile, XPVOID lParam = NULL); -private: - bool bIsInit; private: shared_mutex st_csStl; private: diff --git a/XEngine_Source/XEngine_ModulePlugin/pch.h b/XEngine_Source/XEngine_ModulePlugin/pch.h index 22e72daa6d4961600c45484eb68bfd71d2959a18..d315a09a481b16e3d4c67280d14c3eece0cadff0 100644 --- a/XEngine_Source/XEngine_ModulePlugin/pch.h +++ b/XEngine_Source/XEngine_ModulePlugin/pch.h @@ -11,23 +11,14 @@ // 添加要在此处预编译的标头 #include "framework.h" #include -#include #else #include - -#ifdef __linux__ -#ifdef _CENTOS -#include -#else -#include -#endif -#else -#include #endif -#endif - #endif //PCH_H - +#include "../XEngine_BuildSwitch.h" +#if (1 == _XENGINE_BUILD_SWITCH_LUA) +#include +#endif #include #include #include diff --git a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp index c5a7906fa5307bc032ccd07ee2ad14b9a80f1baf..5ac3a89cc795badf756eadadd57a195bf949a7e7 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp +++ b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Packet/ModuleProtocol_Packet.cpp @@ -131,29 +131,9 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_IDQuery(XCHAR* ptszMsgBuffer, st_JsonObject["nPoliceID"] = pSt_IDInfo->nPoliceID; st_JsonObject["nSex"] = pSt_IDInfo->nSex / 2 == 0 ? 0 : 1; st_JsonObject["nCheck"] = pSt_IDInfo->nCheck; - -#ifdef _MSC_BUILD - int nUTFLen = _tcsxlen(pSt_IDRegion->tszProvincer); - XCHAR tszUTFBuffer[MAX_PATH]; - memset(tszUTFBuffer, '\0', MAX_PATH); - - BaseLib_OperatorCharset_AnsiToUTF(pSt_IDRegion->tszProvincer, tszUTFBuffer, &nUTFLen); - st_JsonObject["tszProvincer"] = tszUTFBuffer; - - nUTFLen = _tcsxlen(pSt_IDRegion->tszCity); - memset(tszUTFBuffer, '\0', MAX_PATH); - BaseLib_OperatorCharset_AnsiToUTF(pSt_IDRegion->tszCity, tszUTFBuffer, &nUTFLen); - st_JsonObject["tszCity"] = tszUTFBuffer; - - nUTFLen = _tcsxlen(pSt_IDRegion->tszCounty); - memset(tszUTFBuffer, '\0', MAX_PATH); - BaseLib_OperatorCharset_AnsiToUTF(pSt_IDRegion->tszCounty, tszUTFBuffer, &nUTFLen); - st_JsonObject["tszCounty"] = tszUTFBuffer; -#else st_JsonObject["tszProvincer"] = pSt_IDRegion->tszProvincer; st_JsonObject["tszCity"] = pSt_IDRegion->tszCity; st_JsonObject["tszCounty"] = pSt_IDRegion->tszCounty; -#endif } st_JsonRoot["code"] = nCode; @@ -224,17 +204,7 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_BankQuery(XCHAR* ptszMsgBuffe st_JsonObject["tszBankNumber"] = pSt_BankInfo->tszBankNumber; st_JsonObject["tszBankAbridge"] = pSt_BankInfo->tszBankAbridge; st_JsonObject["enBankType"] = pSt_BankInfo->enBankType; - -#ifdef _MSC_BUILD - XCHAR tszUTFBuffer[MAX_PATH]; - memset(tszUTFBuffer, '\0', MAX_PATH); - - int nUTFLen = _tcsxlen(pSt_BankInfo->tszBankName); - BaseLib_OperatorCharset_AnsiToUTF(pSt_BankInfo->tszBankName, tszUTFBuffer, &nUTFLen); - st_JsonObject["tszBankName"] = tszUTFBuffer; -#else st_JsonObject["tszBankName"] = pSt_BankInfo->tszBankName; -#endif } st_JsonRoot["code"] = nCode; @@ -304,7 +274,8 @@ bool CModuleProtocol_Packet::ModuleProtocol_Packet_LanguageQuery(XCHAR* ptszMsgB { st_JsonObject["tszSourceStr"] = pSt_LanguageInfo->tszSourceStr; st_JsonObject["tszDestStr"] = pSt_LanguageInfo->tszDestStr; - st_JsonObject["enType"] = pSt_LanguageInfo->enType; + st_JsonObject["tszFromStr"] = pSt_LanguageInfo->tszFromStr; + st_JsonObject["tszToStr"] = pSt_LanguageInfo->tszToStr; } st_JsonRoot["code"] = nCode; diff --git a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Parse/ModuleProtocol_Parse.cpp b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Parse/ModuleProtocol_Parse.cpp index cc4244c6ec7dd9dec440a50acd6b857624ac640f..57a91b3dc4b0cb59b5939c217fdcbebc1cc651b6 100644 --- a/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Parse/ModuleProtocol_Parse.cpp +++ b/XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Parse/ModuleProtocol_Parse.cpp @@ -228,17 +228,18 @@ bool CModuleProtocol_Parse::ModuleProtocol_Parse_Translation(LPCXSTR lpszMsgBuff ModuleProtocol_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PROTOCOL_PARSE_JSON; return false; } - //{"type":"ZH_CN2EN","errorCode":0,"elapsedTime":1,"translateResult":[[{"src":"计算","tgt":"To calculate"}]]} - if (0 != st_JsonRoot["errorCode"].asInt()) + if (!st_JsonRoot["error_code"].isNull()) { ModuleProtocol_IsErrorOccur = true; ModuleProtocol_dwErrorCode = ERROR_XENGINE_APISERVICE_MODULE_PROTOCOL_PARSE_VALIDATE; return false; } - Json::Value st_JsonTranslation = st_JsonRoot["translateResult"]; + Json::Value st_JsonTranslation = st_JsonRoot["trans_result"]; - _tcsxcpy(pSt_LanguageInfo->tszSourceStr, st_JsonTranslation[0][0]["src"].asCString()); - _tcsxcpy(pSt_LanguageInfo->tszDestStr, st_JsonTranslation[0][0]["tgt"].asCString()); + _tcsxcpy(pSt_LanguageInfo->tszFromStr, st_JsonRoot["from"].asCString()); + _tcsxcpy(pSt_LanguageInfo->tszToStr, st_JsonRoot["to"].asCString()); + _tcsxcpy(pSt_LanguageInfo->tszSourceStr, st_JsonTranslation[0]["src"].asCString()); + _tcsxcpy(pSt_LanguageInfo->tszDestStr, st_JsonTranslation[0]["dst"].asCString()); return true; } /******************************************************************** diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile index 78c930ab408c9bd727993a6d7616d050a2d51139..12be67f99c68109541c8a37e04c8f7b015c67fdd 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/Makefile @@ -15,7 +15,7 @@ LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -ljsoncpp LIBEX = OBJECTS = XEngine_Configure.o XEngine_Network.o XEngine_HTTPTask.o XEngine_PluginTask.o XEngine_HttpApp.o \ - TaskGet_Bank.o TaskGet_IDCard.o TaskGet_Language.o TaskGet_Locker.o TaskGet_Translation.o TaskGet_Reload.o \ + TaskGet_Bank.o TaskGet_IDCard.o TaskGet_Locker.o TaskGet_Translation.o TaskGet_Reload.o \ TaskPost_DTest.o TaskPost_Log.o TaskPost_P2PClient.o TaskPost_PostCode.o TaskPost_QRCode.o TaskPost_ShortLink.o TaskPost_SocketTest.o TaskPost_WordFilter.o TaskPost_Image.o TaskPost_BackService.o TaskPost_Deamon.o ifeq ($(RELEASE),1) @@ -70,8 +70,6 @@ TaskGet_Bank.o:./XEngine_TaskGet/TaskGet_Bank.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./XEngine_TaskGet/TaskGet_Bank.cpp TaskGet_IDCard.o:./XEngine_TaskGet/TaskGet_IDCard.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./XEngine_TaskGet/TaskGet_IDCard.cpp -TaskGet_Language.o:./XEngine_TaskGet/TaskGet_Language.cpp - $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./XEngine_TaskGet/TaskGet_Language.cpp TaskGet_Locker.o:./XEngine_TaskGet/TaskGet_Locker.cpp $(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./XEngine_TaskGet/TaskGet_Locker.cpp TaskGet_Translation.o:./XEngine_TaskGet/TaskGet_Translation.cpp diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp index 8c4ec511b32cb55b85bc9f735427a9d29d1bd074..5fd47317ed3da607327348e1f49055f710e92214 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HTTPTask.cpp @@ -98,7 +98,6 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST //get LPCXSTR lpszParamIDCard = _X("id"); LPCXSTR lpszParamBank = _X("bank"); - LPCXSTR lpszParamLanguage = _X("language"); LPCXSTR lpszParamTranslation = _X("translation"); LPCXSTR lpszParamLocker = _X("lock"); LPCXSTR lpszParamReload = _X("reload"); @@ -337,53 +336,17 @@ bool HTTPTask_TastPost_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXST } HTTPTask_TaskGet_BankInfo(lpszClientAddr, tszValue); } - else if (0 == _tcsxnicmp(lpszParamLanguage, tszValue, _tcsxlen(lpszParamLanguage))) - { - //是不是语言转换 - XCHAR tszCvtType[64]; - - memset(tszCvtType, '\0', sizeof(tszCvtType)); - memset(tszKey, '\0', sizeof(tszKey)); - memset(tszValue, '\0', sizeof(tszValue)); - - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); - if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) - { - st_HDRParam.nHttpCode = 404; - HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); - XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, pSt_HTTPParam->tszHttpUri); - return false; - } - memset(tszKey, '\0', sizeof(tszKey)); - - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszCvtType); - HTTPTask_TaskGet_Language(lpszClientAddr, tszValue, _ttxoi(tszCvtType)); - } else if (0 == _tcsxnicmp(lpszParamTranslation, tszValue, _tcsxlen(lpszParamTranslation))) { //是不是翻译 - XCHAR tszCvtType[64]; - - memset(tszCvtType, '\0', sizeof(tszCvtType)); - memset(tszKey, '\0', sizeof(tszKey)); - memset(tszValue, '\0', sizeof(tszValue)); - - BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszValue); - if (0 != _tcsxnicmp(lpszParamName, tszKey, _tcsxlen(lpszParamName))) - { - st_HDRParam.nHttpCode = 404; - HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); - XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszList, nListCount); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,发送的URL请求参数不正确:%s"), lpszClientAddr, pSt_HTTPParam->tszHttpUri); - return false; - } - memset(tszKey, '\0', sizeof(tszKey)); + XCHAR tszMSGBuffer[2048] = {}; + XCHAR tszSrcBuffer[64] = {}; + XCHAR tszDstBuffer[64] = {}; - BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszCvtType); - HTTPTask_TaskGet_Translation(lpszClientAddr, tszValue, _ttxoi(tszCvtType)); + BaseLib_OperatorString_GetKeyValue(pptszList[1], "=", tszKey, tszMSGBuffer); + BaseLib_OperatorString_GetKeyValue(pptszList[2], "=", tszKey, tszSrcBuffer); + BaseLib_OperatorString_GetKeyValue(pptszList[3], "=", tszKey, tszDstBuffer); + HTTPTask_TaskGet_Translation(lpszClientAddr, tszMSGBuffer, tszSrcBuffer, tszDstBuffer); } else if (0 == _tcsxnicmp(lpszParamLocker, tszValue, _tcsxlen(lpszParamLocker))) { diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h index 420e11e82bb1fe2fef41d07e974adb497b2caa65..028e02eddad864fa946ba1029954ff02fd64178b 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_Hdr.h @@ -52,6 +52,7 @@ using namespace std; #include #include //加载项目相关头文件 +#include "../../XEngine_BuildSwitch.h" #include "../../XEngine_UserProtocol.h" #include "../../XEngine_ModuleConfigure/ModuleConfig_Define.h" #include "../../XEngine_ModuleConfigure/ModuleConfig_Error.h" @@ -85,7 +86,6 @@ using namespace std; //get #include "XEngine_TaskGet/TaskGet_IDCard.h" #include "XEngine_TaskGet/TaskGet_Bank.h" -#include "XEngine_TaskGet/TaskGet_Language.h" #include "XEngine_TaskGet/TaskGet_Translation.h" #include "XEngine_TaskGet/TaskGet_Locker.h" #include "XEngine_TaskGet/TaskGet_Reload.h" @@ -113,7 +113,6 @@ extern XHANDLE xhHTTPPool; extern unique_ptr pSTDThread_Deamon; //配置文件 extern XENGINE_SERVICECONFIG st_ServiceConfig; -extern XENGINE_OPENCCCONFIG st_OPenccConfig; extern XENGINE_QRCODECONFIG st_QRCodeConfig; extern XENGINE_PLUGINCONFIG st_PluginLibConfig; extern XENGINE_PLUGINCONFIG st_PluginLuaConfig; diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp index 304a4a5d9cc6239b3ef422df2dc1841fd1f0a169..103728f7797deebdffb445a48053047fb3ee0dfd 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.cpp @@ -21,7 +21,6 @@ XHANDLE xhHTTPPool = 0; unique_ptr pSTDThread_Deamon; //配置文件 XENGINE_SERVICECONFIG st_ServiceConfig; -XENGINE_OPENCCCONFIG st_OPenccConfig; XENGINE_QRCODECONFIG st_QRCodeConfig; XENGINE_PLUGINCONFIG st_PluginLibConfig; XENGINE_PLUGINCONFIG st_PluginLuaConfig; @@ -104,7 +103,6 @@ int main(int argc, char** argv) memset(&st_XLogConfig, '\0', sizeof(HELPCOMPONENTS_XLOG_CONFIGURE)); memset(&st_ServiceConfig, '\0', sizeof(XENGINE_SERVICECONFIG)); - memset(&st_OPenccConfig, '\0', sizeof(XENGINE_OPENCCCONFIG)); memset(&st_QRCodeConfig, '\0', sizeof(XENGINE_QRCODECONFIG)); memset(&st_PluginLibConfig, '\0', sizeof(XENGINE_PLUGINCONFIG)); memset(&st_PluginLuaConfig, '\0', sizeof(XENGINE_PLUGINCONFIG)); @@ -178,19 +176,17 @@ int main(int argc, char** argv) } #endif } - //初始化OPENCC配置 - if (!ModuleConfigure_Json_OPenccFile(st_ServiceConfig.st_XConfig.tszConfigOPencc, &st_OPenccConfig)) - { - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化OPenCC配置文件失败,错误:%lX"), ModuleConfigure_GetLastError()); - goto XENGINE_SERVICEAPP_EXIT; - } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化OPenCC配置文件:%s 成功"), st_ServiceConfig.st_XConfig.tszConfigOPencc); + +#if (1 == _XENGINE_BUILD_SWITCH_QRDECODEC) if (!ModuleConfigure_Json_QRCodeFile(st_ServiceConfig.st_XConfig.tszConfigQRCode, &st_QRCodeConfig)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,初始化二维码配置文件失败,错误:%lX"), ModuleConfigure_GetLastError()); goto XENGINE_SERVICEAPP_EXIT; } XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,初始化二维码配置文件:%s 成功"), st_ServiceConfig.st_XConfig.tszConfigQRCode); +#else + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,初始化二维码配置文件:%s 失败,因为QR编译脚本被关闭"), st_ServiceConfig.st_XConfig.tszConfigQRCode); +#endif //初始化插件配置 if (st_ServiceConfig.st_XPlugin.bEnable) { @@ -369,6 +365,7 @@ int main(int argc, char** argv) } } +#if (1 == _XENGINE_BUILD_SWITCH_LUA) { list::const_iterator stl_ListIterator = st_PluginLuaConfig.pStl_ListPlugin->begin(); for (int i = 1; stl_ListIterator != st_PluginLuaConfig.pStl_ListPlugin->end(); stl_ListIterator++, i++) @@ -390,6 +387,9 @@ int main(int argc, char** argv) } } } +#else + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,加载Lua模块插件失败,因为LUA编译被关闭")); +#endif //展示能力 XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,加载的Lib插件:%d 个,Lua插件:%d 个"), st_PluginLibConfig.pStl_ListPlugin->size(), st_PluginLuaConfig.pStl_ListPlugin->size()); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj index 22c2d5d501e19cafd585cccc04cdf6adefa6d49d..97346abdf55c2e4b90f0659b915f9b9ffc792a1d 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj @@ -160,7 +160,6 @@ - @@ -184,7 +183,6 @@ - diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters index 18debd402d4db9b937c24ea6225640693c44d242..b6ace87711ea24764532d7de1c09518110fb2290 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_HttpApp.vcxproj.filters @@ -63,9 +63,6 @@ 源文件\XEngine_TaskGet - - 源文件\XEngine_TaskGet - 源文件\XEngine_TaskGet @@ -131,9 +128,6 @@ 头文件\XEngine_TaskGet - - 头文件\XEngine_TaskGet - 头文件\XEngine_TaskGet diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Language.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Language.cpp deleted file mode 100644 index dcdd027b34c9e9d8bf49d090169fe0cf12f1a673..0000000000000000000000000000000000000000 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Language.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "../XEngine_Hdr.h" - -bool HTTPTask_TaskGet_Language(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nConvertType) -{ - int nMsgLen = 4096; - int nPktLen = 4096; - XCHAR tszMsgBuffer[4096]; - XCHAR tszPktBuffer[4096]; - XENGINE_LANGUAGEINFO st_LanguageInfo; - RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数 - - memset(tszMsgBuffer, '\0', sizeof(tszMsgBuffer)); - memset(tszPktBuffer, '\0', sizeof(tszPktBuffer)); - memset(&st_LanguageInfo, '\0', sizeof(XENGINE_LANGUAGEINFO)); - memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM)); - - st_HDRParam.nHttpCode = 200; //HTTP CODE码 - st_HDRParam.bIsClose = true; //收到回复后就关闭 - - st_LanguageInfo.enType = nConvertType; - OPenSsl_Codec_UrlDeCodec(lpszMsgBuffer, _tcsxlen(lpszMsgBuffer), st_LanguageInfo.tszSourceStr); - if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2T == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiles2t, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2S == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilet2s, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2TW == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiles2tw, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_TW2S == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiletw2s, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2HK == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiles2hk, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_HK2S == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilehk2s, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2TWP == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiles2twp, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_TW2SP == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiletw2sp, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2TW == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilet2tw, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_HK2T == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilehk2t, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2HK == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilet2hk, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2JP == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilet2jp, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_JP2T == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFilejp2t, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - else if (ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_TW2T == nConvertType) - { - ModuleHelp_Language_ConvertZh(st_OPenccConfig.tszFiletw2t, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - } - //打包发送 - ModuleProtocol_Packet_LanguageQuery(tszPktBuffer, &nPktLen, &st_LanguageInfo); - HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); - XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求语言转换成功,原始语言:%s,目标语言:%s"), lpszClientAddr, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); - return true; -} \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Language.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Language.h deleted file mode 100644 index ce7cdb62cf8775f215f499788e9ae15bcf9ae296..0000000000000000000000000000000000000000 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Language.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -bool HTTPTask_TaskGet_Language(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nConvertType); \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Reload.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Reload.cpp index f6ad71911e5fdd4e1f6f8e3491483950f4ab87a9..a74ed6f1957f6358b9059c450dbac262e3279dd4 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Reload.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Reload.cpp @@ -94,22 +94,6 @@ bool HTTPTask_TaskGet_Reload(LPCXSTR lpszClientAddr, LPCXSTR lpszOPCode) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求重载插件成功,Lib插件:%d 个,Lua插件:%d 个"), lpszClientAddr, st_PluginLibConfig.pStl_ListPlugin->size(), st_PluginLuaConfig.pStl_ListPlugin->size()); } else if (2 == _ttxoi(lpszOPCode)) - { - memset(&st_OPenccConfig, '\0', sizeof(XENGINE_OPENCCCONFIG)); - //重载OPENCC配置 - if (!ModuleConfigure_Json_OPenccFile(st_ServiceConfig.st_XConfig.tszConfigOPencc, &st_OPenccConfig)) - { - st_HDRParam.nHttpCode = 500; - HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); - XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求重载OPenCC配置文件失败,错误:%lX"), lpszClientAddr, ModuleConfigure_GetLastError()); - return false; - } - HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam); - XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求重载OPenCC配置文件:%s 成功"), lpszClientAddr, st_ServiceConfig.st_XConfig.tszConfigOPencc); - } - else if (3 == _ttxoi(lpszOPCode)) { memset(&st_QRCodeConfig, '\0', sizeof(XENGINE_QRCODECONFIG)); if (!ModuleConfigure_Json_QRCodeFile(st_ServiceConfig.st_XConfig.tszConfigQRCode, &st_QRCodeConfig)) @@ -124,7 +108,7 @@ bool HTTPTask_TaskGet_Reload(LPCXSTR lpszClientAddr, LPCXSTR lpszOPCode) XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求重载二维码配置文件:%s 成功"), lpszClientAddr, st_ServiceConfig.st_XConfig.tszConfigQRCode); } - else if (4 == _ttxoi(lpszOPCode)) + else if (3 == _ttxoi(lpszOPCode)) { st_DeamonAppConfig.stl_ListDeamonApp.clear(); if (!ModuleConfigure_Json_DeamonList(st_ServiceConfig.st_XConfig.tszConfigDeamon, &st_DeamonAppConfig)) diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp index 2b7099cf1dc690b12547897543cbe40af52f74c2..7756c9d9e2ac7cfc30e1a83d5506aabf12b00aaa 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.cpp @@ -1,6 +1,6 @@ #include "../XEngine_Hdr.h" -bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nConvertType) +bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, LPCXSTR lpszSrcStr, LPCXSTR lpszDstStr) { int nMsgLen = 4096; int nPktLen = 4096; @@ -22,20 +22,33 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, st_HDRParam.nHttpCode = 200; //HTTP CODE码 st_HDRParam.bIsClose = true; //收到回复后就关闭 - - st_LanguageInfo.enType = nConvertType; - //转换类型 - if (!ModuleHelp_Translation_Convert((ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE)nConvertType, tszTypeBuffer)) + + XCHAR tszURLBuffer[MAX_PATH] = {}; + XCHAR tszSignStr[MAX_PATH] = {}; + XCHAR tszMD5Codec[MAX_PATH] = {}; + XCHAR tszMD5Str[MAX_PATH] = {}; + XCHAR tszURLStr[4096] = {}; + + OPenSsl_Codec_UrlDeCodec(lpszMsgBuffer, _tcsxlen(lpszMsgBuffer), tszURLBuffer); + + int nRandomNumber = rand(); + int nLen = _xstprintf(tszSignStr, _X("%s%s%d%s"), st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPID, tszURLBuffer, nRandomNumber, st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPKey); + + OPenSsl_Api_Digest(tszSignStr, (XBYTE*)tszMD5Codec, &nLen); + for (int i = 0; i < 16; i++) { - ModuleProtocol_Packet_LanguageQuery(tszPktBuffer, &nPktLen, NULL, 1001, _X("type not support")); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); - HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); - XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的翻译类型不正确:%d,原始字符串:%s"), lpszClientAddr, nConvertType, lpszMsgBuffer); - return false; + XCHAR tszTmpStr[4] = {}; + _xstprintf(tszTmpStr, "%2.2x", (XBYTE)tszMD5Codec[i]); + _tcsxcat(tszMD5Str, tszTmpStr); } - _xstprintf(tszUrlBuffer, st_ServiceConfig.st_XApi.tszTranslationUrl, tszTypeBuffer, lpszMsgBuffer); - APIClient_Http_Request(_X("GET"), tszUrlBuffer, NULL, NULL, &ptszBodyBuffer, &nBLen); + XCHAR tszLanguageSrc[64] = {}; + XCHAR tszLanauageDst[64] = {}; + + ModuleHelp_Translation_Convert((ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE)_ttxoi(lpszSrcStr), tszLanguageSrc); + ModuleHelp_Translation_Convert((ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE)_ttxoi(lpszDstStr), tszLanauageDst); + + _xstprintf(tszURLStr, _X("%s?appid=%s&q=%s&from=%s&to=%s&salt=%d&sign=%s"), st_ServiceConfig.st_XApi.tszTranslationUrl, st_ServiceConfig.st_XApi.st_TranslationInfo.tszAPPID, lpszMsgBuffer, tszLanguageSrc, tszLanauageDst, nRandomNumber, tszMD5Str); + APIClient_Http_Request(_X("GET"), tszURLStr, NULL, NULL, &ptszBodyBuffer, &nBLen); //解析数据 if (!ModuleProtocol_Parse_Translation(ptszBodyBuffer, nBLen, &st_LanguageInfo)) { @@ -43,7 +56,7 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的翻译失败,类型:%d,原始字符串:%s"), lpszClientAddr, nConvertType, lpszMsgBuffer); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求的翻译失败,原始字符串:%s"), lpszClientAddr, lpszMsgBuffer); return false; } //打包发送 @@ -51,6 +64,6 @@ bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMsgBuffer, &nMsgLen, &st_HDRParam, tszPktBuffer, nPktLen); XEngine_Network_Send(lpszClientAddr, tszMsgBuffer, nMsgLen); BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszBodyBuffer); - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求语言翻译成功,原始语言:%s,目标语言:%s"), lpszClientAddr, st_LanguageInfo.tszSourceStr, st_LanguageInfo.tszDestStr); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,请求语言翻译成功,原始语言:%s,目标语言:%s"), lpszClientAddr, st_LanguageInfo.tszFromStr, st_LanguageInfo.tszToStr); return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.h b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.h index 6799a714370716048075e405dc78d1b053ffa05f..78cfb542dcdf412d2012dda207c3243d2598fba7 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.h +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskGet/TaskGet_Translation.h @@ -1,3 +1,3 @@ #pragma once -bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nConvertType); \ No newline at end of file +bool HTTPTask_TaskGet_Translation(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, LPCXSTR lpszSrcStr, LPCXSTR lpszDstStr); \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp index e7d778bc43f24d82b3d77f70cf5d565ba186b540..fda49557c2c3c9d7c4d313731ec9bb15a4018d0e 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp @@ -325,6 +325,7 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,初始化音频重采样工具失败,错误码:%lX"), lpszClientAddr, AudioCodec_GetLastError()); return false; } + AVCollect_Audio_Start(xhSound); } //屏幕采集 AVCOLLECT_SCREENINFO st_AVScreen; @@ -368,7 +369,6 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer return false; } bRecord = true; - AVCollect_Audio_Start(xhSound); AVCollect_Video_Start(xhScreen); HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam); XEngine_Network_Send(lpszClientAddr, ptszSDBuffer, nSDLen); diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Deamon.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Deamon.cpp index 11f62f9b0a584eeed6c791de12b952676b7f186b..6c45e47a3c8b0bc2c8a469a5ae321054a16e33e1 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Deamon.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Deamon.cpp @@ -52,7 +52,7 @@ void CALLBACK HTTPTask_TaskPost_Thread() memset(&st_ProcessInfo, '\0', sizeof(SYSTEMAPI_PROCESS_INFOMATION)); if (SystemApi_Process_GetProcessInfo(&st_ProcessInfo, stl_ListIterator->tszAPPName)) { - if (ENUM_SYSTEMSDK_PROCFILE_PROCFILE_PROCESS_STATE_ZOMBIE == st_ProcessInfo.en_ProcessState) + if (ENUM_SYSTEMAPI_PROCESS_STATUS_ZOMBIE == st_ProcessInfo.en_ProcessState) { #ifndef _MSC_BUILD //僵尸进程必须使用waitpid退出 diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp index eade1b91b7137f204ffddf173d5c579a10916a40..a8e2f5587ecc10f1ef00ee622899d17e07ae1821 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_Image.cpp @@ -2,23 +2,32 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR*** ppptszList, int nListCount) { + RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数 + memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM)); + + st_HDRParam.nHttpCode = 200; //HTTP CODE码 + st_HDRParam.bIsClose = true; //收到回复后就关闭 +#if (0 == _XENGINE_BUILD_SWITCH_OPENCV) + int nMLen = 0; + XCHAR tszMSGBuffer[MAX_PATH] = {}; + + st_HDRParam.nHttpCode = 501; + HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMSGBuffer, &nMLen, &st_HDRParam); + XEngine_Network_Send(lpszClientAddr, tszMSGBuffer, nMLen); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求图片操作失败,服务器没有启用此功能"), lpszClientAddr); +#else int nSDLen = 0; int nRVLen = 0; XCHAR tszHTTPKey[64]; XCHAR tszHTTPVlu[64]; - XCHAR *ptszSDBuffer = (XCHAR *)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); - XCHAR *ptszRVBuffer = (XCHAR *)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); - RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数 - + XCHAR* ptszSDBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); + XCHAR* ptszRVBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); + memset(tszHTTPKey, '\0', sizeof(tszHTTPKey)); memset(tszHTTPVlu, '\0', sizeof(tszHTTPVlu)); memset(ptszSDBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); memset(ptszRVBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); - memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM)); - - st_HDRParam.nHttpCode = 200; //HTTP CODE码 - st_HDRParam.bIsClose = true; //收到回复后就关闭 - + BaseLib_OperatorString_GetKeyValue((*ppptszList)[1], "=", tszHTTPKey, tszHTTPVlu); int nOPCode = _ttxoi(tszHTTPVlu); //0获取,1设置 @@ -80,7 +89,7 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int XEngine_Network_Send(lpszClientAddr, ptszSDBuffer, nSDLen); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求设置图像分辨率失败,错误:%lX"), lpszClientAddr, ModuleHelp_GetLastError()); } - + } else if (2 == nOPCode) { @@ -135,5 +144,6 @@ bool HTTPTask_TaskPost_Image(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int free(ptszSDBuffer); ptszRVBuffer = NULL; ptszSDBuffer = NULL; +#endif return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp index 8531ced4b9b3240b0793aa9de81fd94d71ca1add..48f57639fcb2eaf3dffd4f63beba706ae9d2e398 100644 --- a/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp +++ b/XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_QRCode.cpp @@ -2,26 +2,35 @@ bool HTTPTask_TaskPost_QRCode(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nType) { + RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数 + memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM)); + + st_HDRParam.nHttpCode = 200; //HTTP CODE码 + st_HDRParam.bIsClose = true; //收到回复后就关闭 +#if (0 == _XENGINE_BUILD_SWITCH_QRDECODEC) + int nMLen = 0; + XCHAR tszMSGBuffer[MAX_PATH] = {}; + + st_HDRParam.nHttpCode = 501; + HttpProtocol_Server_SendMsgEx(xhHTTPPacket, tszMSGBuffer, &nMLen, &st_HDRParam); + XEngine_Network_Send(lpszClientAddr, tszMSGBuffer, nMLen); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,请求二维码操作失败,服务器没有启用此功能"), lpszClientAddr); +#else int nSDLen = 0; int nRVLen = 0; - XCHAR *ptszSDBuffer = (XCHAR *)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); - XCHAR *ptszRVBuffer = (XCHAR *)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); + XCHAR* ptszSDBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); + XCHAR* ptszRVBuffer = (XCHAR*)malloc(XENGIEN_APISERVICE_BUFFER_SIZE); XENGINE_QRCODE st_QRCode; - RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数 - + memset(ptszSDBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); memset(ptszRVBuffer, '\0', XENGIEN_APISERVICE_BUFFER_SIZE); memset(&st_QRCode, '\0', sizeof(XENGINE_QRCODE)); - memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM)); - - st_HDRParam.nHttpCode = 200; //HTTP CODE码 - st_HDRParam.bIsClose = true; //收到回复后就关闭 //0创建,1解析 if (0 == nType) { ModuleProtocol_Parse_QRCode(lpszMsgBuffer, nMsgLen, &st_QRCode); _tcsxcpy(st_HDRParam.tszMimeType, st_QRCode.tszFmtBuffer + 1); - + if (ModuleHelp_QRCode_QREncodecMemory(st_QRCode.tszMsgBuffer, ptszRVBuffer, &nRVLen, st_QRCode.tszFmtBuffer)) { HttpProtocol_Server_SendMsgEx(xhHTTPPacket, ptszSDBuffer, &nSDLen, &st_HDRParam, ptszRVBuffer, nRVLen); @@ -57,5 +66,6 @@ bool HTTPTask_TaskPost_QRCode(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int free(ptszSDBuffer); ptszRVBuffer = NULL; ptszSDBuffer = NULL; +#endif return true; } \ No newline at end of file diff --git a/XEngine_Source/XEngine_UserProtocol.h b/XEngine_Source/XEngine_UserProtocol.h index a09ae69770da692b0d0381da944d5b09c7294c2d..d7b1e4ff218008fef01df7c9cbd30b4bf3e6179e 100644 --- a/XEngine_Source/XEngine_UserProtocol.h +++ b/XEngine_Source/XEngine_UserProtocol.h @@ -26,41 +26,35 @@ typedef enum ENUM_XENGINE_APISERVICE_BANK_TYPE_DC, // 存蓄卡 ENUM_XENGINE_APISERVICE_BANK_TYPE_CC // 信用卡 }ENUM_XENGINE_APISERVICE_BANK_TYPE; -//语言转换类型 -typedef enum -{ - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_UNKNOWN = 0, // 未知 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2T, // 简体到繁体 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2S, // 繁体到简体 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2TW, // 简体到台繁 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_TW2S, // 台繁到简体 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2HK, // 简体到港繁 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_HK2S, // 港繁到简体 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_S2TWP, // 简体(简到台正体标准) - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_TW2SP, // 繁体(台到简标准) - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2TW, // 繁体(OpenCC 标准)台正体 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_HK2T, // 港繁到繁体(OpenCC) - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2HK, // 繁体(OpenCC)到港繁 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_T2JP, // 繁体(OpenCC 标准,旧字体)到日文新字体 - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_JP2T, // 日文新字体到繁体(OpenCC 标准,旧字体) - ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE_TW2T // 台繁到繁体(OpenCC 标准) -}ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE; //翻译接口 -typedef enum +typedef enum { - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_AUTO = 0, - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2EN, //中文 » 英语 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2JA, //中文 » 日语 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2KR, //中文 » 韩语 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2FR, //中文 » 法语 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2RU, //中文 » 俄语 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH_CN2SP, //中文 » 西语 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EN2ZH_CN, //英语 » 中文 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_JA2ZH_CN, //日语 » 中文 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_KR2ZH_CN, //韩语 » 中文 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_FR2ZH_CN, //法语 » 中文 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_RU2ZH_CN, //俄语 » 中文 - ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SP2ZH_CN //西语 » 中文 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_AUTO = 0, //自动,SRC可用 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ZH, //中文 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EN, //英语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_YUE, //粤语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_WYW, //文言文 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_JP, //日语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_KOR, //韩语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_FRA, //法语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SPA, //西班牙 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_TH, //泰语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_DE, //德语 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_IT, //意大利 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EL, //希腊 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_NL, //荷兰 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_PL, //波兰 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_BUL, //保加利亚 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_EST, //爱沙尼亚 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_DAN, //丹麦 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_FIN, //芬兰 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_CS, //捷克 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_ROM, //罗马尼亚 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SLO, //斯洛文尼亚 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_SWE, //瑞典 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_HU, //匈牙利 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_CHT, //繁体 + ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE_VIE //越南 }ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE; //分布式锁状态 typedef enum @@ -140,9 +134,10 @@ typedef struct //语言转换 typedef struct { - XCHAR tszSourceStr[1024]; //原始字符串 - XCHAR tszDestStr[1024]; //转换字符串 - int enType; //简繁为ENUM_XENGINE_APISERVICE_LANGUAGE_TYPE 翻译为ENUM_XENGINE_APISERVICE_TRANSLATION_TYPE + XCHAR tszSourceStr[MAX_PATH]; //原始字符串 + XCHAR tszDestStr[MAX_PATH]; //转换字符串 + XCHAR tszFromStr[64]; //原始类型 + XCHAR tszToStr[64]; //目标类型 }XENGINE_LANGUAGEINFO; //连接信息 typedef struct