Skip to content
Back to work

FEUP · Parallel and Distributed Computing · 2024

Matchmaking Game Server

A concurrent client–server system with authentication, ranked queues and reconnection.

The problem

Design a game server that many clients can use at the same time: authenticate players, match them into games in casual or ranked mode, and stay correct when clients are slow or disconnect.

What was built

  • TCP server that hands each client connection to its own handler thread.
  • Shared matchmaking queues guarded by explicit locks to avoid race conditions.
  • Ranked mode only pairs players whose ranks are within a fixed threshold; a casual queue matches on arrival.
  • Session tokens let a disconnected player rejoin and resume a match found while they were away; timeouts keep slow clients from blocking others.
  • Credentials stored as SHA-256 hashes; games are played as Tic-Tac-Toe over the terminal.

My role

Group project for the Parallel and Distributed Computing course.

Technologies

  • Java
  • TCP sockets
  • Threads
  • ReentrantLock
  • SHA-256