Answer the question
In order to leave comments, you need to log in
How to make a random chat?
I am making a random chat where the user communicates with a random interlocutor. So, in principle, everything is ready, but I'm not sure if I'm doing it right ...
There is an array, rooms are stored there, and there is only one room or nothing. And so actually how it all works:
The user presses the "Find" button. The server checks the array:
-If the array is empty, it creates a new room and adds the room ID to the array. We display the message "Wait ..." for the user.
-If there is already an element in the array, then we connect to the room, remove this room from the array. Communication begins.
Am I doing the right thing? If not, please suggest your choice.
Answer the question
In order to leave comments, you need to log in
There is an array, rooms are stored there, and there is only one room or nothing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question