PirateGame / Pirate-Game-Backend

1 stars 0 forks source link

Make the turn timer work #73

Closed portaljumper007 closed 3 years ago

portaljumper007 commented 3 years ago

Requires socket.io and some sort of async timer system on the backend.

Alex40144 commented 3 years ago

if we use socket io, will the games have to be "persistant" for this to work?

portaljumper007 commented 3 years ago

if we use socket io, will the games have to be "persistant" for this to work?

No, if I'm understanding you correctly 👯

portaljumper007 commented 3 years ago

The website should open a (for example) 30 secondly special new turn http request so that app.py can wait for the second, then trigger the new turn. This is an example for a 30 second turn timer.

Alex40144 commented 3 years ago

well, with sockets there is no "requests" so the backend will have to run the timer or tell the client to return a "do nothing" if time runs out.

I am hoping sockets has some sort of could not contact client thing

portaljumper007 commented 3 years ago

well, with sockets there is no "requests" so the backend will have to run the timer or tell the client to return a "do nothing" if time runs out.

I am hoping sockets has some sort of could not contact client thing

Okay, if the backend needs to asynchronously time we may have to introduce threading and weird stuff... What's important in my opinion is that communication with the backend does NOT interrupt its runtime, right now if you send something to the backend it will interrupt what it's doing, that needs fixing (some sort of queue system.)

portaljumper007 commented 3 years ago

It works! Woop!