Network & Concurrent Programming
The aim of this module was to learn about Networking and Threads. I was given a small framework for a simple chat program, I then had to create all the networking code to connect the clients. The language used was Java.
I implemented a Chat Server which would listen on TCP and UDP ports. I then created new threads for these on both the Server and Client to keep track and communicate with each other.
I then implemented several additional features which are usually required of chat programs, because this used a simple avatar to display the player it was also proximity based.
Features:
- Owner – with access to more \\Commands
- Mod – Access to some \\Commands but not all that the owner can
- Chat Commands and Shorthand Commands
List of Commands:
- \\Join {username} – used to connect to the server and assign a username
- \\Leave – Used to leave the server
- \\Afk – Toggle AFK so other users know that you aren’t there
- \\Shout – Sends text to all users
- \\Whisper {username} – Sends text to a single user
- \\SetOwner – Used by the server when the current owner leaves, is set to the longest connected moderator
- \\SetMod – Used by the owner to set a new moderator
- \\DelMod – Used to remove a moderator, can only be done by owner
- \\Kick – Used by owners and moderators, you can only kick the tiers below yourself.