Skip to main content

Architecture

This page serves to give you more information about how mCasino works.

Basic Features​

Gems​

Gems are the core currency of mCasino, it allows multiple currencies to be easily added into the system without having to change anything.

They also serve as a way to dissociate the player's currency from the real thing, which is a common casino technique.

Lobby System​

Some mCasino games such as Blackjack and Coinflip use the lobby system. This is a shared system across mCasino which allow games to have a common way of setting up lobbies.

They normally consist of the main game panel being inherited from the lobby panel, and being injected with the game information, as well as a game view which handles the entire game.

The system behind the scenes allows games to hook into when players join, leave, and sync game session information.

Technical Features​

Main Frame​

The main frame of mCasino is known as the "root panel". This panel should always have games and other panels attached to it, as child components will search for this root panel for information implemented on it.

The root panel frame should be registered with mCasino using mCasino.setRootPanel in the PANEL:Init method before any components are added.

There are other methods that are required so have a look in the cl_frame.lua file for more info.

Data Updates​

Almost all mCasino panels have some live information about them that change constantly, in order to handle this, panels must be registered and unregistered based on if the client needs to know the data or not.

This is very easy to hook into and can be seen in the kit games. This is normally done at the end of PANEL:Init using mCasino.setPanel and then is unregistered in PANEL:OnRemove.

In the background this allows mCasino to optimize performance, as data that does not need to be known is never sent to the client.