kuninoto / 42_ft_transcendence Goto Github PK
View Code? Open in Web Editor NEWA website with user accounts/profiles and relations (friendships & blocks), real-time multiplayer game and chat (DMs & rooms)!
License: GNU General Public License v3.0
A website with user accounts/profiles and relations (friendships & blocks), real-time multiplayer game and chat (DMs & rooms)!
License: GNU General Public License v3.0
When blocking a request still leaves on pending.
When request is declined and you can't search for the declined users and if the declined try to send request again doesn't appear on friends requests.
Basically "declined" status is behaving like blocked. W/o the "not be able to search" part, "declined" can be change to "blocked", block table can disappear, and on decline just erase the relation from db.
Add some type of player readiness to assert that both players are ready to start the game
Upon user (player) connection to game-gateway, enqueue and if there are more than 2 players waiting dequeue both and create a Room for them
OR
Upon user connection to game-gateway create and assign a room for him and later, when a new player arrives, add him to that room
Using the chat socket the backend sends events acknowledgeding that a new achievement was unlocked and the frontend shows a popup with which achievement and its description.
When I tried to run the app on my side I was not able to login properly with 42's auth and this error popped on the frontend container logs:
frontend |
frontend | Import trace for requested module:
frontend | ./node_modules/ws/lib/validation.js
frontend | ./node_modules/ws/lib/receiver.js
frontend | ./node_modules/ws/wrapper.mjs
frontend | ./node_modules/engine.io-client/build/esm-debug/transports/websocket-constructor.js
frontend | ./node_modules/engine.io-client/build/esm-debug/index.js
frontend | ./node_modules/socket.io-client/build/esm-debug/url.js
frontend | ./node_modules/socket.io-client/build/esm-debug/index.js
frontend | ./contexts/GameContext.tsx
frontend | ./app/matchmaking/finding-opponent/page.tsx
frontend | - warn ./node_modules/ws/lib/buffer-util.js
frontend | Module not found: Can't resolve 'bufferutil' in '/app/node_modules/ws/lib'
frontend |
frontend |
frontend | Import trace for requested module:
frontend | ./node_modules/ws/lib/buffer-util.js
frontend | ./node_modules/ws/lib/receiver.js
frontend | ./node_modules/ws/wrapper.mjs
frontend | ./node_modules/engine.io-client/build/esm-debug/transports/websocket-constructor.js
frontend | ./node_modules/engine.io-client/build/esm-debug/index.js
frontend | ./node_modules/socket.io-client/build/esm-debug/url.js
frontend | ./node_modules/socket.io-client/build/esm-debug/index.js
frontend | ./contexts/GameContext.tsx
frontend | ./app/matchmaking/finding-opponent/page.tsx
frontend |
frontend |
frontend | ./node_modules/ws/lib/validation.js
frontend | Module not found: Can't resolve 'utf-8-validate' in '/app/node_modules/ws/lib'
frontend |
frontend |
frontend | Import trace for requested module:
frontend | ./node_modules/ws/lib/validation.js
frontend | ./node_modules/ws/lib/receiver.js
frontend | ./node_modules/ws/wrapper.mjs
frontend | ./node_modules/engine.io-client/build/esm-debug/transports/websocket-constructor.js
frontend | ./node_modules/engine.io-client/build/esm-debug/index.js
frontend | ./node_modules/socket.io-client/build/esm-debug/url.js
frontend | ./node_modules/socket.io-client/build/esm-debug/index.js
frontend | ./contexts/GameContext.tsx
frontend | ./app/matchmaking/finding-opponent/page.tsx
frontend | - error api/api.ts (14:29) @ localStorage
frontend | - error ReferenceError: localStorage is not defined
frontend | at eval (./api/api.ts:18:36)
frontend | at (sc_client)/./api/api.ts (/app/.next/server/app/auth/page.js:710:1)
frontend | at __webpack_require__ (/app/.next/server/webpack-runtime.js:33:43)
frontend | at eval (./contexts/AuthContext.tsx:9:66)
frontend | at (sc_client)/./contexts/AuthContext.tsx (/app/.next/server/app/auth/page.js:754:1)
frontend | at __webpack_require__ (/app/.next/server/webpack-runtime.js:33:43)
frontend | at eval (./app/layout.tsx:9:79)
frontend | at (sc_client)/./app/layout.tsx (/app/.next/server/app/auth/page.js:743:1)
frontend | at __webpack_require__ (/app/.next/server/webpack-runtime.js:33:43)
frontend | 12 | headers: {
frontend | 13 | 'Content-Type': 'multipart/form-data',
frontend | > 14 | 'Authorization': `Bearer ${localStorage.getItem('pong.token')}`
frontend | | ^
frontend | 15 | },
frontend | 16 | })
frontend | 17 |
Also, we should check for a scenario where the browser history has the 42 authentication saved (so that allows the user to bypass the 42's login credentials) but the 42's session has expired or if the user is in AGU (he can type his credentials and trigger the 42's auth but most probably a 401 is also returned)
Add:
theme : { background: string, paddle: string, }
When one of us creates an account on the site an achievement relative to being one of the developers is assigned
(check by intra name upon user creation)
Seems like the Socket user is always the id 1. But it might be due to me directly editing stuff on the DB. Need another account to verify that
Everything to change darling
Create endpoint for friend_requests from /me to /me/friend_requests
Create endpoint for friends from /me to /me/friends
Remove friendship_* from every /friendship name (eg. friendship_name -> name)
My code : friend.friend_name
Send friendship information in /users/{id} and block status
Automatically reject friend request when blocked
Remove blocked, friends, (not on pending requests) and self from /users/search
with nginx (?)
Discuss and take in consideration the possibility of adding the option to play vs AI
The frontend it's just the reflection of backend's logic, this means that the paddle, ball and score aren't connected in anyway they just update when needed
Which mean:
Both clients emit the paddle position to the bo
The bo starts the ball position and speed and because it has the paddles can also do the collisions
So for the frontend that only receives the ball position the collisions are meaningless.
Every time the ball passes one of the sides (point) an event from bo is emitted with the new scores.
There is one emit on bo with the paddles and ball position (to reset), then a 2~3 seconds delay w/o emits, and the game starts again.
score passes the max. Bo emits a winner message with the winner and disconnects both
Add some type of abort system to a situation where 2 users are assigned one room as for the matchmaking but one of them leaves
To implement: route (?) to request user's info using username approximation (regex ?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.