Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. veggis
  3. Posts
  • Profile
  • More
    • Continue chat with veggis
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

Posts made by veggis

RE: Readystate error

v0.9.1, I've updated to latest now. Haven't happened since :)

posted in Questions & Help • 29 May 2018, 09:58
Readystate error

Very rarely I get the 'WebSocket is not open: readyState 2' Error. I suspect it happens when the server tries to send to a client that disconnected at the moment it was sent, or something similar.

Do i allways need to check for readystate before send() ?

Thanks

WebSocket is not open: readyState 2 (CLOSING)
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (Y:\UiA\3 År\Bachelor\trianglearcade\server\node_modules\w
s\lib\websocket.js:314:19)
posted in Questions & Help • 28 May 2018, 07:55
RE: Send to clients only within proximity?

@endel I should've said 'trying to use broadcastPatch'. I didn't want to ovverride it rather add to it, but it ended up being a recursive mess. I instead have a seperate interval for proximity messages.

posted in Questions & Help • 13 May 2018, 19:13
Send to clients only within proximity?

I guess it could be done with client messages and a seperate update loop, but if i could, i'd rather do it with the patch. Is there such a feature or any nifty suggestions?
Also, is there a way to add methods to patch interval?

Edit: currently using broadcastPatch for this

posted in Questions & Help • 13 May 2018, 10:09
RE: Reference room by room ID

@lezanardi

function setEnumerable(object) {
    let private = {};

    for (let key in object) {
        Object.defineProperty(private, key, {
            value: object[key],
            enumerable: false,
            writable: true
        });
    }

    return private;
}

Will return the passed object with all the items non-enumerable.

posted in Questions & Help • 13 May 2018, 09:52
RE: Reference room by room ID

After some digging around in the docs I got it. Defining objects non-enumerable does the trick.

posted in Questions & Help • 26 Apr 2018, 18:17
RE: Reference room by room ID

@endel Sorry to bother you, but could you give an example with js?

I'm using babel to transcribe decorators, which is working but not for variables.

posted in Questions & Help • 26 Apr 2018, 13:11
RE: Reference room by room ID

This is exactly what I was looking for! Thanks alot @endel

posted in Questions & Help • 24 Apr 2018, 19:46
Reference room by room ID

Hi! I was wondering, is it possible to reference a room from room ID, say send message to all clients in room?
I have different classes for state, entites, players etc which don't have reference to the parent room class and therefore can't use 'send' method within those classes.

Thanks!

posted in Questions & Help • 24 Apr 2018, 19:25

© 2023 Endel Dreyer