I'm trying to create a local multiplayer system, where it will have a script for the "server" and several "clients" will be able to connect. For now I will use in a simple test application, where users will create their accounts, will log in and on the screen of each user that is connected will appear the list of all who are connected. The list would be changed on all clients when a user logs in or out.
The way I was doing, when the client wanted to do some action, such as login for example, it recorded a string in a text file, for example 'login user password'. So I had the server script that was in an infinite loop reading all these files (each open client would be 1, not necessarily the connected user) and saving the same response file, for example:
Text file:
client_request:login usertest 1234
server_answer:wrong_password
But it was slow, with some problems and I think it's a bit of a problem to keep recording and reading text files without stopping. I wanted some idea how I could do it in a better way, without using files!
If it was not clear, I try to explain it again.