Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. veggis
    V

    veggis

    @veggis

    Chat Follow Unfollow
    0
    Reputation
    9
    Posts
    1872
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Continue chat with veggis
      • Flag Profile
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    veggis Follow

    Posts made by veggis

    RE: Readystate error

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

    posted in Questions & Help •
    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 •
    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 •
    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 •
    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 •
    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 •
    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 •
    RE: Reference room by room ID

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

    posted in Questions & Help •
    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 •