Page 1 of 1

RoomList to Guests

Posted: 07 Jan 2011, 11:47
by yaswanth
Hi,

Is there way to show the room lists to guests?
My problem is as follows:

I have a customLogin implemented, this checks the login/password combination in database, this means that no guest logins are allowed (am I wrong?).

Now, I want to show the list of rooms to anybody who visits the page, but has to login to play a game. Is this possible without any dirty hack?

I was more thinking on lines of
1. SFS Connect
2. getRoomList (this doesn't work on login!!!!)
3. Login if required and play game.

But I have observed that getRoomList does not work without logging in.

This is the solution I have thought of.
1. Generate a random guest name in the client and do a login to the server. Set a user property indicating he/she is a guest.
2. Then when user joins a game, kick him out and display a login box (Dirty)

I see a lot of dirty and hacked code with this.

Is there a better way?


Regards,
Yaswanth

Posted: 07 Jan 2011, 13:36
by appels
It would be easier just to use priviliges, assign guest at login with no rights to join any rooms so he can retrieve the rooms list.
Then once he's ok to join a room, change his privileges.

Smartfox Privileges

Posted: 07 Jan 2011, 17:15
by yaswanth
Hi appels,

Thank you for your reply. Essentially, even I was thinking that it would be good if there was some kind of ACL for smartfox as well. But from what you speak, does smartfox have any inbuilt privilege system? I have seen only one about Spectator, Player, Moderator.

Can we create our own users with custom privileges? In fact it would be great if you can point me in that direction.

Regards,
Yaswanth

Posted: 07 Jan 2011, 17:54
by appels
hmm yes, in SFS2 there is, didn't see this was for SFS1 but if I recall there is one also. If not you would need to do it like you said. Check the docs.