Open vitorenesduarte opened 9 years ago
For now we are returning :ok
for successful requests and :ko
otherwise. It's not very pleasant for the clients who use telnet or nc.
We could send different answers for chat client and telnet client, but I hope it doesn't come to that.
How can we solve this?
Kinda solved. Moved the answers to create, remove and login commands to Common project. Now there's only one place where we can change them and it will keep everything happily working.
Shall we move all?
Since there's one port dedicated to the GUI client we could change all this to JSON.
We will have a problem when we have a chat client. Let's say the client writes in the socket:
Now, if it's successful, our answer is : username, you're logged in. If not: Login invalid. Check valid username or password.
We could test in the client which one it is, but I don't think it's practical, because we would have to do the same in every user action. Besides that, if we change the server, we'll have to change the client.
So, what's the best solution for this?