Corrupted Memory, you are a security specialist sent to investigate a futuristic supermarket
that has been taken over by a rogue AI. You must fight off the AI by scanning corrupted
merchandise stopping the AI from spreading to the rest of the world.
This project was created as part of a 3rd year university project. The project was created
using Unreal Engine 5.1, C++, Nodejs and JavaScript. The project was created in solo testing my
ability to create
scalable backend systems including a custom lobby system using Expressjs and Websockets.
Webserver Source
Client Source
The Lobby System was created using Nodejs, Expressjs, Websockets and SQL. It was designed
to be scalable and able to be used in any dedicated server based UE5 project. The system was
designed to be able to handle multiple lobbies at once and to be able to handle up to 4 players
in each game. Using Websockets the lobby system is able to display real time information to
the players in the lobby such as the current players in the lobby and their ready state.
The Client communicates with the server via basic web requests and websockets. Web API requests
are
used to handle the creation of lobbies, joining of lobbies, leaving of lobbies, and logging in
actions that don't particularly need to be real time. Websockets are used to handle the real
time
actions such as the updating of the lobby information and the ready state of the players in the
lobby.
For the Authentication of web requests I used JWTs (JSON Web Tokens) to authenticate the
requests. The JWTs were created using a secret key that
was stored on the server via .env files that are manually added for security. The JWTs are
created when users login producing a session that can be verified by the server this token is
then stored in the games instance
class so that the information is retained over different levels. I also used Bcrypt a popular
and widely tested algorithm to hash the
passwords of the users when they are stored in the database. This is done to ensure that if the
database is ever compromised the passwords are not stored in plain text.
Players are assigned permissions ie. 'JOIN_LOBBY', 'CREATE_LOBBY', 'DELETE_ACCOUNT' etc. These
are used to regulate what actions the player can perform on the server. These permissions are
stored in the database and are assigned to the player when they login. This is done to ensure
that players can only perform actions that they are allowed to perform.
The database was created using mariadb a SQL based database and was designed to be able to store all the information required for the lobby system and normalised to do so. The database was designed to be able to store the users information such as their username, password, and permissions. The database was also designed to be able to store the information about the lobbies such as the lobby name, the players in the lobby, the players ready state, the server port, the server state and the creator of the lobby. The database by design is able to handle multiple lobbies at once and can handle up to 4 players in each game.