Skip to content

feat(server): implement Redis based queue with ZSET and metadata storage#105

Open
dharapandya85 wants to merge 3 commits intoArenax-gaming:mainfrom
dharapandya85:feature/phase-5-gaming-engine
Open

feat(server): implement Redis based queue with ZSET and metadata storage#105
dharapandya85 wants to merge 3 commits intoArenax-gaming:mainfrom
dharapandya85:feature/phase-5-gaming-engine

Conversation

@dharapandya85
Copy link
Copy Markdown

Fixes: #86
server/src/controllers/match.controller.ts
checks for match state active or not
created rating constant with calculatingRating function
returns rating as JSON

server/src/routes/match.routes.ts
calls MatchController
fetches POST request from matches with id and report constraints
this reports results

server/src/services/elo.service.ts
created a class EloService, calculateRating parameter with calculation of newRatings

server/src/workers/matchmaking.worker.ts
logic for stale players removal
if waitTime greater than stale_timeout, removes stale player
tryMatch creates a match if opponent exists

server/src/workers/reaper.worker.ts
creates class ReaperWorker with checkExpiredMatches to check for expired matches
updates match in prisma with FORFEIT state

server/src/services/match.service.ts
joinQueue adds player to matchmaking queue
leaveQueue removes player from the queue
createMatch returns ids of player, with status pending

server/prisma/schema.prisma
added matches, eloHistory in User model
created model match with id, players id, state, player reports, eloHistory, createdAt, updatedAt
created model elohistory with id, matchId, userid, match, user fields, oldRating, newRating, delta, createdAt,
enum MatchState with PENDING, ACTIVE, SETTLED, FORFEIT

server/src/app.ts
calls MatchMakingWorker and ReaperWorker to start

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 22, 2026

@dharapandya85 is attempting to deploy a commit to the paul joseph's projects Team on Vercel.

A member of the Team first needs to authorize it.

@anonfedora
Copy link
Copy Markdown
Contributor

Resolve conflicts, please

@dharapandya85 dharapandya85 force-pushed the feature/phase-5-gaming-engine branch from bd7b58f to 43ac9c9 Compare February 25, 2026 09:53
@anonfedora
Copy link
Copy Markdown
Contributor

Please, let the frontend and server ci pass, at least. They are easy to fix

@dharapandya85 dharapandya85 force-pushed the feature/phase-5-gaming-engine branch from a90cdbe to a6ce6e0 Compare April 11, 2026 17:14
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Apr 11, 2026

@dharapandya85 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MATCH-01] Redis Matchmaking Architecture

2 participants