Since the online game is already using the Taobao API, it needs to be adapted by the engine. (#17406)

* Revert "Due to the single-instance version of the WebSocket, the onMessage response res contains only one layer of data. For compatibility with the online game, Taobao removed the extra layer of data (#17389)"

This reverts commit 2f4e6d3caa.

* Since the online game is already using the Taobao API, it needs to be adapted by the engine.
This commit is contained in:
bofeng-song
2024-07-24 09:39:52 +08:00
committed by GitHub
parent 52b4d8c18b
commit 89f966f80b
@@ -42,8 +42,9 @@ export default class MultiWebSocket {
socketTask.onMessage((res) => {
if (typeof this.onmessage === 'function') {
if (res && res.data && res.isBuffer) {
res.data = _utils.base64ToArrayBuffer(res.data)
if (res && res.data && res.data.data && res.data.isBuffer) {
res.isBuffer = res.data.isBuffer;
res.data = _utils.base64ToArrayBuffer(res.data.data);
}
this.onmessage(res)
}