What is it?

This project is a chat client and a basic game, both made using networking and multithreading in C#.
For this project, I had to make a chat client and a real time graphical program. So, I decided I would make the graphical component to be a basic 3D scene that players could walk around, and the chat client to be a chat room where users could sent global or private messages and play text based games.

Who did what?

Chat client

Bird icon
Cat icon
Parrot icon
Octopus icon
Dog icon

Game

Monogame
Sand texture
Seabed texture
Water texture
Fish model
Code used for text rendering in ClientName
Everything else in the project was done by myself

When was it worked on?

Work started on the project around September 2020 and finished around Christmas 2020

What are the controls?

For the chat client, click on the name box to enter a name then click connect. To send a message, select the chat box, type the message then press enter or hit send. To use an emote, click on one of the emotes in the box next to the chat box. To send a private message, select a user from the client list, then send a message. To swap between private and public messages, hit the escape key.
For the game, WASD to move and the mouse to look.

What went right/wrong during development?

One of the things that went right in the game was the use of dead reckoning. If the client sent a new position to the server each time their position changed, there would be a lot of redundant data. So instead, the client sends its velocity when it changes. This allows each client to interpolate the position of the other clients. To keep this accurate, the client also periodically sends position/velocity data. With this implemented, the game is able to use less bandwidth.
One of the things that went wrong for the game was how the server handles the players. As mentioned earlier, each client sends position/velocity data periodically and when velocity changes. All the server does is pass this data on to each other client. While this method does work, it has a major flaw in that it fully trusts the data it receives from the client. This means that if a client cheats and moves out of bounds, the server is unable to stop them. While this isn't an issue for the current game (as no bounds checking was intended), this would obviously be an issue in a larger project.
One of the things that went right for the chat client was the use of encryption. When a client connects to the server, it sends an initial connection packet containing its public key. The server then responds with its own public key. From this point on, all data transmitted between the server and client is encrypted.
One of the things that went wrong for the chat client was the use of BinaryFormatter for serialisation. The BinaryFormatter is a bad choice for serialising data as when it deserialises, it will run some code of the deserialised type. As a result, remote code execution is possible. This is a vulnerability that I was aware of going into the project, however due to time constraints, I was not able to use an alternative method for serialisation.

Where can I access the source code?

The source code can be found on my github account. Alternatively, you can click here for the chat client or here for the game.

Screenshots