colyseus / colyseus-haxe

⚔ Colyseus Multiplayer SDK for Haxe

Home Page:https://docs.colyseus.io/getting-started/haxe-client/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unicode string encoding

kotwys opened this issue · comments

Whenever I send some string including characters that take more than one byte, the server crashes with the following message:

Error: 4 trailing bytes
    at Object.decode (<...>/node_modules/notepack.io/lib/decode.js:262:11)
    at <Room>._onMessage (<...>/node_modules/colyseus/lib/Room.js:440:41)
    at WebSocket.emit (events.js:314:20)

Colyseus.js works properly in the same case. Sending Unicode string back to the client also works.

Probably string length detection doesn’t consider variable length of characters.

Hi @kotwys, thanks for reporting! I see that you pushed a fix for this already https://github.com/kotwys/colyseus-hx/commit/33bec78bc7ac8a65a6e900fca2173e56c8fa7344

Can you confirm this works for you? Cheers!

Hello @endel! Yes, that works for me. As far as I could check out different writings with JS-targeted client.