Server-Side Code of the Chat Room
I am using json_simple. I didn't make it.
Example of JSONs:
To Server: { "name": "Alex", "message": "This is a test", "time": 7894612543 }
From Server: { "name": { "text": "Alex", "colour": { "red": 30, "green": 187, "blue": 92 } }, "message": { "text": "This is the message", "colour": { "red": 30, "green": 187, "blue": 92 } }, "time": 157951354513215 }
OR
{ "messsage": { "text": "Alex has joined the chat", "colour": { "red": 20, "green": 78, "blue": 197 } }, "time": 15798715648684 }