8000 GitHub - Waleed101/Blackjack-Server
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Waleed101/Blackjack-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Online Blackjack Server

Goal: Create a multi-threaded application for online blackjack that allows multiple players to play concurrently, ensuring fairness and synchronization by using semaphores to regulate access to the game state.

Technologies & Languages:

  • C++
  • JavaScript & TypeScript
  • Node.js
  • Docker
  • React.js

Key Learnings

Connecting the C++ server to the React front end was an obstacle that the team had to overcome. Due to React’s inability to establish a TCP socket with the server, the team needed an unorthodox solution to allow the client and server to communicate properly. We decided to implement a node js express middleware that receives the HTTP requests sent from the React frontend, and depending on the HTTP data writes relevant data to the appropriate socket that is connected with the C++ server. The server would then receive these packets from the express API and update the game state accordingly. For every game update, the server broadcasts the game state to each active socket which is temporarily stored in the express middleware and relayed to the React frontend for every GET request. Our team also learned how to use a vector object to keep track of active threads. This allowed for practical referencing to active threads for easy garbage collection and management. Finally, our team learned how to make our application both multi-transactional and multi-user. This was a combination of the key learnings that we took away from previous labs that allowed multiple players to play at the same table and also have multiple tables running when there are no more seats left at a table.

Design

Synchronization of Objects

Thread Management

Termination

In-Game Screenshots

First loading screen...
First loading screen

Betting screen...
Betting screen

Individual turn...
Individual turn

Player winning...
Winning

Multiplayer.png
Multiplayer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0