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. Wenish
Wenish

Wenish

@Wenish

Chat Follow Unfollow
4
Reputation
8
Posts
2.1k
Profile views
0
Followers
0
Following
Joined 8 Jun 2018, 13:08 Last Online 11 Mar 2022, 12:01

  • 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 • 1 Mar 2022, 03:20
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 • 28 Feb 2022, 16:05
RE: Integrating Database (sovled)

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

posted in Questions & Help • 3 Jun 2021, 17:21
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 • 9 Jul 2020, 17:20
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 • 6 Nov 2019, 17:28
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 • 12 Feb 2019, 11:50
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 • 12 Feb 2019, 09:41
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 • 8 Jun 2018, 13:17

© 2023 Endel Dreyer