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.
Posts made by Wenish
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
Take a look at typeorm
https://www.npmjs.com/package/typeorm
definitely nice game. i like the camera touch.
and maybe you should let a lawyer look at your tos.
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.
@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
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
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