Navigation

    Colyseus
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. mitchmeyer1
    M

    mitchmeyer1

    @mitchmeyer1

    Chat Follow Unfollow
    2
    Reputation
    10
    Posts
    292
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

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

    Posts made by mitchmeyer1

    How to used patched Colyseus code On Arena?

    Hey! I just moved to Arena from a self hosted server i have been using for the past year. Self hosted was great but experiencing a large number of abnormal disconnects and was recommended to me to try arena as it could be load balancing / infrastructure issues. So here i am!

    My problem is i patched the colyseus library to make the onLeave function have a 3rd parameter which is the "code". It works beautifully and gives me more insight on my onLeave function as to why the user left, so i can handle it differently based on the case.

    However when i did "npm run build" on my codebase to generate the js library to upload to arena, my colyseus dependency modifications are gone. In fact it doesnt look like the colyseus library is in the /lib folder at all. So i assume arena links up its own which would get rid of my change. Any way around this?

    posted in Colyseus Arena - Cloud Hosting •
    "Error: session expired" upon colyseus.reconect(roomId, SessionId)

    Hello,
    In my program reconnection is working for many users but sometimes i get the error "Error: session expired" upon reconnection. What does this error mean? There doesnt seem to be any reference to this in the docs. My room is still up and running at this point and i have in the room the appropriate allowReconnection code configured.

    Can someone explain what "session expired" means? And how to reconnect in this instance?

    Thanks,
    Mitch

    posted in Questions & Help •
    Reasons for onLeave code 1006

    Hello,
    I have a self hosted server, a few hundred times a day my clients receive an onLeave callback from Colyseus with code 1006. My server is not reporting any errors and im not seeing any patterns in the "breadcrumbs" on my clients code. It seems to be happening randomly. Is there any way to debug this? What are some causes for a 1006 error? I saw another post about this from 2019 but with no answers so i thought i would ask again. Any ideas of how to debug would be appreciated!

    Thanks,
    Mitch

    posted in Questions & Help •
    RE: WebSocketSharp Error!An exception has occurred while receiving a message.

    I have the same question! Mine works 95% of the time but sometimes i get 1006 code, what does this mean?

    posted in Questions & Help •
    RE: Detect collision in server Colyseus (Solved)

    I do this on my server with no framework (not saying the framework isnt a better option, just wanted to contribute).

    Whenever a players x or y is updated i run this function which is inside the player class on the server.

    It essentially loops through all the other players in the room, and compares their x and y coordinates to the 1 player who just moved. If the other_players.x is < (player.x-0.4) && other_players.x is < (player.x+0.4) that means they are touching in terms of x axis (my players are about 1 unit wide.

    then if other_players.y is < (player.y-0.2) && other_players.y is > (player.y-0.5) that means my player is higher than them at about head level. You would have to play with the values depending on your character size

    If both of these are true i run the function to kill them and send that message to all the connected clients where they can vanish the player. I also add them to an array with a timeout so that if they are in that array they cannot be killed again within 2 seconds

    Hope this helps someone!

    posted in Questions & Help •
    RE: Reasons for onLeave code 1000 (Solved)

    Figured it out - there was an error in my server code when a player quits. When an exception occurs in a room i guess it kills the room, kicks all the players out with code 1000! Didn't know about that! Hope someone finds this helpful

    posted in Questions & Help •
    Reasons for onLeave code 1000 (Solved)

    Hello,
    I got over 1000 users kicked out of my multiplayer room on my custom server today. I am having trouble sorting out why the users are getting booted out. I have tested and got "randomly" booted out myself. I added logs for the two places I call in my client code room.leave(). Neither of these cases are being hit.

    What are the possible reasons for a onLeave callback with a code 1000? The documentation just says "Successful operation / regular socket shutdown", but in this case i am not calling .leave(). The room is also not shutting down - not everyone is getting kicked out.

    What are the possible reasons for a code 1000?

    Thanks,
    Mitch

    posted in Questions & Help •
    Order or Events for user joining room

    Hello!
    Successfully running a self-hosted Colyseus server for my educational real-time multiplayer platformer game. Really loving the framework.

    I am getting issues with bugs in my client code when a user joins an existing room and have been refactoring it.

    Is there any kind of diagram or list of what is sent in what order when a new user joins a room? Like is there a consisent order of what is sent to a client when they connect first? This would be when other users exist in a room. Some of the items im curious of the order are...

    • room.state.players.onRemove
    • room.state.players.onAdd
    • player.onChange = function(changes)
    • room.onStateChange.once
    • custom methods from server (this.broadcast on server)

    It would be nice if an existing game is going on and a new client joins to know what callbacks in what order would be triggered. Is it consistent. Im trying to look through the code but it is a good size code base

    Thanks,
    Mitch

    posted in Questions & Help •
    RE: Colyseus Server Freezes On Error(solved)

    Hello,

    Im on MacOS 11.6.1 and using Node 16.14.0

    I actually fixed it by changing in package.json
    "start": "ts-node-dev --respawn --transpile-only src/index.ts",
    to:
    "start": "ts-node --transpile-only src/index.ts",

    Turns out the --respawn flag was making it hang upon an error.

    I just had one of my colyseus message channels throw an error like this: "let b = c.d" where c is undefined.

    Now if i could just get it to report errors to RayGun or Sentry upon crash that would be great - seems like a different thread though probably

    posted in Questions & Help •
    Colyseus Server Freezes On Error(solved)

    Hello!
    I am having big issues with my Colyseus server, when my server experiences an issue, it doesnt crash or keep going, it just freezes. If it crashed thats fine, i could use nodemon or pm2 to restart it and report the error, but it just hangs. Having 0 bugs is totally unrealistic. Only thing i can think of is wrap every piece of server code i write in a try {} catch (e) {} but that feels sketchy. Does anyone have a way to keep Colyseus running or have the process terminate on crash?

    Thanks,
    Mitch

    posted in Questions & Help •