Hi! I got back to my project after a delay.
This time I want to get to the bottom of an issue that bothered me for a long time.
Lets say I have two users.
1. I can see rooms created by users only if they were both logged in by that moment. How can I request list of rooms that were there before I log in?
2. If clien that gets notified about the rooms tries to see how many users are there it wont count the creator in my case. I see 0/2 instead on that client. Oreator sees this room as 1/2.
Thanks!
Getting knowledge about runtime created game rooms
Re: Getting knowledge about runtime created game rooms
Hello,
You can't
First you need to login, with or without credentials is up to the developer.
Then you can talk with the server API. No login, no joy
The list of rooms is actually sent back in the login response.
This I don't understand. The number of players / spectators is any Rooms reflects exactly the number of people inside that Room. There are no exceptions.
Can you better explain what is the problem you see?
cheers
braza wrote:Lets say I have two users.
1. I can see rooms created by users only if they were both logged in by that moment. How can I request list of rooms that were there before I log in?
You can't
First you need to login, with or without credentials is up to the developer.
Then you can talk with the server API. No login, no joy
The list of rooms is actually sent back in the login response.
2. If clien that gets notified about the rooms tries to see how many users are there it wont count the creator in my case. I see 0/2 instead on that client. Oreator sees this room as 1/2.
This I don't understand. The number of players / spectators is any Rooms reflects exactly the number of people inside that Room. There are no exceptions.
Can you better explain what is the problem you see?
cheers
Re: Getting knowledge about runtime created game rooms
Lapo wrote:Hello,braza wrote:Lets say I have two users.
1. I can see rooms created by users only if they were both logged in by that moment. How can I request list of rooms that were there before I log in?
You can't
First you need to login, with or without credentials is up to the developer.
Then you can talk with the server API. No login, no joy
The list of rooms is actually sent back in the login response.2. If clien that gets notified about the rooms tries to see how many users are there it wont count the creator in my case. I see 0/2 instead on that client. Oreator sees this room as 1/2.
This I don't understand. The number of players / spectators is any Rooms reflects exactly the number of people inside that Room. There are no exceptions.
Can you better explain what is the problem you see?
cheers
1. That's the info I needed! Rooms created before login arrive in the LoginResponse! Thanks! I'll try that.
2. http://screenpresso.com/=TKVXf
You see 1/2 and 0/2?
Code beghind is the same on both clients of course:
Code: Select all
public void OnScrollPanelItemVirtualize( object backingListItem )
{
room = (Room) backingListItem;
GameName.Text = room.Name;
UserCount.Text = room.UserCount + "/" + room.MaxUsers;
Debug.Log("[GUI]Room with " + room.UserCount + " users in it added to panel");
}
Re: Getting knowledge about runtime created game rooms
As regards point #2, are both users inside the Room? One inside and one outside?
Outside of a specific Room you will need to listen to the USER_COUNT_CHANGE event. When you have joined the Room you should also listen for USER_ENTER_ROOM and USER_EXIT_ROOM to get updated about changes in the Room.
thanks
Outside of a specific Room you will need to listen to the USER_COUNT_CHANGE event. When you have joined the Room you should also listen for USER_ENTER_ROOM and USER_EXIT_ROOM to get updated about changes in the Room.
thanks
Re: Getting knowledge about runtime created game rooms
Lapo wrote:As regards point #2, are both users inside the Room? One inside and one outside?
Outside of a specific Room you will need to listen to the USER_COUNT_CHANGE event. When you have joined the Room you should also listen for USER_ENTER_ROOM and USER_EXIT_ROOM to get updated about changes in the Room.
thanks
One is in and one is out, right. Thanks for pointing out events to listen. Great support!
Re: Getting knowledge about runtime created game rooms
Hi again!
No I actually decided to fix that and wondering how am I supposed to find that room info there in the response... I do ot see it mentioned here http://docs2x.smartfoxserver.com/api-do ... 35530d.htm
No I actually decided to fix that and wondering how am I supposed to find that room info there in the response... I do ot see it mentioned here http://docs2x.smartfoxserver.com/api-do ... 35530d.htm
Re: Getting knowledge about runtime created game rooms
Sorry, I am not following.
Can you explain what you have fixed exactly?
Also, in particular,
What response?
thanks
Can you explain what you have fixed exactly?
Also, in particular,
how am I supposed to find that room info there in the response
What response?
thanks
Re: Getting knowledge about runtime created game rooms
Lapo wrote:The list of rooms is actually sent back in the login response.
I want to extract the data you mentioned. The rooms that were dynamically created before I logged in.
So I look into login response docs http://docs2x.smartfoxserver.com/api-do ... 35530d.htm and do not see how am I supposed to get it...
Re: Getting knowledge about runtime created game rooms
The list of Rooms is not passed directly in the event, but you can obtain it at any time from the SmartFox.roomList property, after having logged in.
If you're working in Java there's an equivalent method called getRoomList().
Cheers
If you're working in Java there's an equivalent method called getRoomList().
Cheers
Re: Getting knowledge about runtime created game rooms
Lapo wrote:The list of Rooms is not passed directly in the event, but you can obtain it at any time from the SmartFox.roomList property, after having logged in.
If you're working in Java there's an equivalent method called getRoomList().
Cheers
aaaaah, I see! Thanks!