Closed huumanoid closed 8 years ago
Regarding the guest user id generation, there's a problem. Following the original xat behavior, when a guest user connects to the flash client, it makes a request to http://www.xat.com/web_gear/chat/auser3.php
and there is where the guest user id generation is done rather than on the server.
About id generation: yes, you are right, and this implementation of server provides such behavoir. I mean that server don't generate user id. It generate temporary guest id, like xat do. Have you noticed that users without id (new users) nonetheless have an id in range [1999900000 ; 2000000000)?
Before send message, user have to receive non-temporary id. So, tempusers can't send ids. I think there is misunderstanding in our terminology. Let's discuss this. When i say 'guest' i mean temporary user without nontemp id. Maybe it's better to call it 'tempuser'?
@HuuMaNoID Oh ok, now I understand, let's leave as it is right now. I think all is ready to merge :dizzy:
Features added:
1. Private messages routing now is like xat's ones.
'p' messages now sends only when sender and receiver are in the same chat.
2. 'z' messages routing like xat's ones.
When i say 'z' messages, i mean both private and locate messages.
Let's say user S is sender and user R is receiver. If S and R in different chats, R receives message in chat where it has been last active. If S and R are in the same chat, R receives message in the same chat too, no matter where it has been active last time.
3. Now locate and answers to locate routed as it should be
But do we need such behavior?
4. Guest users are ok.
To become a guest user, set your id to 0 (it is configurable) and try to auth. For other users, your id will be between [1999900000, 2000000000). If you have id but not registered, it can connect to chat too.