Forum C# Users out of rooms

Users out of rooms

Postby vitsum » October 29th, 2012, 9:58 am

In my game I want users to be in one room only when they are fighting. But the store should be out of rooms?
Or should I create one room for every user?
vitsum
 
Posts: 26
Joined: October 26th, 2012, 8:14 am

Re: Users out of rooms

Postby Benjaminsen » October 29th, 2012, 2:53 pm

I personally use a separate service room type to handle this case.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Users out of rooms

Postby vitsum » October 29th, 2012, 3:27 pm

service room - is it a special type. or is it just the same room type?
vitsum
 
Posts: 26
Joined: October 26th, 2012, 8:14 am

Re: Users out of rooms

Postby Benjaminsen » October 29th, 2012, 3:44 pm

Personally I just connect users to a roomtype of my own personal service type room. Typically with each user in a room with their connectUserId as the roomId.

This allows me to use the service room as an easy way to locate an online user as well.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Users out of rooms

Postby vitsum » October 29th, 2012, 4:04 pm

How many users can be in such room? what if I will have thousands of users? :)
vitsum
 
Posts: 26
Joined: October 26th, 2012, 8:14 am

Re: Users out of rooms

Postby Benjaminsen » October 29th, 2012, 4:06 pm

vitsum wrote:How many users can be in such room? what if I will have thousands of users? :)


I create one room per online user :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Users out of rooms

Postby vitsum » October 29th, 2012, 4:33 pm

ok. and so, user can get list of rooms... and if he will want to send some message to someone, he may find the room in list of rooms, etner it and send a message. Rooms can be named like. User123-serviceroom, so I can locate anyone if he is online.
althogh, I could store information about online users and their rooms, in bigDB...
vitsum
 
Posts: 26
Joined: October 26th, 2012, 8:14 am

Re: Users out of rooms

Postby Benjaminsen » October 30th, 2012, 10:51 am

vitsum wrote:ok. and so, user can get list of rooms... and if he will want to send some message to someone, he may find the room in list of rooms, etner it and send a message. Rooms can be named like. User123-serviceroom, so I can locate anyone if he is online.
althogh, I could store information about online users and their rooms, in bigDB...


You can do it even cleverer than that. Say you have a list of friends and you want to know their online status, you do a simple BigDB.loadKeys to get your friends status.

To talk to an online user, you simply connect to the room he should be in if online. EG connectUserId-serviceroom or some such.

You do not want to use ListRooms to validate online status, as listrooms only allow up to 1000 entries per request. Thus you would be unable to see more than 1000 users online at the same time.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to C#