3.2.53 • Published 1 year ago

live_dealer_roulette v3.2.53

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Roulette

Description of the game

Game controlled by state machine (stateMachineConfig.ts), game logic split on UI components and business logic. Business describe in services (/core/service):

  1. App service - controls the operation of the application, there is no connection with the game
  2. Chat service - all chat activities, chat with dealer and other player
  3. Game service - main game service, all game control, game state management
  4. Player service - player settings, video settings, audio settings, everything what related to player
  5. Stream service - stream control, stop, run, size and other

Docs:

How build game

  1. Download and install packages: npm run i
  2. Download submodules: npm submodule update
  3. Run dev serve: npm serv

How deploy game:

Deploy works with JIRA integration based on bash scripts and bitbucket-pipelines.yml config All scripts located in submodule/platform/scripts

  1. deploy.sh - main game deploy script
  2. pre_pull_request.sh - run on each PR before merge to master
  1. Bitbucket pipeline section BitBucket
  2. Chose branch
  3. Press RUN

Development rules

  1. Create a branch according to the creation rules (check README.md in platform submodule)
  2. Do develop
  3. Create pull request
  4. Deploy implementation for checking by QA
  5. Merge to master

alt text

Stream

  1. Stream doc Stream

alt text

Regular roulette flow

alt text

State machine playground

  1. Copy code from stateMachinePlaygroundConfig.ts into State machine visualizer
  2. Press Visualize
  3. You will see roulette state machine, play with it to understand how it works

Structure

Main game states and handlers

  1. INTl - Initial game state, on this state APP loading all assets, translation and do preparation job like INIT request to server, handler: ChannelInitResponseHandler.ts
  2. GAME STOPPED || GAME PAUSED || CLOSED - SM Manager can stop game, usually its fo for some maintenance handler: ChannelSMActionHandler.ts
  3. PLACE BET - On this state game wait from user action like placing bets, handler: ChannelPlaceBetResponseHandler.ts
  4. NO MORE BETS - On this state user wait while game not choose winning number, handler: ChannelGameStateResponseHandler.ts
  5. WINNING NUMBERS - On this state game show to user his winning number and winning amount, handler: ChannelGameStateResponseHandler.ts
  6. MONEY WHEEL (OPTIONAL) - It is optional state, used in game show roulette, where user can have addition winning bonus, handler: ChannelGameStateResponseHandler.ts

Main game modules

  1. Playground - table where user can make bets and all activities related to main game (Playground.tsx)
  2. Favorite - use can store his favorite bets (Favorite.tsx)
  3. AutoPlay - Allow playing autoplay with some optional parameters (AutoPlay.tsx)
  4. Chat - way of communication with other player or service manager (ChatConnection.tsx)
  5. Statistics - section where user can see most popular and unpopular numbers split by numbers type (Statistics.tsx)
  6. Bet limits - section where described bet limitation per bet type (BetLimits.tsx)
  7. History - user activities from all games, not only from roulette (HistoryConnection.tsx)
  8. Settings - section where user can change his settings (Menu.tsx for mobile or Header.tsx for desktop)

alt text

Code styles

How do I name the style files?

  • There is only one style file in the folder with the component

For example:

MyComponent.tsx
myComponentSytles.scss
  • There are multiple style files in a folder for different devices or screen layouts

For example:

MyComponent.tsx
myComponentD.scss
myComponentM.scss
myComponentP.scss
myComponentL.scss

Where the capital letters D / M / P / L denote, accordingly, desktop / mobile / portrait / landscape