Navigation

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

    Wenish

    @Wenish

    Chat Follow Unfollow
    4
    Reputation
    8
    Posts
    1320
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

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

    Posts made by Wenish

    RE: Set Authorization headers for backend requests(solved)

    true i sent a link to add-ons. i meant to sent a link for service workers
    https://stackoverflow.com/questions/43813770/how-to-intercept-all-http-requests-including-form-submits#:~:text=js file (the actual service,function(event) { event.

    posted in Questions & Help •
    RE: Set Authorization headers for backend requests(solved)

    Hey probably kinda depends on the specific setup you have.
    But in the room in the "onAuth()" callback you can access the header via the request object you get.
    so on client side set the header with your accessToken
    https://docs.colyseus.io/colyseus/server/room/#onauth-client-options-request

    then for /matchmake or sessions endpoints i would add a express middleware
    https://expressjs.com/en/guide/using-middleware.html

    this would work if you use the express setup for the colyseus server:
    https://docs.colyseus.io/colyseus/server/api/#optionsserver

    also you have have to set on client side the header with some sort of intercepter
    this doc helps if you develop you client for the web:
    https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest

    posted in Questions & Help •
    RE: Integrating Database (sovled)

    Take a look at typeorm
    https://www.npmjs.com/package/typeorm

    posted in Questions & Help •
    RE: Shoot 42 - Texas 42 Domino Game

    definitely nice game. i like the camera touch.
    and maybe you should let a lawyer look at your tos.

    posted in Showcase •
    RE: How best to implement an undo/rewind on the server?

    Disclaimer: I didn't implement such a thing by myself. since it is a little time consuming. so maybe someone has a better solution.

    My understanding how to achieve time traveling.

    You start with your base state:

    {
     players: {}
    }
    

    Now you add a player on server tick 1145
    state looks like this after that

    {
     players: {
      "420": {
       name: "Player 1"
      }
     }
    }
    

    Now you add a player on server tick 5000
    state looks like this after that

    {
     players: {
      "420": {
       name: "Player 1"
      },
      "125": {
       name: "Player 2"
      }
     }
    }
    

    so what you have to do is: save somewhere the base state. and every action you do on the state.
    so example:

    {
     baseState: {
      players: {}
     },
     actions: [
      {
       type: "AddPlayer",
       data: {
       id: "420",
       name: "Player 1"
       tick: 1145
      },
      {
       type: "AddPlayer",
       data: {
        id: "125",
        name: "Player 2"
       }
       tick: 5000
      }
     ]
    }
    

    So when the functions which mutate the state of the room are pure functions.
    You can just recalculate the state with all actions to a specific tick.

    if we are on tick 12'000 and we want to rewind 10 seconds. we calculate 12'000 - 10'000 so we get 2'000
    now we just recalculate all actions in the correct order again which happen to the tick 2'000
    so we would get this state:

    {
     players: {
      "420": {
       name: "Player 1"
      }
     }
    }
    

    this is the basic stuff. their can be alot of performance optimisation.
    like after 2 hours of game time you probably dont want to recalculate the hole state from tick 0.
    so you could save a snapshot of the state all 100'000 ticks

    hope this helps.

    posted in Questions & Help •
    RE: Is Colyseus what I'm looking for?

    @Tobi4s1337 cool

    btw i work on a game launcher atm with the electron-vue

    those are some alpha builds if u wanna see how it comes.
    https://github.com/memgame/game-launcher/releases

    posted in Questions & Help •
    RE: Is Colyseus what I'm looking for?

    Hey @Tobi4s1337

    What you describe is possible with colyseus and colyseus will definitely take some work away.
    And you understood colyseus right. the features u want from colyseus are all supportedö.

    Since you think a client would be a cool idea and u already know vue this one would be super good for you:
    https://github.com/SimulatedGREG/electron-vue

    posted in Questions & Help •
    3d gamelogic libraries which works good with colyseus

    Hey guys

    Can anyone recommend a 3d node library which works good with colyseus?

    Multiple librarys for diffrent stuff is also welcome :)

    Im most interested in things for rts/moba/rpg

    posted in Questions & Help •