diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f00cc36..5c23daaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ Removed - 删除功能/接口 Fixed - 修复问题 Others - 其他 --> +## 2024-3-28 【重要更新】 +包含重要bugfix、特性支持 +### Feature +### Fixed +* 重要:修复UDP接口处理buffer +* 重要:修复unity-namespace.js部分环境变量丢失问题 + ## 2024-3-28 【普通更新】 * 普通:优化对团结版的导出支持 ### Fixed diff --git a/Editor/WXPluginVersion.cs b/Editor/WXPluginVersion.cs index 76f239b8..0f4029f5 100644 --- a/Editor/WXPluginVersion.cs +++ b/Editor/WXPluginVersion.cs @@ -2,7 +2,7 @@ { public class WXPluginVersion { - public static string pluginVersion = "202403291954"; // 这一行不要改他,导出的时候会自动替换 + public static string pluginVersion = "202404031940"; // 这一行不要改他,导出的时候会自动替换 } public class WXPluginConf diff --git a/Editor/wx-editor.dll b/Editor/wx-editor.dll index 1637f972..ef62da01 100644 Binary files a/Editor/wx-editor.dll and b/Editor/wx-editor.dll differ diff --git a/Runtime/Plugins/wx-runtime-editor.dll b/Runtime/Plugins/wx-runtime-editor.dll index 80cbdb1f..1512b5ea 100644 Binary files a/Runtime/Plugins/wx-runtime-editor.dll and b/Runtime/Plugins/wx-runtime-editor.dll differ diff --git a/Runtime/Plugins/wx-runtime.dll b/Runtime/Plugins/wx-runtime.dll index 5ec23a56..530960dc 100644 Binary files a/Runtime/Plugins/wx-runtime.dll and b/Runtime/Plugins/wx-runtime.dll differ diff --git a/Runtime/wechat-default/unity-namespace.js b/Runtime/wechat-default/unity-namespace.js index 55ecc614..705dcfd8 100644 --- a/Runtime/wechat-default/unity-namespace.js +++ b/Runtime/wechat-default/unity-namespace.js @@ -127,6 +127,18 @@ function bindGloblException() { // 上报初始信息 function printSystemInfo(systemInfo) { GameGlobal.systemInfoCached = systemInfo; + const { version, SDKVersion, platform, renderer, system } = systemInfo; + unityNamespace.version = version; + unityNamespace.SDKVersion = SDKVersion; + unityNamespace.platform = platform; + unityNamespace.renderer = renderer; + unityNamespace.system = system; + unityNamespace.isPc = platform === 'windows' || platform === 'mac'; + unityNamespace.isDevtools = platform === 'devtools'; + unityNamespace.isMobile = !unityNamespace.isPc && !unityNamespace.isDevtools; + unityNamespace.isH5Renderer = unityNamespace.isMobile && unityNamespace.renderer === 'h5'; + unityNamespace.isIOS = platform === 'ios'; + unityNamespace.isAndroid = platform === 'android'; const bootinfo = { renderer: systemInfo.renderer || '', isH5Plus: GameGlobal.isIOSHighPerformanceModePlus || false, diff --git a/Runtime/wechat-default/unity-sdk/TCPSocket/index.js b/Runtime/wechat-default/unity-sdk/TCPSocket/index.js index baaab2ed..47c41f47 100644 --- a/Runtime/wechat-default/unity-sdk/TCPSocket/index.js +++ b/Runtime/wechat-default/unity-sdk/TCPSocket/index.js @@ -141,12 +141,12 @@ function WX_TCPSocketOnMessage(id, needInfo) { if (needInfo) { const localInfoPtr = convertInfoToPointer(res.localInfo); const remoteInfoPtr = convertInfoToPointer(res.remoteInfo); - GameGlobal.Module.dynCall_viiiii(wxTCPSocketOnMessageCallback, idPtr, messagePtr, res.message.byteLength, localInfoPtr, remoteInfoPtr); + GameGlobal.Module.dynCall_viiiii(wxTCPSocketOnMessageCallback, idPtr, messagePtr, res.message.length || res.message.byteLength, localInfoPtr, remoteInfoPtr); GameGlobal.Module._free(localInfoPtr); GameGlobal.Module._free(remoteInfoPtr); } else { - GameGlobal.Module.dynCall_viiiii(wxTCPSocketOnMessageCallback, idPtr, messagePtr, res.message.byteLength, 0, 0); + GameGlobal.Module.dynCall_viiiii(wxTCPSocketOnMessageCallback, idPtr, messagePtr, res.message.length || res.message.byteLength, 0, 0); } GameGlobal.Module._free(idPtr); GameGlobal.Module._free(messagePtr); diff --git a/Runtime/wechat-default/unity-sdk/UDPSocket/index.js b/Runtime/wechat-default/unity-sdk/UDPSocket/index.js index 7d9e01e1..a0955f1a 100644 --- a/Runtime/wechat-default/unity-sdk/UDPSocket/index.js +++ b/Runtime/wechat-default/unity-sdk/UDPSocket/index.js @@ -102,12 +102,12 @@ function WX_UDPSocketOnMessage(id, needInfo) { if (needInfo) { const localInfoPtr = convertInfoToPointer(res.localInfo); const remoteInfoPtr = convertInfoToPointer(res.remoteInfo); - GameGlobal.Module.dynCall_viiiii(wxUDPSocketOnMessageCallback, idPtr, messagePtr, res.message.byteLength, localInfoPtr, remoteInfoPtr); + GameGlobal.Module.dynCall_viiiii(wxUDPSocketOnMessageCallback, idPtr, messagePtr, res.message.length || res.message.byteLength, localInfoPtr, remoteInfoPtr); GameGlobal.Module._free(localInfoPtr); GameGlobal.Module._free(remoteInfoPtr); } else { - GameGlobal.Module.dynCall_viiiii(wxUDPSocketOnMessageCallback, idPtr, messagePtr, res.message.byteLength, 0, 0); + GameGlobal.Module.dynCall_viiiii(wxUDPSocketOnMessageCallback, idPtr, messagePtr, res.message.length || res.message.byteLength, 0, 0); } GameGlobal.Module._free(idPtr); GameGlobal.Module._free(messagePtr); diff --git a/Runtime/wechat-default/unity-sdk/utils.js b/Runtime/wechat-default/unity-sdk/utils.js index d02cb474..b4754512 100644 --- a/Runtime/wechat-default/unity-sdk/utils.js +++ b/Runtime/wechat-default/unity-sdk/utils.js @@ -294,7 +294,7 @@ export function convertDataToPointer(data) { if (typeof data === 'string') { return convertStringToPointer(data); } - if (data instanceof ArrayBuffer) { + if (data instanceof ArrayBuffer || typeof data === 'object') { return convertArrayBufferToPointer(data); } return 0; diff --git a/package.json b/package.json index f74afeba..0a2a6c39 100644 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"com.qq.weixin.minigame","displayName":"WXSDK","description":"WeChat Mini Game Tuanjie Engine Adapter SDK Package.","version":"0.1.6","unity":"2019.4","unityRelease":"29f1","keywords":["Tuanjie","WX"],"dependencies":{}} +{"name":"com.qq.weixin.minigame","displayName":"WXSDK","description":"WeChat Mini Game Tuanjie Engine Adapter SDK Package.","version":"0.1.7","unity":"2019.4","unityRelease":"29f1","keywords":["Tuanjie","WX"],"dependencies":{}}