Reaster0 / ft_transcendence

la transcendaaance
0 stars 2 forks source link

corrected some stuff and logic for watch since chat interface #122

Closed Ala-Na closed 2 years ago

Ala-Na commented 2 years ago

Opened an issue about it (see 121)

Annnd that's all for today folks ! ;)

Reaster0 commented 2 years ago

wait... you already have merged your modifications in main elsewhere D:

Ala-Na commented 2 years ago

Store is needed here because connection to game websocket is made from chat page and not game page. Which is essential to know if player is inside an ongoing game or just watching/inside a game which ended/... User is redirected on game page only if the game is ongoing, if not he stay in chat and game websocket is disconnected. Because a game socket connection is made once Game page is mounted, I have to be careful to not open a second websocket. This is why I use store : To keep track of the already made game socket through the change of page and to keep essential information (was it for playing ? was it for watching ? if so, which match ?).

Reaster0 commented 2 years ago

okay so after more carefull reviewing, i understand more, there was before commit that modify TheGame.vue and i tough that it was the same modification but it's seems to be only a preview of this commit (like a test version)

okay so i get how it work, kinda, like for example, why do you have to get the socket Id of the opponent? theorically you shouldn't need to do that, i just have to get the matchID as url query or with the store if you prefer and it will work like a charm

Reaster0 commented 2 years ago

this part confuse me a lot...like, does that work? because that's really not how i've designed the system to work '^' Capture d’écran 2022-06-25 à 12 16 30

for invitation i was thinking about just sending a link like http://localhost:8080/game?watch=true?matchid=23412341452452

Ala-Na commented 2 years ago

Well, the idea was to create the match inside back only if opponent accepted and by this way bypass the queue for finding a match opponent. Yeah, it's working. Please look ahead, it's working the way it's implemented. If you make it work another way, go on. But for now, this is also working. The only thing I couldn't try is the watch system from chat.