> For the complete documentation index, see [llms.txt](https://help.pokerscript.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pokerscript.net/code-deployment/game-engine.md).

# Game Engine

Heart of the poker software with Game Server (Real-Time Data Transfer), Backend Logic, and Files with endpoints configurations. 100% open-source, with ZERO third-party.

Poker is a multiplayer game that needs real-time communication between the player's actions and dataset exchange. Here, the game engine act as a facilitator on the back of the Redis server along with the regular web server. The web server holds the permanent dataset stored on MongoDB with a UI-enabled panel we say admin dashboard. An error-free interconnection between both servers is very much required to run the game.

{% hint style="info" %}
**Notice**\
Our aim is to minimize operational costs. No third-party game engine like [Photon Engine](https://www.photonengine.com/pun/pricing) is required. Everything is open source and configured to align with this specific need.
{% endhint %}

**Game Server Code Deployment - Ubuntu Server**

This folder consists of two separate but inter-connected file sets. The web server will execute the Admin Dashboard activities while the game server handles the real-time communications for each gameplay. The PM2 which is a production process manager for Node.Js will keep applications alive forever with 99.99% uptime.\
\
Follow the below-explained steps for code placement.\
`-Put game server and dashboard files inside /home/ubuntu/folder-name.`\
`-Go inside the folder one by one and run pm2 start js-file-name.`\
`i. Go inside the game server and run pm2 start js-file-name (app.js).`\
`ii. Go inside the web server [dashboard] and run pm2 start js-file-name (bin/www).`\
`-Check pm2 logs for check running or error.`\
`-For the dashboard in the browser use a URL with port [3838].`

Now, you are able to access the Admin Dashboard. Create your first poker table.

**Code Configuration - Files Update**

Now, it's time to configure the code for your domain/IP. Follow the file path instructions to update details. Make sure you edit and save the same file as described here.

**Go to Folder:** \
`-Game-Server-Folder/game_server/config/server.json` \
`-Replace example.com with the real domain name`.\
`-Update the game server IP.`

Open the file in IDE and search for the database.

`{` \
`"development":{` \
`"database":[` \
`{`\
`"id":"database-server-1",`\
`"host":"Update the IP",` \
`"port":6051,` \
`"auto-restart": true`\
`}` \
`],`\
`"room":[` \
`{`\
`"id":"room-server-1",`\
`"host":"Update the IP",` \
`"port":4151,` \
`"auto-restart": true,` \
`"restart-force": true`\
`}` \
`],` \
`"connector":[` \
`{`\
`"id":"connector-server-1",` \
`"host":"Update the IP",` \
`"port":4050,` \
`"connectHost": "connector.example.com",` \
`"clientPort": 3050,` \
`"frontend": true,` \
`"auto-restart": true`\
`}` \
`],`\
&#x20;`"gate":[` \
`{`\
`"id": "gate-server-1",` \
`"host": "Update the IP",` \
`"port": 4014,` \
`"connectHost": "gate.example.com",` \
`"clientPort":3014,` \
`"frontend": true,` \
`"auto-restart": true`\
`}`\
`]`\
`}`

**Go to Folder:** \
`-Game-Server-Folder/shared/systemConfig.json` \
`-Replace example.com with the real domain name.`

Open the file in IDE and search for the wordpressHost.

`"wordpressHost" : "https://example.com",` \
`"from_email": "noreply@example.com",` \
`"becomeAffMail" : "noreply@example.com",` \
`"accountMail" : "noreply@example.com",` \
`"mail_subject" : "Your signup request has been proceed",` \
`"mail_content" : "Hello,Your request has been proceed. Admin will contact ASAP",` \
`"serverVersion" : "1.",` \
`"clientVer" : "1.0",` \
`"protocol" : "https://",` \
`"emailHost" : "dashboard.example.com",` \
`"emailPort" : "3838",` \
`"websiteLink" : "https://example.com/",` \
`"feedbackMail" : "feedback@example.com",` \
`"allowedImagesType" : ["png", "jpg", "jpeg"],` \
`"imageUploadHost" : "https://example.com:3838",` \
`"mailFromAppName" : "Project Name",` \
`"dbHost": "",` \
`"inMemoryDbHost": " ",` \
`"wiredTigerDbHost": " ",` \
`"logDBHost": " ",` \
`"financeDBHost": " ",` \
`"adminDBHost": " ",` \
`"sendErrorMailWebServer" : "noreply@example.com,",` \
`"gameNameText" : "Project Name",` \
`"websiteRefrenceText" : " ",`

**Go to Folder:** \
`-Game-Server-Folder/web-server/views/src/dashboard/js/main.js` \
`-Replace example.com with the real domain name.`

Open the file in IDE and search for the websiteLink.

`rootTools.websiteLink = "https://example.com/";`

**Go to Folder:** \
`-Game-Server-Folder/shared/ stateOfX.js` \
`-Replace example.com with the real domain name.`

Open the file in IDE and search for the linkForAppDownload.\
\
`stateOfX.linkForAppDownload = "http://example.com";`

Enjoy, for this section the file deployment, and code configuration is completed.
