Closed jadehare closed 1 year ago
Hi @jadehare,
fetch
and FormData
:XMLHttpRequest
instead of fetch
: https://store.cocos.com/app/en/detail/5086colyseus.js
file made specifically for Cocos Creator here: https://cdn.jsdelivr.net/npm/colyseus.js@latest/dist/colyseus-cocos-creator.jsURL
not having a prototype:Colyseus.Client
:const client = new Colyseus.Client({
hostname: "server-1.your-game.io",
secure: true /* for wss / https */
});
Let me know if you have any other issues on iOS. Cheers
Thanks a lot, this JS file is really working for me.
I'm sorry, I made a mistake. It's not that createElementNS doesn't have a "prototype", but rather that the return object doesn't have "protocols" :( However, the result is similar, so it doesn't affect me. I apologize for providing incorrect information.
Also, I couldn't find the JS file for Cocos Creator in the document, or the zip file, or other branches. For versions before 3.0, I can only manually add the JS file. I hope it can be added to the document of future versions, so that I can replace it directly without bothering you.
version:0.15.11
The issues currently identified are all in the iOS environment.
The object created by calling document.createElementNS in new URL does not have a prototype, resulting in an error. ([https://github.com/cocos-creator-packages/jsb-adapter/blob/410a9ed25c5ad91c064682c8ed0f2093a5dd4ef6/builtin/Blob.js#L93C56-L93C56])
There is no fetch method in colyseus.js:140.
There is no FormData type.
I have rewritten the parameter acquisition for the new URL issue, and found a solution to the FormData issue in another issue. I currently have no idea how to solve the fetch issue, and hope to be informed of a solution. I also hope to have a more elegant solution to other issues. I have not verified if other versions of Cocos have the same issues, but given that this part of the code does not appear to have been updated, I suspect that they may have the same issues.